0% found this document useful (0 votes)
23 views54 pages

Face Mask Detection Report 2

Uploaded by

apekshabadhe2002
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)
23 views54 pages

Face Mask Detection Report 2

Uploaded by

apekshabadhe2002
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/ 54

A PRELIMINARY PROJECT REPORT ON

FACE MASK DETECTION USING DEEP LEARNING

SUBMITTED TO THE SAVITRIBAI PHULE PUNE UNIVERSITY, PUNE


IN THE PARTIAL FULFILLMENT FOR THE AWARD OF THE DEGREE

BACHELOR OF ENGINEERING
(INFORMATION TECHNOLOGY)

BY

Dhawal Tank (72165994C)


Pradeep Paymode (72165990L)
Sanyam Gandhi (72165976E)
Sanket Ghorpade (72165978M)

Under The Guidance of


PROF. R. G. KULKARNI

DEPARTMENT OF INFORMATION TECHNOLOGY


SIDDHANT COLLEGE OF ENGINEERING
SUDUMBARE, TAL- MAVAL DIST-PUNE - 412 109
2022-2023
CAYMET’s
SIDDHANT COLLEGE OF ENGINEERING
DEPARTMENT OF INFORMATION TECHNOLOGY

CERTIFICATE

This is to certify that the Project Entitled

FACE MASK DETECTION UDING DEEP LEARNING

Submitted by

Dhawal Tank (72165994C)


Pradeep Paymode (72165990L)
Sanyam Gandhi (72165976E)
Sanket Ghorpade (72165978M)

is a bonafide work carried out by them under the supervision of Prof. R.G. Kulka-
rni and it is approved for the partial fulfillment for Bachelor’s Degree in Information
Technology of Savitribai Phule Pune University for the award of the Degree of Bach-
elor of Engineering (Information Technology)

Prof. R. G. Kulkarni Dr. Brijendra Gupta


Internal Guide H.O.D
Dept. of IT. Dept. of IT.
Face Mask Detection Using Deep Learning

ACKNOWLEDGMENT

It gives us great pleasure in presenting the preliminary project report on


‘FACE MASK DETECTION USING DEEP LEARNING’

I would like to take this opportunity to thank my internal guide Prof. R. G. Kulkarni
for giving me all the help and guidance I needed. I am really grateful to them for
their kind support. Their valuable suggestions were very helpful.

I am also grateful to Dr. Brijendra Gupta, Head of Information Technology Depart-


ment, Siddhant College Of Engineering for his indispensable support, suggestions.

In the end our special thanks to All Other Staff for providing various resources such
as laboratory with all needed software platforms, continuous Internet connection,
for Our Project.

Dhawal Tank (72165994C)


Pradeep Paymode (72165990L)
Sanyam Gandhi (72165976E)
Sanket Ghorpade (72165978M)
B.E.[IT]
Batch: 2022-23

SCOE, Sudumbare I Dept. of IT


Face Mask Detection Using Deep Learning

ABSTRACT

The world witnessed the outbreak of COVID-19 disease during end of 2019,
which has continued to affect the life of billions of people even in 2021. While
the world recovers from the pandemic and plans to return to its normal state,
people are still continuing to remain anxious, especially the ones who wish to
return to physical state of work. Studies have proved that wearing a face mask
can significantly reduce the chances of infection as well as further
transmission. Since it is not possible to manually track down miscreants who
ignore the rules, technology can pave the path for us. Different Deep learning
algorithms, mainly have CNN models, can not only effectively track the status
of mask on static images, but can also be used for real time monitoring by
launching them on real time streaming cameras for continuous and live
observation.

SCOE, Sudumbare II Dept. of IT


Ty

INDEX
LIST OF SYMBOLS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V

LIST OF FIGURES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . VI

LIST OF ABBREVATIONS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . VII

1 Introduction 1
1.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.1.1 Motivation . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.1.2 Objective . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

2 Literature Survey 5
2.1 Study Of Research Paper . . . . . . . . . . . . . . . . . . . . . . . 6

3 Problem Statement 11
3.1 Problem Statement . . . . . . . . . . . . . . . . . . . . . . . . . . 12

4 Project Requirement 13
4.1 EXTERNAL INTERFACE REQUIREMENT . . . . . . . . . . . . 14
4.1.1 User Interface . . . . . . . . . . . . . . . . . . . . . . . . . 14
4.1.2 Hardware Interfaces: . . . . . . . . . . . . . . . . . . . . . 14
4.1.3 Software Interfaces . . . . . . . . . . . . . . . . . . . . . . 14
4.2 NON FUNCTIONAL REQUIREMENT . . . . . . . . . . . . . . . 15
4.2.1 Performance Requirements . . . . . . . . . . . . . . . . . . 15
4.2.2 Safety Requirement . . . . . . . . . . . . . . . . . . . . . . 15
4.2.3 Software Quality Attributes . . . . . . . . . . . . . . . . . 15

5 System Analysis 17
5.1 System Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . 18
5.1.1 Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
5.1.2 Data Flow Diagram . . . . . . . . . . . . . . . . . . . . . . 19
5.2 UML DIAGRAMS . . . . . . . . . . . . . . . . . . . .. . 21

6 Software Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24

7 Project Plan . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
7.1 Stakeholder List . . . . . . . . . . . . . . . . . . . . . . .. 41
7.2 System Implementation Plan . . . . . . . . . . . . . . . . 41

8 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
8.1 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . .43

9 References. . . .. . . .. . . .. . . . . .. . . . .. . . . . . . .. . . . . .. . . . . . . . 44

SOCE, Sudumbare IV Dept. of IT


Face Mask Detection Using Deep Learning

LIST OF SYMBOLS

h - Height

w - Width

f - Filter

d - Dimension

SCOE, Sudumbare V Dept. of IT


Face Mask Detection Using Deep learning

List of Figures

5.1 system Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . 18


5.2 Data Flow(0) diagram . . . . . . . . . . . . . . . . . . . . . . . . . 19
5.3 Data Flow(1) diagram . . . . . . . . . . . . . . . . . . . . . . . . . 20
5.4 Data Flow(2) diagram . . . . . . . . . . . . . . . . . . . . . . . . . 20
5.5 Class Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
5.6 Use case Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
5.7 Activity Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . 23

SOEC, Sudumbare VI Dept. IT


Face Mask Detection Using Deep Learning

LIST OF ABBREVATIONS

MSCNN - Multi-Stage Convolutions Neural


Networks

CNN - Convolutional Neural Network

CCTV - Closed-Circuit Television

MIT - Massachusetts Institute Technology

CNRI - Corporation for National Research Initiatives

LLNL - Lawrence Livermore National Laboratory

PyPI - Python Package Index

SIFT - Scale-Invariant Feature Transform

HOG - Histogram of Oriented Gradients

UML - Unified Modelling Language

SCOE, Sudumbare VII Dept. of IT


CHAPTER 1

INTRODUCTION
Face Mask Detection Using Deep Learning

1.1 OVERVIEW

The trend of wearing face masks in public is rising due to the COVID-19
corona virus epidemic all over the world. Before Covid-19, People used to
wear masks to protect their health from air pollution. While other people are
self-conscious about their looks, they hide their emotions in public to hide
their faces.

More than five million cases were infected by COVID-19 in less than 6
months across 188 countries. The virus spreads through close contact and
in crowded and overcrowded areas.

We can tackle and predict new diseases by the help of new technology
such as artificial intelligence, lot, big data, and Machine Learning. In order
to better understand infection rates might be decrease through our
technique.

People are forced by laws to wear face masks in public in many countries.
These rules and laws were developed as an action to the exponential
growth in cases and deaths in many areas. However, the process of
monitoring large groups of people is becoming more difficult in public areas.
So we will create a automation process for detecting the faces.

Here we introduce a facemask detection model that is based on computer


vision and deep learning. The proposed model can be integrated with
Surveillance Cameras to impede the COVID-19 transmission by allowing
the detection of people who are wearing masks not wearing face masks.
The model is integration between deep learning and classical machine
learning techniques with OpenCV, TensorFlow, and Keras, we will achieve
the highest accuracy and consume the least time in the process of training
and detection

SCOE, Sudumbare 2 Dept. of IT


Face Mask Detection Using Deep Learning

1.1.1 Motivation

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 Covid- 19 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.

SCOE, Sudumbare 3 Dept. of IT


Face Mask Detection Using Deep Learning

1.1.2 Objective

• Can identify multiple face in a real-time video recording.

• Uses a stored database of faces.

• Return the confidence of the detected image. Lower confidence values


indicate accurate results.

• Is robust and not much affected by light.

SCOE, Sudumbare 4 Dept. of IT


CHAPTER 2

LITERATURE SURVEY
Face Mask Detection Using Deep Learning

2.1 STUDY OF RESEARCH PAPER

1. Paper Name:- Face Mask Detector with OpenCV, Keras/TensorFlow, and


Deep Learning
Author:- Adrian Rosebrock

