English

中国农机化学报

中国农机化学报 ›› 2025, Vol. 46 ›› Issue (7): 220-225.DOI: 10.13733/j.jcam.issn.2095-5553.2025.07.031

• 设施农业与植保机械工程 • 上一篇    下一篇

基于优化YOLOv5算法的玉米苗间杂草检测研究

张天宇,韩静,廖洪晖,曲欣锐   

  1. (黑龙江八一农垦大学工程学院,黑龙江大庆,163319)
  • 出版日期:2025-07-15 发布日期:2025-07-02
  • 基金资助:
    黑龙江省“揭榜挂帅”科技攻关项目(2023ZXJ07B02);黑龙江八一农垦大学学成、引进人才科研启动计划项目(XDB202101)

Research on weed detection among maize seedlings based on optimized YOLOv5 algorithm

Zhang Tianyu, Han Jing, Liao Honghui, Qu Xinrui   

  1. (College of Engineering, Heilongjiang Bayi Agricultural University, Daqing, 163319, China)

  • Online:2025-07-15 Published:2025-07-02

摘要: 针对玉米苗间杂草种类繁多、检测复杂度高、检测速度慢的问题,设计一种基于优化YOLOv5算法的玉米苗间杂草检测方法。在YOLOv5主干网络的卷积层中引入SE无参数注意力模块,构建融入SE模块的C3替换原本的C3模块,更好地聚焦在检测目标上。同时,将BoTNet模块替换传统的残差神经网络,在ResNet的最后3个bottleneck blocks中使用全局多头自注意替换3×3空间卷积,从而提高对小目标检测的准确性。使用改进的目标检测算法检测杂草,将田间中非玉米苗的区域标记为杂草,利用超绿特征结合OTSU阈值分割算法,分割土壤背景,找出杂草的前景区域,从而有效解决玉米苗田中的杂草检测问题。结果表明,改进后的YOLOv5算法在玉米苗的目标检测上精确率达97.5%,较原始的YOLOv5算法提高7.4%,检测速度达40ms,从而提高检测精度和模型的鲁棒性,满足实时检测的需求。

关键词: 玉米苗间杂草检测, YOLOv5, 注意力模块, BoTNet模块, 超绿特征, OTSU阈值分割

Abstract: To address the problems of diverse weed species, high detection complexity, and slow detection speed in the detection of weeds among maize seedlings, this paper proposes a weed detection method based on optimized YOLOv5 algorithm. The SE parameter-free attention module is introduced into the convolutional layers of the YOLOv5 backbone network, with the SE-integrated C3 module replacing the original C3 module to better focus on detection targets. The traditional residual neural network is replaced with the BoTNet module, and global multi-head self-attention is used to replace 3×3 spatial convolution in the last three bottleneck blocks of ResNet, thereby improving the accuracy of detecting small targets. The improved target detection algorithm is used to detect weeds, with non-maize seedling areas in the field labeled as weeds. The super-green feature, combined with the OTSU threshold segmentation algorithm, is used to segment the soil background and identify the foreground areas of weeds, effectively solving the problem of weed detection in maize seedling fields. The results show that the improved YOLOv5 algorithm achieves a target detection precision of 97.5% for maize seedlings, which is 7.4% higher than the original YOLOv5 algorithm. The detection speed reaches 40 ms, thereby improving the detection accuracy and model robustness to meet the needs of real-time detection.

Key words: weed detection among maize seedlings, YOLOv5, attention module, BoTNet module, super-green feature, OTSU threshold segmentation

中图分类号: