You are on page 1of 6

JNROnline Journal Journal of Natural Remedies

ISSN:2320-3358 Vol. 21, No. 12(1), (2021)


ISSN:0972-5547

FACE MASK DETECTION USING CONVOLUTIONAL NEURAL NETWORK


Dr.Beena Ullala Mata1, Bhavya S2, Ashitha S3
1
Professor, Dept. of medical electronics engineering, B.M.S College of engineering,
Bangalore, India
Abstract- Efficient strategies to contain the coronavirus disease 2019 (COVID-19) pandemic are
peremptory to relieve the negatively impacted public health and global economy, with the full
scope yet to unfold. In the absence of highly effective drugs, vaccines, and abundant medical
resources, many measures are used to manage the infection rate and avoid exhausting limited
hospital resources. Wearing masks is among the non-pharmaceutical intervention (NPI) measures
that could be effectively implemented at a minimum cost and without dramatically disrupting social
practices. Therefore, it is essential to develop a system that detects those citizens who wear a face
mask and who do not. We develop this system using Machine Learning and Deep Learning
Techniques and build CNN model to detect people wearing masks and not wearing masks using
image or a video stream as input. Face masks are part of an infection control strategy to eliminate
cross-contamination.
Keywords-Computer Vision, Machine Learning, Deep Learning, Convolution Neural Network.
I. INTRODUCTION
In 2020, due to the rapid spreading of covid-19, the World Health Organization has declared
covid-19 as a global pandemic. Due to this contagious deadly virus, many people have lost their
lives and there is also a massive damage in global economy and even unemployment has increased.
In order to prevent or keep this situation in control, wearing a face mask has become very
important. Many studies have proved that wearing a face mask helps to prevent the transmission
of covid-19. But many people forget about the current situation and not wear masks. In order to
detect those people who wear face mask and who don’t, 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.
This model helps in detecting people wearing face masks. Based on the literature surveys done, we
had come up with a most suitable algorithm that achieves better accuracy and also consumes less
time in training, testing and detection.
II. LITERATURE SURVEY
Paul Viola and Micha. Jonesel J proposed a method to detect faces which are capable of processing
images rapidly while achieving high detection rate. ‘‘integral image’’, Ada Boost learning and finally,
a technique to combine classifiers in ‘‘cascade’’ is performed. These three are the key contribution
steps in face detection. This proposed method minimizes computation time while achieving high
detection accuracy.
Tanmoy Paul, Ummul Afia Shammi et al. found the Viola-Jones Algorithm’s accuracy for images
with different backgrounds, angles and distances. Though the accuracy of detecting the
objects\face is more in Viola-Jones Algorithm, depending up on the backgrounds, angles and
distances the accuracy results decrease.
Jie Wang and Zihao Li using Convolutional Neural Network built a face recognition model. They
have simplified the CNN model by combining the convolution and sampling layers. The advantage
of this model is that the memory requirements are reduced, and the number of parameters to be
trained is correspondingly reduced which also reduces the training time.
Mrs. Monali Nitin Chaudhari et al. presented an improvisation on the existing Viola Jones
algorithm. They have added CNN technique with Viola Jones algorithm. This algorithm increases
the accuracy of face detection to 90% where VLA’s accuracy is just about 78.4%. Again this new
algorithm also fails to detect faces under occlusions, but is comparatively less than VLA.

14
Bin Li and Hong Fu proposed an algorithm. First, a group of candidate regions with regional
extreme points is quickly proposed; then, a set of convolution neural networks (CNNs) is adopted
to determine the most likely eye region and classify the region as left or right eye; finally, the centre
of the eye is located with other CNNs. This method can deal with real time problems that arise in
realistic scenarios.
Sukhada Chokkadi et al have carried out an exhaustive literature review on many face recognition
techniques which uses Deep Learning and along with the outcome of those techniques, its
limitations were mentioned.
Mingjie Jiang et al, proposed Retina Face Mask which is one of the first dedicated face mask
detector. The architecture of Retina Face Mask consists of ResNet or Mobile Net as the backbone.
This method has improved the mask detection ability and is also able to detect small face masks.
They also mentioned accuracy by comparing different models.
Amit Chavda, Jason Dsouzaet al. with the help of dual-stage Convolutional Neural Network
(CNN) architecture, carried out the detection of masked and unmasked faces. This model gives 5
FPS interference speed on a CPU. This system can be easily deployed for automated monitoring
of the use of face masks at workplaces, which will help make them safer.
BoshengQin and Dongxiao Li using CNN, deep learning, image super-resolution, SRCNet face
mask wearing condition is detected. The results obtained were more accurate but numbers of
datasets used were small and this model can’t be tested on video stream because they haven’t added
video in the dataset.
Vinitha.V and Velantina.Vwithdeep learning and computer vision which uses Python, OpenCV,
TensorFlow and Keras detects the person is wearing a face mask. This paper explained in brief the
all above APIs and how it helps to detect people wearing masks or not.
Kewen Yan et al. using Convolution Neural Network proposed a face recognition method. They
trained the feature extraction and the classifier using Stochastic gradient descent algorithm. If ant
over-fitting problem is found, they use dropout method to solve it. During testing and training
process, they have used Convolution Architecture For Feature Extraction framework. The
recognition rate obtained was 99.82% and 99.78%.
Manjunath Jogin et al. using the concept of convolution neural network and deep learning
extracted features of an image. They have implemented various classification algorithm using the
deep learning concept like kNN classifier, SVM, softmax classifier and fully connected neural
networks and CNN. The results obtained for image classification showed accuracy of about
85.97%.
Xin Zhang et al. proposed an algorithm to detect and recognize faces. They implemented this
using a series of signal processing methods like Haar-like feature, facial image pre-processing and
Principal Component Analysis(PCA), AdaBoost and other algorithms. Here, PCA algorithm is
used to recognize faces effectively. And finally they obtained an overall true-positive rate of 98.8%
for face detection and 99.2% for correct facial recognition.
G. Akhila Goud and B. Hemanth built a system or a model to recognize or detect faces. In this
model surveillance camera acts as the primary input block. Server Database System plays an
important role in holding information. Thus a system that can detect and identify a person from a
crowd can be designed using a canny edge detection algorithm.
Constantine Papageorgiou and Tomaso Poggio proposed a trainable system for object detection
in unconstrained and cluttered scenes. They built this system using Haar wavelets which captures
the significant information about elements of the object class. By combining this with other
classification techniques and vector machine, a high accuracy of about 90% with low rates of false
positives output is obtained.

K. Sunil Manohar Reddy made a survey on various face recognition algorithms and even
mentioned their advantages and disadvantages. He did the survey on algorithms like Eigenface,
Neural Networks, Fisherface, Elastic Bunch Graph Matching.
15
SonaliChhapre et al. came up with an Augmented Heterogeneous Face Recognition (AHFR)
algorithm to recognize faces in the night time. It is very difficult to detect faces during night times
and even for cross-distance and cross-spectral face matching. In such cases this algorithm is very
useful. By learning based face image restoration method, the performance of the proposed system
is improved.
Khalid Hussain performed a literature survey on few Face Recognition Techniques where he
discussed about featured and statistical approaches. Featured approach comprises of scale Space
Filtering whereas statistical approach comprises of Principle Component Analysis and Linear
Discriminate Analysis techniques for face recognition. Both method showed better performance
under different circumstances and provide the different base to recognition of faces. No
informative data is lost when PCA and LDA techniques is used as it enhances the power of
recognition.
B. Ajanta Reddy and T. Anil Raju performed illumination normalization techniques, feature
extraction techniques and vector comparison on extended Yale data base which contain 2414
images of size 32X32. This dataset is then divided into two sets for training and testing. The
experimental results shown that gradient faces normalization techniques achieved better
recognition rate than other normalization techniques. Many different recognition rates were
obtained.
Muhammad Naeem et al. shown the comparison of different face recognition techniques. After
the comparison, it is shown that hybrid approach is best approach as it uses two approaches.
I. PROPOSED SYSTEM
Our proposed model is integration between deep learning and classical machine learning
techniques with OpenCV, tensor flow and Keras. Our model consists of about 2000 images which
is split into ‘faces with mask and without mask’. By using these images as dataset and Tensorflow,
we are going to build a Convolutional Neural Network model. The built model is then used to
detect people wearing mask and not wearing mask from the image or video stream.

Fig1: Flow chart of the Face Mask Detector


II. METHODOLOGY
• Data Visualization: In this step we visualize the images in datasetto understand the
significance of data and to communicate this information clearly and efficiently. Image is viewed
using matplotlib in a grid 4x4 consisting of 16 images. First 8 images consist of masked images
and next 8 images consist of nonmasked images.
• Data Augmentation: This is a technique to artificially create new training data from existing
training data. Image data augmentation is used to expand the training dataset in order to improve
the performance and ability of the model to generalize. It performs shift, flip, rotate and zoom
operations on images to increase the number of images. Image data augmentation is supported
in the keras deep learning library via the Image Data Generator class.

16
• Build CNN model: CNNas a machine learning algorithm that can take in an input image,
assign importance like learnable weights and biases to various objects in the image and be able to
differentiate one from the other. Here the image dataset undergoes many layers of convolution
and pooling which results in a flattening image and then these flattened layers are fully connected
in order to obtain a softmax. Features are learnt or identified during the convolution and pooling
layer whereas classification during latter steps.

Fig2: Fully connected CNN layer, source-google.


• Compile and train model: The model is fed with images containing mask and images not
containing mask for training. Once the training is over we test and validate the model.
• Evaluation and test model: After training the model we plot graphs for test loss and test
accuracy and train loss and training accuracy. Below figures are the resulted graphs obtained for
training and validation loss and for training and validation accuracy.

Fig3: Graph obtained for Training and Validation loss

Fig4: Graph obtained for Training and Validation accuracy


• Save model and Predict the result on static images: After training and evaluating the model,
save the model. And now the model is ready. To this model give static image as input and predict
the output that is see if the output detects whether the person on image wearing mask or not
wearing mask.
III. CONCLUSION
As the technology are blooming with emerging trends the availability so we have novel face
mask detector which can possibly contribute to public healthcare. With the help of computer
vision and deep learning, we have come up with a model. This model is tested on different
image. By the development of face mask detection, we can detect if the person is wearing a face
mask and allow their entry would be of great help to the society. Our implementation showed

