Research on an Intelligent Seed-Sorting Method and Sorter Based on Machine Vision and Lightweight YOLOv5n
Abstract
:1. Introduction
2. Materials and Methods
2.1. Structure and Working Principle of the Intelligent Seed Sorter
2.2. Feeding System Design
2.3. Transmission System Design
2.3.1. Transmission System Hardware Design
2.3.2. Transmission System Control
2.4. Design of the Image Acquisition System
2.4.1. Image Acquisition System Hardware Design
2.4.2. Encoder Design
2.4.3. Image Acquisition System Software Control
2.5. Seed-Screening System Design
2.5.1. PLC and Direct-Acting Solenoid Valve Group
2.5.2. Principle of the Seed-Screening System
2.6. Optimization of the YOLOv5n Model
2.6.1. Creation of the Dataset
2.6.2. FS-YOLOv5n Lightweight Improvement
2.6.3. Loss Function Improvement
3. Results and Discussion
3.1. Results and Analysis of the Air-Pump Pressure Test
3.2. Results and Analysis of the Controller Pulse Test
3.3. Results and Analysis of Model Testing
3.3.1. Test Environment Setup
3.3.2. Analysis of Improved Results
3.3.3. Ablation Experiment
3.3.4. Comparative Tests of Different Models
3.4. Results and Analysis of the Seed-Sorting Test
4. Conclusions
- (1)
- A lightweight YOLOv5n model (FS-YOLOv5n) was constructed. FasterNet was incorporated to replace the backbone network, thereby reducing computational redundancy and memory access. Additionally, an SE attention mechanism was added to enhance the feature extraction and fusion effects. Following these lightweight enhancements, the model demonstrated a reduction of approximately 81% in the number of parameters and floating-point operations compared with the baseline models. The model achieved an mAP of 79.4% and an mF1 of 76.3%.
- (2)
- This study explored the utilization of RGB and high-resolution imaging technology to create an intelligent seed sorter. The key components of the sorter are the transmission, feeding, image acquisition, and seed-screening systems. Through the collection of seed images and application of a target detection model, the multispectral intelligent seed sorter conducts a comprehensive analysis and evaluation of seeds based on color, shape, size, texture, and other characteristics. Subsequently, the sorter assessed the seed quality and accomplished seed sorting using an air-blowing actuator.
- (3)
- Using ‘Zheng Dan 958’ corn seeds as the research object, experiments were carried out to optimize the horizontal distance of seed airflow skew casting and the speed of the conveyor belt by adjusting the air-pump pressure and controller pulse frequency of the intelligent seed sorter. The optimal parameter combination of 0.3 MPa air-pump pressure and 3175 Hz controller pulse frequency was determined based on the test results.
- (4)
- Six test groups (1000 seeds in each group) were quality-identified using the target detection model, and a direct-acting solenoid valve group was used to conduct the corn seed-sorting test. The seed-sorting rate was 90.76%. The sorting machine can effectively satisfy the seed-sorting requirements.
Author Contributions
Funding
Data Availability Statement
Acknowledgments
Conflicts of Interest
References
- Xu, P.; Yang, R.B.; Zeng, T.W.; Zhang, J.; Zhang, Y.P.; Tan, Q. Varietal classification of maize seeds using computer vision and machine learning techniques. J. Food Process Eng. 2021, 44, e13846. [Google Scholar] [CrossRef]
- Chen, M.; Ni, Y.L.; Jin, C.Q.; Xu, J.S.; Zhang, G.Y. Online monitoring method of mechanized soybean harvest quality based on machine vision. Trans. Chin. Soc. Agric. Mach. 2021, 52, 91–98. (In Chinese) [Google Scholar]
- Jiang, P.; Chen, Y.H.; Liu, B.; He, D.J.; Liang, C.Q. Real−time detection of apple leaf diseases using deep learning approach based on improved convolutional neural networks. IEEE Access 2019, 7, 59069–59080. [Google Scholar] [CrossRef]
- Zhang, L.; Wang, D.; Liu, J.C.; An, D. Vis-NIR hyperspectral imaging combined with incremental learning for open world maize seed varieties identification. Comput. Electron. Agric. 2022, 199, 107153. [Google Scholar] [CrossRef]
- Bi, C.G.; Hu, N.; Zou, Y.Q.; Zhang, S.; Xu, S.Z.; Yu, H.L. Development of deep learning methodology for maize seed variety recognition based on improved Swin transformer. Agronomy 2022, 12, 1843. [Google Scholar] [CrossRef]
- Bao, Y.D.; Mi, C.X.; Wu, N.; Liu, F.; He, Y. Rapid classification of wheat grain varieties using hyperspectral imaging and chemometrics. Appl. Sci. 2019, 9, 4119. [Google Scholar] [CrossRef]
- Xu, P.; Tan, Q.; Zhang, Y.P.; Zha, X.T.; Yang, S.M.; Yang, R.B. Research on maize seed classification and recognition based on machine vision and deep learning. Agriculture 2022, 12, 232. [Google Scholar] [CrossRef]
- Ma, R.; Wang, J.; Zhao, W.; Guo, H.J.; Dai, D.N.; Yun, Y.L.; Li, L.; Hao, F.Q.; Bai, J.Q.; Ma, D.X. Identification of maize seed varieties using MobileNetV2 with improved attention mechanism CBAM. Agriculture 2023, 13, 11. [Google Scholar] [CrossRef]
- Jin, S.L.; Zhang, W.D.; Yang, P.F.; Zheng, Y.; An, J.L.; Zhang, Z.Y.; Qu, P.X.; Pan, X.P. Spatial-spectral feature extraction of hyperspectral images for wheat seed identification. Comput. Electr. Eng. 2022, 101, 108077. [Google Scholar] [CrossRef]
- Zhu, S.P.; Zhuo, J.X.; Huang, H.; Li, G.L. Wheat grain integrity image detection system based on CNN. Trans. Chin. Soc. Agric. Mach. 2020, 51, 36–42. (In Chinese) [Google Scholar]
- Cheng, K.; Huang, W.X.; Xie, J.; Guo, Y.L.; Zhou, N.; Pan, Q.H.; Cao, M.L.; Guo, Y.F.; Dai, Z.H.; Wang, B.; et al. On-line inspection system of rice processing quality based on machine vision. Mod. Food 2022, 28, 9–11, 22. (In Chinese) [Google Scholar]
- Zhang, H.; Yan, N.; Wu, X.D.; Wang, C.; Luo, B. Design and experiment of online maize single seed detection and sorting device. Trans. Chin. Soc. Agric. Mach. 2022, 53, 159–166. (In Chinese) [Google Scholar]
- Zhang, F.; Zhang, C.C.; Chen, Z.J.; Teng, S.; Xu, R.L. Application of spectral testing technology in seed quality testing. Chin. Agric. Mech. 2021, 42, 109–114. (In Chinese) [Google Scholar]
- Wang, D.; Wang, K.; Wu, J.Z.; Han, P. Progress in research on rapid and non-destructive detection of seed quality based on spectroscopy and imaging technology. Spectrosc. Spectr. Anal. 2021, 41, 52–59. [Google Scholar] [CrossRef]
- Huang, B.S.; Liu, J.; Jiao, J.Y.; Lu, J.; Lv, D.J.; Mao, J.W.; Zhao, Y.J.; Zhang, Y. Applications of machine learning in pine nuts classification. Sci. Rep. 2022, 12, 8799. [Google Scholar] [CrossRef]
- Wang, L.B.; Liu, J.Y.; Zhang, J.; Wang, J.; Fan, X.F. Corn seed defect detection based on watershed algorithm and two−pathway convolutional neural networks. Front. Plant Sci. 2022, 13, 730190. [Google Scholar] [CrossRef]
- Kumar, C.; Mubvumba, P.; Huang, Y.; Dhillon, J.; Reddy, K. Multi-Stage Corn Yield prediction using high-resolution UAV multispectral data and machine learning models. Agronomy 2023, 13, 1277. [Google Scholar] [CrossRef]
- Fan, X.F.; Wang, L.B.; Liu, J.Y.; Zhou, Y.H.; Zhang, J.; Suo, X.S. Corn seed appearance quality estimation based on improved YOLO v4. Trans. Chin. Soc. Agric. Mach. 2022, 53, 226–233. (In Chinese) [Google Scholar]
- Meng, F.J.; Luo, S.; Sun, H.; Li, M.Z. Design and experiment of real-time detection and sorting device for maize seeds. Trans. Chin. Soc. Agric. Mach. 2021, 52, 153–159, 177. (In Chinese) [Google Scholar]
- Chen, J.R.; Kao, S.H.; He, H.; Zhuo, W.P.; Wen, S.; Lee, C.H.; Gary, S.H. Run, Don’t Walk: Chasing Higher FLOPS for Faster Neural Networks. arXiv 2023, arXiv:2303.03667. [Google Scholar]
- Zhang, Y.F.; Ren, W.Q.; Zhang, Z.; Jia, Z.; Wang, L.; Tan, T.N. Focal and efficient IOU loss for accurate bounding box regression. Neurocomputing 2022, 506, 146–157. [Google Scholar] [CrossRef]
LQ-201-CL-F parameter | |
Shooting speed | 33,014 Lines/s |
Video signal output | 8/10-bit |
Camera size | 90 × 90 × 120 mm |
Photosensitive chip | 4xCMOS RGB/NIR |
Port | Camera Link |
Number of effective pixels | 4 × 2048 |
Air-Pump Pressure (MPa) | Longest Distance (m) | Average Distance (m) |
---|---|---|
0.2 | 0.34 | 0.28 |
0.3 | 0.41 | 0.33 |
0.4 | 0.49 | 0.43 |
0.5 | 0.55 | 0.51 |
0.6 | 0.78 | 0.72 |
0.7 | 0.85 | 0.83 |
v (mm/s) | P (Hz) |
---|---|
600 | 2400 |
700 | 2775 |
800 | 3175 |
900 | 3575 |
1000 | 4000 |
Component | Version Model |
---|---|
CPU | Intel Core i7-12700KF |
GPU | NVIDIA GeForce RTX 3090 Ti 16GB |
CUDA | CUDA 11.8 |
RAM | 32 G |
Deep-learning framework | PyCharm2020.1 |
Model Name | mAP Value (%) | mF1 Value (%) | Parameters (M) | GFLOPs (G) | Each Piece Takes Time (s) |
---|---|---|---|---|---|
YOLOv5n | 87.6 | 83.4 | 1,332,547 | 2.6 | 0.17 |
YOLOv5s | 89.9 | 85.1 | 1,379,631 | 3.1 | 0.21 |
YOLOv5m | 91.1 | 87.8 | 1,416,342 | 3.5 | 0.25 |
YOLOv5l | 92.6 | 88.9 | 1,463,285 | 3.9 | 0.29 |
YOLOv5x | 94.5 | 90.2 | 1,533,214 | 4.1 | 0.31 |
FS-YOLOv5n | 79.4 | 76.3 | 246,452 | 0.5 | 0.06 |
Kind | AP Value (%) | mAP Value (%) | F1 Value (%) | mF1 Value (%) | Each Piece Takes Time (s) |
---|---|---|---|---|---|
High-quality | 87.3 | 79.4 | 82.4 | 76.3 | 0.06 |
Low-quality | 71.5 | 70.2 |
Model | SE | FasterNet | Focal-EIoU | mAP Value (%) | Parameters (M) | GFLOPs (G) |
---|---|---|---|---|---|---|
YOLOv5n | 87.6 | 1.3 × 106 | 2.6 | |||
√ | 82.8 | 1.2 × 106 | 2.5 | |||
√ | 76.3 | 0.2 × 106 | 0.5 | |||
√ | √ | 78.8 | 0.3 × 106 | 0.55 | ||
√ | √ | √ | 79.4 | 0.2 × 106 | 0.5 |
Model | Parameters (M) | GFLOPs (G) | mAP Value (%) |
---|---|---|---|
YOLOv4 Tiny | 3.4 × 106 | 6.9 | 82.6 |
YOLOx Tiny | 3.8 × 106 | 7.7 | 82.8 |
YOLOv6n | 4.3 × 106 | 9.8 | 83.4 |
YOLOv7Tiny | 7.1 × 106 | 12.7 | 87.1 |
FS-YOLOv5n | 0.2 × 106 | 0.5 | 79.4 |
Test Lot | Number of Seed Samples to Be Sorted (Grain) | Number of Actual Sorted Seed Samples (Grain) | Sorting Success Rate (%) | ||||||
---|---|---|---|---|---|---|---|---|---|
Artificial Broken Seed | Mildew Seed | Total Number | Artificial Broken Seed | Mildew Seed | Total Number | Artificial Broken Seed | Mildew Seed | Total Number | |
1 | 185 | 64 | 249 | 171 | 58 | 229 | 92.43 | 90.63 | 91.97 |
2 | 178 | 55 | 233 | 154 | 53 | 207 | 86.52 | 96.36 | 88.89 |
3 | 165 | 102 | 267 | 143 | 99 | 242 | 86.67 | 97.06 | 90.52 |
4 | 160 | 54 | 214 | 142 | 53 | 195 | 88.75 | 98.15 | 91.12 |
5 | 173 | 72 | 245 | 156 | 69 | 225 | 90.17 | 95.83 | 91.84 |
6 | 165 | 70 | 235 | 144 | 68 | 212 | 87.27 | 97.14 | 90.21 |
Mean value | 88.64 | 95.86 | 90.76 |
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. |
© 2024 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 (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Feng, Y.; Zhao, X.; Tian, R.; Liang, C.; Liu, J.; Fan, X. Research on an Intelligent Seed-Sorting Method and Sorter Based on Machine Vision and Lightweight YOLOv5n. Agronomy 2024, 14, 1953. https://doi.org/10.3390/agronomy14091953
Feng Y, Zhao X, Tian R, Liang C, Liu J, Fan X. Research on an Intelligent Seed-Sorting Method and Sorter Based on Machine Vision and Lightweight YOLOv5n. Agronomy. 2024; 14(9):1953. https://doi.org/10.3390/agronomy14091953
Chicago/Turabian StyleFeng, Yubo, Xiaoshun Zhao, Ruitao Tian, Chenyang Liang, Jingyan Liu, and Xiaofei Fan. 2024. "Research on an Intelligent Seed-Sorting Method and Sorter Based on Machine Vision and Lightweight YOLOv5n" Agronomy 14, no. 9: 1953. https://doi.org/10.3390/agronomy14091953