计算机工程与应用 ›› 2023, Vol. 59 ›› Issue (20): 184-191.DOI: 10.3778/j.issn.1002-8331.2305-0237

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

改进YOLOv5s的安全帽佩戴检测算法研究

刘雅洁,伊力哈木·亚尔买买提,席凌飞,英特扎尔·艾山江   

  1. 新疆大学 电气工程学院,乌鲁木齐 830017
  • 出版日期:2023-10-15 发布日期:2023-10-15

Research on Improved Safety Helmet Wearing Detection Algorithm of YOLOv5s

LIU Yajie, Yilihamu·Yaermaimaiti, XI Lingfei, Yingtezhaer·Aishanjiang   

  1. School of Electrical Engineering, Xinjiang University, Urumqi 830017, China
  • Online:2023-10-15 Published:2023-10-15

摘要: 针对安全帽佩戴目标检测算法参数多、推理速度慢以及检测准确率低等问题,提出基于改进YOLOv5s的安全帽佩戴检测算法研究。在主干网络添加坐标注意力机制(coordinate attention,CA),提高模型对关键特征的注意力,更聚焦训练安全帽相关目标特征,提高准确率;在特征提取网络引入结构重参数化技术(RepVGG),并在颈部网络融合鬼影混洗卷积(ghost-shuffle conv,GSConv)和VoV-GSCSP构造Slim-neck,在保证模型检测精度和泛化能力的同时,大幅降低模型参数量;设计使用SIoU优化边界框回归损失函数,提升预测框准确度和加快收敛速度。结果表明:改进算法的速度较原始YOLOv5s模型提高了49.51%,参数大小压缩了75.03%,平均精度均值提高了0.029,具有更好效果。

关键词: 安全帽检测, YOLOv5s, 坐标注意力机制, 结构重参数化

Abstract: Aiming at the problems of multiple parameters, slow reasoning speed and low detection accuracy of safety helmet wearing target detection algorithm, a research on safety helmet wearing detection algorithm based on improved YOLOv5s is proposed. Firstly, a coordinate attention mechanism(CA) is added to the backbone network to improve the model’s attention ability to key features, focus more on training helmet-related target features, and improve accuracy. Secondly, the structural reparameterization technology(RepVGG) is introduced in the feature extraction network, and the ghost-shuffle conv(GSConv) and VoV-GSCSP are integrated into the neck network to construct a Slim-neck, which greatly reduces the number of model parameters while ensuring the accuracy of model detection and generalization ability. Finally, SIoU is used to optimize the bounding box regression loss function to improve the prediction box accuracy and accelerate the convergence speed. The results show that compared with the original YOLOv5s model, the speed of the improved algorithm is increased by 49.51%, the parameter size is compressed by 75.03%, and the average accuracy is increased by 0.029, which has better results.

Key words: safety helmet detection, YOLOv5s, coordinate attention mechanism, structural reparameterization