An improved lightweight YOLOv5s algorithm for mask-wearing detection
Shen Jiquan
Ma Shuai
Luo Junwei
Zhang Xiaohong
Abstract:Objectives In order to accurately detect mask wearing in public places and provide humanized re-minders based on the detection results,a fast mask wearing detection solution was constructed to cope with the dual demands of detection speed and accuracy in the real-world scenarios.Methods Firstly,Fast Spa-tial Pyramid Pooling was improved by replacing the original convolution with deep convolution to achieve the purpose of lightweight the Fast Spatial Pyramid Pooling.Secondly,a self-calibrating channel attention mechanism was proposed,which consists of two levels of channel interactions.The first level of interactions was used to obtain the correlation between neighboring channels and channel weights were computed based on the correlation,and the second level of interactions was used to calibrate the channel weights obtained from the first level of interactions over a larger range of channels.This mechanism has been applied to the Neck part of the network.Thirdly,Weighted Bi-directional Feature Pyramid Network was improved by intro-ducing fusion paths for large-scale feature maps and small-scale feature maps,which aimed to enrich the detail information in the fused small-scale feature maps.Finally,GhostConv module and C3Ghost module were separately utilized to replace the Conv module and C3 module in the Backbone and Neck parts respec-tively,which aimed to reduce the computation and parameters of the network and finally lightweight the Backbone and Neck.Results According to the results on the self-made datasets and the public datasets Moxa3K,the solution in this paper separately improved mAP by 3.1%and 2.9%,reduced parameters by 46.8%and 46.8%,and improved detection speed by 25%and 29.1%when comparing with YOLOv5s.Con-clusions The experimental results demonstrated the effectiveness of the proposed solution.
Keywords:mask wear detectionYOLOv5lightweightattention mechanismbi-directional feature fusion
Publication Date:2026-02-28
Online Publishing Date:2025-12-15(First online date of this platform, not the publication date of the document)
Pages:8( 153-160 )
