0% found this document useful (0 votes)
25 views

Face Mask Detection Report Sem7

Uploaded by

Harsh Pandita
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)
25 views

Face Mask Detection Report Sem7

Uploaded by

Harsh Pandita
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
You are on page 1/ 24

Face Mask Detection using CNN

Synopsis Report submitted in partial fulfillment


of the requirement for the degree of
B. E. (Computer Engineering)

Submitted By

Sarvesh Guda
Japleen Singh
Harsh Pandita

Under the Guidance of


Prof. Snehal Andhare
Department of Computer Engineering

(An Autonomous Institute Affiliated to University of Mumbai)

Vidyalankar Institute of Technology


Wadala(E), Mumbai 400 037

University of Mumbai

2022-23

1
CERTIFICATE OF APPROVAL
For
Project Synopsis

This is to Certify that

Sarvesh Guda
Japleen Singh
Harsh Pandita

Have successfully carried out Project Synopsis work entitled

Face Mask Detection using CNN


in partial fulfillment of degree course in
Computer Engineering
As laid down by University of Mumbai during the academic year
2022-23

Under the Guidance of


Prof. Snehal Andhare

Signature of Guide Head of Department

Examiner 1 Examiner 2

Principal

2
Declaration

We declare that this written submission represents our ideas in our own
words and where others' ideas or words have been included, we have adequately
cited and referenced the original sources. We also declare that we have adhered to
all principles of academic honesty and integrity and have not misrepresented or
fabricated or falsified any idea/data/fact/source in our submission. We understand
that any violation of the above will be cause for disciplinary action by the Institute
and can also evoke penal action from the sources which have thus not been
properly cited or from whom proper permission has not been taken when needed.

Name of student Roll No. Signature

1. Sarvesh Guda 19102A0007

2. Japleen Singh 19102A0002

3. Harsh Pandita 19102A0040

Date:

3
Acknowledgements

This Project wouldn’t have been possible without the support, assistance, and
guidance of a number of people whom we would like to express our gratitude to.
First, we would like to convey our gratitude and regards to our mentor Prof. Snehal
Andhare for guiding us with her constructive and valuable feedback and for her time
and efforts. It was a great privilege to work and study under her guidance.

We would like to extend our heartfelt thanks to our Head of Department, Dr.
Sachin Bojewar for overseeing this initiative which will in turn provide every
Vidyalankar student a distinctive competitive edge over others.

We appreciate everyone who spared time from their busy schedules and
participated in the survey. Lastly, we are extremely grateful to all those who have
contributed and shared their useful insights throughout the entire process and
helped us acquire the right direction during this research project.

4
Abstract

Global pandemic COVID-19 circumstances emerged in an epidemic of dangerous


disease in all over the world. Wearing a face mask will help prevent the spread of infection
and prevent the individual from contracting any airborne infectious germs. Using Face Mask
Detection System, one can monitor if the people are wearing masks or not.
Here HAAR-CASACADE algorithm is used for image detection. Collating with other
existing algorithms, this classifier produces a high recognition rate even with varying
expressions, efficient feature selection and low assortment of false positive features. HAAR
feature-based cascade classifier system utilizes only 200 features out of 6000 features to
yield a recognition rate of 85-95%.
According to this motivation we demand mask detection as a unique and public
health service system during the global pandemic COVID-19 epidemic. The model is trained
by face mask image and non-face mask image.
Therefore it is essential to develop a system that detects those citizens who wear a
face mask and who do not.
We develop this system using Deep Learning Techniques and built a CNN model to
detect people wearing masks using live web cameras input. Face masks are part of an
infection control strategy to eliminate cross contamination.
Keywords: COVID-19 epidemic, HAAR-CASACADE algorithm, mask detection,
face mask image, non-face mask image

5
Table of Contents

Sr No Description Page No

1 Introduction 7

2 Aim & Objective 8

3 Literature Survey 9-10

4 Problem Statement 11

5 Proposed System 12

6 Methodology 13-17

7 Design 18-20

8 Hardware and Software Requirement 21

9 Results 22

10 Conclusion 23

11 References 24

6
Introduction

The world has not yet fully recover from this pandemic and the vaccine that can
effectively treat Covid-19 is yet to be discovered. However, to reduce the impact of
the pandemic on the country's economy, several governments have allowed a limited
number of economic activities to be resumed once the number of new cases of
Covid19 has dropped below a certain level. As these countries cautiously restarting
their economic activities, concerns have emerged regarding workplace safety in the
new post-Covid-19 environment.
To reduce the possibility of infection, it is advised that people should wear masks and
maintain a distance of at least 1 meter from each other. Deep learning has gained
more attention in object detection and was used for human detection purposes and
develop a face mask detection tool that can detect whether the individual is wearing
mask or not. This can be done by evaluation of the classification results by analyzing
real-time streaming from the Camera. In deep learning projects, we need a training
data set. It is the actual dataset used to train the model for performing various actions.

7
Aim & Objective

• The main purpose of this system is to collect with mask and without mask datasets
from online resources in order to create a face mask identification model using CNN
deep learning classifier. Face mask recognition from a live web cam is possible with
this face mask detector.

8
Literature Survey

An Automated System to Limit COVID-19 Using Facial Mask Detection in Smart City
Network: COVID-19 pandemic caused by novel coronavirus is continuously spreading until
now all over the world. The impact of COVID-19 has been fallen on almost all sectors of
development. The healthcare system is going through a crisis. Many precautionary measures
have been taken to reduce the spread of this disease where wearing a mask is one of them. In
this paper, we propose a system that restrict the growth of COVID-19 by finding out people
who are not wearing any facial mask in a smart city network where all the public places are
monitored with Closed-Circuit Television (CCTV) cameras. While a person without a mask
is detected, the corresponding authority is informed through the city network. A deep
learning architecture is trained on a dataset that consists of images of people with and
without masks collected from various sources. The trained architecture achieved 98.7%
accuracy on distinguishing people with and without a facial mask for previously unseen test
data. It is hoped that our study would be a useful tool to reduce the spread of this
communicable disease for many countries in the world.

Masked Face Recognition Using Convolutional Neural Network: Recognition from faces
is a popular and significant technology in recent years. Face alterations and the presence of
different masks make it too much challenging. In the real-world, when a person is
uncooperative with the systems such as in video surveillance then masking is further
common scenarios. For these masks, current face recognition performance degrades. An
abundant number of researches work has been performed for recognizing faces under
different conditions like changing pose or illumination, degraded images, etc. Still,
difficulties created by masks are usually disregarded. The primary concern to this work is
about facial masks, and especially to enhance the recognition accuracy of different masked
faces. A feasible approach has been proposed that consists of first detecting the facial
regions. The occluded face detection problem has been approached using Multi-Task

9
Cascaded Convolutional Neural Network (MTCNN). Then facial features extraction is
performed using the Google Face Net embedding model.

EXISTING SYSTEM: face detection problem has been approached using Multi-Task
Cascaded Convolutional Neural Network (MTCNN). Then facial features extraction is
performed using the Google Face Net embedding model. 1.This system is capable to train the
dataset of both persons wearing masks and without wearing masks. After training the model
the system can predicting whether the person is wearing the mask or not wearing mask.

10
Problem statement

• The main objective of the face detection model is to detect the face of individuals and
conclude whether they are wearing masks or not at that particular moment when they
are captured in the image.

11
Proposed System

1. This system is capable to train the dataset of both persons wearing masks and without
wearing masks.
2. After training the model the system can predict whether the person is wearing the mask or
not.
3. It also can access the webcam and predict the result.

12
Methodology

OPENCV:
1. It is a cross-platform library using which we can develop real-time computer vision
applications.
2. It mainly focuses on image processing, video capture and analysis including feature like
face detection and object detection.
3. Currently Open CV supports a wide variety of programming languages like C++, python,
java etc. and is available on different platforms including Windows, Linux, OS X, Android,
iOS etc.
KERAS:
It is an API designed for human beings, not machines. Keras follows best practices for
reducing cognitive load: it offers consistent & simple APIs, it minimizes the number of user
actions required for common use cases, and it provides clear & actionable error messages.
It also has extensive documentation and developer guides. Keras contains numerous
implementations of commonly used neural network building blocks such as layers,
objectives, activation functions, optimizers, and a host of tools to make working with image
and text data easier to simplify the coding necessary for writing deep neural network code
It was developed to make implementing deep learning models as fast and easy as possible for
research and development.
FOUR PRINCIPLES:
 Modularity: A model can be understood as a sequence or a graph alone. All the concerns of
a deep learning model are discrete components that can be combined in arbitrary ways.
 Minimalism: The library provides just enough to achieve an outcome, no frills and
maximizing readability.
 Extensibility: New components are intentionally easy to add and use within the framework,
intended for researchers to trial and explore new ideas.
 Python: No separate model files with custom file formats. Everything is native Python.
Keras is designed for minimalism and modularity allowing you to very quickly define deep
learning models and run them on top of a Theano or TensorFlow backend
13
Machine Learning approaches:
1. Viola–Jones object detection framework based on HAAR Features: The Viola-Jones
algorithm is one of the most popular algorithms for objects recognition in an image. This
research paper deals with the possibilities of parametric optimization of the Viola-Jones
algorithm to achieve maximum efficiency of the algorithm in specific environmental
conditions
2. Scale-invariant feature transform (SIFT): The scale-invariant feature transform (SIFT)
is a feature detection algorithm in computer vision to detect and describe local features in
images. SIFT key points of objects are first extracted from a set of reference images and
stored in a database.
3. Histogram of oriented gradients (HOG) features: The histogram of oriented gradients
(HOG) is a feature descriptor used in computer vision and image processing for the purpose
of object-detection.
An algorithm is involved in this proposed system HAAR Feature-Based Cascade Classifiers

HAAR Feature-Based Cascade Classifiers


It is an Object Detection Algorithm used to identify faces in an image or a real time video.
Dense grid of uniformly spaced cells and uses overlapping local contrast normalization for
improved accuracy. It is an effective way for object detection. In this approach, lot of
positive and negative images are used to train the classifier. In this, a model is pre-trained
with frontal features is developed and used in this experiment to detect the faces in real-time.

DEEP LEARNING:
1. Deep learning is an AI function that mimics the workings of the human brain in
processing data for use in detecting objects, recognizing speech, translating languages, and
making decisions.
2. Deep learning AI is able to learn without human supervision, drawing from data that is
both unstructured and unlabeled.

14
3. In this, face mask detection is built using Deep Learning technique called as Convolution
Neural Networks (CNN).
Convolution Neural Network:
A convolution neural network is a special architecture of artificial neural network proposed
by yann lecun in 1988. One of the most popular uses of the architecture is image
classification. CNNs have wide applications in image and video recognition, recommender
systems and natural language processing. In this article, the example that this project will
take is related to Computer Vision. However, the basic concept remains the same and can be
applied to any other use-case!
CNN MODEL
1. This CNN model is built using the Keras framework and the OpenCv library which is
highly used for real-time applications.
2. This model can also be used to develop a full-fledged software to scan every person
before they can enter the public gathering.
LAYERS IN CNN MODEL:
Conv2D
MaxPooling2D
Flatten ()
Dropout
Dense
1. Conv2D Layer: It has 100 filters and the activation function used is the ‘ReLu’. The ReLu
function stands for Rectified Linear Unit which will output the input directly if it is positive
otherwise it will output zero.
2. MaxPooling2D: It is used with pool size or filter size of 2*2.
3. Flatten () Layer: It is used to flatten all the layers into a single 1D layer.
4. Dropout Layer: It is used to prevent the model from overfitting.
5. Dense Layer: The activation function here is soft max which will output a vector with two
probability distribution values.

15
SYSTEM ARCHITECTURE:

Data Visualization In the first step, let us visualize the total number of images in our dataset
in both categories. We can see that there are 690 images in the ‘yes’ class and 686 images in
the ‘no’ class.
Data Augmentation: In the next step, we augment our dataset to include more number of
images for our training. In this step of data augmentation, we rotate and flip each of the
images in our dataset.
16
Splitting the data: In this step, we split our data into the training set which will contain the
images on which the CNN model will be trained and the test set with the images on which
our model will be tested.
Building the Model: In the next step, we build our Sequential CNN model with various
layers such as Conv2D, MaxPooling2D, Flatten, Dropout and Dense
Pre-Training the CNN model: After building our model, let us create the ‘train_generator’
and ‘validation_generator’ to fit them to our model in the next step.
Training the CNN model: This step is the main step where we fit our images in the training
set and the test set to our Sequential model we built using keras library. I have trained the
model for 30 epochs (iterations). However, we can train for more number of epochs to attain
higher accuracy lest there occurs over-fitting.
Labeling the Information: After building the model, we label two probabilities for our
results. [‘0’ as ‘without_ ask’ and ‘1’ as ‘with_ mask’]. I am also setting the boundary
rectangle color using the RGB values
Importing the Face detection Program: After this, we intend to use it to detect if we are
wearing a face mask using our PC’s webcam. For this, first, we need to implement face
detection. In this, I am using the Haar Feature-based Cascade Classifiers for detecting the
features of the face.
Detecting the Faces with and without Masks: In the last step, we use the OpenCV library
to run an infinite loop to use our web camera in which we detect the face using the Cascade
Classifier.

17
DESIGNS

UML Diagrams:
A UML diagram is a partial graphical representation (view) of a model of a system under
design, implementation, or already in existence. UML diagram contains graphical elements
(symbols) - UML nodes connected with edges (also known as paths or flows) - that represent
elements in the UML model of the designed system. The UML model of the system might
also contain other documentation such as use cases written as templated texts.
The kind of the diagram is defined by the primary graphical symbols shown on the diagram.
For example, a diagram where the primary symbols in the contents area are classes is class
diagram. A diagram which shows use cases and actors is use case diagram. A sequence
diagram shows sequence of message exchanges between lifelines.
Use Case Diagram: In the Unified Modelling Language (UML), a use case diagram can
summarize the details of your system's users (also known as actors) and their interactions
with the system.

18
Sequence Diagram: A sequence diagram is a type of interaction diagram because it
describes how and in what order a group of objects works together.

Data flow diagram: A Data Flow Diagram (DFD) is a traditional visual representation of
the information flows within a system.

19
Flow chart:

20
Hardware and Software Requirement

Hardware Requirements:

• RAM: 4 GB
• Storage: 500 GB
• CPU: 2 GHz or faster
• Architecture: 32-bit or 64-bit

Software Requirements:

• Python 3.9.12 in Jupyter Notebook is used for data pre-processing, model training and
prediction.
• Operating System: windows 7 and above or Linux based OS or MAC OS
• Coding Language: Python.

21
Results

22
Conclusion

As the technology are blooming with emerging trends the availability so we have
novel face mask detector which can possibly contribute to public healthcare. We used
OpenCV, Keras, and NN to detect whether people were wearing face masks or not. The
models were tested with images and real-time video streams. The accuracy of the model is
achieved and, the optimization of the model is a continuous process and we are building a
highly accurate solution by tuning the hyper parameters. This specific model could be used
as a use case for edge analytics. Furthermore, the proposed method achieves state-of-the-art
results on a public face mask dataset. By the development of face mask-detection we can
detect if the person is wearing a face mask and allow their entry would be of great help to the
society

23
References

[1]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), 2019, pp. 1-6, doi: 10.1109/STI47673.2019.9068044.
[2] 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)
[3] M. M. Rahman, M. M. H. Manik, M. M. Islam, S. Mahmud and 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), 2020
[4] Y. Sun, Y. Chen, X. Wang, and X. Tang, “Deep learning face representation by joint
identification-verification,” in Advances in neural information processing systems, 2014, pp.
198hy, A. Khosla, M. Bernstein, A. C. Berg, and L. Fei-Fei, “ImageNet Large Scale Visual
Recognition Challenge,” 2014.
[5] F. S. Samaria and A. C. Harter, “Parameterisation of a stochastic model for human face
identification,” in Applications of Computer Vision, 1994., Proceedings of the Second IEEE
Workshop on, pp. 138–142, IEEE, 1994.
[6] D. Yi, Z. Lei, S. Liao, and S. Z. Li, “Learning face representation from scratch,” CoRR
abs/1411.7923, 2014.
[7] X. Cao, D. Wipf, F. Wen, G. Duan, and J. Sun, “A practical transfer learning algorithm
for face verification,” in Computer Vision (ICCV), 2013 IEEE International Conference on,
pp. 3208–3215, IE8–1996.
[8] W. Zhao, R. Chellappa, P. J. Phillips, and A. Rosenfeld, “Face recognition: A literature
survey,” ACM computing surveys (CSUR), vol. 35, no. 4, pp. 399–458, 2003. [3] O.
Russakovsky, J. Deng, H. Su, J. Krause, S. Satheesh, S. Ma, Z. Huang, A. KarpatEE, 2013.

24

You might also like