Abstract: The topic that we have selected is called Face Mask Detection
using Python, OpenCV, TensorFlow and Deep Learning. This means that we
have developed software that would detect masks on a person or people in
a video or image, it would tell them whether that they are wearing a mask or
not. This particular project is achieved in two phases, where phase 1 would
be to train the face mask detector and phase 2 would be to apply or deploy
the face mask detection Software. In phase 1 of the project, our main focus
would be to create a training model using datasets, where datasets consist
of a huge number of images of people with face masks and people without
a face mask. In phase 2 we would load the trained model and then detect
the face and then categorize the faces as to whether there is any mask or
no mask on that. We see Our Model build in Python Programming Language
can detect the mask on faces once tested using video output.

SCOE, Sudumbare 6 Dept. of IT


Face Mask Detection Using Deep Learning

2. Paper Name:- Image-based Face Detection and Recognition:

Author:- Faizan Ahmad , Aaima Najam and Zeeshan Ahmed

Abstract: Face recognition from image or video is a popular topic in

biometrics research. Many public places usually have surveillance cameras

for video capture and these cameras have their significant value for security

purpose. It is widely acknowledged that the face recognition have played an

important role in surveillance system as it doesn’t need the object’s

cooperation. The actual advantages of face based identification over other

biometrics are uniqueness and acceptance. As human face is a dynamic

object having high degree of variability in its appearance, that makes face

detection a difficult problem in computer vision. In this field, accuracy and

speed of identification is a main issue.

SCOE, Sudumbare 7 Dept. of IT


Face Mask Detection Using Deep Learning

3. Paper Name:- Multi-Stage CNN Architecture for Face Mask Detection

Author:- Amit Chavda, Jason Dsouza, Sumeet Badgujar, Ankit Damani

Abstract: The end of 2019 witnessed the outbreak of Coronavirus Disease

2019 (COVID-19), which has continued to be the cause of plight for millions

of lives and businesses even in 2020. As the world recovers from the

pandemic and plans to return to a state of normalcy, there is a wave of

anxiety among all individuals, especially those who intend to resume

inperson activity. Studies have proved that wearing a face mask significantly

reduces the risk of viral transmission as well as provides a sense of

protection. However, it is not feasible to manually track the implementation

of this policy. Technology holds the key here. We introduce a Deep Learning

based system that can detect instances where face masks are not used

properly. Our system consists of a dualstage Convolutional Neural Network

(CNN) architecture capable of detecting masked and unmasked faces and

can be integrated with pre-installed CCTV cameras. This will help track

safety violations, promote the use of face masks, and ensure a safe working

environment.

SCOE, Sudumbare 8 Dept. of IT


Face Mask Detection Using Deep Learning

4. Paper Name:- Covid-19 Face Mask Detection Using TensorFlow, Keras


and OpenCV.
Author:- Arjya Das, Mohammad Wasif Ansari, Rohini Basak

Abstract: COVID-19 pandemic has rapidly affected our day-to- day life

disrupting the world trade and movements. Wearing a protective face mask

has become a new normal. In the near future, many public service providers

will ask the the customers to wear mask correctly to avail of their services.

Therefore, face mask detection has become a crucial task to help global

society. This paper presents a simplified approach to achieve this purpose

using some basic Machine Learning packages like TensorFlow, Keras,

OpenCV and Scikit-Learn. The proposed method detects the face from the

image correctly and then identifies if it has a mask on it or not. As a

surveillance task performer, it can also detect a face along with a mask in

motion. The method attains accuracy up to 95.77% and 94.58% respectively

on two different datasets. We explore optimized values of parameters using

the Sequential Convolutional Neural Network model to detect the presence

of masks correctly without causing over-fitting.

SCOE, Sudumbare 9 Dept. of IT


Face Mask Detection Using Deep Learning

5. Paper Name:- A Novel Approach to Detect Face Mask using CNN

Author:- Md. Shahriar Islam, Eimdadul Haque Moon, Md. Ashikujjaman


Shaikat, Mohammad Jahangir Alam

Abstract: Face detection and recognition will be considered as one of the


most intriguing modalities for biometric models. Those researches are mainly
required for ensuring security in a most sensitive area. This research paper
has proposed a very fast image pre-processing with the mask in the center
over the faces. For this system, features extraction and Convolutional Neural
Network are used for classification and detection of a masked person. This
research work will be carried out in three levels: preprocessing the images,
cropping the images and classification of the images. This helps to detect
whether the face is masked or not. A webcam or CCTV camera surveillance
will record all the time and it checks whether the person is wearing a mask,
if the person doesn’t wear a mask then the system gives a security alert.

SCOE, Sudumbare 10 Dept. of IT


CHAPTER 3

PROBLEM STATEMENT
Face Mask Detection Using Deep Learning

3.1 PROBLEM STATEMENT

The System is to predict people are wearing masks or without mask, given
an image or a video from real time monitoring system. It is an object detection
and classification problem with 2 different classes (with Mask and Without
Mask).

SCOE, Sudumbare 12 Dept. of IT


CHAPTER 4

PROJECT REQUIREMENT
Face Mask Detection Using Deep Learning

4.1 EXTERNAL INTERFACE REQUIREMENT

4.1.1 User Interface:

Application Based FACE MASK DETECTION USING DEEP LEARNING.

4.1.2 Hardware Interfaces:

RAM: 4GB or above

RAM minimum required is 2 GB.

Hard Disk:- 256SSD or above

Processor:- Intel i3 Processor Intel core 4th Geb or above

IDE:- PyCharm or Jupyter Notebook

Coding Language:- Python

Operating System:- Windows 7 and Above

4.1.3 Software Interfaces

Operating System: Windows 7 and Above

IDE:- PyCharm or Jupyter notebook (open-source IDE)

Programming Language:- Python

Libraries: Keras, TensorFlow, OpenCV

SCOE, Sudumbare 14 Dept. of IT


Face Mask Detection Using Deep Learning

4.2 NON-FUNCTIONAL REQUIREMENT

4.2.1 Performance Requirements

The performance of the functions and every module must be well. The overall
performance of the software will enable the users to work efficiently.
Performance of encryption of data should be fast. Performance of the
providing virtual environment should be fast Safety Requirement.

The application is designed in modules where errors can be detected and solved

easily. This makes it easier to install and update new functionality if required.

4.2.2 Safety Requirement

The application is designed in modules where errors can be detected and fixed easily.

This makes it easier to install and update new functionality if required.

4.2.3 Software Quality Attributes

Our software has many quality attribute that are given below.

Adaptability: This software is adaptable by all users.

Availability: This software is freely available to all users. The availability of


the software is easy for everyone.

Maintainability: After the deployment of the project if any error occurs then
it can be easily maintained by the software developer.

Reliability: The performance of the software is better which will increase the
reliability of the Software.

SCOE, Sudumbare 15 Dept. of IT


Face Mask Detection Using Deep Learning

User Friendliness: Since, the software is a GUI application; the output


generated is much user friendly in its behavior.

Integrity: Integrity refers to the extent to which access to software or data by


unauthorized persons can be controlled.

Security: Users are authenticated using many security phases so reliable


security is provided.

Test ability: The software will be tested considering all the aspects.

SCOE, Sudumbare 16 Dept. of IT


CHAPTER 5

SYSTEM ANALYSIS
Face Mask Detection Using Deep Learning

5.1 SYSTEM ARCHITECTURE

Figure 5.1: system Architecture

5.1.1 Module

1. Creating image datasets a data-loaders for train and test using the
experiments folder split
• Training Datasets: A datasets that we feed into our algorithm
to train in our model.
• Testing Datasets: A datasets that we use to validate the
accuracy of our model but is not used to train the model. It
may be called the validation dataset.
2. Training the model
3. Visualizing images

SCOE, Sudumbare 18 Dept. of IT


Face Mask Detection Using Deep Learning

5.1.2 Data Flow Diagram

In Data Flow Diagram, we Show that flow of data in our system in DFD0 we
show that base DFD in which rectangle present input as well as output and
circle show our system, In DFD1 we show actual input and actual output of
system input of our system is text or image and output is rumor detected like
wise in DFD 2 we present operation of user as well as admin.

Figure 5.2: Data Flows (0) diagram

SCOE, Sudumbare 19 Dept. of IT


Face Mask Detection Using Deep Learning

Figure 5.3: Data Flow (1) diagram

Figure 5.4: Data Flow (2) diagram

SCOE, Sudumbare 20 Dept. of IT


Face Mask Detection Using Deep Learning

5.2 UML DIAGRAMS

Unified Modeling Language is a standard language for writing software blueprints.

The UML may be used to visualize, specify, construct and document the artifacts of
a software intensive system. UML is process independent, although optimally it

should be used in process that is use case driven, architecture-centric, iterative, and
incremental. The number of UML Diagram is available.

Class Diagram.

Use case Diagram.

Activity Diagram.

Sequence Diagram.

Figure 5.5: Class Diagram

SCOE, Sudumbare 21 Dept. of IT


Face Mask Detection Using Deep Learning

Figure 5.6: Use case Diagram

SCOE, Sudumbare 22 Dept. of IT


Face Mask Detection Using Deep Learning

Figure 5.7: Activity Diagram

SCOE, Sudumbare 23 Dept. of IT


CHAPTER 6

SOFTWARE INFORMATION
Face Mask Detection Using Deep Learning

Python
What exactly is Python? You may be wondering about that. You may be
referring to this book because you wish to learn editing but are not familiar
with editing languages. Alternatively, you may be familiar with programming
languages such as C, C ++, C #, or Java and wish to learn more about Python
language and how it compares to these "big word" languages.

Python Concepts
You can skip to the next chapter if you are not interested in how and why
Python. In this chapter, I will try to explain why I think Python is one of the
best programming languages available and why it is such a great place to
start.

Python was developed into an easy-to-use programming language. It uses


English words instead of punctuation, and has fewer syntax than other
languages. Python is a highly developed, translated, interactive, and object-
oriented language.

Python translated - Interpreter processing Python during launch. Before using


your software, you do not need to install it. This is similar to PERL and PHP
editing languages.
Python interactive - To write your own applications, you can sit in Python
Prompt and communicate directly with the interpreter.

Python Object-Oriented - Python supports the Object-Oriented program style


or method, encoding the code within objects.

Python is a language for beginners - Python is an excellent language for


beginners, as it allows for the creation of a variety of programs, from simple
text applications to web browsers and games.

SCOE, Sudumbare 25 Dept. of IT


Face Mask Detection Using Deep Learning

Python Features
Python features include –

1. Easy-to-learn - Python includes a small number of keywords, precise


structure, and well-defined syntax. T This allows the student to learn the
language faster
2. Easy to read - Python code is clearly defined and visible to the naked eye.
3. Easy-to-maintain - Python source code is easy to maintain.

4. Standard General Library - Python's bulk library is very portable and


shortcut compatible with UNIX, Windows, and Macintosh.
5. Interaction mode - Python supports interaction mode that allows
interaction testing and correction of captions errors.
6. Portable - Python works on a variety of computer systems and has the
same user interface for all.
7. Extensible - Low-level modules can be added to Python interpreter. These
modules allow system developers to improve the efficiency of their tools
either by installing or customizing them.
8. Details - All major commercial information is provided by Python ways of
meeting.
9. GUI Programming - Python assists with the creation and installation of a
user interface for images of various program phones, libraries, and
applications, including Windows MFC, Macintosh, and Unix's X Window.
10.Scalable - Major projects benefit from Python building and support, while
Shell writing is not Aside from the characteristics stated above, Python
offers a long list of useful features, some of which are described below.

● It supports OOP as well as functional and structured programming


methodologies.
● It can be used as a scripting language or compiled into Byte-code for
large-scale application development.
● It allows dynamic type verification and provides very high-level dynamic data
types.

SCOE, Sudumbare 26 Dept. of IT


Face Mask Detection Using Deep Learning

● Automatic garbage pickup is supported by IT.

Advantages/Benefits of Python:
The diverse application of the Python language is a result of the combination
of features which
give this language an edge over others. Some of the benefits of
programming in Python include:

1. Presence of Third-Party Modules: The Python Package Index (PyPI) contains


numerous third-party modules that make Python capable of interacting with most
of the other languages platforms.

2. Extensive Support Libraries: Python provides a large standard library which


includes areas like internet protocols, string operations, web services tools and
operating system interfaces. Many high use programming tasks have already
been scripted into the standard library which reduces length of code to be written
significantly.
3. Open Source and Community Development: Python language is developed
under an OSI-approved opensource license, which makes it free to use and
distribute, including for commercial purposes. Further, its development is driven
by the community which collaborates for its code through hosting conferences
and mailing lists, and provides for its numerous modules.

4. Learning Ease and Support Available: Python offers excellent readability and
uncluttered simple-to-learn syntax which helps beginners to utilize this
programming language. The code style guidelines, PEP 8, provide a set of
rules to facilitate the formatting of code. Additionally, the wide base of users
and active developers has resulted in a rich internet resource bank to encourage
development and the continued adoption of the language.

SCOE, Sudumbare 27 Dept. of IT


Face Mask Detection Using Deep Learning

5. User-friendly Data Structures: Python has built-in list and dictionary data
structures which can be used to construct fast runtime data structures. Further,
Python also provides the option of dynamic high- level data typing which
reduces the length of support code that is needed.

6. Productivity and Speed: Python has Clean object-oriented design, provides


enhanced process control capabilities, and possesses strong integration and
text processing capabilities and its own unit testing framework, all of which
contribute to the increase in its speed and productivity. Python is considered a
viable option for building complex multi-protocol network applications

As can be seen from the above-mentioned points, Python offers a number


of advantages for software development. As upgrading of the language
continues, its loyalist base could grow as well.

Python has five standard data types −


● Numbers
● String
● List
● Tuple
● Dictionary

Python Numbers
Numeric values are stored in number data types. When you give a number a
value, it becomes a number object.

Python Strings
In this python uses a string is defined as a collection set of characters
enclosed in quotation marks. Python allows you to use any number of
quotes in pairs. The slice operator ([] and [:]) can be used to extract subsets
of strings, with indexes starting at 0 at the start of the string and working their
way to -1 at the end.

