计算机工程与应用 ›› 2023, Vol. 59 ›› Issue (4): 197-207.DOI: 10.3778/j.issn.1002-8331.2208-0045

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

改进YOLOv5s的轨道障碍物检测模型轻量化研究

李昂,孙士杰,张朝阳,冯明涛,吴成中,李旺   

  1. 1.长安大学 信息工程学院,西安 710064
    2.西安电子科技大学 计算机科学与技术学院,西安 710064
    3.湖南大学 机器人视觉感知与控制技术国家工程实验室,长沙 410000
    4.中车株洲电力机车有限公司,湖南 株洲 412000
  • 出版日期:2023-02-15 发布日期:2023-02-15

Research on Lightweight of Improved YOLOv5s Track Obstacle Detection Model

LI Ang, SUN Shijie, ZHANG Zhaoyang, FENG Mingtao, WU Chengzhong, LI Wang   

  1. 1.School of Information Engineering, Chang’an University, Xi’an 710064, China
    2.School of Computer Science and Technology, Xidian University, Xi’an 710064, China
    3.National Engineering Laboratory of Robot Visual Perception and Control Technology, Hunan University, Changsha 410000, China
    4.CRRC Zhuzhou Electric Locomotive Co. Ltd., Zhuzhou, Hunan 412000, China
  • Online:2023-02-15 Published:2023-02-15

摘要: 针对传统列车轨道障碍物检测方法实时性差和对小目标检测精度低的不足,提出一种改进YOLOv5s检测网络的轻量化障碍物检测模型。引入更加轻量化的Mixup数据增强方式,替代算法中原有的Mosaic数据增强方式;引入GhostNet网络结构中的深度可分离卷积GhostConv,替代原有YOLOv5s模型中特征提取网络与特征融合网络中的普通卷积层,减小了模型的计算开销;在模型特征提取网络末端加入CA空间注意力机制,让算法在训练过程中减少了重要位置信息的丢失,弥补了改进GhostNet对检测精度的损失;将改进后的模型进行稀疏训练和通道剪枝操作,剪掉对检测精度影响不大的通道,同时保留重要的特征信息,使模型更加轻量化。实验结果表明,改进后的模型在自制的多样化轨道交通数据集上,相较于原始YOLOv5s算法,在模型大小减小9.7?MB,检测速度提高14?FPS的前提下,检测精度提升了1.0个百分点。同时与目前主流的检测算法对比,在检测精度与检测速度上也具有一定的优越性,适用于复杂轨道交通环境下的障碍物目标检测。

关键词: 目标检测, YOLOv5s, GhostNet, 注意力机制, 通道剪枝, 轻量化

Abstract: Aiming at the shortcomings of the traditional train track obstacle detection methods with poor real-time performance and low detection accuracy for small targets, a lightweight obstacle detection model based on improved YOLOv5s detection network is proposed. Firstly, a more lightweight Mixup data enhancement method is introduced to replace the original Mosaic data enhancement method. Secondly, the deep separable convolution GhostConv in the GhostNet network structure is introduced to replace the ordinary convolution layer in the feature extraction network and feature fusion network in the original YOLOv5s model, which reduces the computational overhead of the model. The CA spatial attention mechanism is added to the end of the model feature extraction network, which reduces the loss of important location information in the training process of the algorithm and makes up for the loss of detection accuracy caused by improved GhostNet. Finally, sparse training and channel pruning are performed on the improved model to prune away the channels that have little influence on the detection accuracy, while retaining important feature information to make the model more lightweight. The experimental results show that, compared with the original YOLOv5s algorithm, the model size of the improved model is reduced by 9.7 MB, the detection speed is increased by 14 FPS, and the detection accuracy is improved by 1.0 percentage point on the self-made diversified rail transit dataset. At the same time, compared with the current mainstream detection algorithm, the detection accuracy and detection speed also have some advantages, which is suitable for the obstacle target detection in complex rail transit environment.

Key words: object detection, YOLOv5s, GhostNet, attentional mechanism, channel pruning, lightweight