Final Report - Merged
Final Report - Merged
PROJECT REPORT
ON
Mask Detector
Submitted to
Dr. Babasaheb Ambedkar Technological
University, Lonere
IN PARTICAL FULFILMENT OF THE REQUIREMENT
FOR THE DEGREE
OF BACHELOR OF COMPUTER ENGINEERING
Submitted by
GUND MAYUR MAHADEV 4027
ALASE AKASH KALLUSHA 4028
MANE YESHIKA SUNIL 4029
HINGMIRE AISHWARYA GAJANAN 4030
CERTIFICATE
This is to certify that the following students of B.TECH
(Computer) at Sanjay Bhokare Group of Institutes, Miraj has
satisfactorily completed the project work entitled “MASK
DETECTOR” in partial fulfillment for award of Bachelor of
Technology Degree in Computer Engineering by Dr.Babasaheb
Ambedkar Technological University, Lonere in the year 2022-2023.
CERTIFICATE
This is to certify that, the project entitled “MASK DETECTOR” is
presented before Departmental research committee (DRC) by the
following students under the guidance of Prof.A.A.Todkar for the
academic year 2022-2023. The DRC has approved the said project.
Head,
Departmental Research Committee
Department of Computer Engineering.
ACKNOWLEDGEMENT
Every orientation work has an imprint of many people and it becomes our
duty to express deep gratitude for the same. During the entire duration of preparation
for this Dissertation, we received endless help from a number of people and feel that
this report would be incomplete if we do not convey graceful thanks to them.
Thank You.
Chapter 7 Limitation 21
1 SYSTEM DIAGRAM
2 SEQUENCE DIAGRAM
3 USE CASE DIAGRAM
4 ACTIVITY DIAGRAM
5 CLASS DIAGRAM
6 HAAR-CASCADE DIAGRAM
7 FEATURE DIAGRAM
8 CONVOLUTIONAL NEURAL NETWORK
MASK DETECTOR
CHAPTER 1 - Introduction
The COVID-19 pandemic has drastically transformed the way we live, work,
and interact with one another. In order to mitigate the spread of the virus, wearing
face masks has become an essential practice in public spaces. However, ensuring
compliance with mask-wearing guidelines can be challenging, especially in
crowded areas or places where monitoring is difficult.
To address this challenge, the face mask detection project aims to develop a
computer vision-based system that can automatically detect whether individuals
are wearing face masks or not. This system can assist in enforcing mask-wearing
policies, improve public health safety, and streamline monitoring efforts.
The goal of the project is to leverage the power of deep learning and
computer vision algorithms to accurately identify and classify faces as either
wearing masks or not.
1.1. Background
is a technique to find out whether the person is wearing a mask or not. In medical
applications Deep learning techniques are highly used as it allows researchers to
study and evaluate large quantities of data. Deep learning models have shown great
role in object detection. These models and architectures can be used in detecting the
mask on a face. Here we introduce a face mask detection model which is based on
computer vision and deep learning
Wearing face masks has been recognized as an effective measure in reducing the
transmission of respiratory droplets, which can carry infectious diseases like
COVID-19. By detecting individuals who are not wearing masks in public spaces,
face mask detection systems contribute to maintaining public health safety and
preventing the spread of contagious diseases.
Ensuring compliance with mask-wearing guidelines is crucial in controlling the
spread of infectious diseases. However, manual monitoring of mask-wearing in
crowded areas or public spaces can be challenging, time-consuming, and prone to
errors.
Resource Optimization: Human resources dedicated to monitoring mask-
wearing compliance could be deployed more effectively for other critical tasks if
face mask detection systems are employed. By automating the detection process,
authorities can optimize resource allocation, directing personnel to areas where non-
compliance is detected or assisting individuals who require guidance on mask usage.
Face mask detection systems provide real-time insights into the adherence to
mask-wearing guidelines. This information can be used by authorities to identify
patterns, hotspots, or areas of concern, enabling them to implement targeted
interventions, enforce regulations, and educate the public about the importance of
mask-wearing.
1.3. Scope
The system is easy to operate and it can be used in crowded areas. It also
ensures the compliance for wearing mask and the system provides accurate
assessment of the individual in public areas weather the person is wearing a mask
or not.
1.4. Overview
The main purpose the system is to detect the face with mask or without mask,
if without mask the system informs to authorities and beep alert generated.
The Literature Survey is used to provide a brief overview and explanation about
the reference papers. Literature survey conveys the technical details related to the
project in a prop under and detailed manner.
• Python IDE
• VS Code
• Working webcam
• 4 GB RAM and above
• Processor
OPENCV
NUMPY
NumPy is a library for the Python programming language, adding support for large,
multidimensional arrays and matrices, along with a large collection of highlevel
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
opensource software and has many contributors. 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.
Machine Learning
Machine learning is a field of study and application within artificial intelligence (AI)
that focuses on the development of algorithms and models that allow computers to
learn and make predictions or decisions without being explicitly programmed. It is
based on the idea that machines can learn from and adapt to data, enabling them to
improve their performance over time.
Supervised Learning: The model learns from labeled examples where the input data
is paired with the corresponding correct output or target values. It then makes
predictions or classifications on new, unseen data.
Unsupervised Learning: The model learns from unlabeled data and aims to discover
patterns, relationships, or structures within the data. It does not have explicit target
values to learn from.
Here we will work with face detection. Initially, the algorithm needs a lot of
positive images (images of faces) and negative images (images without faces) to
train the classifier. Then we need to extract features from it. For this, haar features
shown in below image are used. They are just like our convolutional kernel. Each
feature is a single value obtained by subtracting sum of pixels under white rectangle
from sum of pixels under black rectangle.
Now all possible sizes and locations of each kernel is used to calculate plenty
of features. For each feature calculation, we need to find sum of pixels under white
and black rectangles. To solve this, they introduced the integral images. It simplifies
calculation of sum of pixels, how large may be the number of pixels, to an operation
Department of Computer Engineering 2022-23 15 | P a g e
MASK DETECTOR
Now all possible sizes and locations of each kernel is used to calculate plenty
of features. For each feature calculation, we need to find sum of pixels under white
and black rectangles. To solve this, they introduced the integral images. It simplifies
calculation of sum of pixels, how large may be the number of pixels, to an operation
involving just four pixels. It makes things super-fast.
But among all these features we calculated, most of them are irrelevant. For
example, consider the image below. Top row shows two good features. The first
feature selected seems to focus on the property that the region of the eyes is often
darker than the region of the nose and cheeks.The second feature selected relies on
the property that the eyes are darker than the bridge of the nose. But the same
windows applying on cheeks or any other place is irrelevant.
For this, we apply each and every feature on all the training images. For each
feature, it finds the best threshold which will classify the faces to positive and
negative. But obviously, there will be errors or misclassifications. We select the
features with minimum error rate, which means they are the features that best
classifies the face and non-face images. (The process is not as simple as this. Each
image is given an equal weight in the beginning. After each classification, weights
of misclassified images are increased. Then again same process is done. New error
rates are calculated. Also new weights. The process is continued until required
accuracy or error rate is achieved or required number of features are found).
Convolutional layers
In a CNN, the input is a tensor with a shape: (number of inputs) x (input height) x
(input width) x(input channels). After passing through a convolutional layer, the
image becomes abstracted to a feature map, also called an activation map, with
shape: (number of inputs) x (feature map height)x (feature map width) x (feature
Department of Computer Engineering 2022-23 18 | P a g e
MASK DETECTOR
map channels).Convolutional layers convolve the input and passits result to the next
layer. This is similar to the response of a neuron in the visual cortex to a specific
stimulus. Each convolutional neuron processes data only for its receptive field.
Although fully connected feedforward neural networks can be used to learn features
and classify data, this architecture is generally impractical for larger inputs such as
high-resolution images.
Pooling layers
Convolutional networks may include local and/or global pooling layers along with
traditional convolutional layers. Pooling layers reduce the dimensions of data by
combining the outputs of neuron clusters at one layer into a single neuron in the next
layer. Local pooling combines small clusters, tiling sizes such as 2 x 2 are commonly
used. Global pooling acts on all the neurons of the feature map. There are two
common types of pooling in popular use: max and average. Max pooling uses the
maximum value of each local cluster of neurons in the feature map, while
average pooling takes the average value.
Fully connected layers
Fully connected layers connect every neuron in one layer to every neuron in another
layer. It is the same as a traditional multilayer perceptron neural network (MLP).
The flattened matrix goes through a fully connected layer to classify the images.
Weights
Each neuron in a neural network computes an output value by applying a specific
function to the input values received from the receptive field in the previous layer.
The function that is appliedto the input values is determined by a vector of weights
and a bias (typically real numbers). Learning consists of iteratively adjusting these
biases and weights.The vector of weights and the bias are called filters and represent
particular features of the input (e.g., a particular shape). A distinguishing feature of
CNNs is that many neurons can share the same filter. This reducesthe memory
footprint because a single bias and a single vector of weights are used across all
receptive fields that share that filter, as opposed to each receptive field having its
own bias and vector weighting.
CHAPTER 6 - Result
6.1. Snapshots
CHAPTER 7 Limitation
Limitation:
There were not many challenges faced but the two problems that were time
consuming and made the tasks tedious are discussed as follows. One was the
excessive data collecting real time imagesfor dataset and second is when detecting
person in came for capturing we need to maintain specific distance from camera.
Future Prospects:
More than fifty countries around the world have recently initiated wearing
face masks compulsory. People have to cover their faces in public, supermarkets,
public transports, offices, and stores. Retail companies often use software to count
the number of people entering their stores. They may also like to measure
impressions on digital displays and promotional screens. Our software can be
equated to any existing cameras to detect people without a mask. This detection live
video feed can be implemented in web applications so that the operator can see
notice messages. . In scenarios such as community access, campus governance, and
enterprise resumption, the algorithm will provide contactless facial authentication.
CHAPTER 9- Conclusion
Conclusion:
Bibliography
Bibilography:
• www.wikipedia.com
• https://pypi.org/project/opencv-python/
• https://www.python.org/downloads/
• https://matplotlib.org/
• https://pypi.org/project/gTTS/
Achivements: