电子科技 ›› 2025, Vol. 38 ›› Issue (1): 81-87.doi: 10.16180/j.cnki.issn1007-7820.2025.01.011

• • 上一篇    下一篇

基于改进YOLOv4的车辆检测算法

赖颖(), 巨志勇, 叶雨新   

  1. 上海理工大学 光电信息与计算机工程学院,上海 200093
  • 收稿日期:2023-05-24 修回日期:2023-07-04 出版日期:2025-01-15 发布日期:2025-01-06
  • 通讯作者: 赖颖(1996-),男, E-mail:2224735890@qq.com,硕士研究生。研究方向:图像识别、目标检测。
  • 作者简介:巨志勇(1975-),男,博士,讲师。研究方向:模式识别、机器视觉、深度学习。
    叶雨新(1999-),男,硕士研究生。研究方向:图像识别、目标检测。
  • 基金资助:
    国家自然科学基金(81101116)

A Vehicle Detection Algorithm Based on Improved YOLOv4

LAI Ying(), JU Zhiyong, YE Yuxin   

  1. School of Optical-Electrical and Computer Engineering, University of Shanghai for Science and Technology,Shanghai 200093,China
  • Received:2023-05-24 Revised:2023-07-04 Online:2025-01-15 Published:2025-01-06
  • Supported by:
    National Natural Science Foundation of China(81101116)

摘要:

在交通监控中进行车辆检测过程时,存在车辆互相遮挡和远距离目标尺寸不足的问题,导致在检测中存在漏检和误检情况。针对此问题,文中提出一种基于YOLOv4(You Only Look Once version 4)的多尺度融合与注意力机制的交通车辆检测算法。在YOLOv4的路径聚合网络中增加一个新的特征层进行多尺度特征融合,提升模型对底层纹理特征的提取能力。在YOLO Head检测头前嵌入ECA(Efficient Channel Attention)通道注意力模块,对聚合后的特征进行合理的抑制和增强,将CIoU(Complete Intersection over Union)损失函数替换为Soft-CIoU损失函数,提高小目标车辆对损失函数的贡献度。在公开车辆数据集UA-DETRAC与KITTI中的实验结果表明,相较于原YOLOv4算法,所提算法的平均精度分别提升了2.45百分点和1.14百分点,检测速度达到41.67 frame·s-1。相较于其他先进算法,所提算法在检测精度上表现良好。

关键词: 车辆检测, 多尺度特征融合, 注意力机制, Soft-CIOU损失函数, YOLOv4, 深度学习, 目标检测, 小目标

Abstract:

In the process of vehicle detection in traffic monitoring, there are some problems such as vehicles shielding each other and insufficient distance target size, which leads to missing detection and false detection. To solve this problem, this study proposes a traffic vehicle detection algorithm based on YOLOv4(You Only Look Once version 4) multi-scale fusion and attention mechanism. A new feature layer is added to YOLOv4's path aggregation network for multi-scale feature fusion to improve the model's ability to extract underlying texture features. The ECA (Efficient Channel Attention) channel attention module is embedded in front of YOLO Head detection head to reasonably suppress and enhance the aggregated features. The CIoU (Complete Intersection over Union) loss function is replaced by the Soft-CIoU loss function to improve the contribution of small target vehicles to the loss function. The experimental results on the publicly available vehicle data sets UA-DETRAC and KITTI show that compared to the original YOLOv4 algorithm, the average accuracy of the proposed algorithm improves by 2.45 percentage points and 1.14 percentage points, respectively, and the detection speed reaches 41.67 frame·s-1.The proposed algorithm performs well in detection accuracy when compared with other advanced algorithms.

Key words: vehicle detection, multi-scale feature fusion, attention mechanism, Soft-CIOU loss function, YOLOv4, deep learning, target detection, small target

中图分类号: 

  • TP391