Abstract:This article proposes an improved UAV target detection algorithm, BG-YOLO, to address the limitations of existing UAV detection models in terms of model size, computational resource requirements, and the detection performance of small targets. Based on YOLOv8, BG-YOLO adds detection heads to the high-resolution feature layers, effectively reducing information loss during image downsampling and significantly enhancing the model′s ability to detect small targets. The introduction of the Biformer attention mechanism enables precise capture of long-range dependencies in images, thereby strengthening the model′s perception of targets at different scales. Additionally, the incorporation of the NWD loss function overcomes the issue of traditional loss functions being sensitive to positional deviations in small target detection, thereby significantly improving the model′s robustness. The model′s lightweighting based on GhostNetV2 replaces traditional convolutional modules, reducing model parameters and computational load while maintaining detection accuracy. Experimental results show that BG-YOLO achieves a 10.3% improvement in mAP@0.5 on the Det-Fly dataset compared to YOLOv8, with a 33.18% reduction in model parameters, and a 7.9% improvement compared to YOLOv9. Moreover, on the self-collected dataset, BG-YOLO demonstrates excellent performance in detecting low, slow, and small targets in various scenarios, including sky, mountain, and urban backgrounds, achieving average precisions of 96.2%, 88.1% and 86.2%, respectively, with detection speeds of 150.36, 128.21 and 112.53 fps. These results meet the real-time requirements of high detection accuracy and speed. In summary, BG-YOLO significantly enhances the detection accuracy and real-time performance for low, slow, and small UAV targets through the design of detection heads, incorporation of attention mechanisms, refinement of the loss function, and model lightweighting, thereby offering broad application prospects.