Computer Engineering and Applications ›› 2022, Vol. 58 ›› Issue (9): 201-207.DOI: 10.3778/j.issn.1002-8331.2111-0346

• Pattern Recognition and Artificial Intelligence • Previous Articles     Next Articles

Lightweight Helmet Wearing Detection Algorithm of Improved YOLOv5

YANG Yongbo, LI Dong   

  1. Inner Mongolia Autonomous Region Key Laboratory of Perception Technology and Intelligent System, College of Information Engineering, Inner Mongolia University of Technology, Hohhot 010051, China
  • Online:2022-05-01 Published:2022-05-01

改进YOLOv5的轻量级安全帽佩戴检测算法

杨永波,李栋   

  1. 内蒙古工业大学 信息工程学院 内蒙古自治区感知技术与智能系统重点实验室,呼和浩特 010051

Abstract: Aiming at the problems of the existing helmet wearing detection algorithm, such as multiple parameters, complex network, large amount of calculation, which is not suitable for deployment on embedded devices, and poor discrimination of occlusion targets, an improved lightweight helmet detection algorithm, YOLo-M3, is proposed.?Firstly, the YOLOv5s backbone network is replaced by MobileNetV3 for feature extraction, which reduces the number of parameters and computation of the network.?Secondly, Diou-NMS is used to replace NMS to improve the identification of occlusion targets. CBAM attention mechanism is added to make the model pay more attention to the main information to improve the detection accuracy. Finally, knowledge distillation is carried out to increase the recall rate and accuracy of model detection.?Experiments verify that YOLO-M3 algorithm can improve the identification of occlusion targets, and reduce the calculation amount of YOLOv5s model by 42% and the model size by 40% while ensuring a high average detection accuracy, thus reducing the hardware cost and meeting the requirements of deployment in embedded end.

Key words: lightweight, object detection, improved YOLOv5, attentional mechanism, knowledge of distillation

摘要: 针对现有的对安全帽佩戴检测算法的参数多、网络复杂、计算量大、不利于在嵌入式等设备进行部署,且对遮挡目标辨别度差等问题,提出了一种改进的轻量级的安全帽检测算法YOLO-M3,先将YOLOv5s主干网络替换为MobileNetV3来进行特征提取,降低了网络的参数量和计算量。使用DIoU-NMS替换NMS,提高对遮挡目标的辨识度,添加CBAM注意力机制使模型更关注主要信息以提升检测精度,对模型进行知识蒸馏,增加模型检测的召回率和准确度。通过实验验证了YOLO-M3算法提高了对遮挡目标的辨识度,在保证较高的检测平均精度时,将YOLOv5s模型的计算量降低了42%,模型大小降低了40%,降低了硬件成本,满足在嵌入式端部署的需求。

关键词: 轻量化, 目标检测, 改进YOLOv5, 注意力机制, 知识蒸馏