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.
We used four publicly available datasets for training the model:
- Kaggle face mask detection dataset
- Kaggle medical masks dataset images tfrecords
- Kaggle face mask detection dataset #2
- 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.
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