Face Mask Detection and Penalty System

DOI : 10.17577/IJERTCONV10IS04018

Download Full-Text PDF Cite this Publication

Text Only Version

Face Mask Detection and Penalty System

Sneha B K Assi Prof

Dept. of computer science

College of Engineering Thalassery kannur, kerala

Anagh C S

Dept. of computer science

College of Engineering Thalassery kannur, kerala

Ganga T

Dept. of computer science

College of Engineering Thalassery kannur, kerala

Adithya M K

Dept. of computer science

College of Engineering Thalassery kannur, kerala

AbstractMost people infected with the virus will experience mild to moderate respiratory illness and recover without requiring special treatment. However some will become seriously ill and require medical attention. Older people and those with underlying medical conditions like cardiovascular disease, diabetes, chronic respiratory disease, or cancer are more likely to develop serious illness. Anyone can get sick with COVID-19 and become seriously ill or die at any age.The most effective way to prevent spread of COVID-19 is wearing a mask in public as well as private areas. It is very difficult to monitor people manually in these areas. Manually checking for each individual who is wearing a mask or not is not practical in the case of large group of people or among a large crowd. In this project introduces a technique to detect a person without a mask with the help of a camera and using deep learning neural Network called CNN.A camera is used to capture video, then this video is converted to images, that is given as input to the neural network CNN.The neural network classifies whether the person is wearing mask or not and Recognize the faces and allot fine to that particular persons id which is already created in the web page.

Index TermsDatesets , Nueral networks , Face detection


    The COVID-19 pandemic has led to a dramatic loss of human life worldwide and presents an unprecedented challenge to public health, food systems and the world of work. The economic and social disruption caused by the pandemic is devastating tens of millions of people are at risk of falling into extreme poverty. As the outbreak of corona virus continues most of the people in the world are suffering badly due to this

    Identify applicable funding agency here. If none, delete this.

    pandemic. Coronavirus disease or COVID-19 is a respiratory illness that caused pneumonia in an infected person and spread this disease is through person-to-person direct contact with generated respiratory droplets, droplets of saliva or discharge from the nose when the infected person coughs or sneezes or through breathing in the virus if you are within the range of an infected person. also acquire this virus by touching a contaminated surface and then entering the virus in your mouth, nose, or eyes. Elderly persons, persons with a poor immune system, and those with underlying health complications like heart failure, diabetes, severe respiratory disease, and cancer are vulnerable in this type of illness . The spread or transmission of coronavirus can be prevented by obey protocols set by medical authorities. The best way to prevent and to slow-down the further spread is to protect yourself and others by washing your hands regularly or using a disinfectant and alcohol with

    70solutions and by nottouching your face including nose, eyes, and mouth and wear fackmask going outside or communicating with others. The virus spread can be limit by observing social distancing and observing hygiene like compulsory wearing of facemask, use of hand-gloves, faceshield, and the use of sanitizer is very important. The Government and most organizations are making it compulsory to follow social distancing and the wearing of a facemask. it is hard to monitor manully person who wear mask to overcome this issue. use Facemask detection system through artificial intelligence is a answer that is beneficial to everyone is recognizing people wearing facemasks. A new normal has emerged in this pandemic by covering faces with a mask that is very effective in the prevention of the disease outbreak. On the other hand it will be challenging to identify faces with masks on any monitoring systems while maintaining contactless access control in buildings or premises. Advancements in the field of deep learning, particularly convolutional neural networks (CNNs), have already shown remarkable success more accurate in the classification of images . The key idea behind the CNNs is to create an artificial model, like a visualization area of the human brain. The biggest advantage of CNNs is that one can extract more important characteristics over the whole image. researchers introduced different deep networks based on CNN and these networks achieved the state of results in computer vision classification, segmentation, object detection, and localization. In this research study deep learning techniques are applied to construct a classifier to collect images of a person wearing a face mask and not wearing from the database it can distinguish between those classes of facemask wearing and not facemask wearing. The artificial neural network has proven to be a vigorous process for extracting features from unprocessed data. This study proposes the use of a convolutional neural network to design the facemask classifier and to include the effect on the predictive performance of the number of the convolution neural layer

    working of CNN in predicting mask or without mask


    COVID-19 is a highly contagious disease, and the WHO and other health agencies have recommended that people use face masks to prevent its transmission Manually checking if a person is wearing a mask or not is a difficult task.By using deep learning method can automate this process to find whether a person wearing mask or not,and identify the person and allot fine.All governments are attempting to guarantee that face masks are worn in public as well as private places, but it is difficult to manually identify those who are not wearing face masks in crowded places. Scientists are working on developing automatic methods to identify and enforce the use of face masks in public locations. The problem may be summarized as follows: given a face picture as an input, the classification model must categorize the facial image in a mask detection task using the classification model. Using Convolutional nural netrwork, this system provide a method for mask detectiondriven face picture classification that is both fast and accurate, as demonstrated in this work.


    A. Dataset Collection The collection of mask and unmasked images used for training and testing the model was collected from the web and download these images automatically to the directory with appropriate labeling from the web. The dataset was able to generate 20,000 images using 2 classes, facemask wearing, and no-facemask wearing. The image size resolution of the dataset ranges from 800 up to 1200 pixels. All images were formatted in a JPEG formatting. The sample of the collected image dataset is illustrated in figure 2 illustrating the person wearing a facemask and not wearing a facemask.

    Fine-tuning is the final method in the training of the model and the start-off point of transfer learning in the study. Feature extraction is used in the first layers of each CNN architectures and the last few layers are intended for learning. Each architecture learned two classes of learned facemask wearing and not facemask wearing and the last few layers of every architecture are replaced with the same kind of layers but with different parameters. The architecture is trained and finetuned with the initial setting set by the authors. The model is designed to learn only two classes of facemask wearing and not wearing with the weight rate and neuron bias rate of 20 on both the fully connected layers or activation to accelerate the processing of learning on new layers. Classification is done with the training of the model that will recognize and classify the trained images with the learned visual patterns . The authors implemented thedevelopment of a program using open-source software using Python and OpenCV. Along with the TensorFlow and Keras module to create a CNN model using the VGG-16 network model. The input parameters for the input image are set to 224 for its height and width, the batch sizes of

    32 and 100 iterations. Subsequently, the method of data augmentations is also utilized for image data buildup by basically employing rotation, rescaling, shifting, and zooming procedures. The dropout rate is set at 501/255 which leads to a multiple for each pixel image.


    DEEP LEARNING Deep learning is a subset of machine learning in artificial intelligence that has networks capable of learning unsupervised from data that is unstructured or unlabelled. Also known as deep neural learning or deep neural network Deep Learning Frameworks: To implement this deep learning network we have the following options. TensorFlow : TensorFlow can be used across a range of tasks but has a particular focus on training and inference of deep neural networks. Tensorflow is a symbolic math library based on dataflow and differentiable programming.In the proposed model, the whole Sequential CNN architecture (consists of several layers) uses TensorFlow at backend. It is also used to reshape the image in the image processing. Deep Learning models directly or by using wrapper libraries that simplify the process built on top of TensorFlow. Keras : is an opensource software library that provides a Python interface for artificial neural networks. Keras acts as an interface for the TensorFlow library.The core data structures of Keras are layers and models.All the layers used in the CNN model are implemented using Keras.It wraps the efficient numerical computation libraries Theano and TensorFlow and allows you to define and train neural network models in just a few lines of code. OpenCV

    : OpenCV is a library of programming functions mainly aimed at real-time computer vision. OpenCV is utilized to differentiate and recognize faces, recognize objects, group movements in recordings, trace progressive modules, follow eye gesture, track camera actions, expel red eyes from pictures taken utilizing flash,find comparative pictures from an image database, perceive landscape and set up markers to overlay it with increased reality A CNN receives an image as an input in the form of a 3D matrix. The first two dimensions corresponds to the width and height of the image in pixels while the third one corresponds to the RGB values of each pixel. DATA

    PREPROCESS step1: The dataset we are using consists of images with different colors, different sizes, and different orientations. Therefore, we need to convert all the images into grayscale because we need to be sure that color should not be a critical point for detecting mask. After that, we need to have all the images in the same size (100×100) before applying it to the neural network. Step 2: Training the CNN This consists of 2 convolutional layers (Two Convo2D 100@3×3). First, you have to load the dataset from data preprocessing. Then you have to configure the convolutional architecture. Ive included a model.add(Dropout(0.5)) to get rid of overfitting. Since we have two categories(with mask and without mask) we can use binary crossentropy. You start training for 20 epoch with a model checkpoint. Step 3: Detecting Faces with and without Masks First, you have to load the model that we created. Then we set the camera we want as the defaultSecondly, we need to label the two probabilities (0 forwith mask and 1 forwithout mask). After that, we need to set the bounding rectangle color using RGB values. Ive given RED and GREEN as two colors. Inside an infinite loop, we are going to read frame by frame from the camera and convert them to grayscale and detect the faces. And it will be run through a for loop to each face and detect the region of interest, resize and reshape it to 4D since the training network expects 4D input. For the model, we are going to use the best model available to get the result. This result consists of the probability (result=[P1, P2]) of the with a mask or without a mask. It will be labeled after that. For picture without mask identify the face and allote fine


    The entire simulation was performed in the 32-bit Windows10 Operating System, using the application development language version of Python 3.6. The experiment was coded to develop and train the model using Keras as backend and within the Tensor-flow platform. Also used to implement the system is the laptop computer with Intel ® Core i7-8700 CPU @4.60GHz with 12 M Cache, 16 GB RAM, and GTX

    1050 video card. Data augmentation was also incorporated to increase the image data collected during the conduct of the research. Some of these techniques used are image flipping, image-rotation, zoom-range, and range-shifts. By futzing with the weights, the optimizer designs and shapes the model to the most realistic achievable form. Optimizers are methods that changes the attributes of the neural networks like weights and learning-rate for reducing the losses during training. As features of optimization were introduced in the analysis, Adam optimizer with a learning rate of 0.0001, and categorical cross- entropy. Adam optimizer is the combination AdaGrad and RMSProp algorithms that can control sparse-gradients on

    noise-problems. Validity accuracy diagrams relative to consistency and loss of validity as opposed to a loss of training

    . Two hidden layers are pretty important in a deep learning model. Combining the output of one or more hidden layers as one output layer is important. By using more hidden layers, it offers a deeper analytical model on the one hand but on the other hand, each added layer adds complexity in computation. Besides, higher numbers of neurons added in each layer will also result in high computational costs. Some added features to the CNN model are optimization using Adam and categorical cross-entropy is implemented. Adam optimizer has shown good results in the application of computer vision and natural language processing. Adams design structure is pretty attractive. For the entire neural network and each attribute, the learning weights and descent rate are the same. On the other hand, Adam provides different learning levels for various parameters and heightens the models overall efficiency. Adam sets new weights for increasing time-based on a previous value of an attribute. Two types of cross entropy are useful in the problem of profound learning classification. The loss function generally tells the discrepancy which is nothing but the error between the actual output and the predicted output. Categorical cross-entropy is useful when clustering data instances among multi-class labels are needed. Epoch implies a full list of available inputs. As when weights are calculated for developing a model after each epoch. The weights change and again tested against the next cycle simulation of the same dataset (called next epoch). The entire training data is expected to be in the main memory when executing this. For larger datasets, keeping the whole dataset in the main memory is not feasible at multiple times, so the whole epoch (dataset) is divided into batches and each batch is sequentially brought into main memory and executed, and the result is summed up and finally interpreted as an epoch output.


    The coronavirus COVID-19 is a very fast-spreading disease. It is important to protect ourselves from being infected by wearing masks and respecting social distances in public environments. In this paer, we propose to build a face mask detector for private spaces to detect if people are wearing masks or not. The proposed detector was based on the CNN technology . Its difficult to identify the person in private spaces wearing mask or not. by implementing this model we can reduce spread on corona virus and reduce human load. by wearing face masks it also prevent attacking of other virus. The model was implemented on both hardware and software to accelerate the inference. The achieved performance has proved the efficiency of the proposed approach for mask detection in private spaces.


    Different facial mask recognition models have been developed for Deep Learning, Computer vision and machine learning (ML). In this paper, different strategies are explored for facial mask detection. Mask identification as we know today is a very difficult task. The Facial Mask Detection apps are especially used to prevent the spread of Corona Virus, monitor

    recognize criminals, anti-spoofing, etc.using a Convolutional Neural Network Algorithm can quickly detect the facial mask. But there were strong differences in facial mask recognition and non masked face detection accuracy. many papers are on face mask detection with-mask or without mask is being reviewed for the detailed study of various Face Mask detection techniques. But only few papers are based on masked face addressed the quality of masked face and non-masked face detection using Convolution Neural Network (CNN). It has a higher identification power for the face with masks. When the face is masked, the identification precision increases to 99 established a new face mask wearing syndrome in that involves proper wearing of the face mask, wrong wearing of the face mask, and no wearing of the face mask. It achieved a precision of 98.70 percent in the face detection phase. People who are wearing a mask or not are detected in CCTV videos that are implemented on the private sector through live monitoring, detecting the people and recognising their faces using the data set after that, allot fine to their profile in the website.


This application can be used in any working environment like any public place, station, corporate environment, streets, shopping malls, examination centers, etc., where accuracy and precision are highly desired to serve the purpose. This technique can be used in smart city innovation and it would boost up the development process in many developing countries. Our analysis of the current circumstance presents a chance to be more ready for the next crisis, or to evaluate the effects of huge scope social change.


[1] Identify facemask wearing condition using image- resolution with classification network . Bosheng Qin and Dongxiao L

[2] Evaluating the mask and unmasked face with Le Net Algorithm. Muhammad Haziq Rusli, Nilam Nur Amir Sjarif, Siti SophiayatiYuhaniz, Steven Muhammad Solihin Kadir. Militante, N. Dionisio.

[3] Physical distance and mask wearing on the face of workers, Militante, N.


[4] Face mask dectection using YOLOv3 and faster R-CNN modeles:COVID19 environment Sunil SingpUmang Ahuja1 Munish Kumar 2 Krishan Kumar1Monika Sachdeva3.

[5] Face mask detection using transfer learning of inception v3 G. Jignesh Chowdary , Narinder Singh Punn and Sanjay Kumar Sonbhadra

[6] Leewayherts. Bobby Bhatia, David Rangel, VireshBhatia

[7] Face Mask Detection Using OpenCV M.Pratapteja,R.Krishna Sri,D.

Kalyani,Harish Adusumalli

[8] An Automated System to Limit COVID-19 Using Facial Mask Detection in Smart City Network. Md. Motaleb Hossen Manik,Mohammad Marufur Rahman

[9] The Face Mask Detection For Preventing the Spread of COVID-19 at Politeknik Negeri Batam. Ika Karlina Laila Nur Suciningtyas,Riska Analia,Febri Alwan Putra,Susanto Susanto.

[10] A Novel Approach to Detect Face Mask using CNN.Md. Shahriar Islam,Eimdadul Haque Moon,Md. Ashikujjaman Shaikat

[11] Face Mask Detection Classifier and Model Pruning with Keras-Surgeon

. Alok Negi, Prachi Chauhan, Krishan Kumar, R.S. Rajput.

Leave a Reply