Abstract
This study aims to address the limitations of the YOLOv8 model in terms of low detection accuracy and poor deployment adaptability in the context of crop pest detection. To this end, a lightweight attention mechanism and a feature enhancement module were incorporated into the structure of YOLOv8s, with a view to optimizing its detection performance across a range of insects. Based on this improved model, a real-time pest monitoring system was further developed. Results showed that on the self-constructed pest dataset, the proposed improved model increased mAP(0.5), and mAP(0.5-0.95) by 0.6% and 0.8%, respectively, and reducing the number of model parameters from 11.1 × 10(6) to 10.2 × 10(6) compared to the original YOLOv8s model. Using an A40 graphics card at 640 × 640 resolution with a batch size of 32, the inference speed reached 249.76 frames per second, representing a modest improvement over the original model's 225.38 frames per second. On the IP102 dataset, the proposed improved model increased Precision (P), mAP(0.5) and mAP(0.5-0.95) by 2.6%, 2.7% and 1.4%, respectively, compared to the original YOLOv8s model. This study demonstrated that the proposed model exhibited a high level of recognition accuracy for pests in different states, thereby providing a valuable reference for the accurate identification of crop pests.