Skip to content

Used CNN based ResNet18 using Pytorch for Masked Face detection

Notifications You must be signed in to change notification settings

Lamnganbi1999/Masked-Face-Recognition

Repository files navigation

Masked-Face-Recognition

About the Project:

This project uses CNN based Transfer Learning to classify whether a face is masked or not. It uses RESNET-18 Backend with pretrained weights, and customized final layers for Binary Classification (Masked/ Not-Masked).

Languages/ Tools used:

  • Python
  • Jupyter Notebook
  • Pytorch

Dependencies:

  • OpenCV
  • PILLOW
  • Resnet-18 (Architecture + Weights)
  • Face_recognition Library

Dataset

RWMFD (Real World Masked Face Dataset)

Inferences from dataset:

Since the dataset didn't contain accurately cropped image consisting of just the face, face_recognition library was applied on the images, to get closeup cropped images.

Some examples of closely cropped masked images



Some examples of closely cropped unmasked images

Training Results

After training for 10 epochs the training loss graphs is as shown below:



The validation accuracy is about 97 % after 10 epochs.

Testing Result

After testing a total of around 150 images, the testing accuracy stands at 97% which can be inferred from the results shown below:

Scopes of Improvement

  1. Since the dataset was small, using a large number of images might result in better accuracy.
  2. Since the model is dependent on face detection, greater occlusions in face due to mask might be the reason for incorrect prediction sometimes.
  3. Face detection module doesn't help identify skewed faces so accurately especially when the size of face is so small.

About

Used CNN based ResNet18 using Pytorch for Masked Face detection

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages