欢迎访问《图学学报》 分享到:

图学学报 ›› 2022, Vol. 43 ›› Issue (4): 559-569.DOI: 10.11996/JG.j.2095-302X.2022040559

• 图像处理与计算机视觉 • 上一篇    下一篇

基于改进 YOLOv4 和图像处理的蔬菜田杂草检测

  

  1. 福州大学机械工程及自动化学院,福建 福州 350108
  • 出版日期:2022-08-31 发布日期:2022-08-15
  • 通讯作者: 孙 浩(1986),男,副教授,博士。主要研究方向为机器人技术、微纳制造和人工智能等
  • 作者简介:东辉(1985),女,副教授,博士。主要研究方向为图像处理及机器学习方法等
  • 基金资助:
    国家自然科学基金项目(62173093);福建省自然科学基金项目(2020J01456)

Weed detection in vegetable field based on improved YOLOv4 and image processing

  1. School of Mechanical Engineering and Automation, Fuzhou University, Fuzhou Fujian 350108, China
  • Online:2022-08-31 Published:2022-08-15
  • Contact: SUN Hao (1986), associate professor, Ph.D. His main research interests cover robotics, micro-nano manufacturing and artificial intelligence, etc.
  • About author:DONG Hui (1985), associate professor, Ph.D. Her main research interests cover image processing and machine learning, etc
  • Supported by:
    National Natural Science Foundation of China (62173093); National Natural Science Foundation of Fujian Province (2020J01456)

摘要:

以蔬菜苗田内幼苗期 7 种常见蔬菜和田间杂草为研究对象,针对田间杂草种类多和分布复杂导致检测方法效率低、精度差和鲁棒性不足等问题,逆向将杂草检测转换为作物检测,提出一种基于优化 YOLOv4和图像处理的蔬菜苗田杂草检测算法。在 YOLOv4 目标检测算法基础上,主干特征提取网络嵌入 SA 模块增强特征提取能力,引入 Transformer 模块构建特征图长距离全局语义信息,改进检测头和损失函数提高检测定位精度。改进模型单幅图像平均识别时间为 0.261 s,平均识别精确率为 97.49%。在相同训练样本以及系统环境设置条件下,将改进方法与主流目标检测算法 Faster RCNN,SSD 和 YOLOv4 算法对比,结果表明改进 YOLOv4模型在蔬菜苗期的多种蔬菜检测具有明显优势。采用改进 YOLOv4 目标检测算法检测作物,作物区域外的植被为杂草,超绿特征结合 OTSU 阈值分割算法获取杂草前景,最后标记杂草前景连通域输出杂草质心坐标和检测框位置,可以较好解决蔬菜苗田杂草检测问题。

关键词: 杂草, 蔬菜, YOLOv4, 图像处理, 目标检测, 分割

Abstract:

To address the problems of low efficiency, poor accuracy, and insufficient robustness of detection methods due to the variety and complex distribution of weeds in the field, the seven kinds of common vegetables and field weeds in the seedling stage in the seedling field were taken as the research objects, the weed detection was reversely converted into crop detection, and a weed detection algorithm in vegetable seedling fields based on optimized YOLOv4 and image processing was proposed. Based on the YOLOv4 object detection algorithm, the backbone feature extraction network was embedded in SA module to enhance the feature extraction capability, the Transformer module was introduced to construct the long-distance global semantic information of the feature map, and the detection head and loss function were improved to increase the detection and positioning accuracy. The improved model’s average recognition time for a single image was 0.261 s, and the average recognition accuracy rate was 97.49%. Under the same training samples and system environment settings, the improved method was compared with the mainstream target detection algorithms Faster RCNN, SSD, and YOLOv4. The results show that the improved YOLOv4 model is of evident advantages in the identification of various vegetables in the seedling stage. The improved YOLOv4 target detection algorithm was used to detect crops: the vegetation outside the crop area is weeds, and the excess-green feature was combined with the OTSU threshold segmentation algorithm to obtain the weed foreground. Finally, the connected component of the weed foreground was marked to output the weed centroid coordinates and the position of the detection frame. In doing so, weed can be effectively detected in vegetable seedling fields.

Key words: weed, vegetable, YOLOv4, image processing, object detection, segmentation

中图分类号: