Abstract:Aiming to address the challenges of difficult feature extraction, low detection accuracy in complex environments, and the need for efficient real-time detection on edge devices for small-target pests (e.g., Diaphorina citri, Spodoptera litura, and Bactrocera dorsalis) commonly encountered during greenhouse citrus seedling cultivation, a lightweight citrus pest recognition method, YOLO v8n-CPestCSR, was proposed. In the backbone network, the C2f structure was replaced with a CPNFocalNeXt module, which improved computational efficiency while maintaining detection accuracy, significantly reducing model weight and parameter count, thereby providing a lightweight foundation for edge device deployment. In the neck structure, the SimAM attention mechanism was integrated with C2f, further reducing model weight and parameter count through a parameter-free design. During the feature fusion stage of the detection network, an E-ReparamLKBlock module was introduced;by additionally stacking three such blocks in the detection head, the model's ability to capture and discriminate key features of citrus pests was enhanced, effectively improving small-target pest detection performance. Experimental results showed that the improved YOLO v8n-CPestCSR model achieved a precision of 96.10%, a recall of 93.33%, and a mean average precision (mAP) of 96.08%, representing increases of 3.75, 0.94, and 2.8 percentage points over that of the baseline YOLO v8n, respectively. Meanwhile, model weight was reduced by 8.1% and floating point operations (FLOPs) was reduced by 9.9%. Compared with models such as Faster R-CNN, YOLO v5s, and SSD, the proposed model improved mAP by 19.71, 1.71, and 11.83 percentage points, respectively, while maintaining a lower parameter count and model complexity. These results demonstrated that the improved YOLO v8n-CPestCSR model achieved significant success in enhancing citrus pest detection accuracy and was favorable for mobile deployment. The model was deployed on a Jetson Xavier NX mobile platform with inference acceleration. Detection results confirmed that the improved YOLO v8n-CPestCSR outperformed YOLO v8n in precision, recall, and inference speed. Finally, field experiments combining a pest suction device with the detection model verified the feasibility and effectiveness of the algorithm in real-world applications, demonstrating its capacity to effectively support precise pest early warning and green pest management for greenhouse citrus seedlings, in line with the practical demands of modern protected agriculture for efficient, low-consumption pest control.