0% found this document useful (0 votes)
12 views66 pages

Final Report - FMDSAZ2

The project report focuses on developing a face mask detection and door automation system using deep learning techniques, specifically TensorFlow, Keras, and OpenCV, to enhance safety measures during the COVID-19 pandemic. The system aims to detect whether individuals are wearing masks in real-time and can be deployed in various public settings to ensure compliance with health guidelines. The report outlines the project's purpose, scope, and the methodologies used, emphasizing the importance of face mask detection in controlling virus transmission.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views66 pages

Final Report - FMDSAZ2

The project report focuses on developing a face mask detection and door automation system using deep learning techniques, specifically TensorFlow, Keras, and OpenCV, to enhance safety measures during the COVID-19 pandemic. The system aims to detect whether individuals are wearing masks in real-time and can be deployed in various public settings to ensure compliance with health guidelines. The report outlines the project's purpose, scope, and the methodologies used, emphasizing the importance of face mask detection in controlling virus transmission.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 66

FINAL PROJECT REPORT

FACE MASK DETECTION AND DOOR


AUTOMATION

Project Supervisor
MR. ZULKIFL HASAN

Submitted By

GROUP ID: FMDSAZ2


ADNAN RASUL HASHMI 1321730209
SULEMAN BHATTI 1321730156

Research and Development Section,


Department of Computer Science,
NCBA&E Lahore.

1|Page
CERTIFICATE

2|Page
EXORDIUM

In the name of Allah,


The Compassionate,
The Merciful.
Praise be to Allah,
Lord of Creation,
The Compassionate,
The Merciful,
King of Judgment-day!
You alone we worship,
And to you alone we pray for help,
Guide us to the straight path
The path of those who you have favored,
Not of those who have incurred your
wrath,
Nor of those who have gone astray.

3|Page
DEDICATION
I dedicate my dissertation work to my family
and many friends. A special feeling of
gratitude to my loving parents, whose words
of encouragement and push for tenacity ring
in my ears. I also dedicate this dissertation to
my many Friends and family who have
supported me throughout the process. I will
always appreciate all they have done,
especially Sarmad Hussain for helping me
develop my technology skills, Adnan Rasul
Hashmi for the many hours of proofreading
and helping me to master the leader dots. I
dedicate this work and give special thanks to
my supervisor MR. ZULKIFL HASAN for being
there for me. We hereby declared that this
project report entitled “FACE MASK
DETECTION AND DOOR AUTOMATION”
submitted to the Campus is a record of
original work done by us under the guidance
of Supervisor Prof. Zulkifl Hasan. Also, this
project work is submitted in the partial
4|Page
fulfillment of the requirements for the degree
of Bachelor of Computer Science.

5|Page
ACKNOWLEDGEMENT
In the Name of Allah, the Most Merciful, the
Most Compassionate all praise be to Allah, the
Lord of the worlds; and prayers and peace be
upon Mohammed (May Allah bless and grant
him), His servant and messenger. I would like
to express my deepest appreciation to all
those who provided me the possibility to
complete this report. A special gratitude I
give to our final year project manager, [MR.
ZULKIFL HASAN], whose contribution in
stimulating suggestions and encouragement,
helped me to coordinate my project especially
in writing this report. A special thanks goes to
my teammate, [Suleman Bhatti], who help me
to assemble the parts and gave suggestion
about the task “FACE MASK DETECTION
AND DOOR AUTOMATION”. Finally, many
thanks go to the head of the project, [MR.
ZULKIFL HASAN] whose have invested his full
effort in guiding the team in achieving the
goal. I must appreciate the guidance given by
6|Page
other supervisor as well as the panels
especially in our project presentation that has
improved our presentation skills thanks to
their comment and advices.

7|Page
ACCEPTENCE CERTIFICATE

8|Page
TABLE OF CONTENTS

CHAPTER NO 1:
GATHERING & ANALYZING INFO
1.1 INTRODUCTION 11
1.2 PURPOSE 13
1.3 SCOPE 14
1.4 SUPPLEMENTARY REQUIREMENTS 15
1.4. USABILITY 15
1
1.4. RELIABILITY 15
2
1.4. SUPPORTABILITY 15
3
1.4. SYSTEM REQUIREMENTS 16
4
CHAPTER NO 2:
PLANNING THE PROJECT
2.1 INTRODUCTION 18
2.2 FUNCTIONAL AND NON FUNCTIONAL 20
REQUIREMENTS
2.3 USE CASE DIAGRAMS 27
2.4 USAGE SCENARIO 30
2.5 METHODOLOGY 34
2.6 WORK PLAN 36
2.7 PROJECT STRUCTURE 37
2.8 PROJECT SCHEDULING 38

9|Page
CHAPTER NO 3:
DESIGNING THE PROJECT
3.1 INTRODUCTION 40
3.2 ERD DIAGRAM 42
3.3 CONTEXT DIAGRAM 43
3.4 DATA FLOW DIAGRAM 44
3.5 ACTIVITY DIAGRAM 45
3.6 ARCHITECTURAL DIAGRAM 46
3.7 SEQUENCE DIAGRAM 47
3.8 DATABASE MODEL DIAGRAM 48
3.9 CLASS DIAGRAM 49
CHAPTER NO 4:
DEVELOPMENT
4.1 INTRODUCTION 51
4.2 GRAPHICAL USER INTERFACES………(Minimum 52
10)
4.2 TEST CASES 57
4.4 CONCLUSION 61

10 | P a g e
CHAPTER 1
GATHERING & ANALYZING INFO

11 | P a g e
1.1 Introduction:
As of January 20, 2021, the uncontrollable coronavirus
disease 2019 (COVID-19) had spread to 213 countries and
territories around the world, as well as two international
conveyances, resulting in 96.1 million confirmed cases and
2.06 million deaths worldwide. The population's vulnerability
was compounded by the lack of dynamic medicinal specialists
and a lack of resistance to COVID19. This has been declared a
pandemic by the World Health Organization.
As a result, the Centers for Disease Control and
Prevention (CDC) advised all people aged 2 and up to wear a
mask in public places, particularly when other social distancing
measures are difficult to maintain. As a result, reducing the risk
of transmission of this deadly virus from an infected person to a
healthy person can greatly reduce the spread of the virus and
the severity of the disease.
Face detection is a key link of subsequent face-related
applications, such as face recognition, facial expression
recognition, and face hallucination, because its effect directly
affects the subsequent applications performance. Therefore,
face detection has become a research hotspot in the field of
pattern recognition and computer vision and has been widely
studied in the past two decades.
So the significant progress in the fields of image
processing and computer vision has been made in the
detection of face masks. Several algorithms and techniques
have been used to create a variety of face detection models. To
detect face masks, the proposed method in this paper uses
deep learning, TensorFlow, Keras, and OpenCV. This model can
be used for safety purposes since it is very resource efficient to
deploy.

12 | P a g e
1.2 Purpose:
In our specific final year project, the focus is to allow a
user to gather client statistics to make informed decisions,
increase the quality of their wearing mask, and improve
services. This is done making use of face recognition and face
mask recognition classification algorithms applied over client’s
images and visuals, which allows for such statistics to be
generated. With this in mind, this research has the intent of
creating a system which can efficiently detect and categorize
people in images, identifying and being able to predict in which
one that person falls in.
This can be achieved using neural networks, provided
that these are able to produce high confidence predictions, i.e.,
relevant and trustworthy. Therefore, this project falls under the
area of artificial intelligence (AI) since it uses Deep Learning
models in order to extract information from images and make
accurate predictions using those. The proposed system works
with the client’s images as input, using those to make the face
mask recognition classifications and to, therefore, deliver that
information to the users.
Face detection as one of the important research
directions of computer vision has been extensively studied in
recent years. From the development process of face detection,
we can simply classify previous work as handcraft feature
based and neural networks based methods.
Face masks help reduce the transmission of SARS-CoV-2
by interfering with the spread of virus-laden droplets ejected
from the nose and mouth. Wearing face mask is one of the
precautionary steps an individual can take in order to lessen
the spread of COVID-19. In this simple project, a video camera
detects if an individual is wearing a face mask or not in real-
time.
13 | P a g e
1.3 Scope:
The scope of this project is to develop a face mask
detection & its application based on Face detection to facilitate
the people in terms of sop’s, time saving, surveillance and
many more. The trained model is used to detect whether the
person is wearing mask or not with the help of webcam or live
video stream. In this way a lot of time and effort can be saved.
The frame around the face is displayed in green if the person is
wearing mask or in red if no mask is detected. Also, the frame
around the face gives the probability of the mask portion
detected. If the person is not wearing mask it gives out an
alarm signal and also a notification to the user.
It is used because it’ll achieve high mask detection
accuracy and can efficiently reduce spread of covid-19 and
making the classification easier. The scope is to extract the
human face with masks and will extract the desire image, for
this system it will extract human faces and also by face
recognition library in some of the applications.
Today, companies are pitching face mask detection
software as the future of everything from pandemic to sop’s.
This project can be used in any working setting that requires
covid-19 SOP’s, such as a public area, a station, a corporate
setting, streets, shopping malls, hospitals, airports and
examination centers. This method can be applied to smart city
innovation, which would aid many underdeveloped countries in
their fight with covid-19 pandemic. Our assessment of the
current situation allows us to better prepare for the next crisis
or examine the impact of large-scale societal change brought
on by covid-19.
Some other benefits of this project is are It can also be
used in educational institutes to ensure SOP’s. This system can
be deployed at various government offices and corporates. For
entrance control verification it can also be installed in banks. To
14 | P a g e
make sure people follow SOP’s. Automatic detection of people
who are not wearing face masks.
1.4 Supplementary Requirements:
1.4.1 Usability:
Our system should be more users friendly. The user
interface should be kept simple. Since the different type of
people will interact with this process so our project should be
very easy to them to understand.
1.4.2 Reliability:
Further work has considered reliability in ML, e.g., looking
at the reliability of individual ML predictions, focusing on
reliability estimation. In most cases, one can find work applying
ML techniques for prediction of the NFR, e.g., to predict
maintainability, but not work considering the NFR as it applies
to ML. Similarly, efforts like the AIRE workshop series focuses
on applying AI to RE, and typically not the other direction. From
a broader perspective, there are efforts to apply SE techniques
to the application of ML, with a focus on reliability, testing and
evolution. As far as we are aware, there is no unified collection
or consideration of many NFRs for ML, including a consideration
of ML-specific quality trade-off data. Current work consists of
only individual considerations of specific quality trade-offs, e.g.,
privacy vs. processing time. Similarly, we are not aware of
approaches for explicitly monitoring ML implementations at
runtime, or considerations of what exactly runtime monitoring
may mean in this context.
1.4.3 Supportability
System interface is divided into two parts frontend and
backend, frontend depend on HTML, CSS, Bootstrap, jQuery and
backend depend on Django (python web framework), SQLite.
There is already a user registered at deployment time. He can
only add new users and remove any user and authenticated

