College of Information Science and Engineering, Shanxi Agricultural University, Taigu District, Jinzhong 030801, China.
Sensors (Basel). 2024 Mar 3;24(5):1654. doi: 10.3390/s24051654.
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.
小麦种子检测在计算千粒重和作物育种方面具有重要应用。为了解决种子堆积、粘连和遮挡等问题,提高计数准确性,同时保证快速检测速度和高精度,提出了一种小麦种子计数方法,为种子计数器嵌入式平台的开发提供技术支持。本研究基于 YOLOv8 提出了一种轻量级实时小麦种子检测模型 YOLOv8-HD。首先,我们引入共享卷积层的概念来改进 YOLOv8 检测头,减少参数数量,实现轻量级设计,提高运行时速度。其次,我们将带有可变形注意力机制的 Vision Transformer 引入到骨干网络的 C2f 模块中,增强网络的特征提取能力,提高检测精度。结果表明,在存在杂质(严重粘连)的堆叠场景下,YOLOv8-HD 模型的平均检测精度(mAP)达到 77.6%,比 YOLOv8 提高了 9.1%。在所有场景下,YOLOv8-HD 模型的平均检测精度(mAP)达到 99.3%,比 YOLOv8 提高了 16.8%。YOLOv8-HD 模型的内存大小为 6.35MB,约为 YOLOv8 的 4/5。YOLOv8-HD 的 GFLOPs 减少了 16%。YOLOv8-HD 的推理时间为 2.86ms(GPU 上),低于 YOLOv8。最后,我们进行了大量实验,结果表明,YOLOv8-HD 在 mAP、速度和模型大小方面均优于其他主流网络。因此,我们的 YOLOv8-HD 可以在各种场景下高效地检测小麦种子,为种子计数仪器的开发提供技术支持。