《计算机应用》唯一官方网站 ›› 2023, Vol. 43 ›› Issue (6): 1943-1949.DOI: 10.11772/j.issn.1001-9081.2022060855

• 多媒体计算与计算机仿真 • 上一篇    下一篇

面向小目标的YOLOv5安全帽检测算法

吕宗喆1,2, 徐慧2(), 杨骁2, 王勇2, 王唯鉴1,2   

  1. 1.北京机械工业自动化研究所,北京 100120
    2.北自所(北京)科技发展股份有限公司,北京 100120
  • 收稿日期:2022-06-14 修回日期:2022-08-27 接受日期:2022-09-05 发布日期:2022-10-11 出版日期:2023-06-10
  • 通讯作者: 徐慧
  • 作者简介:吕宗喆(1997—),男,河南信阳人,硕士研究生,CCF会员,主要研究方向:机器视觉、深度学习
    徐慧(1981—),女,湖北襄阳人,研究员,硕士,主要研究方向:人工智能、数字孪生Email:xuhui@bzkj.cn
    杨骁(1990—),男,黑龙江双鸭山人,工程师,硕士,主要研究方向:机器学习、智能调度
    王勇(1972—),男,北京人,研究员,硕士,主要研究方向:数字孪生、智能制造
    王唯鉴(1997—),男,辽宁沈阳人,硕士研究生,主要研究方向:大数据、强化学习。
  • 基金资助:
    国家重点研发计划项目(2018YFB1601404)

Small object detection algorithm of YOLOv5 for safety helmet

Zongzhe LYU1,2, Hui XU2(), Xiao YANG2, Yong WANG2, Weijian WANG1,2   

  1. 1.Beijing Research Institute of Automation for Machinery Industry,Beijing 100120,China
    2.RIAMB (Beijing) Technology Development Company Limited,Beijing 100120,China
  • Received:2022-06-14 Revised:2022-08-27 Accepted:2022-09-05 Online:2022-10-11 Published:2023-06-10
  • Contact: Hui XU
  • About author:LYU Zongzhe, born in 1997, M. S. candidate. His research interests include machine vision, deep learning.
    YANG Xiao, born in 1990, M. S., engineer. His research interests include machine learning, intelligent scheduling.
    WANG Yong, born in 1972, M. S., research fellow. His research interests include digital twin, intelligent manufacturing.
    WANG Weijian, born in 1997, M. S. candidate. His research interests include big data, reinforcement learning.
  • Supported by:
    National Key Research and Development Program of China(2018YFB1601404)

摘要:

安全帽的佩戴是工人人身安全的有力保障。针对采集的安全帽佩戴图像目标密集、像素点小、检测难度大的特点,提出一种面向安全帽的YOLOv5小目标检测算法。首先,基于YOLOv5算法优化边界框回归损失函数和置信度预测损失函数的计算方式,以提高算法在训练中对密集小目标特征的学习效果;然后,引入切片辅助微调和切片辅助推理(SAHI)对输入网络的图像进行切片处理,使得小目标对象产生更大的像素区域,进而改善网络推理与微调的效果。实验采用了工业场景中包含密集安全帽小目标的数据集进行训练。实验结果表明,改进后的算法相较于原始YOLOv5算法能将精确率提升0.26个百分点,召回率提升0.38个百分点;并且所提算法的平均精确率均值(mAP)达到了95.77%,相较于原始YOLOv5算法等几种算法提升了0.46~13.27个百分点。结果验证了切片辅助微调和SAHI的引入可以提升密集场景下小目标检测识别的精确率和置信度,减少误检漏检的情况,有效满足安全帽佩戴检测的需求。

关键词: 安全帽佩戴检测, YOLOv5算法, 损失函数, 切片辅助微调, 切片辅助推理, 小目标检测

Abstract:

Safety helmet wearing is a powerful guarantee of workers’ personal safety. Aiming at the collected safety helmet wearing pictures have characteristics of high density, small pixels and difficulty to detect, a small object detection algorithm of YOLOv5 (You Only Look Once version 5) for safety helmet was proposed. Firstly, based on YOLOv5 algorithm, the bounding box regression loss function and confidence prediction loss function were optimized to improve the learning effect of the algorithm on the features of dense small objects in training. Secondly, slicing aided fine-tuning and Slicing Aided Hyper Inference (SAHI) were introduced to make the small object produce a larger pixel area by slicing the pictures input into the network, and the effect of network inference and fine-tuning was improved. In the experiments, a dataset containing dense small objects of safety helmets in the industrial scenes was used for training. The experimental results show that compared with the original YOLOv5 algorithm, the improved algorithm can increase the precision by 0.26 percentage points, the recall by 0.38 percentage points. And the mean Average Precision (mAP) of the proposed algorithm reaches 95.77%, which is improved by 0.46 to 13.27 percentage points compared to several algorithms such as the original YOLOv5 algorithm. The results verify that the introduction of slicing aided fine-tuning and SAHI improves the precision and confidence of small object detection and recognition in the dense scenes, reduces the false detection and missed detection cases, and can satisfy the requirements of safety helmet wearing detection effectively.

Key words: safety helmet wearing detection, YOLOv5 (You Only Look Once version 5) algorithm, loss function, slicing aided fine-tuning, Slicing Aided Hyper Inference (SAHI), small object detection

中图分类号: