Computer Engineering and Applications ›› 2023, Vol. 59 ›› Issue (2): 194-201.DOI: 10.3778/j.issn.1002-8331.2206-0468

• Graphics and Image Processing • Previous Articles     Next Articles

Improved YOLOv5s Algorithm for Helmet Wearing Detection

SONG Xiaofeng, WU Yunjun, LIU Bingbing, ZHANG Qinglin   

  1. 1.College of Physical Science and Technology, Central China Normal University, Wuhan 430079, China
    2.The First Military Representative Office of the Armament Department of the Rocket Force Stationed in Wuhan, Wuhan 430079, China
  • Online:2023-01-15 Published:2023-01-15

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

宋晓凤,吴云军,刘冰冰,张青林   

  1. 1.华中师范大学 物理科学与技术学院,武汉 430079
    2.火箭军装备部驻武汉地区第一军事代表室,武汉 430079

Abstract: Wearing safety helmet is one of the important guarantees for personnel safety in the construction process. However, the existing manual detection is time-consuming and unable to achieve real-time monitoring. Aiming at this phenomenon, a safety helmet detection algorithm based on deep learning is proposed. The algorithm is based on YOLOv5s network. Firstly, CoordAtt coordinate attention mechanism module is introduced in the backbone network of the network, considering the global information, so that the network can allocate more attention to the safety helmet, so as to improve the detection ability of small targets. Secondly, to solve the problem of insufficient feature fusion in the original backbone network, the residual block in the backbone network is replaced by the residual block in the Res2NetBlock structure, so as to improve the fine-grained fusion ability of YOLOv5s.?The experimental results show that:It can be seen from the verification in the self-made helmet data set that, compared with the original YOLOv5 algorithm, the average accuracy is improved by 2.3 percentage points and the speed is increased by 18 FPS. Compared with the YOLOv3 algorithm, the average accuracy is improved by 13.8 percentage points and the speed is increased by 95 FPS. A more accurate lightweight and efficient real-time helmet wearing detection is realized.

Key words: helmet wearing detection, YOLOv5s, CoordAtt, Res2NetBlock

摘要: 佩戴安全帽是施工过程中人员安全的重要保障之一,但现有的人工检测不仅耗时耗力而且无法做到实时监测,针对这一现象,提出了一种基于深度学习的安全帽佩戴检测算法。该算法以YOLOv5s网络为基础。在网络的主干网中引入CoordAtt坐标注意力机制模块,考虑全局信息,使得网络分配给安全帽更多的注意力,以此提升对小目标的检测能力;针对原主干网对特征融合不充分的问题,将主干网中的残差块替换成Res2NetBlock结构中的残差块,以此提升YOLOv5s在细粒度上的融合能力。实验结果表明:在自制的安全帽数据集中验证可知,与原有的YOLOv5算法相比,平均精度提升了2.3个百分点,速度提升了18 FPS,与YOLOv3算法相比,平均精度提升了13.8个百分点,速度提升了95 FPS,实现了更准确的轻量高效实时的安全帽佩戴检测。

关键词: 安全帽佩戴检测, YOLOv5s, CoordAtt, Res2NetBlock