• Nu S-Au Găsit Rezultate

View of Face Mask Detector Using Convolutional Neural Network

N/A
N/A
Protected

Academic year: 2022

Share "View of Face Mask Detector Using Convolutional Neural Network"

Copied!
7
0
0

Text complet

(1)

1979 http://annalsofrscb.ro

Face Mask Detector Using Convolutional Neural Network

K.R. Kavitha

1

, S. Vijayalakshmi

2

, A. Annakkili

3

, T. Aravindhan

4

, K. Jayasurya

5

1Professor/ECE, Sona College of Technology, Salem,Tamil Nadu, India. E-mail: [email protected]

2Assistant Professor/ECE, Sona College of Technology, Salem,Tamil Nadu, India.E-mail:[email protected]

3UG Student/ECE, Sona College of Technology, Salem,Tamil Nadu, India. E-mail: [email protected]

4UG Student/ECE, Sona College of Technology, Salem,Tamil Nadu, India. E-mail: [email protected]

5UG Student/ECE, Sona College of Technology, Salem,Tamil Nadu, India. E-mail:[email protected]

ABSTRACT

The corona virus COVID-19 pandemic is causing a worldwide health crisis therefore the effective protection method is wearing a mask publicly areas consistent with the planet Health Organization (WHO). Several world governments were during a situation whereas the transmission can't be cured without lockdown. Reports indicate that wearing facemasks while at work clearly reduces the danger of transmission. The Objective of mask Detector is to detect the presence and absence of mask in a person's face with help of webcam or mobile Camera by using Python modules. within the Covid-19 pandemic situation, this project help to alert people publicly who don't wear masks. This project built with the assistance of very simple and basic Convolutional Neural Network(CNN) model using TensorFlow with Keras library and OpenCV to detect whether the person is wearing a mask for safety or not. OpenCV to try to do real-time face detection from a live stream via the webcam. for creating this model, Prajna Bhandary's mask dataset is employed. It consists of about 1,376 images with 690 images containing people with mask and 686 images containing people without mask. This images are wont to build a CNN model using TensorFlow to detect if the person is wearing a mask or not by using the webcam of PC.

KEYWORDS

Face Mask Detection, Webcam, Python, CNN, TensorFlow, Keras, OpenCV.

Introduction

Wearing of face masks is found to be a compulsory step thanks to this global pandemic. it had been only thanks to pollution where people wore face masks. Many wear this as they're concerned about their appearance without understanding the important purpose of masks. it's been proved that wearing face masks help in preventing the transmission of this pandemic. Coronavirus Disease (COVID 19) was first discovered in Wuhan, China by the top of 2019. It grew at a faster rate than expected by 2020. quite 10 million cases were recorded by the top of 2020. It gets transmitted when social distancing isn't followed and when people are during a close area. However, it helped within the improvement of scientific department. Here is where AI and ML play the sport. They highly help within the prevention of transmission of this disease. ML helps researchers and clinicians evaluate vast quantities of knowledge to forecast the distribution of COVID-19, to alert them about the potential pandemic, and to segregate populations who are vulnerable. Healthcare department everywhere the planet must specialize in developing technologies like AI, IoT, big data and machine learning to manage and forewarn about upcoming pandemics. For a far better perspective of this disease and its infection rates, AI are often deployed as an answer. Many across the planet are forced by governments to wear face masks. They were employed because the death rates were hiking everywhere the world.

Monitoring and recording the activities of individuals everywhere may be a difficult process. However, using ML are often "> this is often possible as people that don't wear face masks can be detected.

Face mask detector may be a simple model to detect mask. This mask detector is often deployed in many public places like malls, public gatherings, schools and colleges. By implementing this detector, people that don't wear face masks during a crowd can even be easily detected. This detector is developed employing a technique called Convolutional Neural Network (CNN). Here Tensorflow and OpenCV are the first packages used.

Fang. Y, Nie. Y and Penny. M together discussed about the outbreak of this pandemic and governments‟ actions to be taken which will be effective for the preventive measures. By the utilization of parameterized susceptible‐exposed‐infectious‐recovered model, the spread dynamics of coronavirus disease 2019 (COVID‐19) outbreak is stimulated and impact of various control measures, conducted the sensitivity analysis to spot the key factor, plotted the trend curve of effective reproductive number (R), and performed data fitting after the simulation.

