Face Mask Detection
Face Mask Detection
2. K. Sai Teja(19BQ1A0577)
3.K. Shravani(19BQ1A0587)
4. K. Suma Sri(19BQ1A0575)
Table of Content
1) Problem Statement
2) Introduction
4) Implementation
1) Modules
5) Results
Problem Statement :- This project is to identify face masks as an object in video surveillance
cameras across different places like hospitals, functions, emergency departments etc to provide
safety to doctors ,patients and reduce the outbreak of the disease and to provide safety for people.
Introduction:-
We will build a real-time system to detect whether the person on the webcam is wearing a mask
or not. We will train the face mask detector model using Keras and OpenCV.
The face mask recognition in this study is developed with a machine learning algorithm through
the image classification method: MobileNetv2. MobileNetV2 is a method based on
Convolutional Neural Network (CNN) that developed by Google with improved performance
and enhancement to be more efficient. This project was done by considering two original
datasets. The dataset was taken from the Kaggle dataset and the Real-World Masked Face
dataset (RMFD); used for the training, validation, and testing phase so the model can be
implemented .
Software Requirements :-
Hardware Requirements :-
Webcam
RAM :- 4GB(or above)
Processor :- i5(or i7 recommended)
Implementation:
Modules used :
➢ TensorFlow: The TensorFlow object detection API is the framework for creating a
deep learning network that solves object detection problems.
TensorFlow Graphics aims at making useful graphics functions widely accessible to the
community by providing a set of differentiable graphics layers (e.g. cameras, reflectance
models, mesh convolutions) and 3D viewer functionalities that can be used in your
machine learning models of choice.
➢ Keras : Keras is an Open Source Neural Network library written in Python that runs on
top of Theano or Tensorflow. It is designed to be modular, fast and easy to use. Keras is
high-level API wrapper for the low-level API, capable of running on top of TensorFlow,
CNTK, or Theano. Keras High-Level API handles the way we make models, defining
layers, or set up multiple input-output models. In this level, Keras also compiles our
model with loss and optimizer functions, training process with fit function. Keras in
Python doesn't handle Low-Level API such as making the computational graph, making
tensors or other variables because it has been handled by the "backend" engine.
➢ Numpy : NumPy is a module for Python. The name is an acronym for "Numeric
Python" or "Numerical Python". It is an extension module for Python, mostly written in
C. This makes sure that the precompiled mathematical and numerical functions.
➢ Furthermore, NumPy enriches the programming language Python with powerful data
structures, implementing multi-dimensional arrays and matrices. These data structures
guarantee efficient calculations with matrices and arrays. The implementation is even
aiming at huge matrices and arrays, better know under the heading of "big data". Besides
that the module supplies a large library of high-level mathematical functions to operate
on these matrices and arrays.
➢ Imutils : Imutils are a series of convenience functions to make basic image processing
functions such as translation, rotation, resizing, skeletonization, and displaying Matplotlib
images easier with OpenCV and both Python 2.7 and Python 3.
➢ OS : The OS module in Python provides functions for interacting with the operating
system. OS comes under Python’s standard utility modules. This module provides a
portable way of using operating system dependent functionality. The *os* and
*os.path* modules include many functions to interact with the file system.
➢ Scipy : SciPy, a scientific library for Python is an open source, BSD-licensed library for
mathematics, science and engineering. The SciPy library depends on NumPy, which
provides convenient and fast N-dimensional array manipulation. The main reason for
building the SciPy library is that, it should work with NumPy arrays.
Note: To install these modules you should type the following command in
command prompt.
pip install (module name)
Example: For installing tensorflow you should type the following
command in your command prompt window.
pip install tensorflow
Flow Chart:
Process for Face Mask Detection :
Image Classification :
Result: After executing our file in the command prompt for detect mask video
the execution process is as shown below:
Before starting the video stream the model checks whether the processor is
suitable for execution or not. After all requirements are satisfied then it will
redirect to a frame then our webcam will on automatically showing faces
along with the tags contained in rectangular boxes with or without mask.
The frame is shown in two cases:
Without Mask:
With Mask: