The novel coronavirus infection is an acute respiratory infectious disease caused by the novel coronavirus,which has been affecting the world since December 2019.The transmission modes of the virus include direct transmission,aerosol transmission,and contact transmission.Wearing masks has become one of the main preventive measures for people worldwide to reduce the risk of infection and stop the ongoing spread of the pandemic.However,some people still do not wear masks,increasing the risk of infection.Therefore,mask wearing checks are particularly important.Mask wearing detection based on deep learning has the advantages of high efficiency,accuracy,and intelligence,which can improve monitoring efficiency,reduce workload,and detect people who do not wear masks in real-time.The main work of this article is to design a mask wearing detection algorithm based on deep learning for mobile or embedded devices with insufficient computing power and poor detection performance in complex scenarios.The self-made dataset in this article has confirmed its feasibility and effectiveness,as follows:Choose YOLOv5 with excellent performance as the basic algorithm for mask wearing.to address the issues of poor accuracy in small object detection and inaccurate prediction boxes,research was conducted to optimize the training process.The effectiveness of Mosaic-9 and Mixup data augmentation methods were compared,and it was found that Mosaic-9 effectively improved the algorithm’s accuracy,while Mixup resulted in loss of detection accuracy,so it was discarded.A K-Means++ clustering algorithm was designed to generate prior boxes using Io U as the distance calculation method,resulting in prediction boxes that were more closely aligned with the targets.Comparative ablation experiments were conducted between EIo U Loss and Alpha-Io U Loss,with results showing that Alpha-EIo U Loss resulted in more accurate prediction box regression,faster algorithm convergence,and faster average inference time per image.Considering the limited hardware conditions and insufficient algorithm recognition for obscure features,improve the network structure: design a C3 Ghost module that integrates lightweight network Ghost Net,greatly reducing the amount of parameters and computation,exchanging less accuracy loss for smaller algorithm computation and faster detection speed,reducing dependence on the hardware environment;Adding attention mechanism(CBAM)to the backbone network improves the network’s ability to extract of masked and facial features;Designing the Bi_Concat module with Weighted Bidirectional Feature Pyramid Network performs bidirectional weighted fusion of multi-scale features of the neck region,effectively identifying small targets in complex backgrounds.The final network structure ablation experiment confirmed that the ultimate network structure has a good effect on improving the accuracy and speed of the algorithm.Then,the synchronization training process optimization scheme obtained the lightweight mask wear detection algorithm Mask-YOLOv5,which meets the high accuracy and real-time requirements of mask-wearing detection in terms of model size,computation,average precision,and detection speed. |