By the method of simulation and data fitting, the model displayed highest number of confirmed cases of 59769

(2)

1980 http://annalsofrscb.ro

arriving on 15 February 2020, which had the coefficient of nearly 1 and therefore the fitting bias 3.02%, with results that were highly accurate.

Leung. L.H, Chu. D. K et al., explained the importance of face masks which will prevent the virus from getting into the tract. When this virus is inhaled, it can cause Severe Acute Respiratory Syndrome (SARS) both in children and in adults. Surgical face masks highly reduced detection of influenza virus RNA in respiratory droplets and coronavirus RNA in aerosols where coronavirus RNA was highly reduced. From these results, they were ready to interpret that surgical face masks highly helped in prevention of disease transmission from symptomatic individuals.

Merenish. Z.A, Zumula A.I et al. explained a few human coronaviruses, referred to as the center East respiratory syndrome coronavirus (MERS-CoV), was first identified and isolated in September 2012 from Saudi businessman who died thanks to acute respiratory failure. From then on, 49 cases caused by MERS-CoV (previously called a completely unique coronavirus) with 26 life losses are reported. From this report, MERS-CoV infection, including the clinical presentation, treatment outcomes, and household relationships of three young men are described who became ill with MERS-CoV infection after the hospitalization of an elderly blood brother, who died of the disease.

Twenty-four other relations within the same neighbourhood and 124 attending staff members at the hospitals were healthy. MERS-CoV transmission can cause a cluster of illness. Although an animal reservoir is suspected, none were found. Meanwhile, the planet highly concerned about MERS-CoV to cause major health issues in close contact with patients.

Xu, L. & Ren, Jimmy et al., described about the Deep Convolutional neural network for image deconvolution and advances in Neural information science Systems. Many fundamental image-related problems involve deconvolution operators. Real blur degradation seldom complies with a deal linear convolution model thanks to camera noise, saturation, compression, to call a couple of. rather than perfectly modeling outliers, which is quite challenging from a generative model perspective, A deep convolutional neural network is developed to capture the characteristics of degradation. The directly applying existing deep neural networks doesn't produce reasonable results. the answer is to determine the connection between traditional optimization-based schemes and a neural specification where a completely unique, separable structure is introduced as a reliable support for robust deconvolution against artifacts.

The network contains two submodules, both trained during a supervised manner with proper initialization. The decent performance is yielded on non-blind image deconvolution compared to previous generative model-based methods.

Proposed System

The proposed system clearly explains the workflow, the model and the nature of the face mask detector. Shown below is the project flow.

Project Flow

Face mask Detector

├── dataset

│├── with_mask [690 entries]

│└── without_mask [686 entries]

├── examples

│├── example_01.png

│├── example_02.png

│└── example_03.png

├── face_detector

│├── deploy. prototxt

│└── res10_300x300_ssd_iter_140000.caffemodel

├── detect_mask_image.py

├── detect_mask_video.py

├── mask_detector.model

├── plot.png

(3)

1981 http://annalsofrscb.ro

├── requiremernts.txt

└── train_mask_detector.py

 5 directories, 10 files.

Flow Chart

Face Mask Detector

Fig. 1.Flowchart

The figure-1 shows eight steps involved in the detection of face mask and each step explained under proposed system. In this flow this project is carried out.

Block Diagram

Fig. 2.Block diagram

(4)

1982 http://annalsofrscb.ro

The figure -2 represents the block diagram of Face mask detector with two phases. In phase#1 the face mask detector is trained and in phase#2 face mask detector is applied.

Proposed Methodology

The proposed methodology explains the process involved in detection of face mask that are given in flow chart.

DataVisualization

to see the entire number of images in dataset in both categories. There are 690 images within the „yes‟ class and 686 images within the „no‟ class.

 The number of images with facemask labelled „yes‟: 690

 The number of images with facemask labelled „no‟: 686 Data Augmentation

For augmenting the dataset to incorporate a greater number of images for training. during this step of knowledge augmentation, each image has got to be rotated and flipped within the dataset. After the info augmentation, the entire number of images become 2751, therein 1380 images within the „yes‟ class and 1371 images within the „no‟ class.

 Number of examples:2751

 Percentage of positive examples:50.163576881134134%

 Number of positive examples: 1380

 Percentage of negative examples:49.83642311886586%

 Number of negative examples:1371 Splitting the Info

For Splitting the info into the training set which can contain the pictures on which the CNN model are going to be trained and therefore the test set with the pictures on which our model are going to be tested.

Taking split_size =0.8, which suggests that 80% of the entire images will attend the training set the remaining 20% of the pictures will go the test set.

 The number of images with facemask within the training set labelled „yes‟:1104

 The number of images with facemask within the test set labelled „no‟:276

 The number of images without facemask within the training set labelled „yes‟:1096

 The number of images without facemask within the test set labelled „no‟:275

After splitting, the specified percentage of images are distributed to both the training set and therefore the test set as mentioned above.

Building the Model

Sequential CNN model with various layers like Conv2D, AvrPooling2D, Flatten, Dropout and Dense. within the last Dense layer, we use the SoftMax function to output a vector that provides the probability of every of the 2 classes.

The „adam‟ optimizer and „binary_crossentropy‟are used because the loss function as there are only two classes.

Additionally, you'll even use the MobileNetV2 for better accuracy.

(5)

1983 http://annalsofrscb.ro

Pre-training the CNN Model

After the building the model, creating the Train_generatorand validation_generator to suit that to the model within the next step. There are a complete of 2200 images within the training set 551 images within the test set.

 Found 2200 images belonging to 2 classes.

 Found 551 images belonging to 2 classes.

Training the CNN Model

This step is that the main step where the pictures within the trainingSet and therefore the test set to the sequential model built using Keras library. Training the model for 30 epochs (iterations). Training for a greater number of epochs to achieve higher accuracy lest there occurs over-fitting.

After the 30th epoch, the model has an accuracy of 98.86% with the training set and an accuracy of 96.19% with the test set. this suggests that it'll be trained with none over-fitting.

G. Labelling the knowledge

After building the model, two probabilities are labelled

for the results. [„0‟ like out mask and „1‟ as with mask]. By setting the boundary rectangle color using the RGB values.

[„Red‟ for without mask and „Green for with mask].

 Labels dict= {0: „without mask‟, 1: „with mask‟}

 Colour dict= {0: (0,0,255), 1:(0,255,0)}

Importing the Face Detection Program

The plan is to use to detect if the people wearing the face mask using PC‟s Webcam. For this implementation of face detection is required. In this, the Haar Feature-based cascade Classifiers is employed for detecting the features of the face.

face_clsfr=cv2.CascadeClassifier („haarcascade_frontal face_ default.xml‟)

This cascade classifier is meant by OpenCV to detect the frontal face by training thousands of images. The.xml file for an equivalent must be downloaded and utilized in detecting the face.

Detecting the Faces with and without Masks

In the last step, the OpenCV library is employed to run aninfinite loop to use the online camera during which the face is detected using the Cascade Classifier. The code webcam=cv2.VideoCapture(0) denotes the usage of webcam.

The model will predict the likelihood of every of the 2 classes ([with_mask, without_mask)]. supported which probability is higher, the label is going to be chosen and displayed around our faces.

Additionally, the „Droid cam‟ application is downloaded for both Mobile and PC to use your mobile‟s camera and alter the worth from 0 to 1 within the code.

webcam=cv2.VideoCapture(0)

Result and Discussions

Thus, the mask detector is capable of running in real-time and is correct in its predictions also. because the technology is blooming with emerging trends theavailability therefore the novel mask detector designed which may possibly contribute to public healthcare. The architecture consists of Mobile Net because the backbone it is often used for top

(6)

1984 http://annalsofrscb.ro

and low computation scenarios. so as to extract more robust features, transfer learning is employed to adopt weights from an identical task face detection, which is trained on a really large dataset.

OpenCV, tensor flow, Keras and CNN is employed to detect whether people were wearing face masks or not. The models were tested with images and real-time video streams. The accuracy of the model is achieved and, the optimization of the model may be a continuous process and a highly accurate solution is building by tuning the hyper parameters. This specific model might be used as a use case for edge analytics. Furthermore, the proposed method achieves state-of-the-art results on a public mask dataset.

By the event of mask detection, if the person is wearing a mask is detected and permit thementry would be of great help to the society.

Working Model

Fig. 3.Without_mask

The Figure -3 represent the person is not wearing mask and showing the result as No mask with 100.00%.

