Abstract:
Chili pepper leaf diseases and insect pests seriously affect chili pepper yield and quality under natural cultivation conditions, while complex backgrounds, variable illumination, and small or partially occluded targets increase the difficulty of accurate identification. To improve the recognition accuracy of chili pepper leaf diseases and insect pests in natural scenes, an improved detection method based on YOLOv8n was proposed. A self-built dataset was established using images collected from major chili pepper-producing areas under different field conditions, including sunny and cloudy weather, front-light and backlight environments, and different shooting distances. The original dataset contained
1283 annotated images covering four categories, namely viral disease, epidemic disease, thrips, and green worm. To ensure an objective evaluation process and avoid data leakage, the original images were first divided into training, validation, and test sets at a ratio of 8:1:1, and data augmentation was then applied only to the training set. The augmentation strategies mainly included random flipping, random affine transformation, scaling, translation, and image blurring, which improved the diversity of training samples and enhanced the adaptability of the model to natural field conditions. On this basis, three improvements were introduced into the original YOLOv8n model. First, a Selective Kernel (SK) module was embedded into the backbone network to strengthen the feature representation ability for targets at different scales by adaptively selecting convolution branches with different receptive fields. Second, part of the C2f structure in the backbone was replaced with a Biformer module, which improved the screening of key information regions and suppressed redundant background interference through a bi-level routing attention mechanism, thereby enhancing the discrimination of disease and pest targets in complex scenes. Third, the Complete Intersection over Union (CIoU) loss was replaced with the Focal-Inner Complete Intersection over Union (FI-CIoU) loss to improve the contribution of difficult samples during bounding box regression and further enhance the localization performance for small and partially occluded targets. Experimental results showed that the improved model achieved better performance than the original YOLOv8n model on the self-built dataset. Precision increased from 63.8% to 66.9%, recall increased from 58.1% to 59.9%, and mean average precision increased from 59.7% to 65.1%, corresponding to improvements of 3.1, 1.8, and 5.4 percentage points, respectively. Visual comparison of the detection results further indicated that the improved model effectively reduced missed detections and false detections in complex natural scenes and showed better adaptability to dense leaf backgrounds, small targets, and partially occluded targets. Overall, the proposed method improved the recognition performance of chili pepper leaf diseases and insect pests under natural conditions and provided a useful technical reference for intelligent monitoring and precise management of chili pepper diseases and insect pests.