15 | P a g e
users are only allow to use the uses service. For deploying the
web app, we need a VPS having Ubuntu as OS, python 3.7,
Django 2.2.7, Ifc open shell to read the Meta of Ifc file and other
libraries.
1.4.4 System requirements
The system will be available for all devices having
internet facility and web browser. Our proposed solution will
provide an online web platform which will make the things
easier as there is no device compatibility problem. It only needs
the device which supports the Web Browsers. A Web Browser is
also considered as a generic platform these days.

16 | P a g e
CHAPTER 2
PLANNING THE PROJECT

17 | P a g e
2.1 Introduction:
Covid-19 has had a major impact on the world in 2019-
2020. Wearing masks in public places is one of the most
common ways for people to protect themselves. In addition,
several public service providers require clients to utilize the
service only if they correctly wear masks. Many public service
providers also require clients to use the service only if they
wear masks. As a result, face mask detection has become a
critical computer vision problem for assisting the global
civilization, yet research on the topic is scarce.
Face mask detection refers to determining whether a
person is wearing a mask and where their face is located. The
challenge is closely related to general object detection, which
detects item classes, and face detection, which detects a
specific object class, namely faces. Face mask detection
systems are part of face image processing applications, and
their prominence as a research topic has risen dramatically in
recent years as a result of the emergence of covid-19.
These technologies can be used to prevent the
transmission of Covid-19, and verify that someone is wearing a
mask. In real- world applications, a face mask detection system
is an image-processing challenge with complicated effects of
light, occlusion, and picture condition on live images. It is a
mixture of facial detection and mask recognition algorithms
used in picture analysis.
The project "face mask detection & its application using
machine learning" is likewise based on a growing trend in our
society, and it employs webcam/video or pictorial input to
detect masked people in a given input. Our security agencies
can utilize the system to control the spread of covid-19 by
automating the entry process with a camera. During the
implementation of the project, many image processing
18 | P a g e
measures will be used, such as image capturing, pre-
processing, database comparison, and so on. On a successful
match, a message is given to the door sensor regarding the
acquired information. The main goal of this project is to
recognize a face mask in a given input through any of the
visual techniques, obtain the person's face mask information,
and send it to the door sensors.
Face mask detection application is used to locate faces
on a given image. A recognition method is used to categorize
images with well-defined structural features, which are typical
in most computer vision applications. Face mask detection is a
type of object detection that may be used in a variety of places,
including security, medical centers, shopping malls, public
areas, and wedding halls, and some others. With a little work,
we can broaden its scope and use it in a variety of ways.
The significant progress in the fields of image processing
and computer vision has been made in the detection of face
masks. Several algorithms and techniques have been used to
create a variety of face detection models. To detect face
masks, the proposed method in this paper uses deep learning,
TensorFlow, Keras, and OpenCV.
This model can be used for safety purposes since it is
very resource efficient to deploy. The main objective of this
project is to detect and locate a medical face mask in a
video/image. In this project, the medical masked face is the
main focus of research to reduce the spreading and
transmission of Coronavirus especially COVID-19.

19 | P a g e
2.2 Functional and Non Functional Requirements:
2.2.1 Functional Requirements:
The primary goal of functional requirements in a
requirement specification document is to define all of the
system's activities or processes. These are derived by the
system's interactions with its users. The general Functional
Requirements that emerged from the Users' interaction are
listed below.
2.2.1.1 Feature Extraction using CNN:
Traditional machine learning approach uses feature
extraction for images using Global feature descriptors
such as Local Binary Patterns (LBP), Histogram of
Oriented Gradients (HoG), Color Histograms etc. or Local
descriptors such as SIFT, SURF, ORB etc. These are hand-
crafted features that requires domain level expertise.
But here comes Convolutional Neural Networks
(CNN). Instead of using hand-crafted features, Deep
Neural Nets automatically learns these features from
images in a hierarchical fashion. Lower layers learn low-
level features such as Corners, Edges whereas middle
layers learn color, shape etc. and higher layers learn
high-level features representing the object in the image.
Instead of making a CNN as a model to classify
images, we can use it as a Feature Extractor by taking
the activations available before the last fully connected
layer of the network (i.e. before the final softmax
classifier). These activations will be acting as the feature
vector for a machine learning model (classifier) which
further learns to classify it. This type of approach is well
suited for Image Classification problems, where instead of
training a CNN from scratch (which is time-consuming

20 | P a g e
and tedious), a pre-trained CNN could be used as a
Feature Extractor that is known as Transfer Learning.
2.2.1.2 Transfer Learning Algorithm
Transfer learning is a machine learning method
where a model developed for a task is reused as the
starting point for a model on a second task. It is the idea
of overcoming the isolated learning paradigm and
utilizing the knowledge acquired for one task to solve
related ones.
Traditional learning is isolated and occurs purely
based on specific tasks, datasets and training separate
isolated models on them. No knowledge is retained which
can be transferred from one model to another. In transfer
learning, you can leverage knowledge (features, weights
etc.) from previously trained models for training newer
models and even tackle problems like having less data
for the newer task!
Learning is not an easy process, not for humans
and not for machines either. It is a heavy-duty, resource-
consuming and time-consuming process and hence it was
important to devise a method that would prevent a model
from forgetting the learning curve that it attained from a
specific dataset and also lets it learn more from new and
different datasets.
Transfer learning is simply the process of using a
pre-trained model that has been trained on a dataset for
training and predicting on a new given dataset. “A pre-
trained model is a saved network that was previously
trained on a large dataset, typically on a large-scale
image-classification task such as the ImageNet.”

