欢迎访问《图学学报》 分享到:

图学学报 ›› 2022, Vol. 43 ›› Issue (4): 590-598.DOI: 10.11996/JG.j.2095-302X.2022040590

• 图像处理与计算机视觉 • 上一篇    下一篇

基于动态加权类别平衡损失的多类别口罩佩戴检测

  

  1. 南昌航空大学软件学院,江西 南昌 330063
  • 出版日期:2022-08-31 发布日期:2022-08-15
  • 通讯作者: 储珺(1967),女,教授,博士。主要研究方向为复杂场景的目标检测和跟踪
  • 作者简介:陈昭俊(1996),男,硕士研究生。主要研究方向为深度学习与目标检测
  • 基金资助:
    国家自然科学基金项目(62162045);江西省重点研发计划项目(20192BBE50073)

Multi category mask wearing detection based on dynamic weighted category balance loss

  1. School of Software Engineering, Nanchang Hangkong University, Nanchang Jiangxi 330063, China
  • Online:2022-08-31 Published:2022-08-15
  • Contact: CHU Jun (1967), professor, Ph.D. Her main research interests conver object detection and tracking in complex scenes
  • About author:CHEN Zhao-jun (1996), master student. His main research interests conver deep learning and object detection
  • Supported by:
    National Natural Science Foundation of China (62162045); Research and Development Projects of Jiangxi Province (20192BBE50073)

摘要:

公共场合佩戴口罩已经成为重要的防疫措施。现有口罩检测方法通常只检测是否佩戴口罩,忽略检测未规范佩戴口罩这一极易发生交叉感染的场景,目前的口罩数据集缺少未规范佩戴口罩数据。针对以上问题,在现有口罩数据集的基础上,通过线下采集和从互联网收集更多未规范佩戴口罩图像,并根据佩戴口罩的人脸图像特点,改进 Mosaic 数据增强算法扩充数据,改进后 Mosaic 数据增强算法能够将基准网络 YOLOv4的平均精度均值(mAP)提升 2.08%;针对扩增后数据集出现的类别不平衡问题,提出动态加权平衡损失函数,在重加权二分类交叉熵损失(weight binary cross entropy loss)基础上,以有效样本数量的倒数作为辅助类别权重,并对训练的每一个批次进行动态调整,解决直接使用重加权方法稳定性弱、检测精度震荡和效果不理想的问题。实验表明,改进后模型 mAP 达到 91.25%,未规范佩戴口罩平均精度(AP)达到 91.69%,与单阶段方法 RetinaNet,Centernet,Effcientdet 和两阶段方法 YOLOv3-MobileNetV2,YOLOv4-MobileNetV2 相比,改进后算法具有更高的检测精度和速度。

关键词: 口罩检测, 类别不平衡, Mosaic 数据增强, YOLOv4, 重加权

Abstract:

 Mask wearing in public has become an important measure to control the spread of Coronavirus Disease 2019 (COVID-19). With the prolonged development of the COVID-19 epidemic, the public’s awareness of self-protection has been gradually declining, leading to the increasing tendency of wearing masks incorrectly in public. The existing mask wearing detection methods usually only detect whether the mask is worn, without the detection of non-standard mask wearing scenarios, which is likely to cause cross infection. The current mask datasets lack the image data of non-standard mask wearing. To solve the above problems, on the basis of the existing mask datasets, more non-standard mask wearing images were collected through the Internet and offline, and the Mosaic data enhancement algorithm was improved to expand the data according to the features of face images in the cases of wearing masks. The improved Mosaic data enhancement algorithm could improve the mean average precision (mAP) of the benchmark network YOLOv4 by 2.08%. To address the problem of category imbalance in the dataset after data enhancement, the dynamic weighted balance loss function was proposed. Based on the weight binary cross entropy loss function, the reciprocal of the number of effective samples served as the auxiliary category weight, and dynamic adjustment was performed in each batch under training, thus solving the problems of weak stability, precision oscillation, and unsatisfactory effect when the re-weighting method was directly put to use. The experiment showed that mAP of the improved model reached 91.25%, and the average precision (AP) of non-standard mask wearing reached 91.69%. Compared with such single-stage methods as RetinaNet, Centernet, and Effcientdet, and such two-stage methods as YOLOv3-MobileNetV2 and YOLOv4-MobileNetV2, the improved algorithm exhibits higher detection accuracy and speed.

Key words: mask detection, category imbalance, Mosaic data enhancement, YOLOv4, re-weight

中图分类号: