| Since the end of 2019,the novel coronavirus(COVID-19)has broken out,which is highly dangerous and contagious.The new coronavirus pneumonia is a respiratory infectious disease.Wearing mask can effectively reduce the probability of infection with the novel coronavirus.Using the technical advantages of deep learning in the field of object detection,a mask detection system has been developed,which can effectively reduce the input of manpower and material resources in epidemic prevention work,improve the efficiency of investigation,and also reduce the risk of frontline workers being infected with the novel coronavirus.Therefore,mask detection system based on convolutional neural network is designed in this thesis.The main research contents of this thesis are as follows:1.Based on different light intensities,shooting distances,and shooting angles,the dataset used in this thesis is collected through online screening and self-production.The dataset is divided into two categories: naked face and mask,a total of 6000 images.Among them,2587 images of labeled mask and naked face have been screened,which are from two open-source datasets,MAFA and WIDER.A total of 3413 pictures have been collected,taken and labeled by the author.2.In order to ensure that the detection model can be deployed in embedded hardware devices with good detection effect,the Yolov4-tiny detection network is used as the original model.On the basis of it,the GCS_Yolov4-tiny mask detection network is designed.By replacing the CBL module in the residual module(CSP block)in the backbone feature extraction network of the original model with ghost module,it becomes a lightweight residual module(G_CSP Block);replace the last layer CBL module in the backbone feature extraction network with ghost module;replace the CBL module in the Yolo Head with ghost module to make it a lightweight detection head(G_Yolo Head),so as to reduce the computational complexity of the model and bring lightweight to the model.By combining Ghost module,CBAM attention,SMU activation function,and BN layer,a lightweight attention mechanism residual module(GCS_Block)is designed,which is sequentially embedded into the lightweight optimized backbone feature extraction network of the first lightweight residual module,the second lightweight residual module and the third lightweight residual module,and the “add”operation method is used for feature fusion to achieve the goal of strengthening the backbone feature extraction network to extract the target feature attributes.All the activation functions of the detection network are replaced by SMU activation functions to improve the nonlinear fitting ability of the model.3.The Kmeans++ method is used to perform anchor box clustering on the dataset in this thesis.The training set and the test set are randomly divided in the ratio of 7:3,and the cosine annealing method is used to adjust the learning rate during training,so that the model achieves the best training effect.The experimental results show that compared with the original model(the model memory size is 22.4MB and the parameter amount is 6,056,606),the memory size of the model of GCS_Yolov4-tiny mask detection network designed in this thesis is only 5.6MB,and the parameter amount is only 1,657,828.Compared with the original model,the detection accuracy(AP)of naked faces and masks has increased from 78.47% and 69.56% to 89.59%and 83.95% respectively.The detection speed(FPS)has increased from 121 to 133.Finally,GCS_Yolov4-tiny is deployed to the embedded hardware Raspberry Pi,and the Raspberry Pi is remotely controlled by the main control computer to use the cameras and speakers to realize the practical application of mask detection. |