航空学报 > 2023, Vol. 44 Issue (7): 327106-327106   doi: 10.7527/S1000-6893.2022.27106

基于改进YOLOv5的无人机实时密集小目标检测算法

奉志强1, 谢志军1(), 包正伟2, 陈科伟3   

  1. 1.宁波大学 信息科学与工程学院,宁波  315211
    2.宁波极望信息科技有限公司,宁波  315000
    3.宁波大学 机械工程与力学学院,宁波  315211
  • 收稿日期:2022-03-04 修回日期:2022-03-22 接受日期:2022-04-28 出版日期:2023-04-15 发布日期:2022-05-11
  • 通讯作者: 谢志军 E-mail:xiezhijun@nbu.edu.cn
  • 基金资助:
    国家自然科学基金(U20A20121);浙江省自然基金(LY21F020006);宁波市自然科学基金(2019A610088);宁波市“科技创新 2025”重大专项(2019B10125)

Real⁃time dense small object detection algorithm for UAV based on improved YOLOv5

Zhiqiang FENG1, Zhijun XIE1(), Zhengwei BAO2, Kewei CHEN3   

  1. 1.School of Information Science and Engineering,Ningbo University,Ningbo  315211,China
    2.Ningbo JIWANG Information Technology Ltd,Ningbo  315000,China
    3.School of Mechanical Engineering and Mechanics,Ningbo University,Ningbo  315211,China
  • Received:2022-03-04 Revised:2022-03-22 Accepted:2022-04-28 Online:2023-04-15 Published:2022-05-11
  • Contact: Zhijun XIE E-mail:xiezhijun@nbu.edu.cn
  • Supported by:
    National Natural Science Foundation of China(U20A20121);Zhejiang Natural Fund Project(LY21F020006);Ningbo Natural Science Foundation Project(2019A610088);Ningbo Key Science and Technology Plan (2025) Project(2019B10125)

摘要:

无人机航拍图像与自然场景图像相比背景更复杂,存在大量密集小目标,对检测网络提出了更高的要求。在保证目标检测实时性的前提下,针对无人机视角下密集小目标检测精度低的问题,提出一种基于YOLOv5的无人机实时密集小目标检测算法。首先,将空间注意力(SAM)与通道注意力(CAM)相结合,改进CAM中特征压缩后的全连接层,降低计算量。另外,改变CAM与SAM的连接结构,提高空间维度特征捕获能力。综上,提出一种空间-通道注意力模块(SCAM),提高模型对特征图中小目标聚集区域的关注程度;其次,提出一种基于SCAM的注意力特征融合模块(SC-AFF),根据不同尺度特征图自适应分配注意力权重,增强小目标的特征融合效率;最后,在主干网络中引入Transformer模块,并利用SC-AFF模块改进原有的残差连接处的特征融合方式,更好地捕获全局信息和丰富的上下文信息提高复杂背景下密集小目标的特征提取能力。在VisDrone2021数据集上进行实验,YOLOv5s基准下,改进后模型的mAP50提高了6.4%,mAP75提高了5.8%,对高分辨率图像的FPS可达到46。在输入分辨率1 504×1 504下训练的模型mAP50可达54.5%,比YOLOv4提高了11.5%,精度提高的同时检测速度FPS依旧保持在46,更适用于密集小目标场景下的无人机实时目标检测。

关键词: 无人机, 小目标检测, 注意力机制, 自注意力机制, 特征融合

Abstract:

UAV aerial images have more complex backgrounds and a large number of dense small targets compared with natural scene images, which impose higher requirements on the detection network. On the premise of ensuring real-time object detection, a YOLOv5-based UAV real-time dense small object detection algorithm is proposed for the problem of low accuracy of dense small object detection in UAV view. First, combining Spatial Attention Module (SAM) with Channel Attention Module (CAM), the fully connected layer after feature compression in CAM is improved to reduce the computational effort. In addition, the connection structure of CAM and SAM is changed to improve the spatial dimensional feature capture capability. In summary, a Spatial-Channel Attention Module (SCAM) is proposed to improve the model's attention to the aggregated regions of small targets in the feature map; secondly, an SCAM- based Attentional Feature Fusion module (SC-AFF) is proposed to enhance the feature fusion efficiency of small targets by adaptively assigning attentional weights according to feature maps of different scales; finally, a backbone network is introduced in the Transformer in the backbone network, and use the SC-AFF to improve the feature fusion at the original residual connections to better capture global information and rich contextual information, and improve the feature extraction capability of dense small targets in complex backgrounds. Experiments are conducted on the VisDrone2021 dataset. The effects of different network scale parameters and different input resolutions on the detection accuracy and speed of YOLOv5 are first investigated. The analysis concludes that YOLOv5s is more suitable to be used as a benchmark model for UAV real-time object detection. Under the benchmark of YOLOv5s, the improved model improves mAP50 by 6.4% and mAP75 by 5.8%, and the FPS for high-resolution images can reach 46. The mAP50 of the model trained at an input resolution of 1504×1504 can reach 54.5%, which is 11.5% better than that of YOLOv4. The accuracy is improved while the detection speed FPS remains at 46, which is more suitable for real-time UAV object detection in dense small target scenarios.

Key words: UAV, small object detection, attention mechanism, self-attention mechanism, feature fusion

中图分类号: