Automatic Face Mask Detection Using Python
Automatic Face Mask Detection Using Python
Abstract:
The corona virus COVID-19 pandemic is causing a global health crisis so the effective
protection methods is wearing a face mask in public areas according to the World Health
Organization (WHO). The COVID-19 pandemic forced governments across the world to impose
lockdowns to prevent virus transmissions. Reports indicate that wearing facemasks while at
work clearly reduces the risk of transmission. An efficient and economic approach of using AI to
create a safe environment in a manufacturing setup. A hybrid model using deep and classical
machine learning for face mask detection will be presented. A face mask detection dataset
consists of with mask and without mask images, we are going to use OpenCV to do real-time
face detection from a live stream via our webcam. We will use the dataset to build a COVID-19
face mask detector with computer vision using Python, OpenCV, and Tensor Flow and Keras.
Our goal is to identify whether the person on image/video stream is wearing a face mask or not
with the help of computer vision and deep learning.
Key words: Machine learning, R-CNN algorithm, MobilenetV2, Keras OpenCV. Face Mask
Detection.
INTRODUCTION:
The reason for this is that the virus that causes COVID-19 can be spread even before
symptoms appear, by such things as coughing, sneezing, or even speaking at close range. Cloth
face coverings have been recommended due to their low cost and ready availability. By using
cloth face coverings, it preserves surgical masks and N-95 masks for healthcare workers who
may be involved in direct care of patients with COVID-19.
Corresponding Author: M.Madan Mohan, Asst. Professor,
Department of CSE, Nehru Institute of Engineering and Technology
Coimbatore.
Mail: [email protected]
The wearing of the face masks appears as a solution for limiting the spread of COVID-19.
In this context, our projects Aims to create a mask detecting system which will enable us with
the information using image processing that if a person is wearing mask on real time or not.
A face mask detection dataset consists of with mask and without mask images. we are
going to use OpenCV to do real-time face detection from a live stream via our webcam. We will
use the dataset to build a COVID-19 face mask detector with computer vision using Python,
OpenCV, and Tensor Flow and Keras. Our goal is to identify whether the person on image/video
stream is wearing a face mask or not with the help of computer vision and deep learning.
Here we introduce a mask face detection model that is based on computer vision and
deep learning. The proposed model can be integrated with surveillance cameras to impede the
COVID-19 transmission by allowing the detection of people who are wearing masks not wearing
face masks. The model is integration between deep learning and classical machine learning
techniques with OpenCV, tensor flow and Keras. We have used deep transfer learning for
feature extractions and combined it with three classical machine learning algorithms. We
introduced a comparison between them to find the most suitable algorithm that achieved the
highest accuracy and consumed the least time in the process of training and detection.
LITERATURE SURVEY
[1] An Automated System to Limit COVID-19 Using Facial Mask Detection in Smart City
Network (Base Paper):
COVID-19 pandemic caused by novel coronavirus is continuously spreading until now all
over the world. The impact of COVID-19 has been fallen on almost all sectors of development.
The healthcare system is going through a crisis. Many precautionary measures have been taken
to reduce the spread of this disease where wearing a mask is one of them. In this paper, we
propose a system that restrict the growth of COVID-19 by finding out people who are not
wearing any facial mask in a smart city network where all the public places are monitored with
Closed-Circuit Television (CCTV) cameras. While a person without a mask is detected, the
Proposed work:
The proposed project will be able to analyze the images through camera and detects the
presence of mask and create masked face images from unmasked face images by appending
the mask on the face recognized on the image and store it. the project works by integration of
python OpenCV tensor flow for implementing the detection of face mask.
We are using R CNN which is really efficient compared to the other machine learning model.
The data modeling and analysis tools, such as data mining, machine learning, have the potential
to generate a knowledge-rich environment which can help to significantly improve the quality
of clinical decisions. MobileNetV2 builds upon the ideas from MobileNetV1 [1], using depth
wise separable convolution as efficient building blocks. However, V2 introduces two new
features to the architecture: 1) linear bottlenecks between the layers, and 2) shortcut
connections between the bottlenecks1. The basic structure is shown below.
CONCLUSION
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 hyperparameters. MobileNetV2
was used to build the mobile version of the same. This specific model could be used as a use
case for edge analytics.