**4. Conclusions**

To meet the need of high-speed garlic seed righting operations and low-cost onboard embedded computing platforms, the contour-based multiple lightweight deep-learning models including transfer learning based on MobileNetV3, naive CNN model, and a contour resampling-based fully connected neural network are proposed for garlic-clove-bud orientation recognition and tested by the image garlic seed samples with the same conditions as a field planter, and the best model was selected for parameter optimization. All of the models' recognition rate of garlic clove bud orientation exceeded 98%. The MobileNetV3 model based on transfer learning, the naive CNN model, and the fully connected model achieved accuracy of 98.71, 98.21, and 98.16%, respectively, all far exceeding statistical learning methods. The parameters of the three are 4.04 M, 61.9 K, and 220.4 K, respectively. The calculation amount of the three is 0.178 G, 17.9 M, and 0.44 M FLOPs, respectively. The recognition speed of the three including auxiliary programs is 19.35, 97.39, and 151.40 FPS, respectively.

Experimental results showed that the contour-image-based garlic-clove-bud orientation recognition method is effective. The form of binarized contour image unifies the pixel value distribution of contour points, so that the information of garlic clove samples can be completely expressed by the coordinate set of contour points. Resampling of contour points further compresses sample features and simplifies the structure of deep-learning models. Ideally, a fully connected neural network based on contour resampling could support a seeding rate of 1.3 hm2/h. Therefore, the garlic-clove-bud orientation recognition based on deep learning proposed by this paper can meet the needs of high-speed and accurate sowing of garlic.

The main goals of this research for the future are to complete the integration of garlic species orientation recognition algorithm and orientation device, verify the effect of system integration, and continuously improve the device; collect more garlic seed contour image samples to join the dataset and train the model to continuously enhance its generalization ability; and try to generalize the orientation recognition algorithm proposed in this paper to other problems in the agricultural field.

**Author Contributions:** J.L.: writing—original draft, writing—review and editing, conceptualization, methodology, investigation, data curation, formal analysis, software, and validation. J.Y.: writing original draft, writing—review and editing, funding acquisition, software and production of related equipment. J.C.: investigation, device design, and production of related equipment. Y.L.: investigation, data curation, validation, and production of related equipment. X.L.: writing—review and editing, funding acquisition, project administration. All authors have read and agreed to the published version of the manuscript.

**Funding:** This research was funded by cotton industry technology system and industrial innovation team projects in Shandong Province (SDAIT-03-09) and supported by the National Natural Science Foundation of China (51675317).

**Institutional Review Board Statement:** Not applicable.

**Informed Consent Statement:** Not applicable.

**Data Availability Statement:** Anyone can access the data by sending an email to jyuan@sdau.edu.cn.

**Conflicts of Interest:** The authors declare no conflict of interest.

### **References**

