高级检索+

基于融合GhostNetV2的YOLO v7水稻籽粒检测

Rice Grain Detection Based on YOLO v7 Fusing of GhostNetV2

  • 摘要: 水稻籽粒检测在粮食储存中凸显重要作用,直接影响粮食销售的价格。针对一般机器视觉检测算法在水稻籽粒小目标的密集场景下存在难以识别且网络模型参数大,检测速度较慢、成本高等问题,提出一种基于YOLO v7优化的水稻籽粒检测算法。首先将部分高效聚合网络模块(Efficient layer aggregation network, ELAN)替换成轻量级网络模块GhostNetV2添加到主干及颈部网络部分,实现网络参数精简化的同时也减少了通道中的特征冗余;其次将卷积和自注意力结合的注意力模块(Convolution and self-attention mixed model, ACmix)添加到MP模块中,平衡全局和局部的特征信息,充分关注特征映射的细节信息;最后使用WIoU(Wise intersection over union)作为损失函数,减少了距离、纵横比之类的惩罚项干扰,单调聚焦机制的设计提高了模型的定位性能。在水稻籽粒图像数据集上验证改进后的模型检测水平,实验结果表明,改进后的YOLO v7模型的mAP@0.5达96.55%,mAP@0.5:0.95达70.10%,训练模型参数量也有所下降,在实际场景以暗黑色为背景的水稻杂质检测中的效果优于其他模型,满足了水稻籽粒的实时检测要求,可将此算法应用于自动化检测粮食系统中。

     

    Abstract: Rice grain detection plays an important role in grain storage, directly affecting the price of grain sales. In response to the problems of difficult recognition, large network model parameters, slow detection speed, and high cost of general machine vision detection algorithms in dense scenes with small rice grain targets, a rice grain detection algorithm was proposed based on YOLO v7 optimization. Firstly, some efficient layer aggregation network(ELAN) modules were replaced with lightweight network module GhostNetV2 and added them to the backbone and neck network sections, achieving precise simplification of network parameters while reducing feature redundancy in channels. Secondly, the attention module(ACmix) that combined convolution and self attention was added to the MP module, balancing global and local feature information and fully paying attention to the details of feature mapping. Finally, wise intersection over union(WIoU) was used as the loss function to reduce penalty term interference such as distance and aspect ratio. The design of monotonic focusing mechanism improved the positioning performance of the model. The improved model detection level was verified on the rice grain image dataset, and the experimental results showed that the improved YOLO v7 model was high, mAP@0.5 was up to 96.55%, mAP@0.5:0.95 reached 70.10%, and the training model parameters were also decreased. In practical scenarios, the effect of rice impurity detection with a dark black background was better than other models, meeting the real-time detection requirements of rice grains. This algorithm can be considered for application in automated grain detection systems.

     

/

返回文章
返回