Topic: Automatic Face Mask Detection
Topic: Automatic Face Mask Detection
Submitted by
RANDHIR KUMAR YADAV 1NH17EE741
CHAPTER 1
INTRODUCTION
The nation-wide lockdown to contain the novel coronavirus pictures the Havoc and
catastrophic on the whole world claiming 1 crore lies and still lives of people affected
and in spite on our and then the news of new strain of coming and students appeared in
the common citizens but people have adapted to the new normal and have begun to
Resume the life with the daily activities such as travelling to places carrying out their
work study travelling with family spending time.
To provide a proper safety and every SOP is followed for the safety
of students we have come off the idea of project which contains a
free fire and safety course of the functional module with the
machine learning code by python libraries
Problem Statements
The Public places & crowded area requires people to wear face masks, some people often
forget to put their masks on —
Implementation
[1]
[2]
Our working methodology is a data science approach in which we are utilizing the
Google colab resource which is an online platform to execute machine learning quotes
with a very highest speed of operation then we download it
B.E (EEE) Project Phase I Page 3
AUTOMATIC FACEMASK DETECTION 2020-2021
3. Running the pre-made model trained with over 1,000 images. In terminal
changing directory (cd) into the directory you just cloned from GitHub.
cd face_mask_detection
4. Running the Python 3 code to open up your webcam and start the mask
detection algorithm.
python3 detect_mask_webcam.py
Photos divided into 2 folders in our dataset, with_mask and without_mask and
the training algorithm created a model of mask vs. no mask based on the dataset.
The sample photos provided in the dataset folder downloaded from GitHub
.
we trained our Raspberry Pi Mask Detection system on 20 photos. Fortunately, we
B.E (EEE) Project Phase I Page 4
AUTOMATIC FACEMASK DETECTION 2020-2021
3.Run Python code to take photos of yourself wearing a mask, the same for no
mask photos.
3. Train the model. Keep in mind that, the more photos you have in the dataset
folder, the longer it will take to create the model. If you get an “out of memory”
error, reduce the number of photos in your dataset until you can successfully run
the Python code.
cd face_mask_detection
Running the same detection script, but specify your model instead of the default
model.
From the same Terminal window:
CHAPTER 2
Components required
1. Raspberry pi [3]
Components Description
1. Raspberry pi
It is a microcontroller board having a 2.6 Ghz of processor and 2GB of RAM, its used
to function as a standalone computer or as a embedded processor board.
Raspberry Pi is a progression of little single-board PCs created in the Assembled
Realm by the Raspberry Pi Establishment in relationship with Broadcom. From the
get-go, the Raspberry Pi project inclined towards the advancement of showing
fundamental software engineering in schools and in creating countries. Later, the first
model got definitely more famous than anticipated, selling outside its objective
market for utilizations, for example, mechanical technology. It is currently generally
utilized in numerous regions, for example, for climate monitoring, on account of its
ease, seclusion, and open plan.
After the arrival of the subsequent board type, the Raspberry Pi Establishment set up
another element, named Raspberry Pi Exchanging, and introduced Eben Upton as
President, with the obligation of creating technology. The Establishment was
rededicated as an instructive foundation for advancing the educating of fundamental
software engineering in schools and agricultural nations.
2.Servo Motor
A servomotor is a rotational actuator or direct actuator that takes into consideration
exact control of precise or straight position, speed and acceleration. It comprises of
an appropriate engine coupled to a sensor for position criticism. It additionally
requires a moderately refined regulator, regularly a committed module planned
explicitly for use with servomotors.
Servomotors are not a particular class of engine, despite the fact that the term
servomotor is frequently used to allude to an engine reasonable for use in a shut circle
control framework.
The Raspberry Pi Camera Module is a 5MP CMOS camera with a fixed center focal point
that is equipped for catching actually pictures just as superior quality video. Stills are
caught at a goal of 2592 x 1944, while video is upheld at 1080p at 30 FPS, 720p at 60
FPS and 640x480 at 60 or 90 FPS.The camera is upheld in the most recent rendition of
Raspbian, Raspberry Pi's favored working framework.
4.Ethernet cable
The first 10BASE5 Ethernet utilizes coaxial link as a shared medium, while the more
current Ethernet variations utilize curved pair and fiber optic connections related to
switches. Throughout the span of its set of experiences, Ethernet information move
B.E (EEE) Project Phase I Page 13
AUTOMATIC FACEMASK DETECTION 2020-2021
rates have been expanded from the first 2.94 megabits every second (Mbit/s) to the
most recent 400 gigabits for each second (Gbit/s). The Ethernet norms include a
few wiring and flagging variations of the OSI actual layer being used with Ethernet.
Frameworks imparting over Ethernet partition a surge of information into more limited
pieces called outlines. Each casing contains source and objective locations, and
blunder checking information so that harmed edges can be recognized and disposed
of; regularly, higher-layer conventions trigger retransmission of lost edges. Per the
OSI model, Ethernet offers types of assistance up to and including the information
interface layer. The 48-piece Macintosh address was embraced by other IE802
systems administration principles, including IEEE 802.11 (Wi-Fi), just as by FDDI.
EtherType esteems are likewise utilized in Subnetwork Access Convention
(SNAP) headers.
Ethernet is generally utilized in homes and industry, and interworks well with remote
Wi-Fi innovations. The Web Convention is regularly continued Ethernet thus it is
viewed as one of the key advances that make up the Web.
Anaconda constrictor Guide is a work area graphical UI (GUI) remembered for Boa
constrictor circulation that permits clients to dispatch applications and oversee conda
bundles, conditions and channels without utilizing order line orders. Pilot can look for
bundles on Boa Constrictor Cloud or in a neighborhood Boa Constrictor Storehouse,
introduce them in a climate, run the bundles and update them. It is accessible for
Windows, macOS and Linux.
Conda is an open source, cross-platform, language-agnostic bundle administrator] that
introduces, runs, and updates bundles and their dependencies. made for Python
programs, however it can bundle and circulate programming for any language (e.g., R),
including multi-language projects. The conda bundle and climate supervisor is
remembered for all renditions of Boa constrictor, Mini conda, and Boa Constrictor
Repository.
4.tensorflow>=1.15.2 [12]
Tensor Flow is a free and open-source programming library for AI. It tends to be utilized
across a scope of errands yet has a specific spotlight on preparing and surmising of
profound neural networks.
Tensor flow is an emblematic numerical library dependent on dataflow and differentiable
B.E (EEE) Project Phase I Page 17
AUTOMATIC FACEMASK DETECTION 2020-2021
5.keras==2.3.1 [13]
Keras is an open-source programming library that gives a Python interface to fake neural
organizations. Keras goes about as an interface for the Tensor Flow library.
6.imutils==0.5.3 [14]
7.numpy==1.18.2 [15]
is a library for the Python programming language, adding support for huge, multi-
dimensional clusters and grids, alongside an enormous assortment of elevated level
8.opencv-python==4.2.0. [15]
9.matplotlib==3.2.1 [16]
Matplotlib is a plotting library for the Python programming language and its
mathematical science augmentation NumPy. It gives an article arranged Programming
interface to installing plots into applications utilizing universally useful GUI tool stash
like Tkinter
10.scipy==1.4.1 [17]
is a free and open-source Python library utilized for logical processing and specialized
computing. SciPy contains modules for streamlining, straight variable based math, mix,
addition, uncommon capacities, FFT, sign and picture preparing, Tribute solvers and
different undertakings regular in science and designing.
CHAPTER 3
Block Diagram
[17]
the signal is sent to Raspberry Pi board if the person is wearing the face
mask on screen terminal shows face mask is on or else it shows based
fast is not on if there is a face mask detected the Servo Motor by action
and control of Raspberry Pi board opens up door
CHAPTER 4
Circuit Diagram
T1.
At the point when a client approaches our webcam, the python code using Tensorflow,
OpenCV, Also, imutils bundles will recognize if a client is wearing a face cover will be
assigned with a red box around their face cover will see a green box around their face
veil with the content.
"Much obliged to you Veil On”. The clients who are not wearing the cover will see the
red box around Their face with, “no face veil identified." Term the Raspberry Pi veil
identifier takes. Beginning with a new introduce of the Raspberry Pi So to complete all
components of this venture.
Will take in any event 5 hours. We can subtract 1.5 hours for the introduce of OpenCV.
Even better, we have incorporated a pre - prepared model for the task to bounce
straightforwardly to a working Pi cover discovery framework. Numerous clients are as
yet utilizing a similar rule of AI and fake intelligence, but we are adding Tensorflow
venture that decided whether a feline was conveying prey to its proprietor entryway.
OpenCV is an open source programming library for preparing continuous picture and
video with AI abilities.
2.Plugged in webcam into one of the USB ports of your Raspberry Pi. If you are utilizing
a Raspberry Pi camera rather than a webcam, use your lace link to interface it to your Pi.
Booting our Raspberry Pi.
Face detection by
OpenCv and
tensorflow via
webcam
Servo Motor
action and door Deep learning
opening if only Model Pre
the person created by keras
detected with & scipy
face mask On
On screen alert
on terminal Classification of
window wish 1. Person wearing
Mask is on or Face mask or not
2. mask is not on
The mask is on or not in green LED blinks when the mask is on and the
screen is founded by the contribution and when the face mask is not
on the red LED closed and the burner alerts the user to put the mask on
CHAPTER 5
5.1 Advantages: -
• It is very portable.
5.2 Disadvantages: -
• Power limitation
• Accuracy of detection.
• Requires continuous Internet link to scan the data sets.
5.3 Applications: -
The following are the applications of our developed project & its technology in real world
–
The applications of our project in very fast and it can be used in surveillance and
detection systems of whether the face mask is on or not
It can be used at big and bigger public gathering such as airport bus stations railway
stations sports events public events marriage concerts music concerts where the
manual instructions of putting the face mask on is not possible
To leverage the power of Artificial Intelligence and deep learning to put into
Practical uses
B.E (EEE) Project Phase I Page 36
AUTOMATIC FACE MASK DETECTION 2020-2021
It can be used for educational purposes training the Computer Science Students as
well as
The making the deep learning library and models
It can be also integrated with microcontroller and processes to for a iot controlled
environment
CHAPTER 6
CONCLUSION
We conclude that any complex problem can also be solved by breaking it into individual
much smaller units and by focusing solution to each of these small solutions. And when
these small solutions are integrated we arrive at a solution to a much bigger problem.
In this project we leverage the power of AI particularly in Face detection System to make
An efficient and accurate system to detect the presence of face masks in order to curb the
spread of coronavirus disease in times of heavy of flow of public as everything has been
unlocked to return back to normal state it causes the great risk of Transmission as large
public bodies are difficult to address be manual instruction to wear the face mask.
We have used the concept of face detection along with deep learning models and utilize
Library such as tensorflow now by and keras to predict the contour region of a person
space dynamically and determine whether he or she is wearing the face mask or not.
Upon detecting the face mask on the person space the prompt is given as thank you your
mask is on and for the hardware implementation we have utilized the action of Servo
Motors controlled by GP IO pins of Raspberry pi to operate a motor which acts as a Lever
of a door to grant access to people wearing mask and for those who are not wearing the
mask are prompted by these wear the mask is not on and the green and red LED light
blinks up and the motor does not open the doors
It Can also be used in various inter-disciplinary fields such as defense & security,
education & Training of students in Practical IOT based operations.
CHAPTER 7
Bibliography
[1]. https://www.kaggle.com/
[2]. https://www.udemy.com/
[3]. https://www.allaboutcircuits.com/projects/building-raspberry-pi-controllers-
part-3-object-detection-dc-motor-controll/
[4]. Google.com, image search service.