Face Mask Detection and Alarming System Using Machine Learning
Face Mask Detection and Alarming System Using Machine Learning
--------------------------------------------------------------------------------------------------------------------------------------
Date of Submission: 17-01-2023 Date of Acceptance: 27-01-2023
---------------------------------------------------------------------------------------------------------------------------------------
ABSTRACT -According to the World Health learning enables researchers and physicians to
Organization, the coronavirus COVID-19 analyze massive amounts of data to estimate the
pandemic is producing a worldwide health dissemination of COVID-19, act as an early
catastrophe, and the most effective protective warning system for possible pandemics, and
strategy is wearing a face mask in public places categorize susceptible groups. We can tackle and
(WHO). According to reports, wearing a facemask predict new diseases with the help of new
in general settings minimizes the chance of technologies such as artificial intelligence, IoT, Big
transmission. This paper describes and construct an data, and Machine learning.
ensemble of Deep Learning and Machine Learning Here we introduce a facemask detection
algorithms to recognize persons without face masks model based on computer vision and deep learning.
and send an email alert when the count threshold The proposed model integrates with Surveillance
crosses. The facemask dataset consists of images of Cameras to impede the COVID19 transmission by
people with and without masks. Our objective is to detecting people wearing masks, no face masks.
take advantage of existing cameras and detect The model is an integration between deep learning
persons wearing masks and avoid virus and classical machine learning. We have
transmission. implemented multiple Machine Learning and Deep
Learning algorithms to achieve the highest
I. INTRODUCTION accuracy and consume the least time in training and
The COVID-19 coronavirus outbreak all detection.
over the world has mandated the use of face masks.
Scientists demonstrated that wearing facemasks II. LITERATURE REVIEW
reduces COVID-19 transmission. COVID-19's fast 2.1 "A Face-Mask Detection Approach based on
spread has compelled the World Health YOLO."
Organization to designate it as a worldwide An object detection model is used in the first
pandemic in 2020. The rapid development of the technique to discover and categorize masked and
COVID-19 pandemic has resulted in the world's unmasked faces. In the second technique, a YOLO
most serious public health disaster. There is no face detector detects faces (whether masked or not),
indication of a clinically approved antiviral and then a CNN architecture classifies the faces
treatment or immunization against the virus until into masked and unmasked categories. We used the
early 2021. People were forced by laws to wear Caffe model, a lightweight and computationally
face masks in public in many countries [18]. efficient model that makes working in real-time
However, the process of monitoring large groups of more manageable. For optimum performance at
people is becoming more complex in public places. high speeds, we examined five different models.
So, we create an automation process for detecting Our proposed approach solves the problem of
the faces. camera specification.
The coronavirus outbreak has led to substantial 2.2 "Rapid object detection using a boosted cascade
levels of international scientific cooperation. of simple features
Artificial Intelligence (A.I.) based on Machine Viola-Jones is an early face detection algorithm. It
Learning and Deep Learning can aid in the fight was designed to identify frontal faces, which it
against Covid-19 in various ways. Machine does better than faces looking laterally, above, or
DOI: 10.35629/5252-0501914919 |Impact Factorvalue 6.18| ISO 9001: 2008 Certified Journal Page 914
International Journal of Advances in Engineering and Management (IJAEM)
Volume 5, Issue 1 Jan. 2023, pp: 914-919 www.ijaem.net ISSN: 2395-5252
downwards. This algorithm recognizes and locates and then classify if the face has a mask[17] or not
human faces regardless of their size, location, or using a machine learning model. Caffe model is
surroundings. Viola-Jones fails when the face is capable of localizing face even with slight
covered, which makes it not a suitable approach. distortion in face angle. We compare multiple Deep
Our proposed system uses a Caffe model capable of Learning and Machine learning models for picking
detecting faces in distorted angles, low brightness, the best performing Face mask detection model.
and masks. The Neural Network architectures implemented
using Keras and Scikit-learn modules in Python.
Face Mask Detection using MTCNN and The real-time implementation made possible using
MobileNetV2 OpenCV.
This solution consists of MobileNet and
MTCNN as the backbone. The system was used for Approach
high and low computation scenarios. MobileNet is A two-phased approach is used which are
a lightweight CNN model built with the aim of discussed as follows;
modularity and efficiency. Though MTCNN is A.Training Phase: Training Dataset on multiple
robust and efficient, it is slow in the detection Machine learning and Deep Learning models, do
process and complex in methodology. The comparative analysis on various performance
proposed solution can overcome this problem and metrics.
is easy to implement using the OpenCV DNN B.Deployment Phase: Apply Face detection, face
module. mask classification on the real-time video feed
from the webcam. Send an email alert to the admin
Face Mask Detection. when the "without a mask" count crosses a
The proposed system is based on a deep threshold.
learning algorithm for image A.Training Phase
segmentationThetechnique of isolating the item of The dataset is adopted from an open-sourced
interest from the rest of the actual material using repository by Prajnasb. The dataset is categorized
input video processing is called segmentation. Face into two folders, namely "with_mask" and
landmarks are used to identify segmentation. "without_mask." Each folder consists of people's
Detecting, mapping, and analyzing landmarks faces with or without masks respective to their
necessitates a high level of computer capacity. The category. The images in the dataset underwent
current proposed solution would bypass the need preprocessing steps of noise reduction and image
for face-landmark detection and additional steps. resizing to maintain consistency and robustness.
Data augmentation was done to make the model
III. METHODOLOGY robust and avoid overfitting.
The proposed system aims to find human
faces using a pretrainedCaffe Face detection model
DOI: 10.35629/5252-0501914919 |Impact Factorvalue 6.18| ISO 9001: 2008 Certified Journal Page 915
International Journal of Advances in Engineering and Management (IJAEM)
Volume 5, Issue 1 Jan. 2023, pp: 914-919 www.ijaem.net ISSN: 2395-5252
Fig 2: Comparison table of Machine Learning & Deep Learning Algorithms for Facemask classification.
In comparison, Random Forest has mis- with the highest votes of predictions. Random
proven the conventional thought of Neural Network Forest has proven to be the best performing model
performance over traditional machine learning compared to other ML and Neural Network
models. Out of all the algorithms, SVM has shown algorithms with an accuracy of 92%.
mere accuracy. Support Vector Machine, or SVM, Transfer Learning in layman terns is a
is a well-known Supervised Learning technique methodology that uses previously acquired
used for both classification and regression issues. knowledge in new problems. It is a widely popular
However, it is primarily utilized in Machine technique in Deep Learning. Transfer Learning
Learning for Classification difficulties. involves taking the pre-trained weights in the first
The SVM algorithm's purpose is to find layers, which are generally universal to many
the optimum line or decision boundary for datasets, and randomly initializing and training the
categorizing n-dimensional space to place new data remaining layers for classification purposes is a
points in the proper category in the future. A standard transfer learning method. On the
hyperplane is the optimal choice boundary. Out of ImageNet dataset, Inception v3 is a commonly used
the other three ML algorithms, SVM has poor image recognition model demonstrated to achieve
accuracy of 67%. Random Forest is a classifier that higher than 78.1 percent accuracy. The
combines several decision trees on different subsets InceptionResNet-v2 model is a variant of the
of a dataset and averages the results to increase the Inception V3 model, and it is far more accurate
dataset's predicted accuracy. Instead, depending on than the preceding Inception V3. The Inception-
a single decision tree, the random forest collects the ResNet-v2 architecture outperforms earlier stateof-
forecasts from each tree and indicates the output the-art models in terms of accuracy.
Fig 4: Facemask detection and classification on live feed during the deployment phase.
Classification of facemask from detected "Without mask" face count crosses a specific count,
individual faces is done using the best performing the system alerts the admin with images of
Machine learning model. When the number of individuals without masks.
Fig 4.1: Webcam input frame of People With andWithout the mask
DOI: 10.35629/5252-0501914919 |Impact Factorvalue 6.18| ISO 9001: 2008 Certified Journal Page 917
International Journal of Advances in Engineering and Management (IJAEM)
Volume 5, Issue 1 Jan. 2023, pp: 914-919 www.ijaem.net ISSN: 2395-5252
Fig 4.2: Output of System after Face detection and Facemask classification
Input frames having individuals without certain count threshold. The alert email has a
the mask would be saved, and an email is sent to subject and images saved without mask frames as
the admin email after some saved frames cross a specified in Fig 5.
Fig 6: Email alert of individuals in the frame without masks at the admin's end.
IV. CONCLUSION this technique may reduce miss and error rates.
Our proposed system can identify and When several models are compared, the best model
recognize human faces in a real-time context. Face with the highest accuracy and prediction emerges.
detection and identification using the Caffe and The findings indicate that current face detection
Machine learning models provide faster detection and identification technology are slower and
and more reliable recognition. Compared to inaccurate, and the suggested method might replace
traditional face detection and recognition systems, it.
DOI: 10.35629/5252-0501914919 |Impact Factorvalue 6.18| ISO 9001: 2008 Certified Journal Page 918
International Journal of Advances in Engineering and Management (IJAEM)
Volume 5, Issue 1 Jan. 2023, pp: 914-919 www.ijaem.net ISSN: 2395-5252
DOI: 10.35629/5252-0501914919 |Impact Factorvalue 6.18| ISO 9001: 2008 Certified Journal Page 919