SCOE, Sudumbare 28 Dept. of IT


Face Mask Detection Using Deep Learning

Python Lists
The most diverse types of Python data are lists. Items are separated by
commas and placed in square brackets in the list ([]). Lists are similar to C-
order in some ways. Listings can be for many types of data, which is one
difference between them.

The slide operator ([] and [:]) can be used to retrieve values stored in the
list, the indicators start with 0 at the beginning of the list and work their way
to the end of the list. The concatenation operator of the list is a plus sign (+),
while the repeater is an asterisk (*).

Python Tuples
A cone is a type of data type similar to a sequence of items. Cone is a
set of values separated by commas. The pods, unlike the list, are
surrounded by parentheses.

Lists are placed in parentheses ([]), and the elements and sizes can be
changed, but the lumps are wrapped in brackets (()) and cannot be sorted.
Powders are the same as reading lists only.

Python Dictionary
Python dictionaries in Python are a way of a hash table. They are similar to
Perl's combination schemes or hashes, and are made up of two key
numbers.The dictionary key can be any type of Python, but numbers and
strings are very common. Prices, on the other hand, can be anything you
choose Python. Curly braces () surround dictionaries, and square braces ([)
are used to assign and access values.

SCOE, Sudumbare 29 Dept. of IT


Face Mask Detection Using Deep Learning

Different modes in python


Python Normal and interactive are the two basic Python modes.

The scripted and completed.py files are executed in the Python interpreter
in the regular manner.

Interactive mode is a command line shell that provides instant response for
each statement while simultaneously running previously provided
statements in active memory.

The feed programmer is assessed in part and whole as fresh lines are fed
into the interpreter.

Pandas
Pandas is an open-source library that is built on top of NumPy library. It is
a Python package that offers various data structures and operations for
manipulating numerical data and time series. It is mainly popular for
importing and analyzing data much easier. Pandas is fast and it has high-
performance & productivity for users.

Pandas is a python package providing fast, flexible, and expressive data


structures designed to make working with “relational” or “labeled” data both
easy and intuitive. It aims to be the fundamental high-level building block
for doing practical, real- world data analysis in Python. Additionally, it has
the broader goal of becoming the most powerful and flexible opensource
data analysis/manipulation tool available in any language. It is already well
on its way toward this goal.

Explore data analysis with Python. Pandas Data Frames make


manipulating your data easy, from selecting or replacing columns and
indices to reshaping your data.

SCOE, Sudumbare 30 Dept. of IT


Face Mask Detection Using Deep Learning

Pandas is well suited for many different kinds of data:

Tabular data with heterogeneously-typed columns, as in an SQL table or


Excel spreadsheet

Ordered and unordered (not necessarily fixed-frequency) time series data.


Arbitrary matrix data (homogeneously typed or heterogeneous) with row
and column labels Any other form of observational / statistical data sets.
The data need not be labeled at all to be placed into a Pandas data
structure.

Keras
Keras 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.

The code is hosted on GitHub, and community support forums include the
GitHub issues page, and a Slack channel. Keras is a minimalist Python
library for deep learning that can run on top of Theano or Tensor Flow.

It was developed to make implementing deep learning models as fast and


easy as possible for research and development.

SCOE, Sudumbare 31 Dept. of IT


Face Mask Detection Using Deep Learning

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.

TensorFlow
Tensor flow is an open-source software library.
Tensor flow was originally developed by researchers and engineers.
It is working on the Google Brain Team within Google’s Machine Intelligence
research organization the purposes of conducting machine learning and
deep neural networks research.
It is an open-source framework to run deep learning and other statistical
and predictive analytics workloads.

It is a python library that supports many classification and regression


algorithms and more generally deep learning.

TensorFlow is a free and open-source software library for dataflow and


differentiable programming across a range of tasks.

SCOE, Sudumbare 32 Dept. of IT


Face Mask Detection Using Deep Learning

It is a symbolic math library, and is also used for machine learning


applications such as neural networks.

It is used for both research and production at Google, TensorFlow is Google


Brain’s second-generation system.

Version 1.0.0 was released on February 11, While the reference


implementation runs on single devices, TensorFlow can run on multiple
CPUs and GPUs (with optional CUDA and SYCL extensions for general
purpose computing on graphics processing units).

Tensor Flow is available on 64-it Linux, macOS, Windows, and mobile


computing platforms including Android and IOS.

Its flexible architecture allows for the easy deployment of computation


across a variety of platforms (CPUs, GPUs, TPUs) and from desktops to
clusters of servers to mobile and edge devices.

The name Tensor Flow derives from the operations that such neural
networks perform on multi-dimensional data arrays, which are referred to
as tensors.

SCOE, Sudumbare 33 Dept. of IT


Face Mask Detection Using Deep Learning

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.

4. Also, interfaces based on CUDA and OpenCL are also under active
development for high-speed GPU operations. Open CV-python is the
Python API of OpenCV.

5. It combines the best qualities of Open CV C++ API and Python language

6. OpenCV (Open-Source Computer Vision Library) is an opensource


computer vision and machine learning software library. OpenCV was built
to provide a common infrastructure for computer vision applications
and to accelerate the use of machine perception in the commercial
products. Being a BSD-licensed product, OpenCV makes it easy for
businesses to utilize and modify the code.

7. The library has more than 2500optimized algorithms, which includes a


comprehensive set of both classic and state-of -the-art computer vision and
machine learning algorithms.

8. Algorithms can be used to detect and recognize faces, identify objects,


classify human actions in videos, track camera movements, track moving
objects, extract 3D models of objects, produce 3D point clouds from stereo
cameras, stitch images together to produce a high resolution image of an

SCOE, Sudumbare 34 Dept. of IT


Face Mask Detection Using Deep Learning

entire scene, find similar images from an image database, remove red eyes
from images taken using flash, follow eye movements, recognize scenery
and establish markers to overlay it with augmented reality, etc.

Numpy:
NumPy is a library for the Python programming language, adding support
for large, multi-dimensional arrays and matrices, along with a large
collection of high- level mathematical functions to operate on these arrays.
The ancestor of NumPy, Numeric, was originally created by Jim Hugunin
with contributions from several other developers. In 2005, Travis Oliphant
created NumPy by incorporating features of the competing Num array into
Numeric, with extensive modifications. NumPy is open- source software and
has many contributors.

The Python programming language was not initially designed for numerical
computing, but attracted the attention of the scientific and engineering
community early on, so that a special interest group called matrix-sig was
founded in 1995 with the aim of defining an array computing package.

Among its members was Python designer and maintainer Guido van
Rossum, who implemented extensions to Python's syntax (in particular the
indexing syntax) to make array computing easier.

An implementation of a matrix package was completed by Jim Fulton, then


generalized by Jim Hugunin to become Numeric also variously called
Numerical Python extensions or NumPy Hugunin, a graduate student at
Massachusetts Institute of Technology (MIT) joined the Corporation for
National Research Initiatives (CNRI) to work on J Python in 1997 leaving
Paul Dubois of Lawrence Livermore National Laboratory (LLNL) to take over
as maintainer.

SCOE, Sudumbare 35 Dept. of IT


Face Mask Detection Using Deep Learning

In early 2005, NumPy developer Travis Oliphant wanted to unify the


community around a single array package and ported num-array's features
to Numeric, releasing the result as NumPy 1.0 in 2006. This new project
was part of SciPy. To avoid installing the large SciPy package just to get an
array object, this new package was separated and called NumPy.

MATPLOT:
Mat plot is a plotting library for the Python programming language and its
numerical mathematics extension NumPy. It provides an object-oriented
API for embedding plots into applications using general-
purpose GUI toolkits like Tkinter, WX Python, Qt, or GTK+. There is also a
procedural "Pylab" interface based on a state machine (like OpenGL),
designed to closely resemble that of MATLAB, though its use is
discouraged SciPy makes use of Matplotlib.
Matplotlib was originally written by John D. Hunter, has an active
development community and is distributed under a BSD-style license.
Michael Droettboom was nominated as matplotlib's lead developer shortly
before John Hunter's death in August 2012 and further joined by Thomas
Caswell.

SCOE, Sudumbare 36 Dept. of IT


Face Mask Detection Using Deep Learning

DEEP LEARNING

1. Deep learning is an AI function that mimics the workings of the humanbrain


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.
3. In this, face mask detection is built using Deep Learning technique called
as Convolution Neural Networks (CNN).

Deep learning methods aim at learning feature hierarchies with features


from higher levels of the hierarchy formed by the composition of lower-
level features. Automatically learning features at multiple levels of
abstraction allow a system to learn complex functions mapping the input
to the output directly from data, without depending completely on human-
crafted features. Deep learning algorithms seek to exploit the unknown
structure in the input distribution in order to discover good representations,
often at multiple levels, with higher-level learned features defined in terms
of lower-level features

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!

CNNs, like neural networks, are made up of neurons with learnable weights
and biases. Each neuron receives several inputs, takes a weighted sum over
them, pass it through an activation function and responds with an output. The
whole network has a loss function and all the tips and tricks that we
developed for neural networks still apply on CNNs. In more detail the image

