Face Mask Detector

In order to effectively prevent the spread of COVID19 virus, almost everyone wears a mask during coronavirus epidemic. Medical image processing is the most challenging and emerging field now a days. The goal of this project is to train a COVID-19 face mask detector with OpenCV, Keras/TensorFlow, and Deep Learning. We’ll use this Python script to train a face mask detector and review the results.

METHODOLOGY

In order to use facial marks to construct a data set of facial masks, we need to begin with an image of a person who does not wear a facial mask:

  • We apply face detection from there to calculate the location of the bounding box in the image.
  • Once we know where in the image the face is, we can extract the face Region of Interest (ROI), and from there, we apply facial landmarks, allowing us to localize mouth, face, and eyes.
  • In order to apply masks, we need an image of a mask (with a transparent and high definition image). Add the mask to the detected face and then resize and rotate, placing it on the face.
  • Repeat this process for all input images

Training and Deployment

1. Training: Train the mask and without mask images with an appropriate algorithm.

2. Deployment: Once the models are trained, then move on the loading mask detector, perform face detection, then classify each face.

As you can see, we are obtaining ~99% accuracy on our test set. Looking at the above figure, we can see there are little signs of overfitting, with the validation loss lower than the training loss.