English

Journal of Chinese Agricultural Mechanization

Journal of Chinese Agricultural Mechanization ›› 2023, Vol. 44 ›› Issue (4): 167-173.DOI: 10.13733/j.jcam.issn.2095-5553.2023.04.023

Previous Articles     Next Articles

Weeds detection in farmland based on a modified YOLOv5 algorithm

Wang Yubo1, 2, Ma Tinghuai1, Chen Guangming3   

  • Online:2023-04-15 Published:2023-04-25

基于改进YOLOv5算法的农田杂草检测

王宇博1, 2,马廷淮1,陈光明3   

  1. 1. 南京信息工程大学计算机与软件学院,南京市,210044; 2. 南京交通职业技术学院电子信息工程学院,

    南京市,211188; 3. 南京农业大学工学院,南京市,210031
  • 基金资助:
    国家重点研发计划(2021YFE0104400)

Abstract: With the continuous development of intelligent agricultural technology and field planting technology, automatic weeding has a broad market prospect. Regarding the effectiveness of automatic herbicide spraying, the precise and rapid identification and positioning of farmland weeds is one of the key technologies. An improved YOLOv5 algorithm to realize weed detection can improve the model generalization of the backbone network, and improve the accuracy of the prediction box by improving the box regression loss function. The experiment shows that under the complex environment of sesame crops and multiple weeds, the mean average detection accuracy of this method is 90.6%, and the average detection accuracy of weed is 90.2%, which were  higher than the YOLOv5s model by 4.7% and 2%, respectively. In the test environment of this paper, a single image detection time is 2.8 ms, enabling realtime detection. The research content can provide a reference for intelligent weeding equipment in farmland.

Key words: weeds detection, YOLOv5, data augmentation, attention mechanism, regression loss function

摘要: 随着智慧农业技术和大田种植技术的不断发展,自动除草具有广阔的市场前景。关于除草剂自动喷洒的有效性,农田杂草的精准、快速地识别和定位是关键技术之一。基于此提出一种改进的YOLOv5算法实现农田杂草检测,该方法通过改进数据增强方式,提高模型泛化性;通过添加注意力机制,增强主干网络的特征提取能力;通过改进框回归损失函数,提升预测框的准确率。试验表明,在芝麻作物和多种杂草的复杂环境下,本文方法的检测平均精度均值mAP为90.6%,杂草的检测平均精度AP为90.2%,比YOLOv5s模型分别提高4.7%和2%。在本文试验环境下,单张图像检测时间为2.8 ms,可实现实时检测。该研究内容可以为农田智能除草设备提供参考。

关键词: 杂草检测, YOLOv5, 数据增强, 注意力机制, 回归损失函数

CLC Number: