Face Mask Detection Using Tensor Floor
Face Mask Detection Using Tensor Floor
USING TENSORFLOW
A PROJECT REPORT
Submitted by
AVINASH RAI
KIRAN SAVANDE
KEVIN PRAJAPATI
NIMT KHATRI
in
September, 2021
PARUL UNIVERSITY
CERTIFICATE
This is to Certify that Project-I -Subject code 03105401 of 7th Semester entitled
“Face Mask Detection” of Group No. PUCSE has been successfully completed by
Project Guide
Prof. Harsh Kantawala
Head of Department
Prof. Amit Barve
ACKNOWLEDGEMENT
Date: 17/9/21
ABSTRACT
SR Title Page No
1.1.2 Objectives 6
1.1.3 Scope 7
3.1.2 Working 23
3.1.3 Advantages 24
3.1.4 Disadvantages 24
3.1.5 Methodology 24
Chapter : 4 Reference 25
LIST OF TABLES
LIST OF FIGURES
Figure No Figure Description Page No
Figure 3.1.1 Training Face Mask Detector
Figure 3.1.2 Apply Face Mask Detector
Figure 3.1.3 Invoice System
CHAPTER 1
1.1 INTRODUCTION
Everyday more and more people are infected by this deadly virus called
Corona Virus(Covid-19) and due to that other humans are also affected
even when they take all precautions. Also there’s no stop to the number
of cases increasing gradually. This problem should be fixed. Our system
aims to provide solutions to these problems using Machine Learning,
Deep Learning and Internet of Things.
1.1.2 OBJECTIVES
1) We intend to design a system which will reduce man power and also
ensure safety of people as the application generates invoice and fine is
taken, as result people don't forget to wear a mask so as to avoid a fine
amount.
2) The webcam would sense if any human has a mask on their face by
implementing a
4) After detecting the faces, with the help of OpenCV , each face ROI is
extracted.
1.1.3 SCOPE
CHAPTER 2
In the given research paper faculties Mohamed Loey and his team
have introduced a mask face detection model that is based on deep
transfer learning and classical machine learning classifiers. The
proposed model can be integrated with surveillance cameras to impede
the COVID-19 transmission by allowing the detection of people who are
not wearing face masks. The model is integration between deep transfer
learning and classical machine learning algorithms. They have used
deep transfer learning for feature extractions and combined it with three
classical machine learning algorithms to get highest accuracy and
consume least time in the process of training and detection. A hybrid
model using deep and classical machine learning for face mask detection
is presented in which it consists of two components, i.e feature
extraction using Resnet50 and classification process of face masks using
decision trees, Support Vector Machine (SVM), and ensemble
algorithm. Also three datasets are selected 1) RMFD, 2) SMFD and 3)
LFW. The SVM classifier achieved 99.64% testing accuracy in RMFD.
In SMFD, it achieved 99.49%, while in LFW, it achieved 100% testing
accuracy. The corona virus epidemic has given rise to an extraordinary
degree of worldwide scientific cooperation. As a result AI based on and
ResNet-50, and ResNet-18 are versions of ResNet to get rid of the
problem of vanishing gradients that have their specific residual block.
ResNet-50 with 50- layers are deep, start with a convolution layer, and
end with a fully- connected layer, and in between followed by 16
residual bottleneck blocks each block has three layers of convolution
layer. In classification, the last layer in ResNet-50 was removed and
replaced with three traditional machine learning classifiers Support
vector machine (SVM), decision tree, and ensemble , quickly detect
infections, the AI ’s power is being exploited to address the Covid-
19.Machine learning and Deep Learning can help to fight Covid-19 in
many ways. To better understand infection rates and to trace , they used
Ensemble methods are K-Nearest Neighbors Algorithm (k-NN), Linear
Regression and Logistic Regression . The first component is deep
transfer learning (ResNet50) as a feature extractor. With three traditional
machine learning classifiers (Support vector
12
machine (SVM) decision tree, and ensemble) to improve our model
performance. The main contribution of this research is to construct
SVM, decision trees, and ensemble that do not over fit the training
process. We will use such methods and algorithms to provide and
deliver results with maximum accuracy. With the proposed system,
higher accuracy can be achieved. The SVM classifier achieved the
highest accuracy possible with the least time consumed in the training
process. The SVM classifier in RMFD achieved 99.64% testing
accuracy. In SMFD, it gained 99.49%, while in LFW, it reached 100%
testing accuracy.
2) They have used deep transfer learning for feature extractions and
combined it with three classical machine learning algorithms
(Decision trees, SVM, and Ensemble).
4) Also three datasets are used : A dataset of RMFD with real face
masks for (training, and testing phases), will be referred to DS1. A
dataset of SMFD with fake masks for (training, and testing phases),
will be referred to DS2. A combined dataset from DS1, and DS2
for (training, and testing phases), will be referred to DS3. A dataset
of LFW with simulated face masks for (testing), will be referred to
DS4.
In This Paper, the author Shifeng Zhang, Zhen lie, Hailin Shi, Stan
Z.li, Xiaobo Wang mainly focused on Face Detection is one of the
fundamental problem in computer vision. This paper mainly shows the
former tends to great efficiency while latter cares more about high
accuracy. To perform well on both speed and accuracy, one natural idea
is to combine the advantages of them. Therefore ,cascade CNN based
methods are proposed that puts features learned by CNN into cascade
framework so as to boost the performance and keep efficient. In this,
they develop a state-of- the-art face detector with CPU real-time speed.
Core idea is to Shrink the input image and focus on detecting small
faces. Developing a novel face detector, designing a light-weight but
powerful convolutional network for face detection. Here FDDB and
AFW dataset is used to analyze model. For understanding DCFPN ,
each componenent one after another is ablate to examine the affect in
final performance. Efficient low-Resolution face recognition via Bridge
Distillation ,it was having low accuracy. Presenting a dataset of faces
that can be used as an additional training source for developing new
faces detectors. Analyzing model by FDDB dataset. Firstly we replace
fair L1 with Smooth L1 loss. Meantime the target of regression is the
same as RPN. Finally we take the place of DCCL with other 4
convolutional layers ; CNN , RDCL , DCDL , PASCAL. Dataset FDDB
Dataset The proposed model achieves the best performance in all
settings. This may imply that the a
12
feasible solution in finding robust and effective features for masked face
detection. In this paper, we propose a novel face detector with real-time
speed on the CPU devices as well as high performance. On the one
hand, our DCFPN has a light weight but-powerful framework that can
well incorporate CNN features from different sizes of receptive field at
multiple levels of abstraction. On the other hand, we use the dense
anchor strategy and propose the fair L1 loss function to handle small
faces well. The state-of-the-art performance on three challenge datasets
shows its ability to detect faces in the uncontrolled environment. The
proposed detector is very fast, achieving 30 FPS to detect faces bigger
than 40 pixels on CPU and can be accelerated to 250 FPS on GPU for
the VGA-resolution images.
In This Paper, the author Erik Hjelm , Boon Kee Low mainly
focused on comprehensive and critical survey of face detection
algorithms. Face detection is a necessary first-step in face recognition
systems, with the purpose of localizing and extracting the face region
from the background. It also has several applications in areas such as
content-based image retrieval, video coding, video conferencing, crowd
surveillance, and intelligent human–computer interfaces. However, it
was not until recently that the face detection problem received
considerable attention among researchers. The human face is a dynamic
object and has a high degree of variability in its apperance, which makes
face detection a difficult problem in computer vision. A wide variety of
techniques have been proposed, ranging from simple edge- based
algorithms to composite high-level approaches utilizing advanced
pattern recognition methods. The human face is a dynamic object and
has a high degree of variability in its apperance, which makes face
detection a difficult problem in computer vision. A wide variety of
techniques have been proposed, ranging from simple edge-based
algorithms to composite high-level approaches utilizing advanced
pattern recognition methods. A high degree of variability in its
apperance, which makes face detection a difficult problem in computer
vision. The face detection problem received considerable attention
among researchers. The human face is a dynamic object and has a high
degree of variability in its apperance, which makes face detection a
difficult problem in computer vision, so a wide variety of techniques
have been proposed, ranging from simple edge-based algorithms to
composite high-level approaches utilizing advanced pattern recognition
methods. A PDBNN is a classification neural network with a
hierarchical modular structure. Training is performed with DBNN
learning rules, which means that the teacher only tells the correctness of
the classification (no exact target values) and LUGS (locally
unsupervised globally supervised) learning is applied. Each subnet is
trained individually with an unsupervised training algorithm K-mean
and vector quantization or the EM algorithm. A wide variety of
techniques have been proposed, ranging from simple edge-based
algorithms to composite high-level approaches utilizing advanced
pattern recognition methods. Face detection is one of the visual tasks
which humans can do effortlessly. However, in computer vision terms,
this task is not easy. The solution to the problem involves segmentation,
extraction, and verification of faces and possibly facial features from an
uncontrolled background. As a visual frontend processor, a face
detection system should also be able to achieve the task regardless of
illumination, orientation, and camera distance. We have presented an
extensive survey of feature-based and image- based algorithms for face
detection, together with a brief presentation of some of the application
areas.Feature-based methods are applicable for real-time systems where
color and motion is available. Since an exhaustive multiresolution
window scanning is not always preferable, feature-based methods can
provide visual cues to focus attention. Image- based approaches are the
most robust techniques for
12
In This Paper, the author Kavita , Ms. Manjeet Kaur mainly focused
on The biometric is a study of human behavior and features. Face
recognition is a technique of biometric. Various approaches are used for
it. A survey for all these techniques is in this paper for analyzing various
algorithms and methods. Face recognition is emerging branch of
biometric for security as no faces can be defeated as a security
approach. So, how we can recognize a face with the help of computers
is given in this paper. Face recognition is emerging branch of biometric
for security as no faces can be defeated as a security approach. Early
face Recognition algorithms used simple geometric models, but the
recognition process has now matured into a science of sophisticated
mathematical representations and matching processes. Major
advancements and initiatives in the past ten to fifteen years have
propelled face recognition technology into the spotlight. Face
recognition can be used for both verification and identification. Over the
past few decades now enable similar recognitions automatically. Early
face recognition algorithms used simple geometric models, but the
recognition process has now matured into a science of sophisticated
mathematical representations and matching processes. There are some
techniques that identify, parameterize and analyze linear subspaces.
Other than linear subspaces there are some statistical face recognition
techniques which are based on non-linear subspaces. Hybrid learning
algorithm to train the RBF Neural Networks: Resting bitch face that
reconigsed the Expression of the person. Single Layer adaptive NN :A
single layer adaptive NN (one for each person) for face recognition,
expression analysis and face verification. Multilayer Perceptron (MLP):
face recognition system with neural networks present results with a
small number of classes the first 50 principal components of the face
images were extracted and reduced to five dimensions using auto
associative neural network. Self-Organizing map (SOM) it provides
dimensionality reduction and invariance to minor changes in the face
image sample. Artificial Neural Network (ANN) is a most successful
tool for pattern recognition problems. Image quality is taken into
consideration, there is a plethora of factors that influence the system’s
accuracy. It is extremely important to apply various image pre-
processing techniques to standardize the images that you supply to a
face recognition system. Most face recognition
12
2) We will use such methods and algorithm to provide and deliver results
with
3) maximum accuracy , reliability &more speedy.
4) Pytorch & Open Vision (OpenCV).
The current study used OpenCV, Pytorch and CNN to detect whether
people were wearing face masks or not. The models were tested with
images and real-time video streams. Even though the accuracy of the
model is around 60%, the optimization of the model is a continuous
process and we are building a highly accurate solution by tuning the
hyper parameters. MobileNetV2 was used to build the mobile version of
the same. This specific model could be used as a use case for edge
analytics. MobileNetV2 was chosen as an algorithm to build a model
that could be deployed ona mobile device. A customized fully connected
layer which contains four sequential layer
12
In This Paper, the author Walid Hariri mainly focused on new face
detection method by extending the state-of- the-art Faster R-CNN
algorithm. Their scheme improves the existing faster RCNN scheme by
combining several important strategies, including feature concatenation,
hard negative mining, and multi-scale training, etc. They conducted a
extensive set of experiments to evaluate the proposed scheme on the
well-known Face Detection Dataset and Benchmark (FDDB), and
achieved the state-of-the-art performance (ranking the best among all
the published approaches. The main results are that they have improved
the state-of-the-art faster RCNN framework by combining a number of
strategies, including feature concatenation, hard negative mining, multi-
scale training, model pretraining, and proper calibration of key
parameters. As a consequence, the proposed scheme obtained the state-
of-the-art face detection performance, making it the best model in terms
of ROC curves among all the published methods on the FDDB
benchmark. Face detection is one of the important key steps towards
many subsequent face-related applications, such as face verification,
face recognition and face clustering, etc. Early research studies in the
literature were mainly focused on extracting different types of hand-
crafted features with domain experts in computer vision, and training
effective classifiers for detection and recognition with traditional
machine learning algorithms. Such approaches are limited in that they
often require computer vision experts in crafting effective features and
each individual component is optimized separately, making the whole
detection pipeline often suboptimal. That's why in this paper they have
came up with new face detection method by extending the state-of-the-
art Faster R-CNN algorithm . To address the first problem, much effort
has been devoted to coming up with more complicated features like
HOG, SIFT, SURF and ACF. Others aimed to speed up the feature
selection in a heuristic way. The well known OpenCV C++ Library took
SVM as the classifier in its face detector. Other approaches, such as
random forest, have also been attempted . In addition, much work has
been done to improve the Faster R-CNN architecture. Also, joint
training conducted on CNN cascade, region proposal network (RPN)
and Faster R-CNN has realized end-to-end optimization. Wan et al
combined Faster R-CNN face detection algorithm with hard negative
mining and ResNet and achieved significant boosts in detection
performance on face detection benchmarks like 1) Feature
Concatenation 2)Hard Negative Mining and 3)Multi-Scale Training.
Their methodology follows the similar deep learning framework of
Faster RCNN, which has been shown to be a state-of-the-art deep
learning scheme for generic object detection. For
12
that, they have trained the CNN model of Faster RCNN using the
WIDER FACE dataset . Then further use the same dataset to test the
pre-trained model so as to generate hard negatives. The hard negatives
are fed into the network as the second step of our training procedure.
The resulting model will be further fine-tuned on the FDDB dataset.
During the final fine-tuning process, they have applied the multi-scale
training process, and adopt a feature concatenation strategy to further
boost the performance of our model. As a final optional step, they have
converted the resulting detection bounding boxes int ellipses as the
regions of human faces are more elliptical than rectangular. The concept
of uploading and training dataset on ImageNet and fine tuning process is
relevant to our methodology. 1) Faster RCNN 2) Pretrained VGG16
selected as backbone CNN network, deep learning framework .. Then,
they conducted an extensive set of experiments on the well-known
FDDB testbed for face detection benchmark, and achieved the state-of-
the-art results which ranked the best among all the published methods.
1) Proposed a new face detection method by extending the state-of-the-
art Faster R-CNN algorithm . 2) Improved the existing faster RCNN
scheme by combining several important strategies, including
feature concatenation, hard negative mining, and multi-scale training.3)
Conducted an extensive set of experiments to evaluate the proposed
scheme on the well-known Face Detection Dataset and Benchmark
(FDDB) and achieved the state-of-the-art performance (ranking the best
among all the published approaches).
12
3.1RESEARCH METHODOLOGY
CHAPTER 3
We have observed that even after the government and authorities said
to take care of our safety, there are people who roam around like
there’s no virus and few of them don't even wear a mask. Even in
malls, after lockdown if there is any sale all rushes like everything is
normal. So we have come up with a solution which may help in
reducing the spread of the coronavirus.
3.1.2 Working
First we’ll review the dataset to train our custom face mask detector .
We’ll use this Python script to train a face mask detector and review
the results.
1) Data augmentation
2) Loading the MobilNetV2 classifier (we will fine-tune this model with
pre-trained Image Net weights)
4) Pre-processing
After the detection of faces is done, extraction of face region is done and
on each face ROI, face mask classifier is applied and then according to
that a person’s face is detected. If the person is not wearing a mask
system will generate an invoice as a script and send it to the admin or
manager and collect the fine on the spot i.e in mall itself.
Figure 3.1.1 Training Face Mask Detector
12
3.1.3 Advantages
3.1.4 Disadvantages
3) ROI: Region of interest (left eye, right eye and lip according to
knowledge based method of face detection.
References
[1] K. He, X. Zhang, S. Ren and J. Sun, "Deep residual learning for image
recognition", 2016 IEEE Conference on Computer Vision and Pattern
Recognition (CVPR), pp. 770-778, 2016.
[3] H. Li, Z. Lin, X. Shen, J. Brandit and G. Hua, "A convolutional neural
network cascade for face detection", IEEE CVPR, pp. 5325-5334, 2015
[4] C.Y. Wen, S.H. Chiu, Y.R. Tseng and C.P. Lu, "The Mask Detection
Technology for Occluded Face Analysis in the Surveillance System",
Journal of forensic sciences, vol. 50, no. 3, pp. 593-601, 2005.1.
RETINAFACEMASK: A FACE MASK DETECTOR (MINGJIE JIANG,
XINQI FAN, HONG YAN).