计算机工程与应用 ›› 2023, Vol. 59 ›› Issue (14): 176-183.DOI: 10.3778/j.issn.1002-8331.2303-0284

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

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

祁泽政,徐银霞   

  1. 1.武汉工程大学 计算机科学与工程学院,武汉 430205
    2.武汉工程大学 智能机器人湖北省重点实验室,武汉 430205
  • 出版日期:2023-07-15 发布日期:2023-07-15

Research on Helmet Wearing Detection of Improved YOLOv5s Algorithm

QI Zezheng, XU Yinxia   

  1. 1.School of Computer Science and Engineering, Wuhan Institute of Technology, Wuhan 430205, China
    2.Hubei Key Laboratory of Intelligent Robot, Wuhan Institute of Technology, Wuhan 430205, China
  • Online:2023-07-15 Published:2023-07-15

摘要: 针对安全帽佩戴检测在背景复杂、密集小目标等场景下的漏检、误检问题,基于YOLOv5s提出了一种适用于安全帽佩戴检测的改进算法。采用串联形式的混合池化优化空间金字塔池化(spatial pyramid pooling,SPP)模块,增强特征提取与特征表达,降低误检率;增加浅层输出加强深层特征图中目标位置信息的表达,提高小目标安全帽佩戴检测的性能;在切片模块中嵌入坐标注意力机制(coordinate attention,CA)扩大感受野,加强位置信息与安全帽特征的关联程度,提高安全帽目标检测的准确率。实验结果表明,改进算法的mAP达到了93.50%,比YOLOv5s、YOLOX算法分别提高了4.28、5.14个百分点,达到了复杂背景下检测小目标和密集目标的要求。

关键词: YOLOv5s, 深度学习, 目标检测, 人工智能, 安全帽识别

Abstract: Aiming at the problem of missed detection and false detection in scenarios such as complex background and dense small targets, an improved algorithm suitable for safety helmet wearing detection is proposed based on YOLOv5s. Firstly, the hybrid pooling in tandem form is used to optimize the spatial pyramid pooling(SPP) module to enhance feature extraction and feature expression and reduce the false detection rate. Then, the shallow output is added to strengthen the expression of target position information in the deep feature map, and improve the performance of small target safety helmet wearing detection. Finally, the coordinate attention mechanism(CA) is embedded in the slice module to expand the receptive field, strengthen the correlation between position information and safety helmet features, and improve the accuracy of safety helmet target detection. Experimental results show that the mAP of the improved algorithm reaches 93.50%, which is 4.28 and 5.14 percentage points higher than that of YOLOv5s and YOLOX algorithms, respectively, which meets the requirements of detecting small targets and dense targets in complex backgrounds.

Key words: YOLOv5s, deep learning, target detection, artificial intelligence, helmet recognition