Fig. 4.With_mask

(7)

1985 http://annalsofrscb.ro

The Figure -4 represent the person is wearing mask and showing the result as Mask with 77.03%.

Conclusion

In this article, a CNN model is successfully built to detect if a person is wearing a face mask or not. This can be used in numerous applications. Sporting a mask may be necessary in the near future, considering the COVID-19crisis and this method to detect if the person wears a face mask may come in handy.

References

[1] Fang.Y, Nie.Y, and Penny.M, (2020) “Transmission dynamics of the covid-19 outbreak and effectiveness of government interventions: A data driven analysis,” Journal of medical virology, vol. 92, no. 6, pp. 645–659.

[2] Feng.S, Shen.C, Xia. N, Song.W, Fan.M, and Cowling.B.J, (2020), “Rational use of face masks in the covid19 pandemic,” The Lancet Respiratory Medicine.

[3] Ge. S, Li.J, Ye. Q, and Luo. Z, (2017) “Detecting Masked Faces in the Wild with LLE-CNNs,” IEEE Conference on Computer Vision and Pattern Recognition (CVPR), Honolulu, HI, pp. 426-434.

[4] Kumar. A, Kaur. A, and Kumar. M (2019), “Face detection techniques: a review,” Artificial Intelligence Review, vol.52,no.2, pp. 927-948.

[5] Liu. Y, Gayle A. A., Wilder-Smith. A, and Rocklov.J, (2020) “The reproductive number of covid-19 is higher comparedto SARS coronavirus,”Journal of travel medicine.

[6] Leung. N. H, Chu. D. K, Shiu. E. Y, Chan. K.H, Mc Devitt.J. J, Hau. B. J, Yen.H.L, Li. Y, et.al.,(2020),“Respiratory virus shedding in exhaled breath and efficacy of face masks.”

[7] Memish Z. A., Zumla. A. I, Al- Hakeem. R. F, Al- Rabeeah. A. A, and Stephens.G. M, (2013), “Family cluster of middle east respiratory syndrome coronavirus infections,” New England Journal of Medicine,vol.

368,no. 26, pp.2487–2494.

[8] Rota P. A., M. S. Oberste, S. S. Monroe, W. A. Nix, R. Campagnoli, J. P. Icenogle, S. Penaranda, B.

Bankamp,K. Maher, M.-h. Chen et al. (2003), “Characterization of a novel coronavirus associated with severe acute respiratory syndrome,” Science, vol. 300, no. 5624, pp. 1394–1399.

[9] Wang. Z, Wang. G, Huang. B, Xiong. Z, Hong. Q, Wu. H, Yi. P, Jiang. K, Wang. N, Pei.Y, et al., (2020),

“Masked facerecognition dataset and application,” arXiv preprint arXiv:2003.09093.

[10] Xu, L. & Ren, Jimmy & Liu, C. & Jia, J. (2014). Deep convolutional neural network for imagedeconvolution. Advances in Neural Information Processing Systems 2. 1790-1798.

[11] Zhao. Z. Q, Zheng. P, St. Xu, and Wu.X, (2019), “Object detection with deep learning: A review,” IEEE transactions on neural networks and learning systems, vol. 30, no. 11, pp. 3212–3232.

Referințe

DOCUMENTE SIMILARE

The ability of a convolutional neural network to provide accurate predictions at the image level and also the advantage of using Long- Short Term Memory to

Efficacy of deep convolutional neural network algorithm for the identification and classification of dental implant systems, using panoramic and periapical

Using OpenCv deep neural networks the model gets good results and by using MobileNetV2 which is an image classifier for the classification of images is processed accurately..

Using OpenCv deep neural networks the model gets good results and by using MobileNetV2 which is an image classifier for the classification of images is processed accurately..

Based on the functions of convolutional neural network layers, thermal images both normal and abnormal are taken as input image for segmentation of cancer

This article focuses on hybrid CNN architecture using SegNet, ResNet and Recurrent Neural Network (RecNet) which are respectively called R-SegNet and R2-SegNet. The steps involved

An Efficient Cervical Image Segmentation Method Using Lagrange Dual Dictionary Learning in Convolutional Neural Network.. K.Shanthi 1

In this research, we propose a plan to analyze ovarian malignant growth using clinical histopathology pictures, in this we are utilizing Deep Convolutional Neural