Skip to main page content
U.S. flag

An official website of the United States government

Dot gov

The .gov means it’s official.
Federal government websites often end in .gov or .mil. Before sharing sensitive information, make sure you’re on a federal government site.

Https

The site is secure.
The https:// ensures that you are connecting to the official website and that any information you provide is encrypted and transmitted securely.

Access keys NCBI Homepage MyNCBI Homepage Main Content Main Navigation
. 2024 Mar 3;24(5):1654.
doi: 10.3390/s24051654.

Wheat Seed Detection and Counting Method Based on Improved YOLOv8 Model

Affiliations

Wheat Seed Detection and Counting Method Based on Improved YOLOv8 Model

Na Ma et al. Sensors (Basel). .

Abstract

Wheat seed detection has important applications in calculating thousand-grain weight and crop breeding. In order to solve the problems of seed accumulation, adhesion, and occlusion that can lead to low counting accuracy, while ensuring fast detection speed with high accuracy, a wheat seed counting method is proposed to provide technical support for the development of the embedded platform of the seed counter. This study proposes a lightweight real-time wheat seed detection model, YOLOv8-HD, based on YOLOv8. Firstly, we introduce the concept of shared convolutional layers to improve the YOLOv8 detection head, reducing the number of parameters and achieving a lightweight design to improve runtime speed. Secondly, we incorporate the Vision Transformer with a Deformable Attention mechanism into the C2f module of the backbone network to enhance the network's feature extraction capability and improve detection accuracy. The results show that in the stacked scenes with impurities (severe seed adhesion), the YOLOv8-HD model achieves an average detection accuracy (mAP) of 77.6%, which is 9.1% higher than YOLOv8. In all scenes, the YOLOv8-HD model achieves an average detection accuracy (mAP) of 99.3%, which is 16.8% higher than YOLOv8. The memory size of the YOLOv8-HD model is 6.35 MB, approximately 4/5 of YOLOv8. The GFLOPs of YOLOv8-HD decrease by 16%. The inference time of YOLOv8-HD is 2.86 ms (on GPU), which is lower than YOLOv8. Finally, we conducted numerous experiments and the results showed that YOLOv8-HD outperforms other mainstream networks in terms of mAP, speed, and model size. Therefore, our YOLOv8-HD can efficiently detect wheat seeds in various scenarios, providing technical support for the development of seed counting instruments.

Keywords: YOLOv8; attention mechanism; lightweight; wheat seed detection.

PubMed Disclaimer

Conflict of interest statement

The authors declare no conflicts of interest.

Figures

Figure 1
Figure 1
Wheat seed collection example images: (a) scattered without impurities; (b) scattered with impurities; (c) clustered without impurities; (d) clustered with impurities; (e) stacked without impurities; (f) stacked with impurities.
Figure 1
Figure 1
Wheat seed collection example images: (a) scattered without impurities; (b) scattered with impurities; (c) clustered without impurities; (d) clustered with impurities; (e) stacked without impurities; (f) stacked with impurities.
Figure 2
Figure 2
Wheat seed data augmented images: (a) original image; (b) augmented image 1; (c) augmented image 2; (d) augmented image 3; (e) augmented image 4; (f) augmented image 5.
Figure 3
Figure 3
Improved YOLOv8 lightweight network model.
Figure 4
Figure 4
YOLOv8 head.
Figure 5
Figure 5
Lightweight YOLOv8 detection head.
Figure 6
Figure 6
Comparison between DAT and other Vision Transformer models: (a) VIT; (b) Swin Transformer; (c) DCN; (d) DAT.
Figure 7
Figure 7
Information flow of the deformable attention mechanism in DAT.
Figure 8
Figure 8
C2f model.
Figure 9
Figure 9
DAT network parameters.
Figure 10
Figure 10
Training loss (above) and validation loss (below) curves of YOLOv8-HD and YOLOv8 models.
Figure 11
Figure 11
Performance curves of YOLOv8-HD and YOLOv8 models.
Figure 12
Figure 12
Comparison between YOLOv8-HD and YOLOv8 heatmaps: (a) YOLOv8 heatmaps, where the red boxes indicate regions with less prominent feature extraction.; (b) YOLOv8-HD heatmaps.
Figure 13
Figure 13
Comparison of FP/FN for YOLOv8-HD and YOLOv8.
Figure 14
Figure 14
Visualization of YOLOv8-HD detection results: (a) dispersed clean; (b) dispersed cluttered; (c) clustered clean; (d) clustered cluttered; (e) clustered clean with cluttered; (f) clustered cluttered.
Figure 14
Figure 14
Visualization of YOLOv8-HD detection results: (a) dispersed clean; (b) dispersed cluttered; (c) clustered clean; (d) clustered cluttered; (e) clustered clean with cluttered; (f) clustered cluttered.
Figure 15
Figure 15
Wheat seed counting results: (a) wheat seed counting results in dispersed scenario; (b) wheat seed counting results in clustered scenario; (c) wheat seed counting results in stacked scenario.

Similar articles

Cited by

References

    1. Xing X., Liu C., Han J., Feng Q., Lu Q., Feng Y. Wheat-Seed Variety Recognition Based on the GC_DRNet Model. Agriculture. 2023;13:2056. doi: 10.3390/agriculture13112056. - DOI
    1. Zhou L. Ph.D. Thesis. Zhejiang University; Hangzhou, China: 2022. Research on Wheat Phenotypic Information Perception Method Based on Spectrum and Image. (In Chinese with English Abstract) - DOI
    1. Yan R., Zhao X., Xiang F., Li Y., Li X., Xi Z., Li P., Gao Y., Li J. Research on the Production Pattern and Fertilization Status of Wheat in China’s Dominant Regions. [(accessed on 29 February 2024)];J. Titioeae Crops. 2024 44:230–241. Available online: http://kns.cnki.net/kcms/detail/61.1359.S.20231018.0954.002.html.
    1. Sun J., Zhang L., Zhou X., Wu X., Shen J., Dai C. Detection of rice seed vigor level by using deep feature of hyperspectral images. Trans. CSAE. 2021;37:171–178. doi: 10.11975/j.issn.1002-6819.2021.14.019. (In Chinese with English Abstract) - DOI
    1. Liu X. Bachelor’s Thesis. Anhui Agriculture University; Hefei, China: 2022. Research on Automatic Counting of Wheat Seed Based on Image Processing. (In Chinese with English Abstract) - DOI

LinkOut - more resources