As Covid-19 is increasing day by day, it is important to make sure that we should overcome from this. But the question arises here is that how we can overcome from this? like wearing mask, sanitizing ourself, taking necessary precautions and all. Nowadays vaccines are must, do you really think after getting vaccinated you are safe? The answer is no vaccines are to boost up our immunity level, so that if you get infected it will be not much harmful to you, so here we have implemented an application Face mask detection with alert system where we can get to know that whether the person is wearing a mask or not. If person is not wearing a mask in the premises, campus a beep sound is generated to catch that person. In this application a screen is displayed which detects the human face with or without mask and shows the percentage score of the mask worn. This application will be useful for the areas were number of peoples are more like hotels, airport, schools and colleges. Here first the model is trained on a real-world dataset having with or without face mask and then we have trained our model with live video streaming. The accuracy is obtained by increasing and decreasing the epoch value.
Keywords: Covid 19; Keras; MobileNetV2; Open CV; Tensorflow
Received: Jun 16, 2021 · Revised: Aug 27, 2021 · Accepted: Oct 20, 2021 · Published: 2022-01-24
Corresponding author: Vishal Chaudhari, [email protected]
This is an open access article under the CC BY 4.0 license.
How to cite: Bhole Varsha, Sakshi Tiwari, Vishal Chaudhari, Vaishali Patil, "Face Mask Detection with alert system using Tensorflow, Keras and OpenCV," International Journal of Engineering and Applied Physics, vol. 2, no. 1, pp. 339–345, 2022.
From past 2 years the deadly Covid 19 disease has spread in such a way that the whole nation is abruptly affected in terms of education, business, economy, etc. As per the data given by WHO there were approximately
Covid cases, death upto
and recovery upto
. As we know the vaccines like covishield and covaxin are available for different ages to boost the immunity level of a particular person so that the death rate should be in control. But the question arises here is that is vaccine is end of covid? Surely no because as mentioned above that it is to boost up our immunity level. It means that after taking the vaccine we should follow the mandatory rules established by government like wearing mask, sanitizing, social distancing, etc.
In this project we are training our model in such a way that it should recognize or find the person without mask in the premises, schools, colleges, office, etc. We are training our model by real world dataset and then by live video streaming. In this way we will be able to identify the person not wearing a mask. So, to take care of this problem we don’t need any guard or person who keeps a watch on people. This system aims at classifying whether a person is wearing a mask or not by taking input from Images and Real time Video streaming. If person is weared a mask then it will show a green frame around the face of that person and give the signal “Mask with percentage” and if person is not wearing a mask, then it will show a red frame around the faces of that person and give the signal “No Mask with percentage”. The Face Mask Detection model is based on computer vision and deep learning. The model is integration between deep learning and classical machine learning techniques with OpenCV, tensor flow and Keras.
Literature review that has been done on Face Mask Detection
Paper Name: Covid-19 Face Mask Detection Using TensorFlow, Keras and OpenCV.
Authors Name: Arjya Das, Mohammad Wasif Ansari, Rohini Basak.
Year of Publication: 2020
Content of the paper: Their proposed methodology consists of a cascade classifier and a pre-trained CNN which contains two 2D convolution layers connected to layers of dense neurons [1]. In this paper they have used two steps Data preprocessing and Training Model. In Data preprocessing they have done Data visualization, Conversion of RGB image into gray image and image reshaping. In the second part Training Model they have builded the model using CNN architecture and splitted the data and trained the CNN model.
Paper Name: Face mask detection using deep learning: An approach to reduce risk of Coronavirus spread Authors Name: Shilpa Sethi, Mamta Kathuria, Trilok Kaushik.
Year of Publication: 2021
Content of the paper: In their methodology they have mentioned three main components: Backbone, Neck and Head. Where backbone corresponds to a baseline convolutional neural network capable of extracting information from images and converting them to a feature map, the Neck contains all those pre-processing tasks that are needed before the actual classification of images and Head stands for identity detector or predictor that can achieve the desired objective of deep-learning neural network [2].
Paper Name: SSDMNV2: A real time DNN-based face mask detection system using single shot multibox detector and MobileNetV2.
Authors Name: Preeti Nagrath, Rachna Jain, Agam Madan, Rohan Arora, Piyush Kataria, Jude Hemanth. Year of Publication: 2021
Content of the paper: In their paper they have an accurate face detection model is required to detect faces, so that the SSDMNV2 model can classify whether the person is wearing a mask or not. The task in this paper is to raise the accuracy of mask detection without being too resource-heavy. For doing this task, the DNN module was used from OpenCV, which contains a ‘Single Shot Multibox Detector’ (SSD)object detection model with ResNet-10 as its backbone architecture [3].
The proposed system focuses on how to identify the person on image/video stream wearing face mask or not with the help of computer vision and deep learning algorithm by using Open CV, Tensorflow, Keras, Pytorch, Numpy, MobileNetV2 and Pygame where,
Open CV: It is an open-source library for machine learning used to process images, videos to identify faces. Tensorflow: It is an open-source artificial intelligence library, using data flow graphs to build models. Keras: It is a free open-source python library used for developing and evaluating deep learning models. Pytorch: It is an open-source machine learning library used in deep learning application.
Numpy: It is used to do mathematical operations on array
MobileNetV2: It is used to extract the data fast and easily.
Pygame: This library is used to create a peep sound if person is not wearing a mask
Algorithm for the model
Step 1: Create Dataset (Arrays).
Step 2: Create python file Train Mask Detector and import libraries.
Step 3: Append images to data List.
Step 4: Go through Path and Create Loops for Images with and without Mask.
Step 5: Use Keras and MobilenetV2 for preprocessing.
Step 6: Use Label by arrays method which includes sklearn module.
Step 7: For deep learning Model Convert into numpy Arrays.
Step 8: Track the Accuracy Matrix to save generated model.
Step 9: Plot the accuracy using matplotlib. Run and check the Accuracy.
Step 10: Train the model by images/Live Webcam to check whether the person is wearing a mask or not. Step 11: A beep sound is generated whether the person is wearing a mask or not.
The below diagram shows the proposed system of the model.

First it captures the image using webcam and then face mask detection model is applied on that face if person is not wearing a mask the notification is displayed on the screen that not wearing a mask with an accurate percentage with a peep sound which is generated by using pygame library and if the person has weared a mask a notification is displayed that wearing mask with an accurate percentage. It also shows that if a person is wearing a mask but not in a proper way i.e below the nose then also it will show “No mask with percentage”. We have created the Dataset of almost 4000 images of with and without mask.


Successfully able to install all libraries required for the project. Gathered around 4000 datasets having with mask and without mask images. Figure 4. shows the model accuracy of the project having precision, recall, f1-score and support. Figure 5. describes the accuracy level of 98% in the form of graph and figure 6. describes the accuracy level of 99.99% when epoch value is 20. Here we have got a highest accuracy for the face mask detection.




As described in the introduction that the person with no mask will be shown in red frame with percentage and the person with mask will be shown in green frame with percentage and the Figure 7. describes the same. Image A shows the output as “No Mask: 100%”, Image B shows that “Mask: 100%”, Image C shows the output as “No Mask: 81.30%” and Image D shows that “Mask: 99.97%”.
This paper briefly explains the Face mask detection using Training and Dataset model using various Libraries of Python. The accuracy of the model had been achieved to a higher level i.e 99.99%. We can prevent peoples from Virus Transmission through this System. So instead of standing and guarding the people, we can do this digitally!!! and by using pygame library we can punish that person without mask because by using this library we will be able to generate a beep sound through our system. In future it will be useful for other viral diseases. It will also become a compulsorily deployed model for the places were gathering of people is more. This model will serve the nation to become a COVID-19 free nation. By this model one can again experience a classroom, office, chill environment i.e only offline mode. As we have gained the maximum accuracy and detected that if a person is wearing the mask properly or not, the thing to improve in this paper is to identify the person is wearing a virus prone mask like surgical mask, N95 mask or not and push the alert message to the higher authority to catch the person via mails, message, etc.
Our team members are sincerely thankful to all those people who have been giving us any kind of assistance in the making of this project.
We would hereby, make most of the opportunity by expressing our sincerest thanks to all my faculties whose teachings gave us conceptual understanding and clarity of comprehension, which ultimately made our job easy. Credit also goes to all my friends whose encouragement kept us in good stead. Their continuous support has given me the strength and confidence to complete the project without any difficulty.
We would like to thank our teacher V.Y bhole and Shaila Pawar and our principal Dr V.N Pawar for their support and guidance. Without them it would not have possible to make this huge project.
BIOGRAPHIES OF AUTHORS
|
degree from Mumbai University. She has 14 years of teaching experience. She is the member of Indian Society of Technical education (ISTE) and Computer Science of India (CSI). She has published 4 National and 2 International Conference papers. Her research interests are Image processing, Soft Computing, Big Data Analytics, Cloud Computing and Internet of Things (IOT). Email- [email protected] Sakshi Tiwari is currently a student of A.C Patil College of Engineering, Kharghar. She is |
|---|---|
|
Sakshi Tiwari is currently a student of A.C Patil College of Engineering, Kharghar. She is pursuing her fourth year IT engineering. She had worked on many projects like IOT based home automation, Travelling Website using HTML, CSS, PHP and IOT based gas leakage detection. She knows the language like HTML, CSS, PHP, JAVA, C, MYSQL, PYTHON. Email- [email protected] |
|
Vishal Chaudhari is currently a student of A.C Patil College of Engineering, Kharghar. He is pursuing his fourth year IT engineering. He had worked on many projects like IOT based home automation, Travelling Website using HTML, CSS, PHP and IOT based gas leakage detection. He knows the language like HTML, CSS, PHP, JAVA, C++, MYSQL, PYTHON, MACHINE LEARNING. Email- [email protected] Vaishali Patil is currently a student of A.C Patil College of Engineering, Kharghar. She is |
|
Vaishali Patil is currently a student of A.C Patil College of Engineering, Kharghar. She is pursuing her fourth year IT engineering. She had worked on many projects like IOT based home automation, Travelling Website using HTML, CSS, PHP and IOT based gas leakage detection. She knows the language like PYTHON, HTML, CSS, C, C++, JAVA. Email- [email protected] |