Detection of underground personnel safety helmet wearing based on improved YOLOv8n
-
摘要: 针对现有井下人员安全帽佩戴检测方法未考虑遮挡、目标较小、背景干扰等因素,存在检测精度差及模型不够轻量化等问题,提出一种改进YOLOv8n模型,并将其应用于井下人员安全帽佩戴检测。在颈部网络中加入P2小目标检测层,提高模型对小目标的检测能力,更好地捕捉安全帽目标细节;在主干网络中添加卷积块注意力模块(CBAM)提取图像关键特征,减少背景信息的干扰;将CIoU损失函数替换为WIoU损失函数,提升模型对检测目标的定位能力;采用轻量化共享卷积检测头(LSCD),通过共享参数的方式降低模型复杂度,并将卷积中的归一化层替换为群组归一化(GN),在尽可能保证精度的同时实现模型轻量化。实验结果表明:与YOLOv8n模型相比,改进YOLOv8n模型在交并比阈值为0.5时的平均精度均值(mAP@50)提升了1.8%,参数量减少了23.8%,计算量下降了10.4%,模型大小减小了17.2%;改进YOLOv8n模型检测精度高于SSD,YOLOv3−tiny,YOLOv5n,YOLOv7和YOLOv8n,模型复杂度仅高于YOLOv5n,较好地平衡了模型检测精度与复杂度;在井下复杂场景下,改进YOLOv8n模型能够实现对井下人员安全帽佩戴的准确检测,改善了漏检问题。Abstract: Existing methods for detecting safety helmet wearing among underground personnel fail to consider factors such as occlusion, small target size, and background interference, leading to poor detection accuracy and insufficient model lightweighting. This paper proposed an improved YOLOv8n model applied to safety helmet wearing detection in underground. A P2 small target detection layer was added to the neck network to enhance the model's ability to detect small targets and better capture details of safety helmets. A convolutional block attention module (CBAM) was integrated into the backbone network to extract key image features and reduce background interference. The CIoU loss function was replaced with the WIoU loss function to improve the model's localization capability for detection targets. A lightweight shared convolution detection head (LSCD) was used to reduce model complexity through parameter sharing, and normalization layers in convolutions were replaced with group normalization (GN) to reduce model weight while maintaining accuracy as much as possible. The experimental results showed that compared to the YOLOv8n model, the improved YOLOv8n model increased the mean average precision at an intersection over union threshold of 0.5 (mAP@50) by 1.8%, reduced parameter count by 23.8%, lowered computational load by 10.4%, and decreased model size by 17.2%. The improved YOLOv8n model outperformed SSD, YOLOv3-tiny, YOLOv5n, YOLOv7, and YOLOv8n in detection accuracy, with a complexity only slightly higher than YOLOv5n, effectively balancing detection accuracy and complexity. In complex underground scenarios, the improved YOLOv8n model were able to achieve accurate detection of safety helmet wearing among underground personnel, addressing the issue of missed detections.
-
Key words:
- underground safety helmet detection /
- small target detection /
- YOLOv8n /
- CBAM /
- WIoU /
- lightweighting
-
表 1 不同注意力机制对比实验结果
Table 1. Comparison of experimental results with different attention mechanisms
注意力机制 精确率 召回率 mAP@50/% SE 0.912 0.873 94.0 EMA 0.902 0.874 93.8 CA 0.920 0.866 94.1 CBAM 0.910 0.881 94.3 表 2 不同损失函数对比实验结果
Table 2. Comparison of experimental results with different loss functions
损失函数 精确率 召回率 mAP@50/% CIoU 0.910 0.881 94.3 EIoU 0.914 0.878 94.2 SIoU 0.909 0.872 94.1 GIoU 0.909 0.884 94.2 WIoU 0.917 0.894 95.1 表 3 消融实验结果
Table 3. Ablation experiment results
P2 CBAM WIoU LSCD mAP@50/% 参数量/
106个浮点运算
数/109模型大
小/MiB× × × × 93.0 3.15 8.7 6.11 √ × × × 93.8 3.35 17.2 6.11 × √ × × 93.3 3.22 8.7 6.24 × × √ × 93.4 3.15 8.7 6.11 √ √ √ × 95.1 3.42 17.2 6.24 √ √ √ √ 94.8 2.40 7.8 5.07 表 4 不同目标检测模型对比实验结果
Table 4. Comparison of experimental results for different object detection models
模型 mAP@50/% 参数量/106个 浮点运算数/109 模型大小/MiB SSD 69.6 23.61 60.8 503.67 YOLOv3−tiny 88.9 8.67 12.9 17.40 YOLOv5n 85.6 1.77 4.2 3.78 YOLOv7 94.1 37.19 105.1 74.80 YOLOv8n 93.0 3.15 8.7 6.11 改进YOLOv8n 94.8 2.40 7.8 5.07 -
[1] OSUNMAKINDE I O. Towards safety from toxic gases in underground mines using wireless sensor networks and ambient intelligence[J]. International Journal of Distributed Sensor Networks,2013,9(2). DOI: 10.1155/2013/159273. [2] LIU Wei,ANGUELOV D,ERHAN D,et al. SSD:single shot multibox detector[C]. The 14th European Conference on Computer Vision,Amsterdam,2016:21-37. [3] REDMON J,DIVVALA S,GIRSHICK R,et al. You only look once:unified,real-time object detection[C]. IEEE Conference on Computer Vision and Pattern Recognition,Las Vegas,2016:779-788. [4] GIRSHICK R,DONAHUE J,DARRELL T,et al. Rich feature hierarchies for accurate object detection and semantic segmentation[C]. IEEE Conference on Computer Vision and Pattern Recognition,Columbus,2014:580-587. [5] 赵红成,田秀霞,杨泽森,等. 改进YOLOv3的复杂施工环境下安全帽佩戴检测算法[J]. 中国安全科学学报,2022,32(5):194-200.ZHAO Hongcheng,TIAN Xiuxia,YANG Zesen,et al. Safety helmet wearing detection algorithm in complex construction environment based on improved YOLOv3[J]. China Safety Science Journal,2022,32(5):194-200. [6] FU Chuan,WANG Rongxin. Research on safety helmet wearing YOLO-V3 detection technology improvement in mine environment[J]. Journal of Physics:Conference Series,2019,1345(4). DOI: 10.1088/1742-6596/1345/4/042045. [7] 李熙尉,孙志鹏,王鹏,等. 基于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 [8] 李凤英,罗超. 基于深度学习的矿山作业安全帽穿戴规范性识别算法[J]. 有色金属(矿山部分),2023,75(4):7-13. doi: 10.3969/j.issn.1671-4172.2023.04.002LI Fengying,LUO Chao. Normative recognition algorithm for safety helmet wearing in mining operations based on deep learning[J]. Nonferrous Metals (Mining Section),2023,75(4):7-13. doi: 10.3969/j.issn.1671-4172.2023.04.002 [9] 雷帮军,余翱,余快. 基于YOLOv8s改进的小目标检测算法[J]. 无线电工程,2024,54(4):857-870. doi: 10.3969/j.issn.1003-3106.2024.04.009LEI Bangjun,YU Ao,YU Kuai. Small object detection algorithm based on improved YOLOv8s[J]. Radio Engineering,2024,54(4):857-870. doi: 10.3969/j.issn.1003-3106.2024.04.009 [10] WOO S,PARK J,LEE J Y,et al. CBAM:convolutional block attention module[C]. European Conference on Computer Vision,Munich,2018:3-19. [11] ZHENG Zhaohui,WANG Ping,REN Dongwei,et al. Enhancing geometric factors in model learning and inference for object detection and instance segmentation[J]. IEEE Transactions on Cybernetics,2022,52(8):8574-8586. doi: 10.1109/TCYB.2021.3095305 [12] TONG Zanjia,CHEN Yuhang,XU Zewei,et al. Wise-IoU:bounding box regression loss with dynamic focusing mechanism[EB/OL]. [2024-04-27]. https://arxiv.org/abs/2301.10051. [13] 陈伟,江志成,田子建,等. 基于YOLOv8的煤矿井下人员不安全动作检测算法[J/OL]. 煤炭科学技术:1-19[2024-04-14]. http://kns.cnki.net/kcms/detail/11.2402.td.20240322.1343.003.html.CHEN Wei,JIANG Zhicheng,TIAN Zijian,et al. Unsafe action detection algorithm of underground personnel in coal mine based on YOLOv8[J/OL]. Coal Science and Technology:1-19[2024-04-14]. http://kns.cnki.net/kcms/detail/11.2402.td.20240322.1343.003.html. [14] TIAN Zhi,SHEN Chunhua,CHEN Hao,et al. FCOS:a simple and strong anchor-free object detector[J]. IEEE Transactions on Pattern Analysis and Machine Intelligence,2022,44(4):1922-1933. [15] YANG Wenjuan,ZHANG Xuhui,MA Bing,et al. An open dataset for intelligent recognition and classification of abnormal condition in longwall mining[J]. Scientific Data,2023,10(1). DOI: 10.1038/s41597-023-02322-9. [16] HU Jie,SHEN Li,SUN Gang. Squeeze-and-excitation networks[C]. IEEE/CVF Conference on Computer Vision and Pattern Recognition,Salt Lake City,2018:7132-7141. [17] OUYANG Daliang,HE Su,ZHANG Guozhong,et al. Efficient multi-scale attention module with cross-spatial learning[C]. IEEE International Conference on Acoustics,Speech and Signal Processing,Rhodes Island,2023:1-5. [18] HOU Qibin,ZHOU Daquan,FENG Jiashi. Coordinate attention for efficient mobile network design[C]. IEEE/CVF Conference on Computer Vision and Pattern Recognition,Nashville,2021:13708-13717. [19] ZHANG Yifan,REN Weiqiang,ZHANG Zhang,et al. Focal and efficient IOU loss for accurate bounding box regression[J]. Neurocomputing,2022,506:146-157. doi: 10.1016/j.neucom.2022.07.042 [20] GEVORGYAN Z. SIoU loss:more powerful learning for bounding box regression[EB/OL]. [2024-04-29]. https://doi.org/10.48550/arXiv.2205.12740. [21] REZATOFIGHI H,TSOI N,GWAK J,et al. Generalized intersection over union:a metric and a loss for bounding box regression[C]. IEEE/CVF Conference on Computer Vision and Pattern Recognition,Long Beach,2019:658-666.