-
摘要:
在无人机(UAV)视角下的目标检测任务中,为使其在有限资源内保证目标检测精度,提出一种轻量化YOLOv8n的无人机视角下目标检测算法YOLOv8n-WMCBS。采用Wise-IoU v3为网络整体损失函数,动态聚焦低质量预测框;引入MobileNetV3网络与坐标注意力(CA)机制骨干网络,降低参数量与计算复杂度;引入小目标检测层与检测头,并去除大目标检测层,保留小目标细节特征和位置信息,减少模型计算负担;设计残差幻影卷积(RGConv),进一步增强骨干网络的特征丰富性,与双向特征金字塔网络(BiFPN)模块结合作为新颈部网络模块,增强颈部网络的动态特征融合;提出改进的非跨步空深卷积(Conv-SPD)取代原跨步下采样,充分保留高分辨率小目标信息。实验结果表明:在VisDrone 2019数据集中,改进算法在参数量降低40.5%和模型文件大小减小35.5%的同时,mAP0.5和mAP0.5:0.95较原算法分别提升4.6%和2.9%,表明模型有着良好的检测效果和更好的轻量化性能。
Abstract:In order to ensure the accuracy of target detection within limited resources, a lightweight YOLOv8n target detection algorithm YOLOv8n-WMCBS from the perspective of an unmanned aerial vehicle (UAV) was proposed. Firstly, Wise-IoU v3 is used as the overall loss function of the network, and the low-quality prediction frame is dynamically focused. Secondly, the MobileNetV3 network and the coordinate attention (CA) backbone network were introduced to reduce the number of parameters and the computational complexity. In order to preserve the specific characteristics and position data of the small target and lessen the model’s computational load, the big target detection layer is eliminated and the small target detection layer and detection head are added concurrently. Then, the residual ghost convolution (RGConv) was designed to further enhance the feature richness of the backbone network, and was combined with the bidirectional feature pyramid network (BiFPN) module as a new neck network module to enhance the dynamic feature fusion of the neck network. Finally, in order to fully preserve the high-resolution small target information, an enhanced convolution-space-to-depth (Conv-SPD) is suggested to replace the initial step-down down sampling. Experimental results show that in the VisDrone 2019 dataset, while the number of parameters and the model size are reduced by 40.5% and 35.5%, the mAP0.5 and mAP0.5:0.95 are increased by 4.6% and 2.9%, respectively, compared with the original algorithm, which has stronger generalization ability and is more suitable for resource-constrained equipment such as UAVs.
-
Key words:
- YOLOv8 /
- unmanned aerial vehicle /
- loss function /
- small-object detection layer /
- lightweight networks
-
表 1 实验参数配置
Table 1. Experimental parameter configuration
初始输入
图像尺寸/(像素×像素)批次大小 训练轮次 工作线程数 优化器 动量系数 权重衰减系数 patience 初始学习率 最终学习率 640×640 16 100 8 AdamW 0.937 0.0005 50 0.01 0.01 注:patience表示模型若经历50轮次后性能仍未提升则立即停止训练。 表 2 颈部网络重设计实验结果
Table 2. Neck network redesign experiment results
模型 P/% R/% mAP0.5/% YOLOv8n 41.7 32.2 31.9 YOLOv8n-P2 45.6 34.9 35.3 YOLOv8n-WMCBS 48.0 36.4 36.5 表 3 损失函数改进实验结果
Table 3. Experimental results of loss function improvement
模型 边界框回归损失 P/% R/% mAP0.5/% +CIoU 1.331 41.4 32.1 31.9 +Wise-IoU v3 1.256 43.5 32.4 32.1 表 4 综合消融实验结果
Table 4. Comprehensive ablation experiment results
算法 Wise-IoU v3 Mobile-CA + P2, −P5 RG-BiFPN Conv-SPD mAP0.5/% mAP0.5:0.95/% 推理帧率/(帧·s−1) 参数量 模型文件大小/MB YOLOv8n 31.9 18.4 326.9 3.01×106 6.2 A √ 32.1 18.5 313.7 3.01×106 6.2 B √ 28.5 15.4 297.5 2.58×106 5.4 C √ 35.3 21.1 229.2 2.01×106 4.3 D √ 35.6 21.2 223.7 2.44×106 7.9 E √ 32.3 18.9 387.3 3.15×106 6.5 F √ √ √ √ √ 36.5 21.3 199.3 1.79×106 4.0 表 5 VisDrone 2019数据集上不同算法对比实验结果
Table 5. Comparison experiments results of different algorithms on the VisDrone 2019 dataset
算法 AP/% mAP0.5/% 行人 人 自行车 汽车 面包车 卡车 三轮车 带篷三轮车 公共汽车 摩托车 YOLOv4[26] 24.8 12.6 8.6 64.3 22.4 22.7 11.4 7.6 44.3 21.7 30.7 YOLOv5s[27] 26.8 13.9 9.0 71.0 36.8 37.4 16.3 18.4 56.1 28.3 31.4 YOLOv6s 24.4 12.9 6.9 71.0 37.5 39.0 15.1 18.0 56.0 26.7 30.7 FPN[28] 33.0 25.8 13.9 69.4 40.0 34.3 27.4 13.4 49.1 37.6 35.6 YOLOv11n 34.3 26.4 7.8 75.2 38.6 27.3 21.6 11.9 48.1 36.9 32.8 YOLOv12n 40.2 32.2 10.3 73.3 35.9 27.5 18.1 10.7 41.5 39.7 33.0 YOLOv8n(原算法) 33.4 27.4 7.4 74.7 38.0 26.3 20.8 10.9 45.3 34.3 31.9 改进算法 41.1 33.6 8.7 79.1 40.8 31.3 24.2 14.0 50.7 41.3 36.5 注:加粗数值表示该类别最优值。 表 6 算法性能对比
Table 6. Comparison of algorithm performance
表 7 VOC2007数据集上泛化性实验结果
Table 7. Generalization experiment results on the VOC2007 dataset
模型 P/% R/% mAP0.5/% 推理帧率/(帧·s−1) YOLOv8n 75.3 67.5 75.1 561 改进算法 76.5 68.9 75.9 323 -
[1] Redmon J, Divvala S, Girshick R, et al. You only look once: unified, real-time object detection[C]//Proceedings of the 2016 IEEE Conference on Computer Vision and Pattern Recognition. Piscataway: IEEE Press, 2016: 779-788. [2] Tan M X, Pang R M, Le Q V. EfficientDet: scalable and efficient object detection[C]//Proceedings of the 2020 IEEE/CVF Conference on Computer Vision and Pattern Recognition. Piscataway: IEEE Press, 2020: 10778-10787. [3] 张瑞芳, 杜伊婷, 程小辉. 无人机视角下小目标检测算法[J]. 激光与光电子学进展, 2025, 62(4): 0437002.Zhang R F, Du Y T, Cheng X H. Algorithm for small target detection from an unmanned aerial vehicle view[J]. Laser & Optoelectronics Progress, 2025, 62(4): 0437002(in Chinese). [4] 李金凤, 崔少华, 潘立慧, 等. 无人机视角下改进YOLOv8的红外小目标检测算法[J]. 河北师范大学学报(自然科学版), 2024, 48(6): 558-564.Li J F, Cui S H, Pan L H, et al. Infrared small target detection algorithm based on improved YOLOv8 from the perspective of UAV[J]. Journal of Hebei Normal University (Natural Science Edition), 2024, 48(6): 558-564(in Chinese). [5] 潘玮, 韦超, 钱春雨, 等. 面向无人机视角下小目标检测的YOLOv8s改进模型[J]. 计算机工程与应用, 2024, 60(9): 142-150.Pan W, Wei C, Qian C Y, et al. Improved YOLOv8s model for small object detection from perspective of drones[J]. Computer Engineering and Applications, 2024, 60(9): 142-150(in Chinese). [6] Zhang X, Liu C, Yang D G, et al. RFAConv: receptive-field attention convolution for improving convolutional neural networks[EB/OL]. (2026-02-28)[2026-06-20]. https://arxiv.org/abs/2304.03198. [7] Woo S, Park J, Lee J Y, et al. CBAM: convolutional block attention module[C]//Proceedings of the Computer Vision-ECCV 2018. Berlin: Springer, 2018: 3-19. [8] Lau K W, Po L M, Rehman Y A U. Large separable kernel attention: rethinking the large kernel attention design in CNN[EB/OL]. (2023-10-20)[2025-06-20]. https://arxiv.org/abs/2309.01439. [9] Yuan Z J, Shao P W, Li J R, et al. YOLOv8-ACU: improved YOLOv8-pose for facial acupoint detection[J]. Frontiers in Neurorobotics, 2024, 18: 1355857. [10] Rezatofighi H, Tsoi N, Gwak J, et al. Generalized intersection over union: a metric and a loss for bounding box regression[C]//Proceedings of the 2019 IEEE/CVF Conference on Computer Vision and Pattern Recognition. Piscataway: IEEE Press, 2020: 658-666. [11] Ma S L, Xu Y. MPDIoU: a loss for efficient and accurate bounding box regression[EB/OL]. (2023-07-14)[2025-06-20]. https://arxiv.org/abs/2307.07662. [12] Jocher G. YOLOv8n[EB/OL]. (2023-09-27)[2025-06-20]. https://github.com/ultralytics/ultralytics. [13] Wang C Y, Mark Liao H Y, Wu Y H, et al. CSPNet: a new backbone that can enhance learning capability of CNN[C]//Proceedings of the 2020 IEEE/CVF Conference on Computer Vision and Pattern Recognition Workshops. Piscataway: IEEE Press, 2020: 1571-1580. [14] Li X, Wang W H, Wu L J, et al. Generalized focal loss: learning qualified and distributed bounding boxes for dense object detection[EB/OL]. (2020-06-08)[2025-06-20]. https://arxiv.org/abs/2006.04388. [15] Zheng Z H, Wang P, Liu W, et al. Distance-IoU loss: faster and better learning for bounding box regression[J]. Proceedings of the AAAI Conference on Artificial Intelligence, 2020, 34(7): 12993-13000. [16] Tong Z J, Chen Y H, Xu Z W, et al. Wise-IoU: bounding box regression loss with dynamic focusing mechanism[EB/OL]. (2023-01-24)[2025-06-20]. https://arxiv.org/abs/2301.10051. [17] Howard A, Sandler M, Chen B, et al. Searching for MobileNetV3[C]//Proceedings of the 2019 IEEE/CVF International Conference on Computer Vision. Piscataway: IEEE Press, 2019: 1314-1324. [18] Hu J, Shen L, Sun G. Squeeze-and-excitation networks[C]//Proceedings of the 2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition. Piscataway: IEEE Press, 2018: 7132-7141. [19] Hou Q B, Zhou D Q, Feng J S. Coordinate attention for efficient mobile network design[C]//Proceedings of the 2021 IEEE/CVF Conference on Computer Vision and Pattern Recognition. Piscataway: IEEE Press, 2021: 13708-13717. [20] Cai W X, Lu K B, Fan M T, et al. Rice growth-stage recognition based on improved YOLOv8 with UAV imagery[J]. Agronomy, 2024, 14(12): 2751. [21] Han K, Wang Y H, Tian Q, et al. GhostNet: more features from cheap operations[C]//Proceedings of the 2020 IEEE/CVF Conference on Computer Vision and Pattern Recognition. Piscataway: IEEE Press, 2020: 1577-1586. [22] Chiley V, Thangarasa V, Gupta A, et al. RevBiFPN: the fully reversible bidirectional feature pyramid network[EB/OL]. (2023-04-28)[2025-06-20]. https://arxiv.org/abs/2206.14098. [23] Xu W Y, Cui C, Ji Y C, et al. YOLOv8-MPEB small target detection algorithm based on UAV images[J]. Heliyon, 2024, 10(8): e29501. [24] Sunkara R, Luo T. No more strided convolutions or pooling: a new CNN building block for low-resolution images and small objects[C]//Proceedings of the Machine Learning and Knowledge Discovery in Databases. Berlin: Springer, 2023: 443-459. [25] Du D W, Wen L Y, Zhu P F, et al. VisDrone-DET2020: the vision meets drone object detection in image challenge results[C]//Proceedings of the Computer Vision-ECCV 2020 Workshops. Berlin: Springer, 2020: 692-712. [26] Bochkovskiy A, Wang C Y, Liao H Y M. YOLOv4: Optimal speed and accuracy of object detection[EB/OL]. (2020-04-23)[2025-06-05]. https://arxiv.org/abs/2004.10934. [27] Jocher G. Ultralytics YOLOv5[EB/OL]. (2020-05-29)[2025-06-05]. https://github.com/ultralytics/yolov5. [28] Lin T Y, Dollar P, Girshick R, et al. Feature pyramid networks for object detection[C]//Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. Piscataway: IEEE Press, 2017: 2117-2125. -


下载: