Abstract:Dendroctonus valens is a harmful forest pest that could cause major economic and environmental damage without effective control. Recently, combining UAV remote sensing with deep learning-based object detection has become an effective way to monitor large forest areas. However, due to the small size and uneven distribution of infected trees, there are issues of missed and false detection during the target detection process. To address these challenges, an SCW-YOLO v8 model based on deep learning which included three improvements was proposed. Firstly, a small object detection layer was added after the second C2f layer in the YOLO v8 Backbone structure to increase the detection accuracy for smaller-sized objects. Then, to reduce the false detection rate and improve detection accuracy, a coordinate attention (CoordAtt) mechanism was integrated into the backbone structure of YOLO v8. Finally, the WIoU loss function was introduced to improve detection accuracy. The dataset was constructed based on the infected forest of Dendroctonus valens, which were photographed at a height range of 190 m to 240 m. In this dataset, most of the infected trees to be detected were small objects. The experiment consisted of four parts. Firstly, a comparative analysis was conducted between YOLO v8n, YOLO v5n, YOLO v9t, YOLO v10n, and YOLO 11n algorithms, through experiment chose the optimal base network model. The experimental results showed that the YOLO v8 model outperformed other object detection algorithms in both mAP and F1-scores, and its model size was relatively suitable. Therefore, the YOLO v8 model was more appropriate to serve as the base object detection model. Then, the detection results of the CoordAtt were compared with that of CBAM, GAM, and SE attention mechanisms, demonstrated the effectiveness of CoordAtt, its mAP and F1 scores were 88.8% and 83.9%. The third part of the experiment focused on the selection of the loss function. Three versions of the WIoU loss function were compared with CIoU, DIoU, and EIoU loss functions. The results showed that WIoUv3 achieved the best mAP (90.0%) and F1-scores (85.1%). Therefore, this loss function was selected as one of the improvements. Finally, ablation experiments were conducted to verify the effectiveness of each improvement method. Among them, adding small object detection layer increased the mAP to 90.4% and the F1 scores to 86.5%. The final SCW-YOLO v8 model, which integrated all improvement methods, achieved a maximum mAP of 91.6% and a maximum F1-scores of 86.8%. The analysis of the detection results demonstrated that small object detection layer could improve the detection accuracy for small objects. On this basis, CoordAtt attention mechanism could reduce false detections of incorrect targets, and the WIoUv3 loss function could further enhance detection accuracy. In summary, the SCW-YOLO v8 model proposed offered an efficient and reliable solution for forest pest detection, especially for the detection of small object Dendroctonus valens infected trees.