21 | P a g e
For algorithm development, I will use the following
python libraries:
 Tensorflow – a free and open-source software library
for machine learning.
 Keras – an open-source software library that provides
a Python interface for artificial neural networks.
 Imutils – to make basic image processing functions.
 Sklearn – is a free software machine learning library
for the Python programming language.
 Opencv – a library of programming functions mainly
aimed at real-time computer vision.
 OS – module in Python provides functions for
interacting with the operating system.
 Numpy – adding support for large, multi-dimensional
arrays and matrices.
 Matplotlib – a plotting library for the Python
programming language and its numerical mathematics
extension NumPy.
2.2.1.3 Some Other Functionalities:
 System will be able to detect masks on the faces.
 The system must have an unbiased ‘with mask’
dataset.
 The dataset must have over 1500+ images in both
‘with mask’ and ‘without mask’ classes.
 The dataset must not re-use the same images in
training and testing phases.
 The system must be correctly able to load the face
mask classifier model.
 The system must be able to detect faces in images or
video stream.
 The system must be able to extract each face’s Region
of Interest (ROI).

22 | P a g e
 There must not be any object between the system and
the face of the user for a successful face detection and
hence the face mask detection.
 The end position of the face must be fit inside the
webcam frame and must be closer to the camera.
 Correctly able to detect masks in ‘png’, ‘jpg’, ‘jpeg’,
and ‘gif’ format images.
 The system must be able to detect face masks on
human faces on every frame in a live video.
 The results must be viewed by showing the probability
along with the output of ‘Mask’ or ‘No Mask’.
 The must have a sensor to detect output of the
system.
 The automatic door placed in this project opens
automatically for authentic users (with face mask).
 The software system is interoperable across different
systems.
 Accuracy defines a data entered into the system is
correctly calculated and used by the system and that
the output is correct.
 Compliance functional requirements validate that the
developed system is compliant to Industrial standards.
In the ADAS surround view system, “rear camera
view should be displayed within 1 second of starting
when a person appears with or without face mask”.
 In the case of performance, we test system throughput
in normal load/stress conditions.
 Maintainability is often measured at code level using
Cyclomatic complexity. Cyclomatic complexity says
that the lesser complex the code is, the easier it is to
maintain the software.
 This quality attribute emphasizes the availability of a
system under certain conditions.
23 | P a g e
 Serviceability of a software system is the ability of a
service/technical expert to install the software system
in a real-time environment, monitor the system while
it is running, identify any technical issues in the
system and provide a solution to resolve the issue.
 A software system to adapt to change in an
environment without any change in its behavior.

24 | P a g e
2.2.2 Non-functional Requirements:
Non-functional requirements are a set of specifications
with specific criteria for evaluating the system's performance.
They encompass everything from simplicity of use to security,
availability, operating speed, and implementation issues. More
specifically, in this project, it will:
2.2.2.1 Security:
Since the system will activate as the car is started,
the driver will have no power over it except to switch off
the alarm.
2.2.2.2 Extensibility:
In future versions, new modules such as haptic
feedback may be added.
2.2.2.3 Usability:
It is simple to understand the system and efficient
to use.
2.2.2.4 Reliability:
The system we implement will be reliable in terms
of data accuracy and time accuracy.
2.2.2.5 Other Non-Functional Requirements:
 The user will find very convenient to take pictorial
input using webcam/video.
 The system must be easy to use and efficient.
 The system must be fast, reliable and help to save
time and over-crowding.
 System output must be intuitive and simple in the way
it displays to the user.
 The face should be localized by detecting the facial
landmarks and the background must be ignored.
 The system will be implemented in Python script with
an accuracy of the model of over 90%.

25 | P a g e
 The user must not move his/her face out of camera’s
sight in order to get correct results.
 The background must not be too bright or too dark
while detecting the face mask.
 The system must be portable and can be applied to
embedded devices with limited computational
capacity (ex., Raspberry Pi, Google Coral, NVIDIA
Jetson Nano, etc.).
 The output response operation must be fast and under
5 seconds per person.
 The system must be able to correctly detect more
than one face if present, and hence the presence of
mask in the frame.
 The system should be easy for usability and self-
descriptive for maintenance purposes.
 The system must be platform independent and flexible
for updates.
 It completes the SW system by helping the functional
requirements stick together, like a muscle.
 Time to log in (performance), how many times user
can log in and out.
 Look and feel of the profile output (usability), output
must be clear and should have an alert alarm for
without mask.
 Number of users who can go through at a time, one at
a time through “walk through door” (capacity,
performance).
 The door will reject to open and sound a beep alarm,
to tell that the user is not authorized (without face
mask).
 When the user passes like an input, the following
questions can be answered by NFRs:

26 | P a g e
2.3 Use Case Diagrams:

27 | P a g e
28 | P a g e
29 | P a g e
2.4 Usage Scenario:

Use Case Phase#1


Title
Use Case Id Training

Requirement 1
Id
Description: This use case is about training of face mask detection
model.
Pre-Conditions:

1. Loading the face mask detection dataset from disk.

2. Training a model using OpenCV,Keras/TensorFlow on this loaded


dataset.

3. Serializing the face mask detector back to disk.


Task Sequence Exceptions

1. Import the loading libraries of OpenCV, Keras


and TensorFlow.

2. Train the model using loaded libraries.

3. Serializing the model to the disk.

Post Conditions:

- A user can successfully review the trained model of facemask


detection.
Unresolved issues:

Authority: Administrator

Modification history: 1.1

Author: <FMDSAZ2>

Description: Face mask detection and door automation.

30 | P a g e
Use Case Phase#2
Title
Use Case Id Applied Model
Requirement 2
Id
Description: This use case is about detecting the face mask of the
persons using webcam or any video/pictorial input and returns the result
in output.
Pre-Conditions:

OpenCV, Keras/TensorFlow libraries must be installed into the Python. The


webcam or the video input must be of high quality & face shouldn’t be
blur. Loading the face mask detector. Performing face detection.
Classifying each face as “Mask” or “No Mask”.

Task Sequence Excep


1. Import the downloaded library of OpenCV,
Keras/TensorFlow.
2. Load the image/video/webcam as the input.
3. Load frontal face cascade file in the code.
4. Convert the image/video to gray scale image.
5. Run the cascade onto the gray image/video.
6. Draw rectangle on the detected object returned by the face
cascade.
7. System will show the output of detected faces as a result after
classification.
Post Conditions: A user can successfully get the detected masked
faces and unmasked faces.
Unresolved issues:
Authority: Administrator

31 | P a g e
Modification history: 1.1
Author: <FMDSAZ2>
Description:

Use Case Output


Title
Use Case Id Output Collection
Requirement 3
Id
Description: This use case is about installation of a sensor that can
detect the output of the model.
Pre-Conditions:

1. Model must detected the face with mask or without mask.


2. There must be at least one person standing or moving in front of
camera.
3. Model must pass a signal about “Yes” and “No” for output.
Task Sequence Exceptions
4. Model detect the face through Camera.
5. Apply classifier for mask detection.
6. Give an output to the sensor.
Post Conditions:

- The sensor on the automatic door will detect the signal of output
to perform next operation.
Unresolved issues:
Authority: Administrator
Modification history: 1.1

Author: <FMDSAZ2>

Description: Face mask detection and door automation.

32 | P a g e
Use Case Automatic Door
Title
Use Case Id Door
Requirement 4
Id
Description: This use case is about working of a automatic door that can
operate for entrance control.
Pre-Conditions:

1. Sensor must have an output signal from the model.


Task Sequence Exceptions
2. Sensor give the command to door when there is an
output signal from the model.
3. Door will open if the person is wearing a mask.
4. Door will not open if person is without wearing a
mask and generate an alarm.
Post Conditions:

- The door will operate according to the given instruction in the


output signal.
Unresolved issues:
Authority: Administrator
Modification history: 1.1

Author: <FMDSAZ2>

Description: Face mask detection and door automation.

33 | P a g e
2.5 Methodology:
Development of the system was through agile
methodology where the scrum and the extreme programming
method were combined. The system was broken into small
modules, these modules were developed independently and
tested integration was done. During unit, testing refactoring
was adopted in order to optimize the units for their intended
purpose.
2.5.1 Agile System Development Methodology
Most agile methods attempt to minimize risk by
developing software in short time boxes called Iterations.
Software development being essentially a human activity will
always have variations in processes and inputs and the model
should be flexible enough to handle the variations.
The following are the characteristics of agile model that
makes it suitable for this system development. Iterative with
short cycles enabling fast verifications and corrections. Time
bound iterative cycles. Modularity at development process
level. People oriented. Collaborative and communicative
working style. Incremental and convergent approach that
minimizes risks and facilitates functional additions.

34 | P a g e
35 | P a g e
2.6 Work Plan:

36 | P a g e
2.7 Project Structures:

37 | P a g e
2.8 Project Scheduling:

38 | P a g e
CHAPTER 3
DESIGNING THE PROJECT

39 | P a g e
3.1 Introduction:
In the fields of science and technology, rapid
developments have brought us to a point where we are able to
accomplish feats that seemed impossible a few decades ago. In
fields such as Machine Learning and Artificial Intelligence,
innovations have made our lives simpler and provide solutions
in different areas to many complex problems. In visual
perception tasks, modern Computer Vision algorithms approach
human-level results. Computer Vision has proved to be a
transformative feature of digital technology, from image
recognition to video analytics. Technology has become a
lifesaver in a world fighting against the Novel Coronavirus
Disease (COVID-19) pandemic.
The statistical data acquired by the World Health
Organization (WHO), how that the COVID 19 pandemic has
heartlessly affected the life of human beings and even the
economic state of the world where over 10 million of people
have been infected with the virus. The pandemic lead to
governments all over the world to impose lockdowns so as to
prevent the transmission of the CORONA virus. So the actual
safety measures being advocated by WHO are wearing of face
masks at public places so that to the spread of the virus can be
prevented.
Another instance where face mask detection is of higher
demand is bank ATMs systems, when a customer does the
transactions using the ATMs, the surveillance systems records
the facial information which later will help in tracing who did
the transaction. However, criminals are using the same ATMs to
do illegal withdrawal of money by blocking their faces with
masks, thus degrading the functionality of these surveillance
system. Creating a safety atmosphere which contribute to

40 | P a g e
public safety, I propose for an effective computer vision based
systems using Artificial Intelligence.
A hybrid system model using classical and deep learning
for facial mask recognition and detection will be implemented. I
will be using face mask detection dataset which will be
consisting of images with mask and images without mask,
OpenCV to detect faces from a livestream through the Webcam
in real-time. The image dataset will be using to build the face
mask detection system. The system will be implemented with
deep learning using python, OpenCV, Numpy, Matplotlib and
Tensorflow. The main goal of the system is to identify whether
the detected individual on the video or image is wearing a
mask or is without the mask with the approach of computer
vision and machine/deep learning.
The system will be used in offices, hospital, airports,
banks, sports venues, entertainment industries, hospitality
places and densely populated places. On the baking sector is
will be used to over earlier warning to security guards incase
customer or intruder does the ATM transactions with masks on
or blocking his/her face with safety helmets. In hospitals,
offices, stores, malls and any other public places it will be used
to alert an individual without the mask to put it on so as to curb
the transmission of the COVID-109 virus.
The door for entrance will open for valid people (with
wearing mask) otherwise if the person is invalid (without face
mask) the door will remain close for that person. The proposed
system model will be built with deep learning algorithms that
are diversified with some geometric methods so as to build a
robust system covering the following three features of tracking,
detection and validation. The system shall support the society
through offering lower spread of COVID-19 and time saving.
The system will be effectively implemented during this
current condition where lockdowns has been eased to allow
41 | P a g e
public gatherings, mall shopping, Mosques and reopening of
schools. This automation of checks will minimize the number of
manpower for inspections at public gatherings hence can be
used at any situation and period of time.

42 | P a g e
3.2 ERD Diagram:

43 | P a g e
3.3 Context Diagram:

44 | P a g e
3.4 Data Flow Diagram:

45 | P a g e
3.5 Activity Diagram:

46 | P a g e
3.6 Architectural Diagram:

47 | P a g e
3.7 Sequence Diagram:

48 | P a g e
3.8 Database Model Diagram:
Not Applicable.

49 | P a g e
3.9 Class Diagram:

50 | P a g e
CHAPTER 4
DEVELOPMENT

51 | P a g e
4.1 Introduction:
In the present scenario due to Covid-19, there is no
efficient face mask detection applications, which are now in
high demand for transportation means, densely populated
areas, residential districts, large-scale manufacturers and other
enterprises to ensure that the safety guidelines are strictly
followed. Also, the absence of large datasets of ‘with_mask’
images has made this task more cumbersome and challenging.
Therefore, the need of the hour is to generate a huge custom
dataset of ‘with_mask’ images with the help of existing
datasets and search APIs followed by developing a face mask
detection system. This system is need of the hour as world tries
to battle the novel coronavirus that has infected almost every
part of world.
This project uses a Deep Neural Network, more
specifically a Convolutional Neural Network, to differentiate
between images of people with and without masks. The CNN
manages to get an accuracy of 99% on the training set and
99% on the test set. Then the stored weights of this CNN are
used to classify as mask or no mask, in real time, using
OpenCV. With the webcam capturing the video, the frames are
preprocessed and fed to the model to accomplish this task. The
model works efficiently with no apparent lag time between
wearing/removing mask and display of prediction.

52 | P a g e
4.2 Graphical User Interface:

53 | P a g e
54 | P a g e
55 | P a g e
56 | P a g e
57 | P a g e
4.3 Test Cases:

Test Case ID: 1 System Administrator


Testers:
Version: 1.1 Date: 2021
Use case Ref: Start the system
Purpose: To start the application
Environment: Google Colab, Anaconda(Jupyter Notebook)
Pre-Conditions: Code is loaded in Notebook
Execution Run the code and wait until the camera window
Description appear in which camera is capturing your video.
:
Input: User looking into the camera or face is in front of
camera.
Expected Result: Camera is capturing live video of user.
Result: Input is accepted

58 | P a g e
Test Case ID: 2 System Administrator
Testers:
Version: 1.1 Date: 2021
Use case Ref: Face Mask Detection
Purpose: To check Application is detecting desired output
Environment: Google Colab, Anaconda(Jupyter Notebook)
Pre-Conditions: Application is running
Execution Wear a Mask and put your face in front of Camera
to check whether system detect your mask.
Description
:
Input: User looking into the camera or face is in front
of camera wearing a mask.

Expected Result: System Detect the mask on the face of user and
allow him to enter from the door.

Result: User allowed to enter from the door.

59 | P a g e
Test Case ID: 3 System Administrator
Testers:
Version: 1.1 Date: 2021
Use case Ref: Face Mask Detection
Purpose: To check Application is detecting desired output
Environment: Google Colab, Anaconda(Jupyter Notebook)
Pre-Conditions: Application is running
Execution Not wearing a Mask and put your face in front of
Descriptio Camera to check whether system detect your mask or
n: not.
Input: User looking into the camera or face is in front of
camera not wearing a mask.
Expected System does not detect the mask on the face of user
Result: and do not allow him to enter from the door.
Result: User not allowed to enter from the door.

60 | P a g e
Test Case ID: 4 System Administrator
Testers:
Version: 1.1 Date: 2021
Use case Ref: Face Mask Detection
Purpose: To check Application is detecting desired output
Environment: Google Colab, Anaconda(Jupyter Notebook)
Pre-Conditions: Application is running
Execution Wearing a Mask on chin (Incorrectly) and put your
Descriptio face in front of Camera to check whether system
n: detect your mask or not.

Input: User looking into the camera or face is in front of


camera wearing a mask Incorrectly.
Expected System does not detect the mask on the face of user
Result: and do not allow him to enter from the door.
Result: User not allowed to enter from the door.

61 | P a g e
4.4 Conclusion:
An accurate and efficient face mask detection system has
been developed which achieves comparable metrics with the
existing state-of-the-art system. This project uses recent
techniques in the field of computer vision and deep learning.
Custom dataset was made from scratch using Bing Search API,
Kaggle datasets and RMFD dataset, and the evaluation of the
model on test dataset was found consistent. The system
correctly detected the presence of face masks on human faces
that it detected in static images as well as real-time video
streams.
To create our face mask detector, we trained a two-class
model with images of people wearing masks and not wearing
masks. We then fine-tuned our model on our mask/no mask
dataset and obtained an image classifier that was 99%
accurate. We then took this face mask classifier and applied it
to both images and real-time video streams by: Detecting faces
in the images/video, extracting each individual face ROI,
Applying our face mask classifier
Our face mask detector is accurate, and it’s also
computationally efficient and thus making it easier to deploy
the model to embedded systems (Raspberry Pi, Google Coral,
etc.). This system can therefore be used in real-time
applications which require face-mask detection for safety
purposes due to the outbreak of Covid-19. This project can be
integrated with embedded systems for application in airports,
railway stations, offices, schools, and public places to ensure
that public safety guidelines are followed.

62 | P a g e
4.5 References:
4.5.1 S. SINGH, U. AHUJA, M. KUMAR, K. KUMAR, AND M.

SACHDEVA, “FACE MASK DETECTION USING YOLOV3 AND

FASTER R-CNN MODELS: COVID-19

ENVIRONMENT,” MULTIMED. TOOLS APPL., PP. 1–16, 2021.

4.5.2 P. NAGRATH, R. JAIN, A. MADAN, R. ARORA, P. KATARIA, AND

J. HEMANTH, “SSDMNV2: A REAL TIME DNN-BASED FACE

MASK DETECTION SYSTEM USING SINGLE SHOT MULTIBOX

DETECTOR AND MOBILENETV2,” SUSTAIN. CITIES SOC., VOL.

66, NO. 102692, P. 102692, 2021.

4.5.3 H. QIN, J. YAN, X. LI, AND X. HU, “JOINT TRAINING OF

CASCADED CNN FOR FACE DETECTION,” IN 2016 IEEE

CONFERENCE ON COMPUTER VISION AND PATTERN

RECOGNITION (CVPR), 2016.

4.5.4 H. JIANG AND E. LEARNED-MILLER, “FACE DETECTION WITH

THE FASTER R-CNN,” IN 2017 12TH IEEE INTERNATIONAL

CONFERENCE ON AUTOMATIC FACE & GESTURE

RECOGNITION (FG 2017), 2017.

4.5.5 W. WU, Y. YIN, X. WANG, AND D. XU, “FACE DETECTION WITH

DIFFERENT SCALES BASED ON FASTER R-CNN,” IEEE TRANS.

CYBERN., VOL. 49, NO. 11, PP. 4017–4028, 2019.

63 | P a g e
4.5.6 S. REN, K. HE, AND R. GIRSHICK, “FASTER R-CNN: TOWARDS

REAL TIME OBJECT DETECTION WITH REGION PROPOSAL

