Submitted:
08 December 2025
Posted:
09 December 2025
Read the latest preprint version here
Abstract
Seed quality is a crucial factor in determining yield before sowing. Ginseng seeds undergo several processes before sowing, including picking, washing, and germination. The germination process is susceptible to damage or failure, which can directly impact the final yield of subsequent cultivation. Therefore, precise and reliable quality inspection and screening must be done before sowing to ensure a high germination rate. Based on YOLOv11n, this study proposes the YOLO-GS model to test the quality of ginseng seeds. Firstly, a SELP module was designed to enhance the network's ability to focus on the key features of ginseng seeds and improve the model's detection accuracy. Secondly, the Channel Prior Convolution Attention (CPCA) mechanism was introduced into the backbone network to dynamically assign attention weights to the feature map in both the channel and spatial dimensions, thereby enhancing the network's ability to extract features from the target. Thirdly, the C3k2 structure in the backbone was improved to account for both local feature extraction and global dependency modeling, thereby enhancing the model's accuracy. Finally, a Convolutional Attention Module (CloFormerAttnConv) based on the multi-frequency position-sensitive attention mechanism in C2PSA was introduced to achieve a dual perception of local details and global semantics while maintaining computational efficiency and improving feature extraction capabilities. The experimental findings demonstrated that the YOLO-GS model attained 97.7% mAP@0.5, with Precision, Recall, F1-Score, and mAP@0.5:0.95 reaching 96.7%, 96.4%, 90.5% and 90.3%, respectively. The model has only 4.2 million parameters. When deployed on the Jetson edge device, the model inference time is 0.6ms, providing an effective solution for real-time target detection tasks in the application of seed quality assessment of ginseng. In conclusion, the YOLO-GS model will be applicable for the precise detection of ginseng seed quality.
Keywords:
1. Introduction
2. Materials and Methods
2.1. Data Collection
2.2. Data Preprocessing
2.3. YOLO-GS
2.3.1. SELP Module
2.3.2. Channel Prior Convolutional Attention
2.3.3. C2PSA_CloFormerAttnConv Module
2.3.4. C3k2_AssemFormer Module
2.4. Evaluation Metrics
3. Experiments and Results
3.1. Test Platform and Hyperparameter Settings
3.2. Model Training Results
3.3. Model Performance and Test Results Analysis
3.4. Ablation Test
3.5. Performance Comparison with Other Models
3.6. Comparison of detection results with other models
3.7. Performance Evaluation of Model Deployment
4. Discussion
5. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Data Availability Statement
Conflicts of Interest
Abbreviations
| CBAM | Convolutional Block Attention Module |
| SE | Squeeze-and-Excitation |
| PConv | Partial Convolution |
| CPCA | Channel Prior Convolutional Attention |
| CA | Channel Attention |
| SA | Spatial Attention |
| FN | False Negative |
| FP | False Positive |
| IoU | Intersection over Union |
| TP | Ture Positive |
| P | Precision |
| R | Recall |
| AP | Average Precision |
| mAP | mean Average Precision |
| YOLO | You Only Look Once |
References
- Yoon, S.J.; Sukweenadhi, J.; Khorolragchaa, A.; Mathiyalagan, R.; Subramaniyam, S.; Kim, Y.J.; Kim, H.B.; Kim, M.J.; Kim, Y.J.; Yang, D.C. Overexpression of Panax ginseng sesquiterpene synthase gene confers tolerance against Pseudomonas syringae pv. tomato in Arabidopsis thaliana. Physiol Mol Biol Plants 2016, 22, 485–495. [Google Scholar] [CrossRef]
- Hu, L.-J.; Zhang, Z.; Wang, W.; Wang, L.; Yang, H. Ginseng plantations threaten China’s forests. Biodivers. Conserv. 2018, 27, 2093–2095. [Google Scholar] [CrossRef]
- Zhang, K.; Zhang, S.; Ebihara, A.; Zhou, X.; Fan, L.; Li, P.; Zhang, Z.; Wang, Y. The current research progress of ginseng species: The cultivation and application. Cogent Food Agric. 2023, 9. [Google Scholar] [CrossRef]
- Kurtulmuş, F.; Kavdir, İ. Detecting corn tassels using computer vision and support vector machines. Expert Syst. Appl. 2014, 41, 7390–7397. [Google Scholar] [CrossRef]
- Wu, A.; Zhu, J.; Yang, Y.; Liu, X.; Wang, X.; Wang, L.; Zhang, H.; Chen, J. Classification of corn kernels grades using image analysis and support vector machine. Adv. Mech. Eng. 2018, 10. [Google Scholar] [CrossRef]
- Tu, K.; Wu, W.; Cheng, Y.; Zhang, H.; Xu, Y.; Dong, X.; Wang, M.; Sun, Q.J.C.; Agriculture, E.i. AIseed: An automated image analysis software for high-throughput phenotyping and quality non-destructive testing of individual plant seeds. 2023, 207, 107740. [Google Scholar] [CrossRef]
- Fan, Y.; An, T.; Yao, X.; Long, Y.; Wang, Q.; Wang, Z.; Tian, X.; Chen, L.; Huang, W. An interpretable nondestructive detection model for maize seed viability: Based on grouped hyperspectral image fusion and key biochemical indicators. Comput. Electron. Agric. 2025, 239, 111036. [Google Scholar] [CrossRef]
- Ren, S.; He, K.; Girshick, R.; Sun, J. Faster R-CNN: Towards Real-Time Object Detection with Region Proposal Networks. IEEE Trans. Pattern Anal. Mach. Intell. 2017, 39, 1137–1149. [Google Scholar] [CrossRef] [PubMed]
- He, K.; Gkioxari, G.; Dollár, P.; Girshick, R. Mask R-CNN. 2017 IEEE Int. Conf. Comput. Vis. (ICCV) 2017, 2980–2988. [Google Scholar] [CrossRef]
- Wu, W.; Liu, T.; Zhou, P.; Yang, T.; Li, C.; Zhong, X.; Sun, C.; Liu, S.; Guo, W. Image analysis-based recognition and quantification of grain number per panicle in rice. Plant Methods 2019, 15, 122. [Google Scholar] [CrossRef] [PubMed]
- Li, Z.; Li, Y.; Yang, Y.; Guo, R.; Yang, J.; Yue, J.; Wang, Y. A high-precision detection method of hydroponic lettuce seedlings status based on improved Faster RCNN. Comput. Electron. Agric. 2021, 182, 106054. [Google Scholar] [CrossRef]
- Deng, R.; Tao, M.; Huang, X.; Bangura, K.; Jiang, Q.; Jiang, Y.; Qi, L. Automated Counting Grains on the Rice Panicle Based on Deep Learning Method. Sensors 2021, 21, 281. [Google Scholar] [CrossRef] [PubMed]
- Tan, S.; Lu, H.; Yu, J.; Lan, M.; Hu, X.; Zheng, H.; Peng, Y.; Wang, Y.; Li, Z.; Qi, L.; et al. In-field rice panicles detection and growth stages recognition based on RiceRes2Net. Comput. Electron. Agric. 2023, 206, 107704. [Google Scholar] [CrossRef]
- Liu, W.; Anguelov, D.; Erhan, D.; Szegedy, C.; Reed, S.; Fu, C.-Y.; Berg, A.C. SSD: Single Shot MultiBox Detector. Computer Vision – ECCV 2016 2016, 21–37. [Google Scholar] [CrossRef]
- Lu, A.; Guo, R.; Ma, Q.; Ma, L.; Cao, Y.; Liu, J. Online sorting of drilled lotus seeds using deep learning. Biosyst. Eng. 2022, 221, 118–137. [Google Scholar] [CrossRef]
- Wang, Q.; Yu, C.; Zhang, H.; Chen, Y.; Liu, C. Design and experiment of online cottonseed quality sorting device. Comput. Electron. Agric. 2023, 210, 107870. [Google Scholar] [CrossRef]
- Jiao, Y.; Wang, Z.; Shang, Y.; Li, R.; Hua, Z.; Song, H. Detecting endosperm cracks in soaked maize using μCT technology and R-YOLOv7-tiny. Comput. Electron. Agric. 2023, 213, 108232. [Google Scholar] [CrossRef]
- Li, Q.; Ma, W.; Li, H.; Zhang, X.; Zhang, R.; Zhou, W. Cotton-YOLO: Improved YOLOV7 for rapid detection of foreign fibers in seed cotton. Comput. Electron. Agric. 2024, 219, 108752. [Google Scholar] [CrossRef]
- Niu, S.; Xu, X.; Liang, A.; Yun, Y.; Li, L.; Hao, F.; Bai, J.; Ma, D. Research on a Lightweight Method for Maize Seed Quality Detection Based on Improved YOLOv8. IEEE Access 2024, 12, 32927–32937. [Google Scholar] [CrossRef]
- Yi, W.; Xia, S.; Kuzmin, S.; Gerasimov, I.; Cheng, X. RTFVE-YOLOv9: Real-time fruit volume estimation model integrating YOLOv9 and binocular stereo vision. Comput. Electron. Agric. 2025, 236, 110401. [Google Scholar] [CrossRef]
- Khanam, R.; Hussain, M. YOLOv11: An Overview of the Key Architectural Enhancements. Arxiv Prepr. 2024, abs/2410.17725. [CrossRef]
- Hu, J.; Shen, L.; Sun, G. Squeeze-and-Excitation Networks. 2018 IEEE/CVF Conf. Comput. Vis. Pattern Recognit. 2018, 7132–7141. [Google Scholar] [CrossRef]
- Liu, G.; Shih, K.J.; Wang, T.-C.; Reda, F.A.; Sapra, K.; Yu, Z.; Tao, A.; Catanzaro, B. Partial Convolution based Padding. Arxiv Prepr. 2018, abs/1811.11718. [CrossRef]
- Clevert, D.-A.; Unterthiner, T.; Hochreiter, S. Fast and Accurate Deep Network Learning by Exponential Linear Units (ELUs). Arxiv Prepr. 2015, abs/1511.07289. [CrossRef]
- Huang, H.; Chen, Z.; Zou, Y.; Lu, M.; Chen, C.; Song, Y.; Zhang, H.; Yan, F. Channel prior convolutional attention for medical image segmentation. Comput. Biol. Med. 2024, 178, 108784. [Google Scholar] [CrossRef]
- Woo, S.; Park, J.; Lee, J.-Y.; Kweon, I.S. CBAM: Convolutional Block Attention Module. Computer Vision – ECCV 2018: 15th European Conference, Munich, Germany, September 8–14, 2018, Proceedings, Part VII 2018, 3–19. [CrossRef]
- Fan, Q.; Huang, H.; Guan, J.; He, R. Rethinking Local Perception in Lightweight Vision Transformer. Arxiv Prepr. 2023, abs/2303.17803. [CrossRef]
- Vaswani, A.; Shazeer, N.M.; Parmar, N.; Uszkoreit, J.; Jones, L.; Gomez, A.N.; Kaiser, L.; Polosukhin, I. Attention is All you Need. Arxiv Prepr. 2017, abs/1706.03762. [CrossRef]
- Yi, F.; Wen, H.; Jiang, T. ASFormer: Transformer for Action Segmentation. Arxiv Prepr. 2021, abs/2110.08568. [CrossRef]
- Wang, S.; Li, B.Z.; Khabsa, M.; Fang, H.; Ma, H. Linformer: Self-Attention with Linear Complexity. Arxiv Prepr. 2020, abs/2006.04768. [CrossRef]
- Li, J.; Gong, G.; Zhang, J.; Liu, X.; Jiang, S.; Wu, X.; Xie, H.; Gu, L.J.J.o.F.C.; Analysis. Multi-task learning based approach for potato edibility detection and defect segmentation. 2025, 108420. [Google Scholar] [CrossRef]
- Wang, L.; Wang, S.; Wang, B.; Yang, Z.; Zhang, Y.J.E.S.w.A. Jujube-YOLO: a precise jujube fruit recognition model in unstructured environments. 2025, 128530. [Google Scholar] [CrossRef]
- Zhang, Y.; Lv, C.; Wang, D.; Mao, W.; Li, J.J.C.; Agriculture, E.i. A novel image detection method for internal cracks in corn seeds in an industrial inspection line. 2022, 197, 106930. [Google Scholar] [CrossRef]
















