作者投稿和查稿 主编审稿 专家审稿 编委审稿 远程编辑

计算机工程 ›› 2024, Vol. 50 ›› Issue (1): 232-241. doi: 10.19678/j.issn.1000-3428.0067030

• 图形图像处理 • 上一篇    下一篇

大田环境下的农业害虫图像小目标检测算法

蒋心璐1,2,3, 陈天恩2,3, 王聪2,3, 赵春江1,2,3,*()   

  1. 1. 西北农林科技大学信息工程学院, 陕西 杨凌 712100
    2. 国家农业信息化工程技术研究中心, 北京 100097
    3. 北京市农林科学院信息技术研究中心, 北京 100097
  • 收稿日期:2023-02-24 出版日期:2024-01-15 发布日期:2024-01-13
  • 通讯作者: 赵春江
  • 基金资助:
    北京市科技计划(Z221100006422010); 北京市农林科学院改革与发展项目; 北京市农林科学院信息技术研究中心开放课题(KF2022W001)

Small Object Detection Algorithm for Agricultural Pest Images in Field Environments

Xinlu JIANG1,2,3, Tianen CHEN2,3, Cong WANG2,3, Chunjiang ZHAO1,2,3,*()   

  1. 1. College of Information Engineering, Northwest A and F University, Yangling 712100, Shaanxi, China
    2. National Engineering Research Center for Information Technology in Agriculture, Beijing 100097, China
    3. Research Center of Information Technology, Beijing Academy of Agriculture and Forestry Sciences, Beijing 100097, China
  • Received:2023-02-24 Online:2024-01-15 Published:2024-01-13
  • Contact: Chunjiang ZHAO

摘要:

智能化害虫检测是目标检测技术在农业领域的重要应用,可以有效提高害虫测报工作效率和可靠性,保障农作物产量和质量。在诱虫灯、粘虫板等固定式诱捕装置下,图像背景简单、光照条件稳定、害虫特征显著易于提取,害虫检测可以达到较高的准确率,但其应用场景固定,检测范围局限于设备周围,无法适应复杂的田间环境。针对田间环境下图像背景复杂和害虫尺寸小带来的难检和漏检问题,提出一种改进YOLOv5的小目标害虫检测算法Pest-YOLOv5,以提高害虫测报的灵活性。在特征提取网络中增加坐标注意力机制,通过结合空间和通道信息,增强对小目标害虫特征的提取能力,在颈部连接部分使用双向特征金字塔网络结构,通过融合多尺度特征,缓解多次卷积带来的小目标信息丢失问题。在此基础上,使用SIoU和变焦损失函数计算损失值,同时通过实验得到最优分类损失权重系数,使模型更关注分类困难的目标样本。在公开数据集AgriPest上的实验结果表明,Pest-YOLOv5模型mAP0.5和召回率分别为70.4%和67.8%,优于原YOLOv5s模型、SSD和Faster R-CNN等经典目标检测模型。与YOLOv5s模型相比,Pest-YOLOv5模型将mAP0.5、mAP0.50:0.95和召回率分别提高8.1%、7.9%和12.8%,改善了难检和漏检情况。

关键词: 深度学习, 目标检测, 害虫检测, 小目标检测, 损失函数

Abstract:

Intelligent pest detection is an essential application of target detection technology in the agricultural field. This detection method effectively improves the efficiency and reliability of pest detection and reporting work and ensures crop yield and quality. Under fixed-trapping devices such as insect traps and sticky insect boards, the image background is simple, the lighting conditions are stable, and the pest features are significant and easy to extract. Pest detection can achieve high accuracy, but its application scenario is fixed, and the detection range is limited to the surrounding equipment and cannot adapt to complex field environments. A small object pest detection model called Pest-YOLOv5 is proposed to improve the flexibility of pest detection and prediction to address the difficulties and missed detections attributed to complex image backgrounds and small pest sizes in field environments. By adding a Coordinate Attention(CA) mechanism in the feature extraction network and combining spatial and channel information, the ability to extract small object pest features is enhanced. The Bidirectional Feature Pyramid Network(BiFPN) structure is used in the neck connection section, and multi-scale features are combined to alleviate the problem of small object information loss caused by multiple convolutions. Based on this, SIoU and VariFocal loss functions are used to calculate losses, and the optimal classification loss weight coefficients are obtained experimentally, making the model more focused on object samples that are difficult to classify. The experimental results on a subset of the publicly available dataset, AgriPest, show that the Pest-YOLOv5 model has mAP0.5 and recall of 70.4% and 67.8%, respectively, which are superior to those of classical object detection models, such as the original YOLOv5s model, SSD, and Faster R-CNN. Compared with the YOLOv5s model, the Pest-YOLOv5 model improves the mAP0.5, mAP0.50∶0.95, and recall by 8.1%, 7.9%, and 12.8%, respectively, enhancing the ability to detect targets.

Key words: deep learning, object detection, pest detection, small object detection, loss function