17
accuracy of about 60% which can be improved in the future using improved techniques and
advanced algorithms.
IV. ACKNOWLEDGEMENT
We would like to express our special thanks of gratitude to Professor’s Dr.BeenaUllala Mata and
Dr. H N Suma for their able guidance and support in completing our Project for Community
Service (PCS) project. We would also like to thank the Department of Medical Electronics for
giving us the golden opportunity and providing us the required efficient equipment and support.
REFERENCES
[1] Paul Viola and Michael J. Jones, ’’Robust real-time face detection’’, International Journal of
Computer Vision, Kluwer Academic Publishers., Vol 57(2), pp. 137–154,2004.
[2] Jie Wang, Zhao Li, ‘’ Research on face recognition based on CNN’’, 2 nd International Symposium
on Resource Exploration and Environmental Science IOP Conf. Ser.: Earth Environ. Sci. 170
032110, 2018.
[3] Mrs. Monali Nitin chaudhari, Ms. Mrinal Deshmukh, Ms. Gayatri Ramrakhiani, Ms.
RakshitaParvatikar, ‘’Face detection using viola-jones algorithm and neural networks’’, IEEE, 978-
1-5386-5257-2/18 ©2018.
[4] Bin Li and Hong Fu, ‘’Real time eye detector with cascaded convolutional neural networks’’,
Hindawi, Applied Computational Intelligence and Soft Computing, Volume 2018.
[5] SukhadaChokkadi, Sannidhan MS, Sudeepa K B, AbhirBhandary, ‘’A study on various state of
the art of the art face recognition system using deep learning techniques‘’, International Journal of
Advanced Trends in Computer Science and Engineering, Vol 8(4), July- August 2019.
[6] Mingjie Jiang, Xinqi Fan and Hong Yan, ‘’Retinafacemask: A face mask detector’’, Innovation
and Technology Commission, and City University of Hong Kong, June 9, 2020.
[7] Amit Chavda, Jason Dsouza, Sumeet Badgujar and Ankit Damani ‘’ Multi-stage CNN
architecture for face mask detection’’, iPing Data Labs LLP, Mumbai, 2020.
[8] Bosheng Qin and Dongxiao Li, ‘’ Identifying facemask-wearing condition using image super-
resolution with classification network to prevent covid-19’’, Sensors, Vol.
20, 2020.
[9] Vinitha.V and Velantina.V’Covid-19 facemask detection with deep learning and computer
vision’’, International Research Journal of Engineering and Technology (IRJET), Volume: 07 Issue:
08, Aug 2020.
[10] Tanmoy Paul, UmmulAfiaShammi, Mosabber Uddin Ahmed, Rashedur Rahman,
SyojiKobashi, Md Atiqur Rahman Ahad, ‘’A study on face detection using viola-jones algorithm in
various backgrounds, angles and distances’’, Biomedical Soft Computing and Human Sciences, Vol
23, No. 1, pp. 7-36, 2018.
[11] Manjunath Jogin, Mohana, Madhulika M S, Divya G D, Meghana R K, Apoorva S, “Feature
Extraction using Convolution Neural Networks (CNN) and Deep Learning”, 2018 3rd IEEE
International Conference on Recent Trends in Electronics, Information & Communication
Technology, May 18th & 19th 2018.
[12] Xin Zhang, Thomas Gonnot, JafarSaniie, “Real-Time Face Detection and Recognition in
Complex Background”, Journal of Signal and Information Processing, 2017, 8, 99-112.
[13] G. Akhila Goud, B. Hemanth, “Face Recognition using Edge Detection of Layer” © 2015
IJSRSET | Volume 1.
[14] Constantine Papageorgiouand Tomaso Poggio, “A Trainable System for Object Detection”,
International Journal of Computer Vision 38(1), 15–33, 2000.
[15] K. Sunil Manohar Reddy, “Comparison of Various Face Recognition Algorithms”,
International Journal of Advanced Research in Science, Engineering and Technology Vol. 4, Issue
2, February 2017.
[16] SonaliChhapre, Priti Jadhav, Ankita Sonawane, Paresh Korani, “Night time face recognition at
large standoff”, International Research Journal of Engineering and Technology (IRJET), Volume:
04 Issue: 03, Mar -2017
18
[17] Khalid Hussain, “A Literature Study on Face Recognition Techniques”, International Journal
of Recent Advances in Engineering & Technology (IJRAET) V-4 I-1, February 2016.
[18] B. Ajanta Reddy, T. Anil Raju, “Extraction of Hidden Features using Preprocessing Techniques
and Texture analysis for Face Recognition”, International Journal of Advanced Research in
Electronics and Communication Engineering (IJARECE) Volume 4, Issue 8, August 2015.
[19] Muhammad Naeem, Imran Qureshi and Faisal Azam, “Face Recognition Techniques and
Approaches: a survey”, ISSN 1013-5316; Sci.Int.(Lahore),27(1),301-305,2015
[20] A. Kumar, A. Kaur, and M. Kumar, “Face detection techniques: a review, “Artificial
Intelligence Review, vol. 52,no. 2, pp. 927–948, 2019.D.-H. Lee, K.-L. Chen, K.-H. Liou, C.-L. Liu
and J.-L. Liu, Deep learning and control algorithms of direct perception for autonomous driving,
2019.
[21]Lin, T., Dollár, P., Girshick, R., He, K., Hariharan, B., and Belongie, S.J., “Feature pyramid
networks for object detection”, IEEE Conference on Computer Vision and Pattern Recognition
(CVPR), vol. 1, no. 2, 2017.
[22]He, K., Zhang, X., Ren, S., and Sun, J., Deep residual learning for image recognition,
Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 770– 778,
2016.
[23]Huang, G., Liu, Z., Van Der Maaten, L., and Weinberger, K. Q., “Densely Connected
Convolutional Networks”, 2017 IEEE Conference on Computer Vision and Pattern Recognition
(CVPR), Honolulu, HI, 2017, pp. 2261-2269, doi: 10.1109/CVPR.2017.

19

You might also like