0% found this document useful (0 votes)
49 views6 pages

19 Ijmtst0806025

Uploaded by

Versha Kumari
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
49 views6 pages

19 Ijmtst0806025

Uploaded by

Versha Kumari
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

See discussions, stats, and author profiles for this publication at: [Link]

net/publication/361465615

Face Mask Detection Using Machine Learning

Article in International Journal for Modern Trends in Science and Technology · June 2022
DOI: 10.46501/IJMTST0806019

CITATIONS READS

0 4,813

6 authors, including:

Editor Ijmtst
International Journal for Modern Trends in Science and Technology
440 PUBLICATIONS 396 CITATIONS

SEE PROFILE

All content following this page was uploaded by Editor Ijmtst on 22 June 2022.

The user has requested enhancement of the downloaded file.


As per UGC guidelines an electronic bar code is provided to seure your paper

International Journal for Modern Trends in Science and Technology, 8(06): 132-136, 2022
Copyright © 2022 International Journal for Modern Trends in Science and Technology
ISSN: 2455-3778 online
DOI: [Link]
Available online at: [Link]

Face Mask Detection Using Machine Learning

Dr. Santosh Kumar Shukla, Pradeep Singh, Diksha Haswani, Sarthak Khare, Atul Gupta

Department of Information and Technology, Babu Banarassi Das Engineering College, Lucknow, Uttar Pradesh , India
Corresponding Author :

To Cite this Article


Dr. Santosh Kumar Shukla, Pradeep Singh, Diksha Haswani, Sarthak Khare, Atul Gupta. Face Mask Detection Using
Machine Learning. International Journal for Modern Trends in Science and Technology 2022, 8(06), pp. 132-136.
[Link]

Article Info
Received: 02 May 2022; Accepted: 30 May 2022; Published: 05 June 2022.

ABSTRACT
According to the World Health Organization, the corona virus COVID-19 pandemic is causing a worldwide health disaster,
and the most effective preventative measure is to wear a face mask in public places (WHO). The COVID-19 epidemic compelled
governments worldwide to implement lockdowns in order to limit viral spread. Wearing a face mask at work, according to
reports, reduces the likelihood of transmission significantly. An efficient and cost-effective method of using AI to create a safe
environment in a manufacturing setting. Face mask detection will be demonstrated using a deep learning model. We'll utilize
OpenCV to accomplish real-time face detection from a live feed via our webcam using a face mask detection dataset that consists
of with mask and without mask photos. Using Python, OpenCV, and Karas, we will develop a COVID-19 face mask detector
using deep learning. With the use of deep learning, we hope to determine whether or not the individual in the image/video stream
is wearing a face mask.

KEYWORDS: COVID-19, OpenCV, MobilenetV2, Adam, VGG16

1. INTRODUCTION tackle Covid-19 in a variety of ways. Machine learning


It's tough to spot a mask on someone's face. The might be used by researchers and medics to predict the
corona virus infection has recently gained a lot of
attention due to its spread. As a result, laws such as "No spread of COVID-19, operate as an early warning
entrance without a mask" have been implemented in a system for future pandemics, and identify vulnerable
number of countries. In the prevention and security of groups by analysing massive volumes of data.
Covid-19, face mask detection is a key issue. In the Investment in developing technologies such as artificial
medical field, a mask reduces the risk of infection from intelligence and machine learning is essential to combat
an infected person, regardless of whether they display and foresee new ailments. The AI's power is being
symptoms. Face mask detection is used in airports, utilised to tackle the Covid-19 outbreak, allowing
hospitals, offices, and educational institutions, among researchers to better assess infection rates and track
other places. As a result of the corona virus outbreak, down and identify infections more quickly. Many
unprecedented levels of worldwide scientific countries have laws requiring that people wear face
cooperation have emerged. Artificial intelligence (AI) masks in public. The significant increase in cases and
based on machine learning and deep learning can help deaths in various regions prompted the creation of these
recommendations and regulations. On the other hand,

132 International Journal for Modern Trends in Science and Technology


the task of monitoring large groups of people is performance measures may be considered while
becoming increasingly [Link] the monitoring developing the optimum system for large-scale
operation, anyone who is not wearing a face mask is implementation. The system has been worked with the
detected. Face identification without a mask is easier, following classifiers:
while face recognition with a mask is more challenging
due to the difficulty of extracting masked face features MobilenetV2[5]: MobileNetV2 is a state of the art for
against regular face features. The veiled face is devoid mobile visual recognition including classification, object
of several facial features such as the nose, lips, and chin. detection and semantic segmentation[17]. This classifier
A big number of face masks may be identified in two uses Depth wise Separable Convolution which is
periods. 1) Recognition of faces 2) Extraction of Features introduced to dramatically reduce the complexity cost
Face recognition is the initial stage, which comprises and model size of the network, and hence is suitable to
recognizing a person's face from a photograph. Mobile devices, or devices that have low computational
Detecting several mask and unmasked faces in an image power. Inverted residual structure is another excellent
is the most typical problem. The problem can be solved module included in MobileNetV2. Non-linearity in
using a typical object detection method. Feature narrow layers is deleted. Best performance for object
extraction is the process of isolating elements of a face detection and semantic segmentation is achieved using
that are of interest. The process of extracting parts of MobileNetV2 as the backbone for feature extraction.
faces that are of interest is known as feature extraction.
ResNet50: ResNet50 enables us to train deep neural
The result is obtained by matching the extracted image
networks with more than 150 layers. Prior to ResNet,
with mask and no mask images using a classifier
training very deep neural networks was challenging
(model).
due to the problem of vanishing gradients. The skip
connection concept was first developed by ResNet.
2. LITERATURE REVIEW
In many usage instances, such a solution is critical VGG16: VGG16 is a CNN architecture that is regarded
during the current Covid-19 lockdown period to
as one of the best vision models available today. The
prevent the spread. The following are a few examples of most distinguishing feature of VGG16 is that instead of
applications that will benefit from this technology. a huge number of hyper-parameters, it focuses on 3x3
filters with a stride of 1. The convolution and max pool
Airports: The proposed system could be extremely
layers are placed in the same way throughout the
useful in detecting travellers without masks at airports.
architecture. At last there are 2 FC (fully connected
The data of travellers can be recorded as movies in the
layers) followed by a softmax for output. The 16 in
system at the entrance. Any traveler found to be
VGG16 stands for 16 weighted layers. For each of the
without a face mask, an alarm alerting the airport
classifiers following 3 optimizers are applied to check
authorities is sent so that they could take quick action.
the performance of the system.
Hospitals: The suggested system can be coupled with
CCTV cameras, and data from such cameras can be ADAM[6]: Adam is a first-order gradient-based
used to determine whether or not their employees are
stochastic objective function optimization algorithm
wearing masks. If some health worker is found without based on adaptive estimations of lower-order moments.
a mask, they can receive a reminder notification to wear This method is computationally efficient and requires
a mask.[6]
little memory to operate. It is an invariant to diagonal
rescaling of the gradients, which is well suited for
Offices: The proposed method can aid in the
problems which are large in terms of dataand/or
maintenance of safety standards in order to prevent the
parameters. The hyper-parameters have
spread of Covid-19 or any other airborne disease.[15] If
straightforward interpretations and require little
an employee is not wearing a mask, they may be
adjustment in most cases. Adam performs well in
reminded to do so. The choice of a system must be
practise and compares favourably to other stochastic
based on the best performance. As a result, the above

133 International Journal for Modern Trends in Science and Technology


optimization approaches, according to empirical can be used to tackle this problem. Each SGD iteration
evidence. uses a single sample, or a batch size of one. The sample
is jumbled and chosen at random to execute the
ADAGRAD[8]:Adagrad is an optimizer with iteration. Because only one sample from the dataset is
parameter-specific learning rates, which are adapted chosen at random for each iteration in SGD, the route
relative to how frequently a parameter gets updated travelled by the algorithm to reach the minima is
during training. The smaller the updates become when typically noisier than that of a traditional Gradient
a parameter receives more updates. Descent method.

SGD: In Stochastic Gradient Descent, instead of using


3. METHODOLOGY
the entire data set for each iteration, some samples are
chosen at random. The term "batch" in Gradient Descent A. Deep Learning
refers to the total number of samples from a dataset that The deep learning architecture learns a range of
are utilised to calculate the gradient for each significant nonlinear features from the examples
iteration. Usage of whole dataset is useful for getting to presented. After then, the learned architecture is used to
the minima in a less noisy and less random manner. The predict samples that have never been seen before. To
issue comes when the datasets become excessively train our deep learning architecture, we acquired
large. If the dataset has a million samples, a images from a variety of sources. The architecture of the
conventional Gradient Descent optimization technique learning process is heavily influenced by CNN. The
would take all one million samples to complete one parts that follow go through every aspect of deep
iteration while executing the Gradient Descent, and this learning architecture. Obtaining Datasets: Data from
would have to be done for each iteration until the two different sources is collected for training and testing
minima was reached. As a result, performing it becomes the model. A total of 1915 photographs of persons
computationally expensive. Stochastic Gradient Descent wearing and not wearing masks were obtained. Eighty
can be used to tackle this problem. Each SGD iteration percent of the photographs are used for training, while
uses a single sample, resulting in a batch size of one. the rest are used for testing. ii) Design of the Learning
The sample is jumbled and chosen at random to execute Model: The learning model is based on a deep learning
the iteration. Because only one sample from the dataset classifier that can recognise patterns in images. The
is picked at random for each iteration in SGD, the path network is made up of an input layer, many hidden
taken by the algorithm to reach the minima is frequently layers, and an output layer. The hidden layers are made
noisier than the path taken by a traditional Gradient up of many convolution layers that generate
Descent method. appropriate filters for extracting crucial features from
SGD: In Stochastic Gradient Descent, instead of using the input data. To make classification judgments, many
the entire data set for each iteration, some samples are dense neural networks use the characteristics acquired
chosen at random. The term "batch" in Gradient Descent by DL.
refers to the total number of samples from a dataset that
B. Tensorflow
are utilised to calculate the gradient for each
TensorFlow is a free and open-source dataflow and
iteration. Usage of whole dataset is useful for getting to
differentiable programming software framework that
the minima in a less noisy and less random manner. The
may be used to tackle a wide range of problems. It's a
issue comes when the datasets become excessively
symbolic math library that's also used in machine
large. If the dataset has a million samples, a
learning applications like neural networks. Google's
conventional Gradient Descent optimization technique
second-generation system, TensorFlow, is utilised for
would take all one million samples to complete one
both research and production.
iteration while executing the Gradient Descent, and this
would have to be done for each iteration until the C. Keras
minima was reached. As a result, performing it becomes Keras is a human-centric API, not a machine-centric
computationally expensive. Stochastic Gradient Descent one. By providing uniform and straightforward APIs,

134 International Journal for Modern Trends in Science and Technology


decreasing the number of user activities necessary for to enforce the regulations against violators, to get the
typical use cases, and giving clear and actionable error best results from this system.
signals, Keras adheres to best practices for lowering Cla Epoc Train/t Optimi Train Trai Test Test
ssifi hs est zer loss n loss accu
cognitive load. Keras contains many implementations of
er accu racy
common neural-network building pieces like layers,
racy
objectives, activation functions, optimizers, and a slew Mo 20 90/10 ADAM 0.0090 0.99 0.00 1.00
of other tools to make working with neural networks bile 81 71 00

easier. net ADAG 0.2454 0.91 0.18 0.98


V2 RAD 48 11 55
D. Pytorch SGD 0.1549 0.95 0.02 0.98
02 16 55
PyTorch is an open-source machine learning framework
for computer vision and natural language processing
that is based on the Torch library. It was mostly
4. EXPERIMENTAL RESULT
produced by the Facebook AI Research team (FAIR).
By preserving a suitable proportion of distinct classes,
E. Applications
the dataset is partitioned into training and testing sets.
Airports:When travelling through airports, the There are a total of 1915 samples in the dataset, with
proposed method could be quite useful in identifying 80% of them being used in the training phase and 20%
those who aren't wearing masks. At the entry, traveller in the testing phase. The training and testing datasets
data can be collected as movies in the system. The contain 1532 and 383 images, respectively. The resulting
airport authorities are contacted if a passenger is architecture is trained for 100 epochs because longer
detected without a face mask, allowing them to respond training leads to overfitting on the training data.
quickly. Overfitting occurs when a model learns the undesired
Hospitals:To determine whether or not their employees patterns in the training data. As a result, training
are wearing masks, the proposed technique can be precision improves but test precision decreases.
utilised in conjunction with CCTV cameras. A health
practitioner who is not wearing a mask may be 5. CONCLUSION AND FUTURE WORK
reminded to do so.
Office:The method proposed could aid in the We used OpenCV, tensor flow, Keras, Pytorch, and
maintenance of safety standards and the prevention of Deep Learning to assess whether people were wearing
the spread of Covid-19 or any other airborne infection. face masks or not, as technology advances and more
A reminder message may be delivered to an employee options become available. The models were evaluated
who is not wearing a mask. The best performance must using images and real-time video feeds. The model's
be considered when selecting a system. As a result, the accuracy has been achieved, and model optimization is
aforementioned performance indicators can be a continuous process in which we fine-tune the hyper
considered while creating the optimum system for a parameters to generate a highly precise answer. This
large-scale implementation. model could be used to demonstrate how edge analytics
works. Furthermore, the suggested approach produces
F. Limitations
state-of-the-art results when employing a public face
The built system has problems distinguishing faces mask dataset. Face mask detection technology that can
covered by hands since it appears as if the person is detect whether someone is wearing a mask and allow
wearing a mask. In a crowded environment, them in would be highly valuable to society.
distinguishing each person's face is challenging. In this
situation, identifying people without a face mask would The current system is evaluated using a variety of
be extremely difficult using our proposed method. The classifiers. The best system, as well as an interface with
city will need a large number of CCTV cameras to alarm and alerting systems, may be built in the near
monitor the entire city, as well as dedicated employees future. This system could be combined with one that
uses social distance to create a healthy system that has a

135 International Journal for Modern Trends in Science and Technology


substantial impact on the transmission of disease. masks has been demonstrated to be the most effective
Masks are becoming the new normal, and a world approach to prevent the spread of airborne viruses like
without faces is on the horizon. Experts fear that this Corona, it poses a serious security concern to the
could pose a significant security risk." Luke McGee country since it may allow those who
(Luke McGee) (Luke McGee) Though wearing face
want to cover their faces for nefarious intentions to do Cognitive Engineering, pp. 603–613, Springer, Dhaka,
Bangladesh, December 2021.
so. Experts worry that as face recognition becomes a
[11] S. Ghosh, N. Das and M. Nasipuri, “Reshaping inputs for
more important part of catching criminals, the convolutional neural network: Some common and uncommon
widespread use of masks could stymie criminal methods”, Pattern Recognition, vol. 93, pp. 79-94, 2019.
investigations in the future. Available: 10.1016/[Link].2019.04.009
[12] R. Yamashita, M. Nishio, R. Do and K. Togashi, “Convolutional
neural networks: an overview and application in radiology”,
Conflict of interest statement
Insights into Imaging, vol. 9, no. 4, pp. 611-629, 2018. Available:
Authors declare that they do not have any conflict of
10.1007/s13244- 018-0639-9.
interest. [13] D. Meena and R. Sharan, “An approach to face detection and
recognition,” 2016 International Conference on Recent Advances
and Innovations in Engineering (ICRAIE), Jaipur, 2016, pp. 1-6,
REFERENCES
doi: 10.1109/ICRAIE.2016.7939462.
[1] P. A. Rota, M. S. Oberste, S. S. Monroe, W. A. Nix, R.
[14] S. Ge, J. Li, Q. Ye and Z. Luo, “Detecting Masked Faces in the
Campagnoli, J. P. Icenogle, S. Penaranda, B. Bankamp, K. Maher,
Wild with LLE-CNNs,” 2017 IEEE Conference on Computer
M.-[Link] al., “Characterization of a novel coronavirus
Vision and Pattern Recognition (CVPR), Honolulu, HI, 2017, pp.
associated with severe acute respiratory syndrom” science, vol.
426-434, doi: 10.1109/CVPR.2017.53.
300, no. 5624, pp. 1394–1399,2003
[15] S. Bouaafia, S. Messaoud, R. Khemiri, and F. E. Sayadi,
[2] Z. A. Memish, A. I. Zumla, R. F. Al-Hakeem, A. A. Al-Rabeeah,
“COVID-19 recognition based on deep transfer learning,” in
and G. M. Stephens, “Familycluster of middleeastrespiratory
Proceedings of the 2021 IEEE International Conference on Design
syndrome coronavirus infections,”New England Journal of
& Test of Integrated Micro & Nano-Systems (DTS), pp. 1–4, IEEE,
Medicine, vol. 368, no. 26, pp.2487–2494, 2013
Sfax, Tunisia, July 2021.
[3] M. Sandler, A. Howard, M. Zhu, A. Zhmoginov and L. Chen,
[16] A. Sedik, M. Hammad, F. E. Abd El-Samie, B. B. Gupta, and A. A.
"MobileNetV2: Inverted Residual sand Linear Bottlenecks," 2018
Abd El-Latif, “Efficient deep learning approach for augmented
IEEE/CVF Conference on Computer Vision and Pattern
detection of Coronavirus disease,” Neural Computing &
Recognition, Salt Lake City, UT, 2018, pp. 4510-4520, doi:
Applications, vol. 18, pp. 1–18, 2021.
10.1109/CVPR.2018.00474.
[17] S. Saponara, A. Elhanashi, and A. Gagliardi, “Implementing a
[4] Xin, M., Wang, Y. Research on image classification model based
real-time, AI-based, people detection and social distancing
on deep convolution neural network. J Image Video Proc. 2019,
measuring system for Covid-19,” Journal of Real-Time Image
40 (2019).
Processing, vol. 11, pp. 1–11, 2021.
[5] S. Sakshi, A.K. Gupta, S.S Yadav, U. Kumar; Face Mask Detection
[18] M. Coşkun, A. Uçar, O. Yildirim, and Y. Demir, “November).
System using CNN . 2021 International Conference on Advance
Face recognition based on convolutional neural network,” in
Computing and Innovative Technologies in Engineering
Proceedings of the 2017 International Conference on Modern
(ICACITE).
Electrical and Energy Systems (MEES), pp. 376–379, IEEE,
[6] A. Das; M.W. Ansari, R. Basak, Covid-19 Face Mask Detection
Kremenchuk, Ukraine, November 2017.
Using TensorFlow, Keras and OpenCV 2020 IEEE 17th India
[19] N. Abbassi, R. Helaly, M. A. Hajjaji, and A. Mtibaa, “A deep
Council International Conference (INDICON).
learning facial emotion classification system: a VGGNet-19 based
[7] M. Loey, G. Manogaran, M. H. N. Taha, and N. E. M. Khalifa, “A
approach,” in Proceedings of the 2020 20th International
hybrid deep transfer learning model with machine learning
Conference on Sciences and Techniques of Automatic Control
methods for face mask detection in the era of the COVID-19
and Computer Engineering (STA), pp. 271–276, IEEE, Monastir,
pandemic,” Measurement, vol. 167, Article ID 108288, 2021.
Tunisia, December 2020.
[8] B. Qin and D. Li, “Identifying facemask-wearing condition using
[20] S. Shissiqui, N.P. Singh, N. Singh, P. Mishra, N. Kesarwani, ,
image super-resolution with classification network to prevent
“Face Mask Detection System using ML” vol 8, issue 7,2021.
COVID-19,” Sensors, vol. 20, no. 18, p. 5236, 2020.
[9] X. Zhang, H. Saleh, E. M. Younis, R. Sahal, and A. A. Ali,
“Predicting coronavirus pandemic in real-time using machine
learning and big data streaming system,” Complexity, vol. 2020,
Article ID 6688912, 10 pages, 2020.
[10] S. K. Dey, A. Howlader, and C. Deb, “MobileNet mask: a
multi-phase face mask detection model to prevent
person-to-person transmission of SARS-CoV-2,” in Proceedings
of International Conference on Trends in Computational and

136 International Journal for Modern Trends in Science and Technology

View publication stats

You might also like