SCOE, Sudumbare 37 Dept. of IT


Face Mask Detection Using Deep Learning

is passed through a series of convolution, nonlinear, pooling layers and fully


connected layers, then generates the output.

In deep learning, a convolutional neural network (CNN, or ConvNet) is a class


of deep, feed-forward artificial neural networks, most commonly applied to
analyzing visual imagery.

Convolutional networks were inspired by biological processes in that the


connectivity pattern between neurons resembles the organization of the
visual cortex. CNNs use relatively little pre-processing compared to other
image classification algorithms. CNN is a special kind of multi- layer NNs
applied to 2-d arrays (usually images), based on spatially localized neural
input. CNN Generate ‘patterns of patterns’ for pattern recognition.

CNN MODEL

1. This CNN model is built using the Tensorflow 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
MaxPoolin
g2D
Flatten ()
Dropout
Dense

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.

SCOE, Sudumbare 38 Dept. of IT


Face Mask Detection Using Deep Learning

MaxPooling2D:
It is used with pool size or filter size of 2*2.

Flatten () Layer:
It is used to flatten all the layers into a single 1D layer.

Dropout Layer:
It is used to prevent the model from overfitting.

Dense Layer:
The activation function here is soft max which will output a vector with
two probability distribution values.

CNN Diagram Fig.

SCOE, Sudumbare 39 Dept. of IT


CHAPTER 7

PROJECT PLAN
Face Mask Detection Using Deep Learning

In this chapter we are going to have an overview about how much time does it took

to complete each task like Preliminray Survey Introduction and Problem

Statement, Literature Survey, Project Statement, Software Requirement and

Specification, System Design, Partial Report Submission, Architecture Design,

Implementation, Deployment, Testing, Paper Publish, Report Submission and

etcetera. This chapter also gives focus on stakeholder list which gives information

about project type, customer of the proposed system, user and project member

who developed the system.

7.1 STAKEHOLDER LIST

7.2 SYSTEM IMPLEMENTATION PLAN

The System Implementation plan table, shows the overall schedule of tasks
compilation and time duration required for each task.

Sr. No. Name/Title Start End Remark


Date Date
1. Preliminary Survey 05/07/22 04/08/22
2. Literature Survey 04/08/22 17/08/22
3. Introduction and Problem 17/08/22 17/08/22
Statement
4. Project Statement 17/09/22 01/09/22
5. Software Requirement and 01/09/22 07/09/22
Specification
6. System Design 07/09/22 15/09/22
7. Partial Report Submission 15/09/22 30/09/22
8. Architecture Design 30/09/22 14/10/22
9. Implementation 14/10/22 02/11/22
10. Deployment
11. Testing
12. Paper Publish
13. Report Submission

SCOE, Sudumbare 41 Dept. of IT


CHAPTER 8

CONCLUSION
Face Mask Detection Using Deep Learning

8.1 CONCLUSION
• The model is accurate, and since the MobileNetV2 architecture is used, 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.

• Our project will help in identifying miscreants who disregard the current covid
19 guidelines, and help in creating a more woke society which understands
the necessity of rules.

• Furthermore, the project can also be useful in the times of any future
pandemics.

• The project will serve as a template for any sort of object


detection/classification problems.

SCOE, Sudumbare 43 Dept. of IT


CHAPTER 9

REFERENCES
Face Mask Detection Using Deep Learning

[1] Adrian Rosebrock (2020), Face Mask Detector with OpenCV,

Keras/TensorFlow, and Deep Learning, pyimagesearch

[2] Faizan Ahmad, Aaima Najam & Zeeshan Ahmed (2013), “Image-based Face

Detection and Recognition, ResearchGate, International Journal of Computer

Science Issues

[3] Amit Chavda and Jason Dsouza (2020), Multi-Stage CNN Architecture for Face

Mask Detection, IEEE International Conference for Convergence in Technology

(I2CT)

[4] Arjya Das, Mohammad Wasif Ansari, Rohini Basak (2020) Covid-19 Face Mask

Detection Using TensorFlow, Keras and OpenCV, IEEE 17th India Council

International Conference (INDICON)

[5] Md. Shahriar Islam, Eimdadul Haque Moon (2020), A Novel Approach to Detect

Face Mask using CNN, IEEE Third International Conference on Intelligent

Sustainable Systems [ICISS 2020]

[6] https://www.javatpoint.com/keras

[7] https://www.tensorflow.org/learn

[8] https://www.geeksforgeeks.org/python-programming-language/

[9] https://youtube.com/playlist?list=PLeo1K3hjS3uu7CxAacxVndI4bE_o3BDtO

SCOE, Sudumbare 45 Dept. of IT

You might also like