Professional Documents
Culture Documents
Batch 3
Batch 3
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.
• 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.
• 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.
• 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.
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
(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.
• 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.