English

中国农机化学报

中国农机化学报 ›› 2023, Vol. 44 ›› Issue (1): 185-191.DOI: 10.13733/j.jcam.issn.2095-5553.2023.01.026

• 农业智能化研究 • 上一篇    下一篇

用于复杂环境下果蔬检测的改进YOLOv5算法研究

汪颖,王峰,李玮,王艳艳,王应彪,罗鑫   

  1. 西南林业大学机械与交通学院,昆明市,650224
  • 出版日期:2023-01-15 发布日期:2023-01-18
  • 基金资助:
    云南省教育厅科学研究基金(2022Y571)

Study on improved YOLOv5 algorithm for fruit and vegetable detection in complex environments

Wang Ying, Wang Feng, Li Wei, Wang Yanyan, Wang Yingbiao, Luo Xin.   

  • Online:2023-01-15 Published:2023-01-18

摘要: 针对不同光照,遮挡重叠,大视场等复杂环境下,自动采摘机器人无法快速准确地识别果蔬目标的问题,提出一种用于复杂环境下果蔬检测的改进YOLOv5(You Only Look Once v5)算法。首先,在主干网络Backbone中的CBL模块中嵌入卷积注意力机制(Convolutional Block Attention Module,CBAM),提高目标特征的提取能力。其次,引入完全交并比非极大抑制算法(Complete IOU Nonmaximum suppression,CIOU-NMS),考虑长宽边长真实差,提高回归精度。最后,用加权双向特征金字塔网络(Bidirectional Feature Pyramid Network,BiFPN)替换原始YOLOv5的路径聚合网络(PANet),融合多尺度特征提高识别精度和准确率。以苹果为例进行试验,结果表明:改进YOLOv5算法精准率为94.7%,召回率为87%,平均精度为92.5%,相比于原始YOLOv5算法AP提高3.5%,在GPU下的检测时间为11 ms,可以实现复杂情况下的果蔬快速准确识别。

关键词: YOLOv5, 果蔬检测, 注意力机制, 完全交并比, 特征金字塔

Abstract: Aiming at the problem that automatic picking robots cannot quickly and accurately identify fruit and vegetable targets in the complex environments with different lighting, overlapping shadows and large fields of viewm, an improved YOLOv5 algorithm is proposed for fruit and vegetable detection in complex environments. Firstly, Convolutional Block Attention Module is embedded in the CBL module in the backbone network to improve the extraction capability of target features. Secondly, Complete IOU Nonmaximum suppression is introduced to improve the regression accuracy by considering the aspectedge length real difference. Finally, the original YOLOv5 path aggregation network is replaced with a Bidirectional Feature Pyramid Network. The results of this experiment, using Apple as an example, show that the accuracy of the improved YOLOv5 algorithm is 94.7%, the recall is 87%, the average accuracy is 92.5%, which is 3.5% higher than the AP of the original YOLOv5 algorithm, and the detection time under GPU is 11 ms, achieving fast and accurate recognition of fruits and vegetables under complex situations.

Key words: YOLOv5, fruit and vegetable detection, attention module, complete IOU, feature pyramid

中图分类号: