Accurate and intelligent detection of rice pests is critical for ensuring food security and advancing precision agriculture. However, due to the small size, irregular morphology, dense distribution, and complex backgrounds of pest targets, traditional lightweight detection models often suffer from low recall and poor localization accuracy in real-world paddy field environments. To address these challenges, this study proposes an enhanced detection model, YOLO-Rice, based on the YOLOv8n framework. First, a Multilayer Contextual Attention (MLCA) module is embedded after the SPPF layer to collaboratively fuse channel, spatial, local, and global contextual information, thereby enhancing the model's sensitivity to subtle pest features. Second, the original C2f structure is redesigned into C2f-DS, which integrates Dynamic Snake Convolution (DSConv) to improve adaptive perception of deformable pest contours and irregular morphological edges. Finally, the conventional CIoU loss is replaced with a WIoU loss to guide the network to focus more effectively on hard-to-fit small and occluded targets. Extensive experiments on a self-constructed dataset of 11 common rice pest species demonstrate that YOLO-Rice achieves 84.8% Precision, 69.9% Recall, 78.7% mAP@0.5, and 63.4% mAP@0.5:0.95, representing significant improvements over the baseline YOLOv8n model. The proposed approach achieves an excellent balance between detection accuracy and computational efficiency, making it highly suitable for real-time deployment on UAVs and edge devices in agricultural pest monitoring applications.
Li et al. (Thu,) studied this question.