Small object detection method for mining face based on improved YOLOv8n
-
摘要: 为有效检测和识别煤矿井下采掘工作面人员是否佩戴安全防护装置,针对井下光照条件差、安全防护装备目标尺寸小且颜色与背景相似等情况,提出了一种基于改进YOLOv8n的采掘工作面小目标检测方法。在YOLOv8n骨干网络C2f模块中融合动态蛇形卷积(DSConv),构建C2f−DSConv模块,以提高模型提取多尺度特征的能力;在Neck层引入极化自注意力(PSA)机制,以减少信息损失,提高特征表达能力;在Head层增设1个专门针对小目标的检测头,形成4检测头结构,以扩大模型检测范围。实验结果表明,改进YOLOv8n模型对井下人员及其所佩戴安全帽、矿灯、口罩、自救器检测的平均精度分别为98.3%,95.8%,89.9%,87.2%,90.8%,平均精度均值为92.4%,优于Faster R−CNN,YOLOv5s,YOLOv7,YOLOv8n模型,且检测速度达208帧/s,满足煤矿井下目标检测精度和实时性要求。Abstract: In order to effectively detect and recognize whether the personnel on the mining face in coal mines are wearing safety protection devices, a small object detection method based on improved YOLOv8n is proposed. It is applied in situations such as poor underground lighting conditions, small object sizes of safety protection device, and similar colors to the background. The method integrates Dynamic Snake Convolution (DSConv) into the C2f module of YOLOv8n backbone network to construct a C2f DSConv module, in order to enhance the model's capability to extract multi-scale features. The method introduces polarized self-attention (PSA) mechanism in the Neck layer to reduce information loss and improve feature expression capability. The method adds one detection head specifically designed for small objects at the Head layer, forming a four detection head structure to expand the detection range of the model. The experimental results show that the improved YOLOv8n model has an average precision of 98.3%, 95.8%, 89.9%, 87.2%, and 90.8% for detecting underground personnel and their safety helmets, mining lights, masks, and self rescue devices, respectively. The average precision is 92.4%, which is better than Faster R-CNN, YOLOv5s, YOLOv7, and YOLOv8n models. The detection speed reaches 208 frames per second, meeting the requirements of object detection precision and real-time performance in coal mines.
-
表 1 实验平台配置
Table 1. Experimental platform configuration
配置 参数 操作系统 Windows10 CPU Intel Core i7−12700K GPU NVIDIA GeForce RTX 3060 内存 32 GiB GPU加速工具 CUDA11.1 表 2 消融实验结果
Table 2. Ablation experiment results
% YOLOv8n DSConv 检测头 PSA 精确率 召回率 mAP50 √ × × × 86.9 85.9 89.1 √ √ × × 87.4 89.3 89.7 √ √ √ × 88.0 90.1 91.1 √ √ √ √ 89.3 91.3 92.4 表 3 不同目标检测模型对5种类别目标检测的AP对比
Table 3. Average precision (AP) comparison of detecting five categories by use of different object detection models
% 类别 Faster−
RCNNYOLOv5s YOLOv7 YOLOv8n 改进YOLOv8n 人员 84.2 92.9 94.2 97.7 98.3 安全帽 80.7 90.1 91.7 93.7 95.8 矿灯 68.7 76.6 76.3 79.8 89.9 口罩 74.3 82.9 83.9 86.2 87.2 自救器 73.3 81.7 81.4 85.1 90.8 mAP50 79.2 85.6 86.3 89.1 92.4 表 4 不同目标检测模型的检测性能对比
Table 4. Comparison of detection performance of different object detection models
模型 参数量/MiB GFLOPs mAP/% 检测速度/(帧·s−1) Faster R−CNN 53.0 887.5 79.2 7 YOLOv5s 7.2 16.0 85.6 59 YOLOv7 36.9 104.7 86.3 142 YOLOv8n 3.0 8.1 89.1 457 改进YOLOv8n 3.4 13.3 92.4 208 -
[1] 郝帅,杨晨禄,赵秋林,等. 基于双分支头部解耦和注意力机制的灾害环境人体检测[J]. 西安科技大学学报,2023,43(4):797-806.HAO Shuai,YANG Chenlu,ZHAO Qiulin,et al. Pedestrian detection method in disaster environment based on double branch decoupled head and attention mechanism[J]. Journal of Xi'an University of Science and Technology,2023,43(4):797-806. [2] 罗南超,郑伯川. 视频监控领域深度特征编码的行人检测算法[J]. 西安科技大学学报,2019,39(4):701-707.LUO Nanchao,ZHENG Bochuan. Deep feature coding for pedestrian detection in video surveillance[J]. Journal of Xi'an University of Science and Technology,2019,39(4):701-707. [3] 程德强,寇旗旗,江鹤,等. 全矿井智能视频分析关键技术综述[J]. 工矿自动化,2023,49(11):1-21.CHENG Deqiang,KOU Qiqi,JIANG He,et al. Overview of key technologies for mine-wide intelligent video analysis[J]. Journal of Mine Automation,2023,49(11):1-21. [4] 赵伟,王爽,赵东洋. 基于SD−YOLOv5s−4L的煤矿井下无人驾驶电机车多目标检测[J]. 工矿自动化,2023,49(11):121-128.ZHAO Wei,WANG Shuang,ZHAO Dongyang. Multi object detection of underground unmanned electric locomotives in coal mines based on SD-YOLOv5s-4L[J]. Journal of Mine Automation,2023,49(11):121-128. [5] REDMON J,DIVVALA S,GIRSHICK R,et al. You only look once:unified,real-time object detection[C]. The IEEE Conference on Computer Vision and Pattern Recognition,Las Vegas,2016:779-788. [6] REDMON J,FARHADI A. YOLO9000:better,faster,stronger[C]. The IEEE Conference on Computer Vision and Pattern Recognition,Honolulu,2017:7263-7271. [7] REDMON J,FARHADI A. Yolov3:an incremental improvement[EB/OL]. [2024-04-23]. https://pjreddie.com/media/files/papers/YOLOv3.pdf. [8] BOCHKOVSKIY A, WANG C Y, LIAO H Y M. Yolov4: optimal speed and accuracy of object detection [Z/OL]. [2024-05-23]. https://doi.org/10.48550/arXiv. 2004.10934. [9] REN Shaoqing,HE Kaiming, GIRSHICK R,et al. Faster R-CNN:towards real-time object detection with region proposal networks[J]. IEEE Transactions on Pattern Analysis and Machine Intelligence,2017,39(6):1137-1149. [10] HE Kaiming,ZHANG Xiangyu,REN Shaoqing,et al. Deep residual learning for image recognition[C]. The IEEE Conference on Computer Vision and Pattern Recognition,Las Vegas,2016:770-778. [11] HUANG Gao,LIU Zhuang,VAN DER MAATEN L,et al. Densely connected convolutional networks[C]. The IEEE Conference on Computer Vision and Pattern Recognition,Honolulu,2017:4700-4708. [12] HOWARD A G,ZHU Menglong,CHEN Bo,et al. Mobilenets:efficient convolutional neural networks for mobile vision applications[Z/OL]. [2024-04-23]. https://arxiv.org/pdf/1704.04861. [13] 崔铁军,王凌霄. YOLOv4目标检测算法在煤矿工人口罩佩戴监测工作中的应用研究[J]. 中国安全生产科学技术,2021,17(10):66-71.CUI Tiejun,WANG Lingxiao. Research on application of YOLOv4 object detection algorithm in monitoring on masks wearing of coal miners[J]. Journal of Safety Science and Technology,2021,17(10):66-71. [14] 李熙尉,孙志鹏,王鹏,等. 基于YOLOv5s改进的井下人员和安全帽检测算法研究[J]. 煤,2023,32(3):22-25. doi: 10.3969/j.issn.1005-2798.2023.03.006LI Xiwei,SUN Zhipeng,WANG Peng,et al. Research on underground personnel and safety helmet detection algorithm based on YOLOv5s improvement[J]. Coal,2023,32(3):22-25. doi: 10.3969/j.issn.1005-2798.2023.03.006 [15] 曹帅,董立红,邓凡,等. 基于YOLOv7−SE的煤矿井下场景小目标检测方法[J]. 工矿自动化,2024,50(3):35-41.CAO Shuai,DONG Lihong,DENG Fan,et al. A small object detection method for coal mine underground scene based on YOLOv7-SE[J]. Journal of Mine Automation,2024,50(3):35-41. [16] 王科平,连凯海,杨艺,等. 基于改进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. [17] 顾清华,何鑫鑫,王倩,等. 基于改进YOLOv5的煤矿井下暗环境矿工安全穿戴智能识别[J]. 矿业研究与开发,2024,44(3):201-208.GU Qinghua,HE Xinxin,WANG Qian,et al. Research on intelligent recognition of safety wearing of miners in dark enviroment of coal mine based on improved YOLOv5[J]. Mining Research and Development,2024,44(3):201-208. [18] 寇发荣,肖伟,何海洋,等. 基于改进YOLOv5的煤矿井下目标检测研究[J]. 电子与信息学报,2023,45(7):2642-2649. doi: 10.11999/JEIT220725KOU Farong,XIAO Wei,HE Haiyang,et al. Research on target detection in underground coal mines based on improved YOLOv5[J]. Journal of Electronics & Information Technology,2023,45(7):2642-2649. doi: 10.11999/JEIT220725 [19] GE Zheng,LIU Songtao,WANG Feng,et al. Yolox:Exceeding YOLO series in 2021[Z/OL]. [2024-04-23]. https://arxiv.org/pdf/2107.08430. [20] YU F,KOLTUN V. Multi-scale context aggregation by dilated convolutions[Z/OL]. [2024-04-23]. https://arxiv.org/pdf/1511.07122. [21] DAI Jifeng,QI Haozhi,XIONG Yuwen,et al. Deformable convolutional networks[C]. The IEEE International Conference on Computer Vision,Venice,2017:764-773. [22] QI Yaolei,HE Yuting,QI Xiaoming,et al. Dynamic snake convolution based on topological geometric constraints for tubular structure segmentation[C]. The IEEE/CVF International Conference on Computer Vision,Paris,2023:6070-6079. [23] LIU Huajun,LIU Fuqiang,FAN Xinyi,et al. Polarized self-attention:towards high-quality pixel-wise regression[Z/OL]. [2024-04-23]. https://arxiv.org/pdf/2107.00782.