计算机与现代化 ›› 2022, Vol. 0 ›› Issue (01): 85-90.

• 图像处理 • 上一篇    下一篇

基于改进YOLOv4的口罩佩戴检测算法

  

  1. (1.辽宁石油化工大学信息与控制工程学院,辽宁抚顺113001;2.辽宁石油化工大学创新创业学院,辽宁抚顺113001)
  • 出版日期:2022-01-24 发布日期:2022-01-24
  • 作者简介:金鑫(1986—),男,辽宁阜新人,副教授,硕士生导师,博士,研究方向:深度学习算法,智能嵌入式系统,E-mail: jinxin@lnpu.edu.cn; 曾思轲(1999—),男,四川绵阳人,本科生,研究方向:机器学习,模式识别; 刘阳(2000—),男,安徽安庆人,本科生,研究方向:过程控制; 武楚涵(2000—),男,辽宁抚顺人,本科生,研究方向:机器感知与计算机智能。
  • 基金资助:
    国家自然科学基金资助项目(62073158); 辽宁石油化工大学引进人才科研启动基金资助项目(2016XJJ-102)

Mask Wearing Detection Algorithm Based on Improved YOLOv4

  1. (1. School of Information and Control Engineering, Liaoning Petrochemical University, Fushun 131001, China;
    2. School of Innovation and Entrepreneurship, Liaoning Petrochemical University, Fushun 131001, China)
  • Online:2022-01-24 Published:2022-01-24

摘要: 为解决YOLOv4在目标检测任务中检测速度低、模型参数多等问题,提出一种改进YOLOv4的目标检测算法。将YOLOv4主干网络中的CSPDarknet53替换成Mobilenet用以增强YOLOv4的特征提取网络,PANet原有的3×3标准卷积被深度可分离卷积取代,以降低计算负荷,从而提高识别速度,减少模型参数。然后使用K-means+〖KG-*3〗+算法对由8565张图像组成的数据集进行anchor维度聚类,以提升算法精度。同时,搭建行人口罩佩戴及人体测温拍摄系统用以在人群密集场所中执行疫情防控任务。在保证YOLOv4-Mobilenet网络精度的前提下,相较于原算法FPS提升200%、模型参数减少82%。改进后的模型平均每秒可检测67张图片,可以胜任实际应用中的口罩佩戴检测任务,结果表明该模型检测效果好、鲁棒性较强。

关键词: YOLOv4, Mobilenet, 深度可分离卷积, K-means+〖KG-*3〗+, 口罩佩戴检测

Abstract: In order to solve the problems of low detection speed and large amount of model parameters of YOLOv4 in the target detection task, an improved target detection algorithm of YOLOv4 is proposed. CSPDarknet53 of the YOLOv4 backbone is replaced by Mobilenet to improve the feature extraction network of YOLOv4, and the original standard 3×3 convolution of PANet is replaced by a depth-division convolution to reduce the computational burden, so as to improve the detection speed and reduce the model parameters. The K-means+〖KG-*3〗+ algorithm is then used to perform anchor dimension clustering on a dataset consisting of 8565 images to improve the accuracy of the algorithm. At the same time, a system for recording pedestrian wearing of masks and measuring people’s temperature is built to perform epidemic control tasks in crowded places. The FPS has been improved by 200% and the model parameters have been reduced by 82% compared with the original algorithm, while maintaining the accuracy of the YOLOv4-Mobilenet. The improved model can detect an average of 67 frames per second, which can detect mask wearing in real applications, and the results show that the model is efficient and reliable.

Key words: YOLOV4, Mobilenet, depth seperable convolution, K-means+〖KG-*3〗+, mask wearing test