计算机工程与应用 ›› 2022, Vol. 58 ›› Issue (13): 63-73.DOI: 10.3778/j.issn.1002-8331.2202-0093

• 热点与综述 • 上一篇    下一篇

基于改进YOLOv5的目标检测算法研究

邱天衡,王玲,王鹏,白燕娥   

  1. 长春理工大学 计算机科学技术学院,长春 130022
  • 出版日期:2022-07-01 发布日期:2022-07-01

Research on Object Detection Algorithm Based on Improved YOLOv5

QIU Tianheng, WANG Ling, WANG Peng, BAI Yan’e   

  1. College of Computer Science and Technology, Changchun University of Science and Technology, Changchun 130022, China
  • Online:2022-07-01 Published:2022-07-01

摘要: YOLOv5是目前单阶段目标检测性能较好的算法,但对目标边界回归的精确度不高,难以适用对预测框交并比要求较高的场景。基于YOLOv5算法,提出一种对硬件要求低、模型收敛速度快、目标框准确率高的新模型YOLO-G。改进特征金字塔结构(FPN),采用跨层级联的方式融合更多的特征,一定程度上防止了浅层语义信息的丢失,同时加深金字塔深度,对应增加检测层,使各种锚框的铺设间隔更加合理;其次把并行模式的注意力机制融入到网络结构中,赋予空间注意力模块和通道注意力模块相同的优先级,以加权融合的方式提取注意力信息,使网络可根据对空间和通道注意力的关注程度得到混合域注意力;通过降低网络的参数量和计算量对网络进行轻量化处理,防止因模型复杂度提升造成实时性能的损失。使用PASCAL VOC的2007、2012两个数据集来验证算法的有效性,YOLO-G比YOLOv5s的参数量减少了4.7%,计算量减少了47.9%,而mAP@0.5提高了3.1个百分点,mAP@0.5:0.95提高了5.6个百分点。

关键词: YOLOv5算法, 特征金字塔(FPN), 注意力机制, 目标检测

Abstract: YOLOv5 is an algorithm with good performance in single-stage target detection at present, but the accuracy of target boundary regression is not too high, so it is difficult to apply to scenarios with high requirements on the intersection ratio of prediction boxes. Based on YOLOv5 algorithm, this paper proposes a new model YOLO-G with low hardware requirements, fast model convergence and high accuracy of target box. Firstly, the feature pyramid network(FPN) is improved, and more features are integrated in the way of cross-level connection, which prevents the loss of shallow semantic information to a certain extent. At the same time, the depth of the pyramid is deepened, corresponding to the increase of detection layer, so that the laying interval of various anchor frames is more reasonable. Secondly, the attention mechanism of parallel mode is integrated into the network structure, which gives the same priority to spatial and channel attention module, then the attention information is extracted by weighted fusion, so that the network can fuse the mixed domain attention according to the attention degree of spatial and channel attention. Finally, in order to prevent the loss of real-time performance due to the increase of model complexity, the network is lightened to reduce the number of parameters and computation of the network. PASCAL VOC datasets of 2007 and 2012 are used to verify the effectiveness of the algorithm. Compared with YOLOv5s, YOLO-G reduces the number of parameters by 4.7% and the amount of computation by 47.9%, while mAP@0.5 and mAP@0.5:0.95 increases by 3.1 and 5.6 percentage points respectively.

Key words: YOLOv5 algorithm, feature pyramid network(FPN), attention mechanism, object detection