针对YOLOv7模型在口罩佩戴检测任务中特征提取能力不足、模型感受野相对较小等问题,提出一种改进YOLOv7的口罩佩戴检测算法。首先,在YOLOv7模型的主干网络引入感受野模块(receptive field block,RFB),增大模型的感受野;其次,在YOLOv7模型的头部网络引入卷积块注意力模块(convolutional block attention module,CBAM),提取关键信息,忽略无关信息,增强特征图的信息表达能力,提高模型的检测能力。实验结果表明:改进后的YOLOv7 口罩佩戴检测算法精确率达到95。7%,较原YOLOv7算法提高了 5。6百分点;平均精度均值达到96。6%,提高了 2。6百分点。相比于目前主流的口罩佩戴检测算法,改进后的YOLOv7 口罩佩戴检测算法可以更加准确地检测出口罩佩戴情况。
Mask wearing detection algorithm based on improved YOLOv7
An improved YOLOv7 mask wearing detection algorithm was proposed to address the issues of insufficient feature extraction ability and relatively small receptive field of the YOLOv7 model.Firstly,a receptive field block(RFB)was introduced into the backbone network of the YOLOv7 model to increase the receptive field.Secondly,the convolutional block attention module(CBAM)attention mechanism was introduced into the head network of the YOLOv7 model to extract key information and ignore irrelevant information,so as to enhance the information expression ability of the feature map and improve the detection ability of the model.Experimental results show that the improved YOLOv7 mask wearing detection algorithm has a precision of 95.7%and a mean average precision of 96.6%,which is 5.6 and 2.6 percentage points higher than the original YOLOv7 algorithm respectively.Compared to the current mainstream mask wearing detection algorithms,the improved YOLOv7 mask wearing detection algorithm can detect the wearing of masks more accurately.
YOLOv7mask wearing detectionCBAM attention mechanismreceptive field blockaverage accuracy