Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 23

Department of Computer Science And Engineering

University College of Engineering, Kakinada.

AUTOMATIC FACEMASK DETECTION USING


MobileNetV2

Presented by Under the supervision of


A Lakshmi Anisha - 17021A0527 Dr.Ch.Satyanarayana,Phd,
Professor of CSE
Maleka Farheen - 17021A0533
K Manoj Kumar - 17021A0522
D Leela Govardhan - 17021A0545
B.Tech CSE
Contents:
 Abstract
 Introduction
 Dataset
 Existing System
 Drawbacks of Existing System
 Proposed System
 Architecture
 Feature extraction
 Workflow
 Face-mask detection for Images
 Face-mask detection for Video
 Advantages of Proposed System
 Hardware Specifications
 Software Specifications
Abstract
 This project introduces face mask detection that can be used by the authorities to make
mitigation, evaluation, prevention, and action planning against COVID-19.

 This project builds a user interface model to detect the face mask in images as well as in live
video stream efficiently . Deep Learning is used to extract the relevant features from the image
which can be used to detect the face mask.

 The proposed algorithm in face mask detection is a transfer learning method called MobileNetV2
which is a light-weight model.
Introduction
 Automatic face-mask detection at real-time is emerging as a very interesting problem in image
processing and computer vision.

 The goal has been to detect automatically whether a person is wearing a mask or not either in
images or live video stream.

 Face mask detection is done by analyzing the image by a convolutional neural network .
Convolutional neural network is a type of artificial neural network used in feature extraction and
classification of images in detection of face mask.

 TensorFlow is used for implementation of Convolutional neural networks.


DATASET
• The dataset consists of two folders of size 51MB of total 1377 images.

• The first folder, with_mask which contains 691 images of people wearing masks and another
folder, without_mask contains 686 files of people not wearing masks.

• Here the whole dataset is given to train_test_split() function to split the dataset in 80:20 ratio for
training and testing, respectively.
Existing system
• Single Shot Detector architecture is used for the object detection purpose.

• This algorithm uses one shot to detect multiple objects present in an image using multibox.

• SSD has two components: a backbone model and SSD head.

• Backbone model usually is a pre-trained image classification network as a feature extractor. This


model is trained on ImageNet.

• The SSD head is just one or more convolutional layers added to this backbone to get the output as
the bounding boxes.
Drawbacks
• It takes excessive time for data loading in Jupyter Notebook.

• It did not allow the access of webcam which posed a hurdle in testing images and video stream.

• We had to run the code locally on the computer through which we tested the code on the live
video stream.
Proposed System
• We proposed a system computationally efficient using MobileNetV2 which makes it easier to extract
the data sets. We use CNN architecture for better performance.

• Image augmentation is applied to capture invariance by generating additional images to improve


generalization. TensorFlow is used for implementation of CNN.

• This approach reduces our computer vision pipeline to a single step — rather than applying face
detection and then our face mask detector model, all we need to do is apply the object detector to
give us bounding boxes for people both with_mask and without_mask in a single forward pass of the
network.

• The proposed system can detect people wearing mask or not at an accuracy of 97%.
Fine-tuning is applied on proposed model as follows:
1. We load MobileNetV2 with pre-trained ImageNet weights, leaving off head of network(top
layer).

2. Construct a new fully connected head and append it to the base in place of the old head.
Architecture of MobileNetv2
FEATURE EXTRACTION
• Feature extraction is a process of dimensionality reduction by which an initial set of raw data is reduced to
more manageable groups for processing. A characteristic of these large data sets is a large number of
variables that require a lot of computing resources to process.

• Feature extraction is the name for methods that select and /or combine variables into features, effectively
reducing the amount of data that must be processed, while still accurately and completely describing the
original data set.

• In MobileNetV2 architecture ,feature extraction is done by convolution layers , average pooling layer.

• The process of feature extraction is useful when you need to reduce the number of resources needed for
processing without losing important or relevant information.
WORKFLOW OF PROJECT
1. Data Collecting
The development of the Face Mask Recognition model begins with collecting the data. The dataset train data on
people who use masks and who do not. The model will differentiate between people wearing masks and not.

For building the model, this study uses 691 data with mask and 686 data without a mask. At this step, the image is
cropped until the only visible object is the face of the object.

2.Pre-processing
The pre-processing phase is a phase before the training and testing of the data. There are four steps in the pre-
processing which are resizing image size, converting the image to the array, pre-processing input using
MobileNetV2, and the last is performing hot encoding on labels.

3.Split the Data


After the pre-processing phase, the data is split into two batches, which are training data namely 80 percent, and
the rest is testing data. Each batch is containing both of with-mask and without-mask images.

4.Building the Model


The next phase is building the model. There are six steps in building the model which are constructing the training
image generator for augmentation, the base model with MobileNetV2, adding model parameters, compiling the
model, training the model, and the last is saving the model for the future prediction process.
5.Testing the Model
To make sure the model can predict well, there are steps in testing the model. The first step is making
predictions on the testing set. When the accuracy line is being stable, it means that there is no need for more
iteration for increasing the accuracy of the model. We have gotten testing accuracy of 97% for the proposed
model

6.Implementing the model


The model implemented in the video. The video read from frame to frame, then the face detection algorithm
works. If a face is detected, it proceeds to the next process. From detected frames containing faces, reprocessing
will be carried out including resizing the image size, converting to the array, pre-processing input using
MobileNetV2.

The next step is predicting input data from the saved model. Predict the input image that has been processed
using a previously built model. Besides, the video frame will also be labelled that the person is wearing a mask
or not along with the predictive percentage.
MASK DETECTION USING IMAGES
RESULTS ON IMAGES
Input: (with_mask) Output:
RESULTS ON IMAGES

Input: (without_mask) Output:


MASK DETECTION FOR LIVE-VIDEO
RESULTS:

(WITHOUT_MASK) (WITH_MASK)
ADVANTAGES OF PROPOSED SYSTEM
• It is a light-weight model.

• We can integrate this model with real time applications in mobile as it occupies less space and
memory.

• MobilenetV2 model uses less computational power compared to traditional CNN.

• Face mask detector can be deployed in many areas like shopping malls, airports and other heavy
traffic places to monitor the public and to avoid the spread of the disease.

• It helps in optimizing the detection by focusing on what matters(feature extraction).


Hardware Specifications
• RAM : 4 GB
• Hard Disk : 500 GB
• Processor : Core i5 or Higher
• Speed : 2. 6Ghz
Software Specifications
• Python 3.6 or later.
• TensorFlow 2.0+
• Keras 2.5.0+
• Jupyter Notebook or Spyder
• Windows.

You might also like