Journal of Computer Applications ›› 2022, Vol. 42 ›› Issue (4): 1292-1300.DOI: 10.11772/j.issn.1001-9081.2021071246

• The 36 CCF National Conference of Computer Applications (CCF NCCA 2020) • Previous Articles    

Safety helmet wearing detection algorithm based on improved YOLOv5

Jin ZHANG1, Peiqi QU1(), Cheng SUN2, Meng LUO2   

  1. 1.College of Information Science and Engineering,Hunan Normal University,Changsha Hunan 410081,China
    2.School of Mathematics and Statistics,Hunan Normal University,Changsha Hunan 410081,China
  • Received:2021-07-16 Revised:2021-08-27 Accepted:2021-08-31 Online:2021-09-10 Published:2022-04-10
  • Contact: Peiqi QU
  • About author:ZHANG Jin, born in 1979, Ph. D., professor. His research interests include artificial intelligence, software engineering.
    SUN Cheng, born in 1994, Ph. D. candidate. Her research interests include artificial intelligence, computer vision.
    LUO Meng, born in 1996, M. S. candidate. Her research interests include artificial intelligence, computer vision.
  • Supported by:
    National Defence Basic Scientific Research Program of State Administration of Science, Technology and Industry for National Defence(WDZC20205500119);Natural Science Foundation of Hunan Province(2021JJ30456);Science and Technology Progress and Innovation Program of Department of Transportation of Hunan Province(201927);Open Project of State Key Laboratory of Industrial Control Technology(ICT2021B10);Hunan Province Graduate Student Training Innovation Practice Base Project (Xiang Jiao Tong [2019] 248)

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

张锦1, 屈佩琪1(), 孙程2, 罗蒙2   

  1. 1.湖南师范大学 信息科学与工程学院,长沙 410081
    2.湖南师范大学 数学与统计学院,长沙 410081
  • 通讯作者: 屈佩琪
  • 作者简介:张锦(1979—),男,河南信阳人,教授,博士,CCF会员,主要研究方向:人工智能、软件工程
    孙程(1994—),女,山东枣庄人,博士研究生,CCF会员,主要研究方向:人工智能、计算机视觉
    罗蒙(1996—),女,江西南昌人,硕士研究生,CCF会员,主要研究方向:人工智能、计算机视觉。
  • 基金资助:
    国防科工局国防基础科研计划项目(WDZC20205500119);湖南省自然科学基金资助项目(2021JJ30456);湖南省交通运输厅科技进步与创新计划项目(201927);工业控制技术国家重点实验室开放课题(ICT2021B10);湖南省研究生培养创新实践基地项目(湘教通〔2019〕248号)

Abstract:

Aiming at the problems of strong interference and low detection precision of the existing safety helmet wearing detection, an algorithm of safety helmet detection based on improved YOLOv5 (You Only Look Once version 5) model was proposed. Firstly, for the problem of different sizes of safety helmets, the K-Means++ algorithm was used to redesign the size of the anchor box and match it to the corresponding feature layer. Secondly, the multi-spectral channel attention module was embedded in the feature extraction network to ensure that the network was able to learn the weight of each channel autonomously and enhance the information dissemination between the features, thereby strengthening the network ability to distinguish foreground and background. Finally, images of different sizes were input randomly during the training iteration process to enhance the generalization ability of the algorithm. Experimental results show as follows: on the self-built safety helmet wearing detection dataset, the proposed algorithm has the mean Average Precision (mAP) reached 96.0%, the the Average Precision (AP) of workers wearing safety helmet reached 96.7%, and AP of workers without safety helmet reached 95.2%. Compared with the YOLOv5 algorithm, the proposed algorithm has the mAP of helmet safety-wearing detection increased by 3.4 percentage points, and it meets the accuracy requirement of helmet safety-wearing detection in construction scenarios.

Key words: safety helmet wearing detection, object detection, deep learning, YOLOv5 (You Only Look Once version 5), attention mechanism

摘要:

针对现有安全帽佩戴检测干扰性强、检测精度低等问题,提出一种基于改进YOLOv5的安全帽检测新算法。首先,针对安全帽尺寸不一的问题,使用K-Means++算法重新设计先验框尺寸并将其匹配到相应的特征层;其次,在特征提取网络中引入多光谱通道注意力模块,使网络能够自主学习每个通道的权重,增强特征间的信息传播,从而加强网络对前景和背景的辨别能力;最后,在训练迭代过程中随机输入不同尺寸的图像,以此增强算法的泛化能力。实验结果表明,在自制安全帽佩戴检测数据集上,所提算法的均值平均精度(mAP)达到96.0%,而对佩戴安全帽的工人的平均精度(AP)达到96.7%,对未佩戴安全帽的工人的AP达到95.2%,相较于YOLOv5算法,该算法对佩戴安全帽的平均检测准确率提升了3.4个百分点,满足施工场景下安全帽佩戴检测的准确率要求。

关键词: 安全帽佩戴检测, 目标检测, 深度学习, YOLOv5, 注意力机制

CLC Number: