A miner queue detection method based on improved YOLOv5s
-
摘要: 传统的目标检测算法识别矿工排队异常行为时需人工提取特征,检测时间长、检测精度低;基于卷积神经网络的目标检测算法在检测速度和精度上有所提升,但在遮挡、昏暗和光照不均等场景下的检测效果难以保障。针对上述问题,提出了一种改进YOLOv5s(HPI−YOLOv5s)模型,并将其用于矿工排队检测。HPI−YOLOv5s模型在YOLOv5s模型的基础上对路径聚合网络(PANet)进行改进,通过删除单个输入边节点、增加双向交叉路径,构建了一种双向交叉特征金字塔网络(BCrFPN)进行多尺度特征融合。鉴于手动设置阈值的标签分配策略鲁棒性不高,在自适应训练样本选择(ATSS)动态设置阈值的基础上,提出动态标签分配策略(ATSS_PLUS),更合理地评估候选样本的质量,动态设定每个真实目标的阈值,具有更高的检测精度和鲁棒性。通过半平面交法计算人脸框与所划定排队区域的相交面积,并将相交面积和人脸框面积之比与设置的阈值比较以判断矿工是否有序排队。实验结果表明:HPI−YOLOv5s模型比YOLOv5s模型的准确率提高了1.9%,权重大小减少了32%,参数量减少了6.9%,检测速度提高了7.8%,且针对遮挡、昏暗、光照不均的矿井图像,能够更准确地识别矿工排队情况。Abstract: Traditional object detection algorithms require manual feature extraction when recognizing abnormal behavior of miners queuing, resulting in long detection time and low detection precision. The object detection algorithm based on convolutional neural networks has improved detection speed and precision. But its detection performance is difficult to guarantee in scenarios of obstruction, dimness, and uneven illumination. In order to solve the above problems, an improved YOLOv5s (HPI YOLOv5s) model is proposed. It is used for miner queue detection. The HPI-YOLOv5s model improves the path aggregation network (PANet) on the basis of the YOLOv5s model. By deleting a single input edge node and adding bidirectional crossing paths, a bidirectional cross feature pyramid network (BCrFPN) is constructed for multi-scale feature fusion. Considering the low robustness of label allocation strategies with manually set thresholds, a dynamic label allocation strategy (ATSS-PLUS) is proposed based on adaptive training sample selection (ATSS) to dynamically set thresholds. It can reasonably evaluate the quality of candidate samples and dynamically set thresholds for each real object, resulting in higher detection precision and robustness. The method calculates the intersection area between the face frame and the designated queue area using the half plane intersection method. The method compares the ratio of the intersection area to the face frame area with the set threshold to determine whether the miners are queuing in an orderly manner. The experimental results show that the HPI-YOLOv5s model has an accuracy improvement of 1.9%, a weight reduction of 32%, a parameter reduction of 6.9%, and a detection speed improvement of 7.8% compared to the YOLOv5s model. Moreover, it can more accurately recognize the queuing situation of miners in obstruction, dimness, and uneven illumination mine images.
-
表 1 不同模型在MAFA数据集上的性能
Table 1. Performance of different models on MAFA dataset
% 模型 准确率 精确率 召回率 特异性 SSD 59.34 60.92 58.60 58.56 YOLOv4 69.00 72.20 68.50 68.44 YOLOv5s 70.00 72.00 71.60 70.34 HPI−YOLOv5s 72.90 73.10 70.80 71.00 表 2 不同模型在Wider Face数据集上的性能
Table 2. Performance of different models on Wider Face dataset
% 模型 准确率 精确率 召回率 特异性 SSD 58.24 61.10 59.56 58.20 YOLOv3 67.50 71.34 69.30 65.80 YOLOv4 69.66 72.12 68.98 67.70 YOLOv5s 71.40 72.50 70.60 71.80 HPI−YOLOv5s 73.20 73.10 71.80 72.00 表 3 不同模型在自建井下矿工人脸检测数据集上的性能
Table 3. Performance of different models on self-built miner face detection dataset
% 模型 准确率 精确率 召回率 特异性 SSD 58.40 57.20 58.00 56.80 YOLOv3 59.34 59.40 58.56 56.70 YOLOv4 59.38 58.60 58.30 59.67 YOLOv5s 60.10 60.60 61.40 61.90 Deit 60.00 60.20 62.90 61.18 HPI−YOLOv5s 61.90 62.00 61.80 62.65 表 4 消融实验结果
Table 4. Ablation experiment results
模型 准确率/% 权重大
小/MiB每秒浮点运
算次数/109参数量/
106个检测速度/
(帧·s−1)YOLOv5s 60.1 15.3 15.9 7.020 92 115 YOLOv5s
(BCrFPN)60.0 9.7 8.5 4.683 97 — YOLOv5s
(ATSS)60.5 14.2 10.7 5.098 05 — YOLOv5s
(ATSS_PLUS)62.1 12.9 9.7 6.452 74 — HPI−YOLOv5s 62.0 10.4 9.0 6.530 91 124 -
[1] 饶天荣,潘涛,徐会军. 基于交叉注意力机制的煤矿井下不安全行为识别[J]. 工矿自动化,2022,48(10):48-54.RAO Tianrong,PAN Tao,XU Huijun. Identification of unsafe behaviors in coal mines based on cross-attention mechanism[J]. Journal of Mine Automation,2022,48(10):48-54. [2] 李琰,刘珍,陈南希. 基于矿工大数据的不安全行为主题挖掘与语义分析[J]. 煤矿安全,2023,54(9):254-257.LI Yan,LIU Zhen,CHEN Nanxi. Topic mining and semantic analysis of unsafe behavior based on miner big data[J]. Safety in Coal Mines,2023,54(9):254-257. [3] 崔丽珍,张清宇,郭倩倩,等. 基于CNN−LSTM的井下人员行为模式识别模型[J]. 无线电工程,2023,53(6):1375-1381. doi: 10.3969/j.issn.1003-3106.2023.06.017CUI Lizhen,ZHANG Qingyu,GUO Qianqian,et al. Underground personnel behavior pattern recognition model based on CNN-LSTM[J]. Radio Engineering,2023,53(6):1375-1381. doi: 10.3969/j.issn.1003-3106.2023.06.017 [4] 王科平,连凯海,杨艺,等. 基于改进YOLOv4的综采工作面目标检测[J]. 工矿自动化,2023,49(2):70-76.WANG Keping,LIAN Kaihai,YANG Yi,et al. Target detection of the fully mechanized working face based on improved YOLOv4[J]. Journal of Mine Automation,2023,49(2):70-76. [5] 张海彬,黄晶,宋志强,等. 一种基于背景差分法的室内排队人数检测方法[J]. 电子测量技术,2019,42(14):123-126.ZHANG Haibin,HUANG Jing,SONG Zhiqiang,et al. Detection method of the number of people of indoor queues based on background difference method[J]. Electronic Measurement Technology,2019,42(14):123-126. [6] ZHU Di,ZHANG Fan,WANG Shengyin,et al. Understanding place characteristics in geographic contexts through graph convolutional neural networks[J]. Journal of Planning Literature,2020,35(3):362-363. [7] JATI A,GEORGIOU P. Neural predictive coding using convolutional neural networks toward unsupervised learning of speaker characteristics[J]. IEEE/ACM Transactions on Audio,Speech,and Language Processing,2019,27(10):1577-1589. doi: 10.1109/TASLP.2019.2921890 [8] 陈国栋,严铮,赵志峰,等. 一种基于OpenPose和OpenCV的公共场所排队异常行为检测方法:CN202111251971. X[P]. 2022-01-28.CHEN Guodong,YAN Zheng,ZHAO Zhifeng,et al. A method for detecting abnormal queuing behavior in public places based on OpenPose and OpenCV:CN202111251971. X[P]. 2022-01-28. [9] 侯公羽,陈钦煌,杨振华,等. 基于改进YOLOv5的安全帽检测算法[J/OL]. 工程科学学报:1-15[2023-11-03]. http://kns.cnki.net/kcms/detail/10.1297.TF.20231103.1351.004.html.HOU Gongyu,CHEN Qinhuang,YANG Zhenhua,et al. Safety helmet detection algorithm based on improved YOLOv5[J/OL]. Chinese Journal of Engineering:1-15[2023-11-03]. http://kns.cnki.net/kcms/detail/10.1297.TF.20231103.1351.004.html. [10] 张释如,黄综浏,张袁浩,等. 基于改进YOLOv5的煤矸识别研究[J]. 工矿自动化,2022,48(11):39-44.ZHANG Shiru,HUANG Zongliu,ZHANG Yuanhao,et al. Coal and gangue recognition research based on improved YOLOv5[J]. Journal of Mine Automation,2022,48(11):39-44. [11] LIN T Y,GOYAL P,GIRSHICK R,et al. Focal loss for dense object detection [C]. IEEE International Conference on Computer Vision,Venice,2017:2999-3007. [12] 张倩,刘紫燕,陈运雷,等. 融合Transformer和改进PANet的YOLOv5s交通标志检测[J]. 传感技术学报,2023,36(2):232-241.ZHANG Qian,LIU Ziyan,CHEN Yunlei,et al. Fusion transformer and improved PANet for YOLOv5s traffic sign detection[J]. Chinese Journal of Sensors and Actuators,2023,36(2):232-241. [13] 郭宝鑫,谢晓尧,刘嵩. 改进ResNet50和FPN的多尺度目标检测算法研究[J/OL]. 贵州师范大学学报(自然科学版):1-9[2023-11-03]. http://kns.cnki.net/kcms/detail/52.5006.N.20230925.1017.006.html.GUO Baoxin,XIE Xiaoyao,LIU Song. Research on improved multiscale object detection algorithm of ResNet50 and FPN[J/OL]. Journal of Guizhou Normal University(Natural Sciences):1-9[2023-11-03]. http://kns.cnki.net/kcms/detail/52.5006.N.20230925.1017.006.html. [14] REDMON J,DIVVALA S,GIRSHICK R,et al. You only look once:unified,real-time object detection[EB/OL]. [2023-02-25]. https://arxiv.org/abs/1506.02640. [15] REDMON J,FARHADI A. YOLO9000:better,faster,stronger[C]. IEEE Conference on Computer Vision and Pattern Recognition,Honolulu,2017:7263-7271. [16] ARION N,MASSA F,SYNNAEVE G,et al. End-to-end object detection with transformers[C]. Proceedings of the Computer Vision ,Glasgow,2020:213–229. [17] 邵文泽,胡洪明,李金叶,等. 一种适应不同距离的低清人脸深度识别算法[J]. 南京邮电大学学报(自然科学版),2023,43(1):1-10.SHAO Wenze,HU Hongming,LI Jinye,et al. Deep recognition of low-res faces in varying different distances[J]. Journal of Nanjing University of Posts and Telecommunications (Natural Science Edition),2023,43(1):1-10. [18] 王星,白尚旺,潘理虎,等. 一种矿井图像增强算法[J]. 工矿自动化,2017,43(3):48-52.WANG Xing,BAI Shangwang,PAN Lihu,et al. A mine image enhancement algorithm[J]. Industry and Mine Automation,2017,43(3):48-52. [19] 姚超修,蒋泽,胡亚磊. 基于改进EnlightenGAN的煤矿井下图像增强算法[J]. 煤炭技术,2023,42(9):219-222.YAO Chaoxiu,JIANG Ze,HU Yalei. Improved image enhancement algorithm for underground coal mine based on enlightenGAN[J]. Coal Technology,2023,42(9):219-222. [20] 彭章龙. 基于YOLOX的低光照条件下目标检测算法研究[D]. 荆州:长江大学,2023.PENG Zhanglong. Research on object detection algorithm under low light conditions based on YOLOX [D]. Jingzhou:Yangtze University,2023. [21] 邵小强,李鑫,杨涛,等. 改进YOLOv5s和DeepSORT的井下人员检测及跟踪算法[J/OL]. 煤炭科学技术:1-12[2023-11-03]. https://doi.org/10.13199/j.cnki.cst.2022-1933.SHAO Xiaoqiang,LI Xin,YANG Tao,et al. Detection and tracking algorithm for underground personnel of improved YOLOv5s and DeepSORT[J/OL]. Coal Science and Technology:1-12[2023-11-03]. https://doi.org/10.13199/j.cnki.cst.2022-1933.