English

中国农机化学报

中国农机化学报 ›› 2024, Vol. 45 ›› Issue (6): 235-241.DOI: 10.13733/j.jcam.issn.2095-5553.2024.06.035

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

改进YOLOv5的小目标多类别农田害虫检测算法研究

周康乔, 刘向阳, 郑特驹   

  1. (河海大学理学院,南京市,211100)
  • 出版日期:2024-06-15 发布日期:2024-06-09
  • 基金资助:
    云南省重大科技专项计划项目资助(202002AE090010)

Research on improved YOLOv5 small target multiclass farmland pest detection algorithm

Zhou Kangqiao, Liu Xiangyang, Zheng Teju   

  1. (College of Science, Hohai University, Nanjing, 211100, China)
  • Online:2024-06-15 Published:2024-06-09

摘要:

针对农田害虫图像中感兴趣目标特征不明显、小目标居多导致的目标检测精度较低的问题,提出一种基于YOLOv5改进的小目标多类别农田害虫目标检测算法。首先,在主干网络最后两个C3卷积块特征融合部分引入Swin Transformer窗口注意力网络结构,增强小目标的语义信息和全局感知能力;其次,在颈部网络的C3卷积块后添加通道注意力机制和空间注意力机制的可学习自适应权重,使网络能够关注到图像中关于小目标的特征信息;最后,由于YOLOv5自身的交并比函数存在收敛速度较慢且精确率较低的问题,引入SIOU函数作为新的边界框回归损失函数,提高检测的收敛速度和精确度。将所提出的算法在包含28类农田害虫公开数据集上进行试验,结果表明,改进后的算法在农田害虫图像数据集上的准确率、召回率和平均准确率分别达到85.9%、76.4%、79.4%,相比于YOLOv5分别提升2.5%、11.3%、4.7%。

关键词: 农田害虫检测, 小目标, YOLOv5, 注意力机制, 损失函数

Abstract:

Aiming at the problem of low target detection accuracy caused by the lack of obvious features of the interested target and the majority of small targets in the farmland pest images, a small target multicategory farmland pest target detection algorithm based on YOLOv5 was proposed. Firstly, the Swin Transformer window attention network structure was introduced into the feature fusion part of the last two C3 convolution blocks of the trunk network to enhance the semantic information and global awareness of small targets. Secondly, the learnable adaptive weights of the channel attention mechanism and the spatial attention mechanism were added to the C3 convolution block of the neck network, so that the network could pay attention to the feature information of small targets in the image. Finally, since the intersection ratio function of YOLOv5 itself had the problem of slow convergence speed and low accuracy rate, SIOU function was introduced as a new boundary box regression loss function to improve the convergence speed and accuracy of detection. The proposed algorithm was tested on the open data set of 28 farmland pests. The results showed s that the accuracy rate, recall rate and average accuracy of the improved algorithm in the farmland pest image data set reached 85.9%、 76.4% and 79.4%, respectively, which were 2.5%、 11.3% and 4.7% higher than that of YOLOv5.

Key words: farmland pest detection, small goal, YOLOv5, attention mechanism, loss function

中图分类号: