广西师范大学学报(自然科学版) ›› 2023, Vol. 41 ›› Issue (1): 76-86.doi: 10.16088/j.issn.1001-6600.2022030402

• 研究论文 • 上一篇    下一篇

基于YOLOv3的公共场所口罩佩戴检测方法

魏明军1,2*, 周太宇1, 纪占林1,2, 张鑫楠1   

  1. 1.华北理工大学人工智能学院, 河北 唐山 063210;
    2.华北理工大学河北省工业智能感知重点实验室, 河北 唐山 063210
  • 收稿日期:2022-03-04 修回日期:2022-04-18 出版日期:2023-01-25 发布日期:2023-03-07
  • 通讯作者: 魏明军(1969—),男,河北唐山人,华北理工大学教授。E-mail:wei_mingjun@126.com
  • 基金资助:
    科技部重点研发项目(2017YFE0135700)

Detection Method of Mask Wearing in Public Places Based on YOLOv3

WEI Mingjun1,2*, ZHOU Taiyu1, JI Zhanlin1,2, ZHANG Xinnan1   

  1. 1. College of Artificial Intelligence, North China University of Science and Technology, Tangshan Hebei 063210, China;
    2. Hebei Provincial Key Laboratory of Industrial Intelligent Perception, North China University of Science and Technology, Tangshan Hebei 063210, China
  • Received:2022-03-04 Revised:2022-04-18 Online:2023-01-25 Published:2023-03-07

摘要: 针对公共场所人群口罩佩戴检测小尺度目标较多导致其检测精度不高的问题,本文改进YOLOv3的特征金字塔结构,利用跳跃连接和包含通道注意力的位置特征增强模块LFE,将低层特征图的丰富位置信息传递到中层和高层特征图中,加强了对小目标的识别,并使用CIoU损失函数进行边框回归,提高了算法定位精度。除佩戴和未佩戴口罩外,也对不规范佩戴口罩进行检测。实验结果表明,改进后的YOLOv3算法在自制的口罩佩戴数据集上mAP达到86.96%,较YOLOv3算法提高了3.30个百分点,该结果也同样优于Faster R-CNN、SSD300、DSSD321和YOLOv4等主流算法,且算法检测速度达到39.2 frame/s,相比YOLOv3仅下降2.2 frame/s,仍满足实时检测要求。

关键词: YOLOv3算法, 口罩佩戴检测, 小目标, 通道注意力, 多尺度融合, 损失函数

Abstract: Aiming at the problem of low detection accuracy due to the large number of small-scale targets in the detection of masks worn by people in public places, the feature pyramid structure of YOLOv3 is improved by the method in this paper. Firstly, the rich location information of the low-level feature map is transmitted to the middle-level and high-level feature map by using the jump connection and the location feature enhancement module LFE containing channel attention, so as to strengthen the recognition of small targets. Secondly, the bounding box regression using the CIoU loss function improves the positioning accuracy of the algorithm. In addition, nonstandard wearing of masks is also detected. The experimental results show that on the self-made mask wearing dataset, the mAP of the improved YOLOv3 algorithm reaches 86.96%, which is 3.30% higher than that of the YOLOv3 algorithm. The result is also better than those of the mainstream algorithms such as Faster R-CNN, SSD300, DSSD321 and YOLOv4. The detection speed FPS of the algorithm reaches 39.2 frame/s, which is only 2.2 frame/s lower than that of YOLOv3, meeting the requirements of real-time detection.

Key words: YOLOv3 algorithm, mask wearing detection, small-scale targets, channel attention, multiscale fusion, loss function

中图分类号: 

  • TP391.41
[1] 张旭,董亚琼. 新冠肺炎(COVID-19)的致死率分析与治疗对策[J]. 基因组学与应用生物学,2020,39(9):4405-4408. DOI:10.13417/j.gab.039.004405.
[2]张修宝,林子原,田万鑫,等. 全天候自然场景下的人脸佩戴口罩识别技术[J]. 中国科学:信息科学,2020,50(7):1110-1120. DOI:10.1360/SSI-2020-0046.
[3]荣誉. 基于YOLOv3的人脸佩戴口罩检测改进算法[D]. 南宁:广西大学,2021.DOI:10.27034/d.cnki.ggxiu.2021.001442.
[4]GIRSHICK R,DONAHUE J,DARRELL T,et al. Rich feature hierarchies for accurate object detection and semantic segmentation[C]// 2014 IEEE Conference on Computer Vision and Pattern Recognition. Los Alamitos,CA:IEEE Computer Society,2014:580-587. DOI:10.1109/CVPR.2014.81.
[5]GIRSHICK R. Fast R-CNN[C]// 2015 IEEE International Conference on Computer Vision. Los Alamitos,CA:IEEE Computer Society,2015:1440-1448. DOI:10.1109/ICCV.2015.169.
[6]REN S Q,HE K M,GIRSHICK R,et al. Faster R-CNN:towards real-time object detection with region proposal networks[J]. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2017,39(6):1137-1149. DOI:10.1109/TPAMI.2016.2577031.
[7]HE K M,GKIOXARI G,DOLL R P,et al. Mask R-CNN[C]// 2017 IEEE International Conference on Computer Vision(ICCV). Los Alamitos,CA:IEEE Computer Society,2017:2980-2988. DOI:10.1109/ICCV.2017.322.
[8]REDMON J,FARHADI A. YOLO9000:better,faster,stronger[C]// 2017 IEEE Conference on Computer Vision and Pattern Recognition(CVPR). Los Alamitos,CA:IEEE Computer Society,2017:6517-6525. DOI:10.1109/CVPR.2017.690.
[9]REDMON J,DIVVALA S,GIRSHICK R,et al. You only look once:unified,real-time object detection[C]// 2016 IEEE Conference on Computer Vision and Pattern Recognition(CVPR). Los Alamitos,CA:IEEE Computer Society,2016:779-788. DOI:10.1109/cvpr.2016.91.
[10]REDMON J,FARHADI A. YOLOv3:an incremental improvement[EB/OL].(2018-04-08)[2022-03-04]. https://arxiv.org/abs/1804.02767. DOI:10.48550/arXiv.1804.02767.
[11]BOCHKOVSKIY A,WANG C Y,LIAO H Y M. YOLOv4:optimal speed and accuracy of object detection[EB/OL].(2020-04-23)[2022-03-04]. https://arxiv.org/abs/2004.10934. DOI:10.48550/arXiv.2004.10934.
[12]LIU W,ANGUELOV D,ERHAN D,et al. SSD:single shot multibox detector[C]// Computer Vision-ECCV 2016:LNCS Volume 9905. Cham:Springer International Publishing AG,2016:21-37. DOI:10.1007/978-3-319-46448-0_2.
[13]FU C Y,LIU W,RANGA A,et al. DSSD:deconvolutional single shot detector[EB/OL].(2017-01-23)[2022-03-04]. https://arxiv.org/abs/1701.06659. DOI:10.48550/arXiv.1701.06659.
[14]张琴涛. 基于改进YOLOv3的口罩佩戴检测算法研究[D]. 天津:天津工业大学,2021.DOI:10.27357/d.cnki.gtgyu.2021.000069.
[15]曹城硕,袁杰. 基于YOLO-Mask算法的口罩佩戴检测方法[J]. 激光与光电子学进展,2021,58(8):0810019. DOI:10.3788/LOP202158.0810019.
[16]曾成,蒋瑜,张尹人. 基于改进YOLOv3的口罩佩戴检测方法[J]. 计算机工程与设计,2021,42(5):1455-1462. DOI:10.16208/j.issn1000-7024.2021.05.035.
[17]张路达,邓超. 多尺度融合的YOLOv3人群口罩佩戴检测方法[J]. 计算机工程与应用,2021,57(16):283-290. DOI:10.3778/j.issn.1002-8331.2103-0505.
[18]王艺皓,丁洪伟,李波,等. 复杂场景下基于改进YOLOv3的口罩佩戴检测算法[J]. 计算机工程,2020,46(11):12-22. DOI:10.19678/j.issn.1000-3428.0058802.
[19]程可欣,王玉德. 基于改进YOLOv3的自然场景人员口罩佩戴检测算法[J]. 计算机系统应用,2021,30(2):231-236. DOI:10.15888/j.cnki.csa.007788.
[20]LIN T Y,DOLLR P,GIRSHICK R,et al. Feature pyramid networks for object detection[C]// 2017 IEEE Conference on Computer Vision and Pattern Recognition(CVPR). Los Alamitos,CA:IEEE Computer Society,2017:936-944. DOI:10.1109/CVPR.2017.106.
[21]卢伟. 基于深度学习的无人机航拍图像目标检测[D]. 厦门:厦门大学,2019.
[22]HU J,SHEN L,SUN G. Squeeze-and-excitation networks[C]// 2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition. Los Alamitos,CA:IEEE Computer Society,2018:7132-7141. DOI:10.1109/cvpr.2018.00745.
[23]WOO S,PARK J,LEE J Y,et al. CBAM:convolutional block attention module[C]// Computer Vision-ECCV 2018:LNCS Volume 11211. Cham:Springer,2018:3-19. DOI:10.1007/978-3-030-01234-2_1.
[24]陈科圻,朱志亮,邓小明,等. 多尺度目标检测的深度学习研究综述[J]. 软件学报,2021,32(4):1201-1227. DOI:10.13328/j.cnki.jos.006166.
[25]WANG K X,LIEW J H,ZOU Y T,et al. PANet:few-shot image semantic segmentation with prototype alignment[C]// 2019 IEEE/CVF International Conference on Computer Vision(ICCV). Los Alamitos,CA:IEEE Computer Society,2019:9196-9205. DOI:10.1109/ICCV.2019.00929.
[26]YI L,WANG C J,LI F Z,et al. TFPN:twin feature pyramid networks for object detection[C]// 2019 IEEE 31st International Conference on Tools with Artificial Intelligence(ICTAI). Los Alamitos,CA:IEEE Computer Society,2019:1702-1707. DOI:10.1109/ictai.2019.00251.
[27]PANG J M,CHEN K,SHI J P,et al. Libra R-CNN:towards balanced learning for object detection[C]// 2019 IEEE/CVF Conference on Computer Vision and Pattern Recognition(CVPR). Los Alamitos,CA:IEEE Computer Society,2019:821-830. DOI:10.1109/CVPR.2019.00091.
[28]ZHENG Z H,WANG P,LIU W,et al. Distance-IoU loss:faster and better learning for bounding box regression[J]. Proceedings of the AAAI Conference on Artificial Intelligence,2020,34(7):12993-13000. DOI:10.1609/aaai.v34i07.6999.
[29]WANG Z Y,WANG G C,HUANG B J,et al. Masked face recognition dataset and application[EB/OL].(2020-03-23)[2022-03-04]. https://arxiv.org/abs/2003.09093. DOI: 10.48550/arXiv.2003.09093.
[30]YANG S,LUO P, LOY C C,et al. WIDER FACE:a face detection benchmark[C]// 2016 IEEE Conference on Computer Vision and Pattern Recognition(CVPR). Los Alamitos,CA:IEEE Computer Society,2016:5525-5533. DOI:10.1109/CVPR.2016.596.
[31]LIN T Y,MAIRE M,BELONGIE S,et al. Microsoft COCO:common objects in context[C]// Computer Vision-ECCV 2014:LNCS Volume 8693. Cham:Springer,2014:740-755. DOI:10.1007/978-3-319-10602-1_48.
[32]牛作东,覃涛,李捍东,等. 改进RetinaFace的自然场景口罩佩戴检测算法[J]. 计算机工程与应用,2020,56(12):1-7. DOI:10.3778/j.issn.1002-8331.2002-0402.
[1] 张文龙, 南新元. 基于改进YOLOv5的道路车辆跟踪算法[J]. 广西师范大学学报(自然科学版), 2022, 40(2): 49-57.
[2] 陈文康, 陆声链, 刘冰浩, 李帼, 刘晓宇, 陈明. 基于改进YOLOv4的果园柑橘检测方法研究[J]. 广西师范大学学报(自然科学版), 2021, 39(5): 134-146.
[3] 张伟彬, 吴军, 易见兵. 基于RFB网络的特征融合管制物品检测算法研究[J]. 广西师范大学学报(自然科学版), 2021, 39(4): 34-46.
[4] 林原, 刘海峰, 林鸿飞, 许侃. 基于损失函数融合的组排序学习方法[J]. 广西师范大学学报(自然科学版), 2019, 37(1): 62-70.
[5] 丁新月, 徐美萍. Mlinex损失函数下逆伽马分布尺度参数的Bayes估计[J]. 广西师范大学学报(自然科学版), 2014, 32(3): 61-64.
Viewed
Full text


Abstract

Cited

  Shared   
  Discussed   
[1] 郑威,文国秋,何威,胡荣耀,赵树之. 属性自表达的低秩无监督属性选择算法[J]. 广西师范大学学报(自然科学版), 2018, 36(1): 61 -69 .
[2] 梁士楚, 田华丽, 田丰, 夏艺, 覃盈盈. 漓江湿地植被类型及其分布特点[J]. 广西师范大学学报(自然科学版), 2015, 33(4): 115 -119 .
[3] 徐久成, 李晓艳, 李双群, 张灵均. 基于相容粒的多层次纹理特征图像检索方法[J]. 广西师范大学学报(自然科学版), 2011, 29(1): 186 -187 .
[4] 程瑞, 何明先, 钟春英, 罗树毅, 武正军. 野生与人工繁育鳄蜥游泳能力比较[J]. 广西师范大学学报(自然科学版), 2021, 39(1): 79 -86 .
[5] 陈丹妮, 陈志林, 周善义. 中国蚁科昆虫名录——切叶蚁亚科(补遗)[J]. 广西师范大学学报(自然科学版), 2021, 39(1): 87 -97 .
[6] 罗树毅, 黎永泰, 武正军, 程瑞, 陈耀还, 何家松. 广西大桂山鳄蜥的栖枝高度及其影响因素[J]. 广西师范大学学报(自然科学版), 2021, 39(5): 182 -189 .
[7] 邵玉馥, 季婷婷, 姚怡辰, 闻炳海. 基于晶格Boltzmann方法研究曲面上接触角的测量算法[J]. 广西师范大学学报(自然科学版), 2021, 39(6): 44 -53 .
[8] 张仕艳, 谢强, 黄丽娟, 黄庆, 冯学宇, 苏华龙. 广西灵渠流域青冈栎群落主要种群生态位分析[J]. 广西师范大学学报(自然科学版), 2021, 39(6): 162 -173 .
[9] 郭家宝, 毕硕本, 邱湘开, 张莉. 清代东北三省旱涝灾害时空特征分析[J]. 广西师范大学学报(自然科学版), 2021, 39(6): 183 -196 .
[10] 白德发, 徐欣, 王国长. 函数型数据广义线性模型和分类问题综述[J]. 广西师范大学学报(自然科学版), 2022, 40(1): 15 -29 .
版权所有 © 广西师范大学学报(自然科学版)编辑部
地址:广西桂林市三里店育才路15号 邮编:541004
电话:0773-5857325 E-mail: gxsdzkb@mailbox.gxnu.edu.cn
本系统由北京玛格泰克科技发展有限公司设计开发