| Name | Configuration |
|---|---|
| CPU | i7-13700KF |
| GPU | Nvidia GeForce RTX 4070Ti |
| GPU-accelerated library | CUDA11.8 |
| Operating system | Ubuntu22.04 |
| Software environment | Python3.11.4 |
| Model | Gategory | P | R | mAP@0.5 | F1-Score | mAP@0.5:0.95 |
|---|---|---|---|---|---|---|
| YOLOv11n | all | 0.938 | 0.963 | 0.970 | 0.950 | 0.897 |
| open | 0.994 | 0.992 | 0.995 | 0.993 | 0.957 | |
| close | 0.983 | 0.998 | 0.991 | 0.990 | 0.939 | |
| damaged | 0.836 | 0.897 | 0.923 | 0.865 | 0.795 | |
| YOLO-GS | all | 0.967 | 0.964 | 0.977 | 0.965 | 0.903 |
| open | 0.998 | 0.992 | 0.995 | 0.995 | 0.959 | |
| close | 0.990 | 0.995 | 0.993 | 0.992 | 0.942 | |
| damaged | 0.905 | 0.905 | 0.943 | 0.905 | 0.808 |
| Baseline | SELP | CPCA | C3k2_ AssemFormer |
C2PSA_CloFormerAttnConv | P | R | mAP@0.5 | F1-Score | mAP@0.5:0.95 |
|---|---|---|---|---|---|---|---|---|---|
| √ | 0.938 | 0.962 | 0.97 | 0.950 | 0.897 | ||||
| √ | √ | 0.958 | 0.959 | 0.977 | 0.958 | 0.9 | |||
| √ | √ | 0.936 | 0.980 | 0.964 | 0.957 | 0.886 | |||
| √ | √ | 0.942 | 0.959 | 0.968 | 0.950 | 0.898 | |||
| √ | √ | √ | 0.940 | 0.983 | 0.961 | 0.961 | 0.894 | ||
| √ | √ | √ | 0.924 | 0.979 | 0.957 | 0.951 | 0.885 | ||
| √ | √ | √ | 0.926 | 0.949 | 0.951 | 0.937 | 0.881 | ||
| √ | √ | √ | √ | 0.938 | 0.963 | 0.975 | 0.950 | 0.905 | |
| √ | √ | √ | √ | √ | 0.967 | 0.964 | 0.977 | 0.965 | 0.903 |
| Model | Precision | Recall | mAP@0.5 | F1-Score | mAP@0.5:0.95 |
|---|---|---|---|---|---|
| YOLOv3 | 0.922 | 0.948 | 0.943 | 0.934 | 0.846 |
| YOLOv5n | 0.893 | 0.941 | 0.925 | 0.916 | 0.844 |
| YOLOv5s | 0.953 | 0.914 | 0.951 | 0.933 | 0.879 |
| YOLOv7 | 0.908 | 0.976 | 0.951 | 0.941 | 0.870 |
| YOLOv7-tiny | 0.944 | 0.973 | 0.961 | 0.958 | 0.884 |
| YOLOv8n | 0.930 | 0.919 | 0.931 | 0.924 | 0.858 |
| YOLOv8s | 0.937 | 0.954 | 0.959 | 0.945 | 0.892 |
| YOLOv9 | 0.928 | 0.952 | 0.943 | 0.940 | 0.871 |
| YOLOv10n | 0.924 | 0.960 | 0.964 | 0.942 | 0.878 |
| YOLOv11n | 0.938 | 0.962 | 0.970 | 0.950 | 0.897 |
| YOLOv11s | 0.944 | 0.946 | 0.967 | 0.945 | 0.903 |
| YOLOv12 | 0.941 | 0.967 | 0.957 | 0.954 | 0.888 |
| Faster RCNN |
- | 0.412 | 0.534 | - | 0.367 |
| YOLO-GS | 0.967 | 0.964 | 0.977 | 0.965 | 0.903 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2025 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).