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

图学学报 ›› 2023, Vol. 44 ›› Issue (1): 16-25.DOI: 10.11996/JG.j.2095-302X.2023010016

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

融合注意力机制的 YOLOv5 口罩检测算法

  

  1. 1. 青海大学计算机技术与应用系,青海 西宁 810016;  2. 青海大学省部共建三江源生态与高原农牧业国家重点实验室,青海 西宁 810016
  • 出版日期:2023-02-28 发布日期:2023-02-16
  • 基金资助:
    国家自然科学基金项目(61962051);省部共建三江源生态与高原农牧业国家重点实验室自主课题项目(2021-ZZ-2)

Mask detection algorithm based on YOLOv5 integrating attention mechanism

#br#
  

  1. 1. Department of Computer Technology and Applications, Qinghai University, Xining Qinghai 810016, China; 

    2. State Key Laboratory of Plateau Ecology and Agriculture, Qinghai University, Xining Qinghai 810016, China

  • Online:2023-02-28 Published:2023-02-16
  • Supported by:
    National Natural Science Foundation of China (61962051); Independent Project of the State Key Laboratory of Plateau Ecology and Agriculture (2021-ZZ-2)

摘要:

新冠疫情期间正确佩戴口罩可以有效防止病毒的传播,针对公共场所存在的人员密集、检测目 标较小等加大检测难度的问题,提出一种以 YOLOv5s 模型为基础并引入注意力机制融合多尺度注意力权重的 口罩佩戴检测算法。在 YOLOv5s 模型的骨干网络中分别引入 4 种注意力机制,抑制无关信息,增强特征图的 信息表达能力,提高模型对小尺度目标的检测能力。实验结果表明,引入 CBAM 模块后较原网络 mAP 值提升 了 6.9 个百分点,在 4 种注意力机制中提升幅度最明显,而引入 NAM 模块后在损失少量 mAP 的情况下使参 数量最少,最后通过对比实验选用 GIoU 损失函数计算边界框回归损失,进一步提升定位精度,最终结果较 原网络 mAP 值提升了 8.5 个百分点。改进模型在不同场景下的检测结果证明了该算法对小目标检测的准确 率和实用性。

关键词:

Abstract:

Wearing masks correctly during the COVID-19 pandemic can effectively prevent the spread of the virus. In response to the detection challenge posed by dense crowds and small detection targets in public places, a mask wearing detection algorithm based on the YOLOv5s model and integrating an attention mechanism was proposed. Four attention mechanisms were introduced into the backbone network of the YOLOv5s model to respectively suppress irrelevant information, enhance the ability of the feature map to express information, and improve the modelʹs detection ability for small-scale targets. Experimental results show that the introduction of the convolutional block attention module could increase the mAP value by 6.9 percentage points compared with the original network, with the greatest improvement among the four attention mechanisms. The normalization-based attention module also showed excellent performance, with the least quantity of parameters while losing a small amount of mAP. Through comparative experiments, the GIoU loss function was selected to calculate the bounding box regression loss, resulting in further improvements to positioning accuracy, resulting in an mAP value that was improved by 8.5 percentage points compared to the original network. The detection results of the improved model in different scenarios prove the accuracy and practicability of the algorithm for small target detection. 

Key words: mask detection, YOLOv5, attention mechanism, feature fusion, small target detection

中图分类号: