基于改进YOLOv5的安全帽检测算法

Helmet detection method based on improved YOLOv5

  • 摘要: 为了解决建筑工地、隧道、煤矿等施工场景中现有安全帽检测算法对于小目标、密集目标以及复杂环境下的检测精度低的问题,设计实现了一种基于YOLOv5的改进目标检测算法,记为YOLOv5-GBCW. 首先使用Ghost卷积对骨干网络进行重构,使得模型的复杂度有了显著降低;其次使用双向特征金字塔网络(BiFPN)加强特征融合,使得算法对小目标准确率提升;引入坐标注意力(Coordinate attention)模块,能够将注意力资源分配给关键区域,从而在复杂环境中降低背景的干扰;最后提出了Beta-WIoU作为边框损失函数,采用动态非单调聚焦机制并引入对锚框特征的计算,提升预测框的准确率,同时加速模型收敛. 为了验证算法的可行性,以课题组收集的安全帽数据集为基础,选用了多种经典算法进行对比,并且进行了消融实验,探究各个改进模块的提升效果. 实验结果表明:改进算法YOLOv5-GBCW相较于YOLOv5s算法,算法平均精确率(IOU=0.5)提升了5.8%,达到了94.5%,检测速度达到了124.6 FPS(每秒处理帧数),模型更加轻量化,在复杂环境、密集场景和小目标场景下检测能力提升显著,并且同时满足安全帽检测精度和实时性的要求,给复杂施工环境下安全帽检测提供了一种新的方法.

     

    Abstract: To address the challenge of low detection accuracy in existing safety helmet detection algorithms, particularly in scenarios with small targets, dense environments, and complex surroundings like construction sites, tunnels, and coal mines, we introduce an enhanced object detection approach, denoted as YOLOv5-GBCW. Our methodology includes several key innovations. First, we apply Ghost convolution to overhaul the backbone network, considerably reducing model complexity, decreasing computational requirements by 48.73%, and reducing model size by 45.84% while maintaining high accuracy with only a 1.6 percentage point reduction. Second, we employ a two-way feature pyramid network (BiFPN) to enhance feature fusion, providing distinct weights to objects of varying scales. This empowers our algorithm to excel in detecting small targets. We incorporate a leap-layer connection strategy for cross-scale weight suppression and feature expression, further enhancing object detection performance. In addition, we introduce the coordinate attention module to allocate attention resources to key areas, minimizing background interference in complex environments. Finally, we propose the Beta-WIoU border loss function, employing a dynamic non-monotonic focusing mechanism to reduce the impact of simple examples on loss values. This enables the model to prioritize challenging examples like occlusions, enhancing generalization performance. We also introduce anchor box feature calculations to improve prediction accuracy and expedite model convergence. To validate our algorithm’s feasibility, we use a dataset of 7000 images collected by our research group featuring safety helmets in construction sites, tunnels, mines, and various other scenarios. We conduct comparisons with classic algorithms, including Faster RCNN, SSD, YOLOv3, YOLOv4, and YOLOv5s, along with algorithms from relevant literature. We employ adaptive Gamma transformation for image preprocessing during training to facilitate subsequent detection. Ablation experiments systematically investigate the contributions of each improvement module. Our experimental findings demonstrate that, compared to the YOLOv5s algorithm, our improved YOLOv5-GBCW achieves a remarkable average accuracy improvement of 5.8% at IOU=0.5, reaching 94.5% while maintaining a detection speed of 124.6 FPS(Frames per second). This results in a lighter model with faster convergence, considerably enhancing its detection capabilities in complex, dense, and small target environments while meeting the stringent requirements for helmet detection accuracy and real-time performance. This work introduces a novel approach for detecting safety helmets in intricate construction settings.

     

/

返回文章
返回