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.
deep learningobject detectionpest detectionsmall object detectionloss function