Skip to content

Latest commit

 

History

History
46 lines (34 loc) · 1.94 KB

Mask-detection-plugin.md

File metadata and controls

46 lines (34 loc) · 1.94 KB

Face mask detection plugin

A Mask detection plugin can be used to detect if the person wears a mask correctly automatically. There are three possible results: without_mask, mask_worn_incorrectly, mask_worn_correctly.

There was no suitable free and ready-to-use model for face mask detection at the moment of adding this plugin, so we created our model.

Disclaimer:
Software developers, not medical experts, created the plugin. 
The plugin doesn't contain the recommendations of how to use and wear face mask correctly.
The accuracy of the model is not 100%.
Please use the plugin at your own risk.

Face mask detection example

results

Training process

Dataset

We used four publicly available datasets for training the model:

  1. Kaggle face mask detection dataset
  2. Kaggle medical masks dataset images tfrecords
  3. Kaggle face mask detection dataset #2
  4. MAFA dataset

We extracted faces with masks from the first dataset (around 4k images), faces without a mask from the first two datasets (around 4k images), faces with masks worn incorrectly from all four datasets (around 2k images). Then we duplicated each incorrect worn mask image with data augmentation (see augmentation.py) to achieve class balance.

Train

InceptionV3 was cut off on a mixed 7 layer to improve speed and was used as a backbone. The final model with 97.2 % accuracy is used by default and can be found here