计算机工程与应用 ›› 2023, Vol. 59 ›› Issue (1): 61-71.DOI: 10.3778/j.issn.1002-8331.2204-0405

• YOLO的改进及应用专题 • 上一篇    下一篇

改进YOLOX的轻量级安全帽检测方法

吕志轩,魏霞,马志钢   

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

Lightweight Safety Helmet Detection Method of Improved YOLOX

LV Zhixuan, WEI Xia, MA Zhigang   

  1. Schoolof Electrical Engineering, Xinjiang University, Urumqi 830000, China
  • Online:2023-01-01 Published:2023-01-01

摘要: 针对施工环境下安全帽数据集少,被检测物体目标小和现有检测模型参数量大导致的模型鲁棒性差,准确率低,训练时间长问题,提出了一种改进YOLOX网络的安全帽检测方法。使用在线困难样本挖掘(OHEM)寻找数据集中的困难样本,结合马赛克(Mosaic)方法对困难样本拼接来扩充训练集数量;在模型预测端(prediction)加入分支注意力模块,将网络输出分为两部分输入模块来提取空间层面和通道层面上关键信息;提出一种新的余弦退火算法,初始时加入预热(warm up),过程中逐段减小学习率曲线的振荡幅度,训练中减小模型的收敛时间。实验结果表明,与原方法相比,改进安全帽检测方法对安全帽检测的mAP、准确率、召回率分别提高了6.77、2.52、9.14个百分点,训练中使用CDWR余弦退火算法在同周期下损失值减少了0.5~1.0,与原算法相比训练收敛时间减少约50%。

关键词: 施工环境, 安全帽检测, YOLO网络, 注意力模块, 学习率

Abstract: Aiming at the problems of poor robustness, low accuracy and long training time caused by few helmet data sets, small detected object targets and large amount of existing detection model parameters in the construction environment, a helmet detection method based on improved YOLOX network is proposed. Firstly, online difficult sample mining(OHEM) is used to find the difficult samples in the dataset, and Mosaic method is used to splice the difficult samples to expand the number of training sets. Then the branch attention module is added to the prediction part of the model, and the network output is divided into two parts. The input module extracts the key information at the spatial level and channel level. Finally, a new cosine annealing algorithm is proposed, which adds warm up at the beginning, reduces the oscillation amplitude of the learning rate curve segment by segment in the process, and reduces the convergence time of the model in training. The experimental results show that compared with the original method, the improved helmet detection method improves the mAP, accuracy and recall of helmet detection by 6.77%, 2.52% and 9.14% respectively.Using the CDWR cosine annealing algorithm in training, the loss value is reduced by 0.5~1.0 in the same period, and the training convergence time is reduced by 50% compared with the original algorithm.

Key words: construction environment, helmet detection, YOLO network, attention module, learning rate