In order to accurately and quickly achieve wheat grain detection and counting, and to efficiently evaluate wheat quality and yield, a lightweight YOLOv8 algorithm is proposed to automatically count wheat grains in different scenarios. Firstly, wheat grain images are collected under three scenarios: no adhesion, slight adhesion, and severe adhesion, to create a dataset. Then, the neck network of YOLOv8 is modified to a bidirectional weighted fusion BiFPN to establish the wheat grain detection model. Finally, the results of wheat grain counting are statistically analyzed. Experimental results show that after lightweight improvement of YOLOv8 with BiFPN, the mAP (mean Average Precision) value of wheat grain detection is 94.7%, with a reduction of 12.3% in GFLOPs. The improved YOLOv8 model now requires only 9.34ms for inference and occupies just 4.0MB of memory. Compared with other models, the proposed model in this paper performs the best in terms detection accuracy and speed comprehensively, better meeting the real-time counting requirements of wheat grains.
Read full abstract