《计算机应用》唯一官方网站 ›› 2023, Vol. 43 ›› Issue (6): 1943-1949.DOI: 10.11772/j.issn.1001-9081.2022060855
吕宗喆1,2, 徐慧2(), 杨骁2, 王勇2, 王唯鉴1,2
收稿日期:
2022-06-14
修回日期:
2022-08-27
接受日期:
2022-09-05
发布日期:
2022-10-11
出版日期:
2023-06-10
通讯作者:
徐慧
作者简介:
吕宗喆(1997—),男,河南信阳人,硕士研究生,CCF会员,主要研究方向:机器视觉、深度学习基金资助:
Zongzhe LYU1,2, Hui XU2(), Xiao YANG2, Yong WANG2, Weijian WANG1,2
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.Supported by:
摘要:
安全帽的佩戴是工人人身安全的有力保障。针对采集的安全帽佩戴图像目标密集、像素点小、检测难度大的特点,提出一种面向安全帽的YOLOv5小目标检测算法。首先,基于YOLOv5算法优化边界框回归损失函数和置信度预测损失函数的计算方式,以提高算法在训练中对密集小目标特征的学习效果;然后,引入切片辅助微调和切片辅助推理(SAHI)对输入网络的图像进行切片处理,使得小目标对象产生更大的像素区域,进而改善网络推理与微调的效果。实验采用了工业场景中包含密集安全帽小目标的数据集进行训练。实验结果表明,改进后的算法相较于原始YOLOv5算法能将精确率提升0.26个百分点,召回率提升0.38个百分点;并且所提算法的平均精确率均值(mAP)达到了95.77%,相较于原始YOLOv5算法等几种算法提升了0.46~13.27个百分点。结果验证了切片辅助微调和SAHI的引入可以提升密集场景下小目标检测识别的精确率和置信度,减少误检漏检的情况,有效满足安全帽佩戴检测的需求。
中图分类号:
吕宗喆, 徐慧, 杨骁, 王勇, 王唯鉴. 面向小目标的YOLOv5安全帽检测算法[J]. 计算机应用, 2023, 43(6): 1943-1949.
Zongzhe LYU, Hui XU, Xiao YANG, Yong WANG, Weijian WANG. Small object detection algorithm of YOLOv5 for safety helmet[J]. Journal of Computer Applications, 2023, 43(6): 1943-1949.
实验超参数 | 值 | 实验超参数 | 值 |
---|---|---|---|
初始学习率 | 0.003 2 | 预训练权重 | YOLOv5m |
循环学习率 | 0.12 | 训练图像大小 | 640 |
学习率动量 | 0.843 | 训练轮数epoch | 300 |
IoU训练阈值 | 0.2 | batch‑size | 4 |
IoU损失系数 | 0.029 6 | 每次传入网络数 | 8 |
Anchor长宽比 | 2.91 | Mosaic | 1 |
表1 实验关键超参数
Tab. 1 Key hyperparameters in experiments
实验超参数 | 值 | 实验超参数 | 值 |
---|---|---|---|
初始学习率 | 0.003 2 | 预训练权重 | YOLOv5m |
循环学习率 | 0.12 | 训练图像大小 | 640 |
学习率动量 | 0.843 | 训练轮数epoch | 300 |
IoU训练阈值 | 0.2 | batch‑size | 4 |
IoU损失系数 | 0.029 6 | 每次传入网络数 | 8 |
Anchor长宽比 | 2.91 | Mosaic | 1 |
真实情况 | 预测情况 | |
---|---|---|
正例 | 反例 | |
正例 | TP | FN |
反例 | FP | TN |
表2 真实情况和预测情况的分类
Tab. 2 Classification of real and prediction situations
真实情况 | 预测情况 | |
---|---|---|
正例 | 反例 | |
正例 | TP | FN |
反例 | FP | TN |
组合 | P | R | mAP_0.5 |
---|---|---|---|
组合1 | 94.15 | 91.89 | 95.31 |
组合2 | 94.21 | 92.01 | 95.53 |
组合3 | 94.27 | 92.25 | 95.63 |
组合4 | 94.41 | 92.27 | 95.77 |
表3 消融实验结果对比 (%)
Tab. 3 Comparison of ablation experimental results
组合 | P | R | mAP_0.5 |
---|---|---|---|
组合1 | 94.15 | 91.89 | 95.31 |
组合2 | 94.21 | 92.01 | 95.53 |
组合3 | 94.27 | 92.25 | 95.63 |
组合4 | 94.41 | 92.27 | 95.77 |
算法 | AP | mAP | |
---|---|---|---|
hat | person | ||
文献[ | 86.50 | 78.50 | 82.50 |
文献[ | 88.75 | 89.32 | 89.03 |
原始YOLOv5算法 | 94.60 | 95.50 | 95.31 |
文献[ | 96.54 | 93.21 | 94.88 |
本文算法 | 96.70 | 94.50 | 95.77 |
表4 不同算法性能对比 (%)
Tab. 4 Performance comparison of different algorithms
算法 | AP | mAP | |
---|---|---|---|
hat | person | ||
文献[ | 86.50 | 78.50 | 82.50 |
文献[ | 88.75 | 89.32 | 89.03 |
原始YOLOv5算法 | 94.60 | 95.50 | 95.31 |
文献[ | 96.54 | 93.21 | 94.88 |
本文算法 | 96.70 | 94.50 | 95.77 |
1 | 唐凯,陈陆,张洲境,等. 我国建筑施工行业生产安全事故统计分析及对策[J]. 建筑安全, 2020, 35(9):40-43. 10.3969/j.issn.1004-552X.2020.09.014 |
TANG K, CHEN L, ZHANG Z J, et al. Statistical analysis and countermeasures of production safety accidents in Chinese construction industry[J]. Construction Safety, 2020, 35(9):40-43. 10.3969/j.issn.1004-552X.2020.09.014 | |
2 | 吕谋贵. 分析施工现场安全帽佩戴情况监控技术[J]. 低碳世界, 2018(7):205-206. 10.3969/j.issn.2095-2066.2018.07.143 |
LYU M G. Analysis of the monitoring technology of wearing safety helmet on construction site [J]. Low Carbon World, 2018(7):205-206. 10.3969/j.issn.2095-2066.2018.07.143 | |
3 | 郭师虹,井锦瑞,张潇丹,等. 基于改进的YOLOv4安全帽佩戴检测研究[J]. 中国安全生产科学技术, 2021, 17(12):135-141. |
GUO S H, JING J R, ZHANG X D, et al. Research on detection of safety helmet wearing based on improved YOLOv4 [J]. Journal of Safety Science and Technology, 2021, 17(12):135-141. | |
4 | KELM A, LAUßAT L, MEINS-BECKER A, et al. Mobile passive Radio Frequency Identification (RFID) portal for automated and rapid control of Personal Protective Equipment (PPE) on construction sites[J]. Automation in Construction, 2013, 36:38-52. 10.1016/j.autcon.2013.08.009 |
5 | DONG S, HE Q H, LI H, et al. Automated PPE misuse identification and assessment for safety performance enhancement[C]// Proceedings of the 2015 International Conference on Construction and Real Estate Management. Reston, VA: American Society of Civil Engineers, 2015:204-214. 10.1061/9780784479377.024 |
6 | BIRCHFIELD S. Elliptical head tracking using intensity gradients and color histograms [C]// Proceedings of the 1998 IEEE Computer Society Conference on Computer Vision and Pattern Recognition. Piscataway: IEEE, 1998:232-237. |
7 | 刘晓慧,叶西宁. 肤色检测和Hu矩在安全帽识别中的应用[J]. 华东理工大学学报(自然科学版), 2014, 40(3):365-370. |
LIU X H, YE X N. Skin color detection and Hu moments in helmet recognition research[J]. Journal of East China University of Science and Technology (Natural Science Edition), 2014, 40(3):365-370. | |
8 | CHIVERTON J. Helmet presence classification with motorcycle detection and tracking[J]. IET Intelligent Transport Systems, 2012, 6(3):259-269. 10.1049/iet-its.2011.0138 |
9 | AKYON F C, ALTINUC S O, TEMIZEL A. Slicing aided hyper inference and fine-tuning for small object detection[C]// Proceedings of the 2022 IEEE International Conference on Image Processing. Piscataway: IEEE, 2022:966-970. 10.1109/icip46576.2022.9897990 |
10 | LIN T Y, MAIRE M, BELONGIE S, et al. Microsoft COCO: common objects in context [C]// Proceedings of the 2014 European Conference on Computer Vision, LNCS 8693. Cham: Springer, 2014:740-755. |
11 | RAWAT S S, ALGHAMDI S, KUMAR G, et al. Infrared small target detection based on partial sum minimization and total variation [J]. Mathematics, 2022, 10(4): No.671. 10.3390/math10040671 |
12 | ZHANG Q, REN J, LIANG H, et al. BFE-Net: bidirectional multi-scale feature enhancement for small object detection[J]. Applied Sciences, 2022, 12(7): No.3587. 10.3390/app12073587 |
13 | 谢富,朱定局. 深度学习目标检测方法综述[J]. 计算机系统应用, 2022, 31(2):1-12. |
XIE F, ZHU D J. Survey on deep learning object detection [J]. Computer Systems & Applications, 2022, 31(2):1-12. | |
14 | 王慧. 基于改进Faster R-CNN的安全帽检测及身份识别[D]. 西安:西安科技大学, 2020:28-41 |
WANG H. Safety helmet detection and identification based on improved Faster R-CNN [D]. Xi’an: Xi’an University of Science and Technology, 2020:28-41. | |
15 | 李明山,韩清鹏,张天宇,等. 改进SSD的安全帽检测方法[J]. 计算机工程与应用, 2021, 57(8):192-197. |
LI M S, HAN Q P, ZHANG T Y, et al. Safety helmet detection method of improved SSD [J]. Computer Engineering and Applications, 2021, 57(8):192-197. | |
16 | 肖体刚,蔡乐才,高祥,等. 改进YOLOv3的安全帽佩戴检测方法[J]. 计算机工程与应用, 2021, 57(12):216-223. 10.3778/j.issn.1002-8331.2009-0175 |
XIAO T G, CAI L C, GAO X, et al. Improved YOLOv3 helmet wearing detection method[J]. Computer Engineering and Applications, 2021, 57(12):216-223. 10.3778/j.issn.1002-8331.2009-0175 | |
17 | 王玲敏,段军,辛立伟. 引入注意力机制的YOLOv5安全帽佩戴检测方法[J]. 计算机工程与应用, 2022, 58(9):303-312. 10.3778/j.issn.1002-8331.2112-0242 |
WANG L M, DUAN J, XIN L W. YOLOv5 helmet wear detection method with introduction of attention mechanism[J]. Computer Engineering and Applications, 2022, 58(9):303-312. 10.3778/j.issn.1002-8331.2112-0242 | |
18 | 赵睿,刘辉,刘沛霖,等. 基于改进YOLOv5s的安全帽检测算法[J/OL]. 北京航空航天大学学报 (2021-11-23) [2022-05-09].. 10.1109/icccas55266.2022.9825037 |
ZHAO R, LIU H, LIU P L, et al. Research on safety helmet detection algorithm based on improved YOLOv 5s [J/OL]. Journal of Beijing University of Aeronautics and Astronautics (2021-11-23) [2022-05-09].. 10.1109/icccas55266.2022.9825037 | |
19 | ZHU L L, GENG X, LI Z, et al. Improving YOLOv5 with attention mechanism for detecting boulders from planetary images[J]. Remote Sensing, 2021, 13(18): No.3776. 10.3390/rs13183776 |
20 | 郭磊,王邱龙,薛伟,等. 基于改进YOLOv5的小目标检测算法[J]. 电子科技大学学报, 2022, 51(2):251-258. 10.12178/1001-0548.2021235 |
GUO L, WANG Q L, XUE W, et al. A small object detection algorithm based on improved YOLOv5[J]. Journal of University of Electronic Science and Technology of China, 2022, 51(2):251-258. 10.12178/1001-0548.2021235 | |
21 | ZHENG Z H, WANG P, LIU W, et al. Distance-IoU loss: faster and better learning for bounding box regression [C]// Proceedings of the 34th AAAI Conference on Artificial Intelligence. Palo Alto, CA: AAAI Press, 2020:12993-13000. 10.1609/aaai.v34i07.6999 |
22 | 刘超阳,曲金帅,范菁,等. 基于改进YOLOv5算法的车辆目标检测[J]. 云南民族大学学报(自然科学版), 2022, 31(6):749-754. |
LIU C Y, QU J S, FAN J, et al. Vehicle target detection based on improved YOLOv5 algorithm[J]. Journal of Yunnan Minzu University (Natural Sciences Edition), 2022, 31(6):749-754. | |
23 | 杨莲,石宝峰,董轶哲. 基于Class Balanced Loss修正交叉熵的非均衡样本信用风险评价模型[J]. 系统管理学报, 2022, 31(2):255-269, 289. 10.3969/j.issn1005-2542.2022.02.005 |
YANG L, SHI B F, DONG Y Z. A credit risk evaluation model for imbalanced data classification based on class balanced loss modified cross entropy function [J]. Journal of Systems & Management, 2022, 31(2): 255-269, 289. 10.3969/j.issn1005-2542.2022.02.005 | |
24 | 郑德重,杨媛媛,黄浩哲,等. 基于距离置信度分数的多模态融合分类网络[J]. 上海交通大学学报, 2022, 56(1):89-100. |
ZHENG D Z, YANG Y Y, HUANG H Z, et al. Multimodal fusion classification network based on distance confidence score[J]. Journal of Shanghai Jiaotong University, 2022, 56(1):89-100. | |
25 | VRBANČIČ G, PODGORELEC V. Transfer learning with adaptive fine-tuning [J]. IEEE Access, 2020, 8:196197-196211. 10.1109/access.2020.3034343 |
26 | SARASAEN C, CHATTERJEE S, BREITKOPF M, et al. Fine-tuning deep learning model parameters for improved super-resolution of dynamic MRI with prior-knowledge[J]. Artificial Intelligence in Medicine, 2021, 121: No.102196. 10.1016/j.artmed.2021.102196 |
27 | CHEN K, WANG J, PANG J, et al. MMDetection: open MMLab detection toolbox and Benchmark [EB/OL]. [2022-05-02].. |
[1] | 李钟华, 白云起, 王雪津, 黄雷雷, 林初俊, 廖诗宇. 基于图像增强的低照度人脸检测[J]. 《计算机应用》唯一官方网站, 2024, 44(8): 2588-2594. |
[2] | 邓凯丽, 魏伟波, 潘振宽. 改进掩码自编码器的工业缺陷检测方法[J]. 《计算机应用》唯一官方网站, 2024, 44(8): 2595-2603. |
[3] | 李烨恒, 罗光圣, 苏前敏. 基于改进YOLOv5的Logo检测算法[J]. 《计算机应用》唯一官方网站, 2024, 44(8): 2580-2587. |
[4] | 孔哲, 李寒, 甘少伟, 孔明茹, 何冰涛, 郭子钰, 金督程, 邱兆文. 基于非对称多解码器和注意力模块的三维肾脏影像结构分割模型[J]. 《计算机应用》唯一官方网站, 2024, 44(7): 2216-2224. |
[5] | 姬张建, 杜娜. 基于改进VariFocalNet的微小目标检测[J]. 《计算机应用》唯一官方网站, 2024, 44(7): 2200-2207. |
[6] | 程小辉, 黄云天, 张瑞芳. 基于多尺度和加权坐标注意力的轻量化红外道路场景检测模型[J]. 《计算机应用》唯一官方网站, 2024, 44(6): 1927-1934. |
[7] | 刘越, 刘芳, 武奥运, 柴秋月, 王天笑. 基于自注意力机制与图卷积的3D目标检测网络[J]. 《计算机应用》唯一官方网站, 2024, 44(6): 1972-1977. |
[8] | 李威, 陈玲, 徐修远, 朱敏, 郭际香, 周凯, 牛颢, 张煜宸, 易珊烨, 章毅, 罗凤鸣. 基于多任务学习的间质性肺病分割算法[J]. 《计算机应用》唯一官方网站, 2024, 44(4): 1285-1293. |
[9] | 陈天华, 朱家煊, 印杰. 基于注意力机制的鸟类识别算法[J]. 《计算机应用》唯一官方网站, 2024, 44(4): 1114-1120. |
[10] | 王林, 刘景亮, 王无为. 基于空洞卷积融合Transformer的无人机图像小目标检测方法[J]. 《计算机应用》唯一官方网站, 2024, 44(11): 3595-3602. |
[11] | 刘涛, 鞠事宏, 高一萌. 基于改进YOLOv8n的无人机视角下小目标检测算法[J]. 《计算机应用》唯一官方网站, 2024, 44(11): 3603-3609. |
[12] | 李大海, 李冰涛, 王振东. 基于改进YOLOv8的水下目标检测算法[J]. 《计算机应用》唯一官方网站, 2024, 44(11): 3610-3616. |
[13] | 郭祥, 姜文刚, 王宇航. 基于改进Inception-ResNet的加密流量分类方法[J]. 《计算机应用》唯一官方网站, 2023, 43(8): 2471-2476. |
[14] | 梁美佳, 刘昕武, 胡晓鹏. 基于改进YOLOv3的列车运行环境图像小目标检测算法[J]. 《计算机应用》唯一官方网站, 2023, 43(8): 2611-2618. |
[15] | 陈志, 李歆, 林丽燕, 钟婧, 时鹏. 引入门控轴向自注意力的多通道病理图像分割[J]. 《计算机应用》唯一官方网站, 2023, 43(4): 1269-1277. |
阅读次数 | ||||||
全文 |
|
|||||
摘要 |
|
|||||