Computer Engineering and Applications ›› 2023, Vol. 59 ›› Issue (11): 203-211.DOI: 10.3778/j.issn.1002-8331.2212-0190

• Graphics and Image Processing • Previous Articles     Next Articles

Improved Helmet Wear Detection Algorithm for YOLOv5

QIAO Yan, ZHEN Tong, LI Zhihui   

  1. 1.College of Information Science and Engineering, Henan University of Technology, Zhengzhou 450001, China
    2.Key Laboratory of Grain Information Processing and Control(Henan University of Technology), Ministry of Education, Zhengzhou 450001, China
  • Online:2023-06-01 Published:2023-06-01

改进YOLOv5的安全帽佩戴检测算法

乔炎,甄彤,李智慧   

  1. 1.河南工业大学 信息科学与工程学院,郑州 450001
    2.粮食信息处理与控制重点实验室,郑州 450001

Abstract: Aiming at the problems of complex structure, large computation and low detection accuracy of the current target detection model, the helmet wearing algorithm based on the improved YOLOv5 is proposed in industrial scenarios. Firstly, the light-weight network ShuffleNetv2 is introduced in the backbone network, and the Focus structure and ShuffleNetv2 are retained to jointly form the backbone network to reduce the computation and number of parameters of the network; secondly, the Swin Transformer Block is made to be introduced in the C3 module to obtain the C3STB module, replacing the original C3 module in the Neck part; finally, the CBAM_ H attention mechanism is designed and embedded in the Neck network to obtain global context information and improve the model detection accuracy. The experimental results show that the improved YOLOv5 model compresses the number of parameters from 6.14×106 to 8.9×105, the computational volume from 1.64×1010 to 6.2×109, and the mAP from 0. 899 to 0. 908, which is better than the performance of the original model.

Key words: YOLOv5, ShuffleNetv2, CBAM attention mechanism, Swin Transformer Block

摘要: 针对目前目标检测模型结构复杂、计算量大、检测准确率低等问题,提出在工业场景下基于改进型YOLOv5的安全帽佩戴算法。在主干网络引入轻量型网络ShuffleNetv2,保留Focus结构和ShuffleNetv2共同组成主干网络,降低网络的计算量和参数量;在C3模块中引入Swin Transformer Block,得到C3STB模块,替换Neck部分原有的C3模块;设计了CBAM_H注意力机制,并将其嵌入Neck网络中,获取全局上下文信息,提高模型检测准确率。自建数据集并进行实验,实验结果表明,改进后的YOLOv5模型的参数量由6.14×106压缩到8.9×105,计算量由1.64×1010压缩到6.2×109,mAP由0.899上升到0.908,优于原模型性能。

关键词: YOLOv5, ShuffleNetv2, CBAM注意力机制, Swin Transformer Block