计算机工程与应用 ›› 2023, Vol. 59 ›› Issue (13): 186-193.DOI: 10.3778/j.issn.1002-8331.2211-0188

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

改进YOLOv5的轻量级不规范驾驶行为实时检测

邹鹏,杨凯军,梁晨   

  1. 陕西科技大学 电气与控制工程学院,西安 710021
  • 出版日期:2023-07-01 发布日期:2023-07-01

Improved YOLOv5 Algorithm for Real-Time Detection of Irregular Driving Behavior

ZOU Peng, YANG Kaijun, LIANG Chen   

  1. School of Electrical and Control Engineering, Shaanxi University of Science & Technology, Xi’an 710021, China
  • Online:2023-07-01 Published:2023-07-01

摘要: 针对现有的不规范驾驶行为检测算法占用内存多、计算量大、难以在边缘设备部署且在昏暗条件下对检测目标有干扰等问题,提出了一种改进YOLOv5模型的轻量级不规范驾驶行为实时检测算法。将SE注意力机制引入到YOLOv5模型的Backbone网络部分,再将Backbone网络里的CSP模块替换为轻量化的GhostBottleNeck网络模块,从而减少模型的参数量;将原网络中的激活函数改进成SiLU函数,可提高模型检测的准确率,增强模型的鲁棒性;对改进的模型以及原网络进行相关的测试,验证所修改方法的有效性以及实时性。实验结果表明,改进后的YOLOv5-GS算法提高了对不规范驾驶行为的检测精度,参数量降低20.75%,检测速度提升75%,极大地降低了所需的硬件成本,适用于在小型边缘设备上部署。

关键词: 不规范驾驶行为检测, 轻量化, 注意力机制, YOLOv5, GhostBottleNeck

Abstract: Aiming at the problems of existing irregular driving behavior detection algorithms, such as occupying too much memory, large amount of calculation, being difficult to deploy on edge devices and interfering with detection targets in dim conditions, a lightweight irregular driving behavior real-time detection algorithm with improved YOLOv5 model is proposed. Firstly, the SE attention mechanism is introduced in the Backbone network of the YOLOv5 model, and then the CSP module of the Backbone network is replaced by a lightweight GhostBottleNeck network module, which tends to reduce the number of model references. Next, the activation function in the original network is modified into SiLU function, which can improve the accuracy of model detection and enhance the robustness of the model. Finally, the improved model and the original network are tested to verify the effectiveness and real-time performance of the modified method. Experimental results show that the improved YOLOv5-GS algorithm can improve the detection accuracy of irregular driving behavior, the number of parameters is reduced by 20.75%, the detection speed is increased by 75%, and the required hardware cost is greatly reduced, which is suitable for deployment on small edge equipment.

Key words: non-standard driving behavior detection, lightweight, attention mechanism, YOLOv5, GhostBottleNeck