NETWORKS,” IEEE TRANSACTIONS ON PATTERN ANALYSIS

AND MACHINE INTELLIGENCE, VOL. 39, NO. 6, PP. 91–99,

2015.

4.5.7 Y. LEI ET AL., “BREAST TUMOR SEGMENTATION IN 3D

AUTOMATIC BREAST ULTRASOUND USING MASK SCORING R-

CNN,” MED. PHYS., VOL. 48, NO. 1, PP. 204–214, 2021.

4.5.8 T.-Y. LIN ET AL., “MICROSOFT COCO: COMMON OBJECTS IN

CONTEXT,” ARXIV [CS.CV], 2014.

4.5.9 S. YANG, P. LUO, C. C. LOY, AND X. TANG, “WIDER FACE: A

FACE DETECTION BENCHMARK,” IN 2016 IEEE CONFERENCE

ON COMPUTER VISION AND PATTERN RECOGNITION (CVPR),

2016.

4.5.10 M. S. EJAZ, M. R. ISLAM, M. SIFATULLAH, AND A. SARKER,

“IMPLEMENTATION OF PRINCIPAL COMPONENT ANALYSIS ON

MASKED AND NON-MASKED FACE RECOGNITION,” IN 2019

1ST INTERNATIONAL CONFERENCE ON ADVANCES IN

SCIENCE, ENGINEERING AND ROBOTICS TECHNOLOGY

(ICASERT), 2019.

64 | P a g e
4.5.11 Q. I. N. BOSHENG AND L. I. DONGXIAO, “IDENTIFYING

FACEMASK-WEARING CONDITION USING IMAGE

SUPERRESOLUTION WITH CLASSIFICATION NETWORK TO

PREVENT COVID19.” .

4.5.12 K. LIN ET AL., “FACE DETECTION AND SEGMENTATION WITH

GENERALIZED INTERSECTION OVER UNION BASED ON MASK

RCNN",ADVANCES IN BRAIN INSPIRED COGNITIVE SYSTEM J,”

2020, PP. 106–116,.

4.5.13 N. UD DIN, K. JAVED, S. BAE, AND J. YI, “A NOVEL GAN-BASED

NETWORK FOR UNMASKING OF MASKED FACE,” IEEE

ACCESS, VOL. 8, PP. 44276–44287, 2020.

4.5.14 N.-C. RISTEA AND R. T. IONESCU, “ARE YOU WEARING A

MASK? IMPROVING MASK DETECTION FROM SPEECH USING

AUGMENTATION BY CYCLE-CONSISTENT GANS,” ARXIV

[EESS.AS], 2020.

4.5.15 ARXIV.ORG. [ONLINE]. AVAILABLE:

HTTP://ARXIV.ORG/ABS/2005.03950V2. [ACCESSED: 16-SEP-

2021].

4.5.16 Y. FANG, Y. NIE, AND M. PENNY, “TRANSMISSION DYNAMICS

OF THE COVID-19 OUTBREAK AND EFFECTIVENESS OF

GOVERNMENT INTERVENTIONS: A DATA-DRIVEN

ANALYSIS,” J. MED. VIROL., VOL. 92, NO. 6, PP. 645–659,

2020.

4.5.17 Z. WANG ET AL., “MASKED FACE RECOGNITION DATASET

65 | P a g e
AND APPLICATION,” ARXIV [CS.CV], 2020.

4.5.18 A. KUMAR, A. KAUR, AND M. KUMAR, “FACE DETECTION

TECHNIQUES: A REVIEW,” ARTIFICIAL INTELLIGENCE REVIEW,

VOL. 52, NO. 2, PP. 927–948, 2019.

4.5.19 IRJMETS.COM. [ONLINE]. AVAILABLE:

HTTPS://IRJMETS.COM/ROOTACCESS/FORMS/UPLOADS/IRJMET

S689844.PDF. [ACCESSED: 16-SEP-2021].

4.5.20 Y. CHEN, “FACE MASK ASSISTANT: DETECTION OF FACE MASK

SERVICE STAGE BASED ON MOBILE PHONE,” IEEE SENS. J,

VOL. 21, NO. 9, PP. 11084–11093, 2021.

4.5.21 “CHAPTER-2.DOCX - CHAPTER 2 REQUIREMENT

SPECIFICATION AND ANALYSIS FUNCTIONAL REQUIREMENTS

FUNCTIONAL REQUIREMENTS OF FACE MASK DATASET R1

THE SYSTEM,” COURSEHERO.COM. [ONLINE]. AVAILABLE:

HTTPS://WWW.COURSEHERO.COM/U/FILE/75231298/CHAPTE

R-2DOCX/?JUSTUNLOCKED=1. [ACCESSED: 16-SEP-2021].

4.5.22 MILESTONESYS.COM. [ONLINE]. AVAILABLE:

HTTPS://WWW.MILESTONESYS.COM/GLOBALASSETS/MARKET

PLACE/UPLOADED-ASSETS/0012000001GW7I7AAD/FACE-

MASK-DETECTION-DATASHEET-CB--V1.8.PDF. [ACCESSED:

16-SEP-2021].

SUPERVISOR REMARKS AREA:

66 | P a g e

You might also like