计算机工程与应用 ›› 2023, Vol. 59 ›› Issue (4): 183-190.DOI: 10.3778/j.issn.1002-8331.2205-0137

• 模式识别与人工智能 • 上一篇    下一篇

改进YOLOv4-tiny的安全帽佩戴检测算法

王建波,武友新   

  1. 南昌大学 数学与计算机学院,南昌 330000
  • 出版日期:2023-02-15 发布日期:2023-02-15

Safety Helmet Wearing Detection Algorithm of Improved YOLOv4-tiny

WANG Jianbo, WU Youxin   

  1. School of Mathematics and Computer Sciences, Nanchang University, Nanchang 330000, China
  • Online:2023-02-15 Published:2023-02-15

摘要: 针对已有的安全帽检测方法存在的模型参数量大,难以部署在边缘设备上,以及对较小目标检测效果不好等问题,提出一种改进YOLOv4-tiny的轻量级安全帽检测模型。针对小目标丢失过多问题,增加了检测小目标的尺度,提升模型关注小目标的能力。提出了一种轻量级特征融合结构,缓解特征融合部分的语义混叠问题,并且在模型中融入了优化的注意力模块,提升模型捕获上下文信息的能力。针对分类与回归任务之间的冲突,将模型预测头替换为解耦合的预测头,采用并行的卷积分别进行分类与回归任务。将改进的模型命名为HM-YOLO,通过实验验证了HM-YOLO算法的有效性,相比YOLOv4-tiny模型,HM-YOLO模型平均精度提升了14.2个百分点,参数量减少了19%,检测速度为为63?FPS,具有良好的检测精度和实时性,更易于部署在边缘设备上。

关键词: 小目标检测, 频域注意力, 解耦头, YOLOv4, 轻量级网络

Abstract: Aiming at the problems of the existing safety helmet detection methods, such as large number of model parameters, difficulty to deploy on edge devices, and poor detection effect on small targets, an improved YOLOV4-tiny lightweight safety helmet detection model is proposed. Firstly, to solve the problem of too many small targets missing, the detection scale of small targets is increased to improve the ability of the model to focus on small targets. Secondly, a lightweight feature fusion structure is proposed to alleviate semantic confusionin feature fusion. In addition, an optimized attention module is integrated into the model to improve the ability of the model to capture context information. Finally, for the conflicts between classification and regression tasks, the model prediction head is replaced by the decoupled prediction head, and the parallel convolution is used for classification and regression tasks respectively. The improved model is named HM-YOLO, and the effectiveness of the HM-YOLO algorithm is verified by experiments. Compared with the YOLOv4-tiny model, the average accuracy of the HM-YOLO model is improved by 14.2 percentage points, the number of parameters is reduced by 19%, and the speed is 63 FPS. It has good detection accuracy and real-time performance, and is easier to deploy on edge devices.

Key words: small object detection, frequency channel attention, decoupled head, YOLOv4, lightweight network