Authors: J Jenitta, Vidya D Y
Certificate: View Certificate
Novel Corona virus also known as COVID-19 has affected humans worldwide. Because of this pandemic the schools, universities and colleges were closed. One of the important guidelines to stop the spread of COVID-19 is wearing a facemask, but the knowledge of wearing facemask is gradually decreasing and the public are not aware of their safety towards corona virus disease. So, to alert the people who are not wearing the facemask, a facemask detection system is proposed in this paper. In this paper, the Tensorflow object detection algorithm is used to detect the face mask. The people who are in the institution are monitored through the camera, whether a person is wearing a face mask or not. If face mask is missing, then the person is alerted to follow the safety protocol. The proposed method achieves 95%accuracy.
The World Health Organization (WHO) has announced the COVID-19 as a pandemic disease. In India, as of January 2022, 36,582,129 humans were affected by COVID 19 and 485,350 humans were dead because of COVID19. COVID-19 is caused by SARS-CoV-2 virus which spreads from person to person in many ways. This virus spread from the infected person through droplets which comes from mouth or nose. The size of the droplet may vary from small aerosols to large respiratory droplets. These aerosols can remain in the air or travel more than 1 meter. A person can be infected when he inhales these aerosols or comes in direct contact with eyes, nose and mouth. Now, the COVID cases are reduced a lot and the educational institutions are on the verge of reopening to start a new normal life. To avoid the spreading of virus from one person to another person SOPs are released by WHO which includes keeping 1 meter distance from another person, wearing mask, avoiding crowded place, frequently washing hands, covering nose and mouth while sneezing. Out of all these, wearing facemask is the major SOP to be followed. Facemasks acts as a protection layer to prevent the droplets which are coming from respiratory track from reaching others. Research show that masks when worn over the nose and mouth, reduce the spread of droplets. The spread of virus can be done through the asymptomatic and pre-symptomatic people also without their knowledge to other people. Wearing a mask helps protect those around the infected people. But few people are not having this knowledge and are neglecting the guideline. Therefore, in this paper, a method is proposed to monitor the people without mask and visiting the educational institutions.
In this paper a method is proposed to monitor students and faculty who are in the campus by detecting whether they are wearing face mask or not. The rest of the paper is arranged as follows: Literature review is given in section II. The proposed method and the flow diagram are discussed in section III. The experimental results and conclusion are given in section IV and V respectively.
There are few papers in which the researchers have used the face detection algorithm. This section gives an overview about those literatures.
Gayatri Deore et al.  proposed a method to detect whether a person is wearing a mask or not using four different steps. They estimated distance from camera, eye line detection, facial part detection and eye detection. Analysis of the algorithm’s performance on test video sequences was done. From four different aspects the accuracy of each is different but very less.
Mohammad Marufur Rahaman et al.  proposed a method to find out whether a person is wearing a mask or not. Public places in a smart city network are monitored by CCTV cameras. A person without a mask is detected which is considered as issue, then that issue is reported to the authority of the city network. The images captured by CCTV cameras are processed and normalized. In this paper, Convolutional Neural Network (CNN) is used as a deep learning architecture. The proposed system detects a facemask with an accuracy of 98.7%.
Md. Sabbir Ejaz and Md. Rabiul Islam  have proposed an approach in detecting the face mask. The face has been detected by the Multitask Cascaded Convolutional Neural Network (MTCNN). Then the detected face is used to align faces from an input image. The facial feature extraction is done by the Google FaceNet model. The facial recognition is performed using the Support Vector Algorithm (SVM). The test accuracy of masked and non-mask face detection using FaceNet is 98.50%. It is found that when the complexity is increased the detection accuracy is decreased.
Bima Sena Bayu Dewantara and Dhiska Twinda Rhamadhaningrum  proposed Adaptive Boosting (AdaBoost) and Cascade Classifier based methods to detect whether a person is wearing a mask or not on various facial poses. There are many methods available for object detection, in that some of the popular methods are Haar-like features, Local Binary Pattern (LBP) and Histogram of Oriented Gradient (HOG). AdaBoost and Cascade Classifier are used for filtering object features. Accuracy obtained is not very high using this method.
Md. Raffiuzzaman Bhuiyan et al.  proposed an approach to detect face masks. The data annotation is done using LabelIMG. YOLOv3 is used for object classification and detection. YOLOv3 uses Darknet-53 for feature extraction. Google Colaboratory is used for training purposes. The experimental results show that an average loss of 0.0730 is obtained after 4000 epochs with detection accuracy of 96%. Later they applied this model into real time video; they obtained an average fps output of 17.
Based on deep transfer learning and classical machine learning classifiers, Mohamed Loey etal.  introduced a mask detection model. The Authors used three different types of datasets. In this paper, the authors have used three types of machine learning classifiers, namely Decision Trees, Support Vector Machine (SVM) and Ensemble methods. The SVM classifier gives the highest testing accuracy and it consumes less time in the training process.
In order to prevent spreading of COVID 19 we propose the Object Detection algorithm using Tensorflow. Figure1 shows the block diagram of the proposed method. There are three major blocks in the proposed method. First block is used for the creation of a dataset, the second block is used for training the model and the third block is used for testing the model.
A. Creation of dataset
The first stage of any vision system is the image acquisition stage. A real time monitoring camera is used to capture images in order to detect facemask which is the Region of Interest (ROI). Figure 2 shows sample images which are obtained from the various places of college campus viz., corridor, laboratories etc., under different lighting conditions. After images have been obtained, Images are annotated using LabelImg. Image preprocessing is performed to improve images or prepare them as an input for annotation.
B. Training the Model
Tensorflow object detection model is used for detecting the presence and location of multiple classes of objects. A large bounding box spanning the full image is drawn by the model. From each bounding box the features are extracted. From each bounding box, the presence of objects are found out. Then where the object is present in the bounding box was also found by the model. At last, a single bounding box is obtained by combining the overlapping boxes. When an image is given as input to the model, it would detect the list of objects and the location in the bounding box and the confidence score of detection is also given.
An input image is passed onto the object detection model. The model is trained on the training dataset using a supervised learning algorithm. Raspberry Pi 4 is used to upload the trained model. Finally, the test dataset is used to predict the model. Speaker is used as a model output to alert the person to follow the SOP.
IV. EXPERIMENTAL RESULTS AND DISCUSSION
A real time monitoring camera captures images from different places in the Institution. The video footage is converted into images. To train the proposed model, 2095 images are used. Total of 15000 steps are used to train the model. Figure 3 shows the training error graph in which the error is decreased as the number of steps increases. During the training of the model 90% accuracy was achieved. For the prediction of the model, 200 images are taken as a test set. The threshold value of 0.8 is used which is found by trial-and-error method.
When the threshold value is less than the optimum value, little wrong detection was done by the model. Figure 4(a) shows wrong detection of no face mask. Figure 4 (b) shows the test results of the model in detecting persons wearing a facemask with optimum threshold value even though the lighting condition is poor. Because the visitor is not wearing a face mask which is detected, immediately it will prompt the system to give an alert message through the speaker which is attached to the system to follow the SOP.
The proposed model is evaluated using various performance analysis parameters namely Precision, Recall, F1 score and accuracy which is calculated using equation (1), (2) and (3). Table 1 represents the confusion matrix of the testing phase. True positive means the model has predicted them ask correctly when there is mask in the test image, True negative means when there is no mask, model has predicted correctly as no mask, False positive means when there is no mask, model has wrongly predicted as mask and False negative means, when there is mask, model has wrongly predicted as no mask. From the confusion matrix the performance parameters are calculated.
The Precision value for prediction of people with and without facemask is 1 and recall value is 0.9130 as calculated from the confusion matrix. F1 score is 0.9545 which takes both precision and recall average for better measure. A confusion matrix allows visualization of performance of algorithm and can observe classification of facemask and no mask.
Precision, Recall and F1 score are approximately 1 hence, we claim that this is a good classifier.
Wearing a face mask is one of the essential and effective method to prevent the spreading of COVID-19 as per SOP. The main aim of this paper is to detect facemask. The proposed Tensorflow object detection model was tested for detecting facemask. If the model detects a person without a facemask, then immediately the alert message is given through a speaker to wear a facemask. The system was able to detect the presence of facemask from the image taken from the camera. Precision value for prediction of people with and without facemask is 1, recall value is 0.9130, F1 score is 0.9545 and an accuracy of 95% is achieved for the proposed method. In future, this method can also be implemented in various industries, companies and other public places, which will protect the employees and people from the spread of COVID-19. The accuracy of the detection of facemask can be improved by further training of a dataset in order to get better results. Finally, this proposed work can be upgraded by adding the feature of social distance monitoring which is also one of the SOP in prevention against the COVID-19.
 https://www.who.int  G.Deore, R. Bodhula, V. Udpikar and V.More ,\"Study of masked face detection approach in video analytics,\" 2016 Conference on Advances in Signal Processing (CASP), Pune, 2016,pp.196-200.  M. M. Rahman, M. M. H. Manik, M. M. Islam, S. Mahmudand, J. -H. Kim,\" An Automated System to Limit COVID-19 Using Facial Mask Detection in Smart City Network,\" 2020 IEEE International IOT Electronics and Mechatronics Conference (IEMTRONICS), Vancouver, BC, Canada, 2020, pp. 1-5.  M. S. Ejaz and M. R. Islam, \"Masked Face Recognition Using Convolutional Neural Network,\" 2019 International Conference on Sustainable Technologies for Industry 4.0 (STI), Dhaka, Bangladesh, 2019.  B. S. Bayu Dewantara and D. Twin da Rhamadhaningrum, \"Detecting Multi-Pose Masked Face Using Adaptive Boosting and Cascade Classifier,\" 2020 International Electronics Symposium (IES), Surabaya, Indonesia, 2020, pp.436-441.  M. R. Bhuiyan, S. A. Khushbu and, M. S. Islam,\" A Deep Learning Based Assistive System to Classify COVID-19 Face Mask for Human Safety with YOLOv3,\" 2020 11th International Conference on Computing, Communication and Networking Technologies (ICCCNT), Kharagpur, India, 2020, pp.1-5.  Mohamed Loey, Gunasekaran Manogaran, Mohamed Hamed N.Taha, Nour Eldeen M. Khalifa, “A hybrid deep transfer learning model with machine learning methods for face mask detection in the era of the COVID-19 pandemic”, 0263-2241© 2020 Elsevier Ltd.
Copyright © 2022 J Jenitta, Vidya D Y. This is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.