MAG-YOLOv8 model for moth adult and larva detection based on multi-scale fusion
摘要
Deep learning-based methods show promise for detecting crop pests and diseases, but significant challenges remain in moth detection. These challenges stem from the significant morphological variations of moths across different life stages and the agility exhibited by adult moths. In this paper, an improved MAG-YOLOv8 model based on YOLOv8 is proposed for the detection of moth adults and larvae. The main innovations of this model are summarized as follows: (1) Multi-scale convolution structure (MSCS) is introduced into the backbone network to enhance the feature extraction capability; (2) The Attentional Scale Sequence Fusion (ASF-P2) module is incorporated into the feature fusion network to enhance the detection accuracy for small targets; (3) The Programmable Gradient Information (PGI) module is introduced to enhance the training process efficiency while preserving reasoning efficacy via reparameterization techniques. Furthermore, based on 1,600 manually labeled images, data augmentation was used to build a dataset of eight moth species in both adult and larval stages, with 500 images per stage, totaling 8,000 samples for training. Experimental results show that MAG-YOLOv8 achieves high accuracy, with Precision, Recall, mAP50, and mAP50-95 reaching 93.2%, 88.5%, 94.3%, and 69.5% respectively. These metrics are 2.3%, 4.5%, 2.9%, and 4.5% higher than those of the benchmark YOLOv8 model. The proposed MAG-YOLOv8 model demonstrated superior performance in detecting moth adults and larvae across diverse agricultural environments, and provided a practical solution for automated pest monitoring and management.