DOI: 10.3390/insects17080822 ISSN: 2075-4450

Lightweight Visual Detection Framework for Accurate Pepper Pest Detection Under Complex Field Conditions

Min Dai, Chiyu Hu, Hong Miao

Early pest infestations can significantly reduce chili pepper yield and quality. Therefore, timely and accurate pest detection is essential for precision pest management. However, pest detection under practical cultivation conditions remains challenging because of small target sizes, dense distributions, partial occlusion, and complex background interference. To address these challenges, this study proposes HCFD-YOLOv8, a task-oriented lightweight visual detection framework based on YOLOv8n for pepper pest monitoring in complex agricultural environments. A novel Cross-Stage Partial Hybrid Spatial Attention (CSP-HSA) module is developed as the core feature enhancement component. It is designed to improve fine-grained pest feature extraction while reducing computational redundancy. CSP-HSA combines cross-stage partial feature reuse, heterogeneous convolution, lightweight spatial-channel attention, and channel shuffle to enhance discriminative representations of small and densely distributed pests. In addition, a Cross-Scale Context Fusion Module (CCFM) is introduced to improve information interaction between high-resolution spatial details and high-level semantic features across different scales. DyHead and Inner-MPDIoU are further incorporated as complementary components to enhance adaptive feature perception and bounding-box localization, especially for partially occluded and overlapping targets. Experimental results show that YOLOv8n achieves a Precision of 84.0% and an mAP50 of 87.1%, whereas HCFD-YOLOv8 improves these values to 90.9% and 92.0%, respectively, corresponding to increases of 6.9 and 4.9 percentage points. Meanwhile, the proposed framework reduces the number of parameters, model weight-file size, and FLOPs from 3.00 M to 2.43 M, from 5.97 MB to 4.96 MB, and from 7.5 G to 6.5 G, respectively. The model achieves an inference throughput of 39.40 FPS on the evaluated cloud-server platform. Comprehensive ablation experiments demonstrate that DyHead delivers the largest standalone improvement in detection accuracy, whereas CSP-HSA provides a more favorable trade-off between feature enhancement and computational efficiency. CCFM and Inner-MPDIoU further provide complementary improvements in cross-scale feature representation and bounding-box localization. These results indicate that HCFD-YOLOv8 achieves a favorable balance between detection accuracy and computational efficiency, demonstrating its potential for lightweight and accurate pepper pest monitoring under complex agricultural conditions.

More from our Archive