计算机工程与应用 ›› 2024, Vol. 60 ›› Issue (11): 165-172.DOI: 10.3778/j.issn.1002-8331.2306-0315

• 图形图像处理 • 上一篇    下一篇

改进YOLOv7的自动驾驶目标检测算法

胡淼,姜麟,陶友凤,张志坚   

  1. 昆明理工大学 理学院,昆明 650500
  • 出版日期:2024-06-01 发布日期:2024-05-31

Improved YOLOv7 Automatic Driving Object Detection Algorithm

HU Miao, JIANG Lin, TAO Youfeng, ZHANG Zhijian   

  1. Faculty of Science, Kunming University of Science and Technology, Kunming 650500, China
  • Online:2024-06-01 Published:2024-05-31

摘要: 能否准确实时检测出道路上的车辆、行人等物体对自动驾驶车辆十分重要。针对自动驾驶场景下,车辆在行驶中存在的漏检,小目标检测效果差的问题,提出一种改进YOLOv7算法的自动驾驶目标检测算法。修改网络中扩充感受野的模块,减少感受野模块的大小,提高模型速度的同时增强对图片特征信息的提取能力。在主干网络输出端引入双层路由注意力机制,提高模型对小目标物体的检测性能。用EIOU损失函数替换算法原本的CIOU损失函数,将预测框与真实框的高度与宽度的差异最小化,加快模型收敛速度的同时达到更好的定位效果。实验结果表明:在KITTI数据集上,改进后的YOLOv7算法进行目标检测时,其mAP达到94.7%,在原YOLOv7算法上提升了3.1个百分点,并且在小目标物体检测上获得了更高的检测精度,有效提升了模型对小目标检测效果。

关键词: 自动驾驶, 小目标检测, YOLOv7, 注意力机制, 损失函数

Abstract: It is very important for autonomous driving vehicles to accurately detect objects such as vehicles and pedestrians on the road in real time. Aiming at the problems of missed detection and poor detection effect of small targets in the autonomous driving scene, this paper proposes an automatic driving target detection algorithm that improves the YOLOv7 algorithm. Firstly, it modifies the modules in the network to expand the receptive field, reduces the size of the receptive field module, and improves the speed of the model and enhances the ability to extract image feature information. Secondly, the paper introduces the BRA attention mechanism at the output of the backbone network to improve the model’s ability to small target objects. Finally, it replaces the original CIOU loss function of the algorithm with the EIOU loss function to minimize the difference between the height and width of the predicted frame and the real frame, and speeds up the convergence of the model while achieving better positioning results. The experimental results show that:on the KITTI dataset, when the improved YOLOv7 algorithm performs target detection, its mAP reaches 94.7%, which is 3.1 percentage points higher than the original YOLOv7 algorithm, and it has achieved higher detection accuracy in small target object detection. It effectively improves the model’s detection effect on small targets.

Key words: autonomous driving, small target detection, YOLOv7, attention mechanism, loss function