Face Mask Detection at the Edge

    Face Mask Detection at the Edge


    Along with practicing social distancing, wearing a face mask in public settings is an effective way to keep our community safe during the COVID-19 pandemic. Researchers have shown that wearing a mask can reduce infection risk to the wearer by 65%. However, face masks are most effective when everyone wears one, and it is impractical to ensure everyone is wearing a mask by sticking to traditional methods and older technologies.

    At Neuralet, we leverage AI to help businesses get back to work safely during the COVID-19 pandemic. We have designed and open-sourced a Face Mask Detector application, sponsored by Lanthorn.ai, to ensure everybody is wearing a face mask.

    Neuralet’s Face Mask Detector application can detect face masks even in low-resolution CCTV videos, and it works in real-time. The best part about our application is that no personal data is stored anywhere; the computations take place locally, at the edge of the network, and users’ privacy is completely preserved. Only statistical data is stored in the storage that can lead decision-makers to shape policies to minimize exposure risk.

    How it works

    Neuralet’s Face Mask Detector applies state-of-the-art computer vision algorithms to detect if people are wearing a face mask or not. This application is compatible with the existing cameras installed at hospitals, workplaces, schools, and elsewhere.

    To train a face mask detector, our R&D team conducted several experiments to obtain the best model architecture with the highest accuracy. Our major challenge was detecting face masks in videos captured by CCTV cameras, where faces only occupy a small portion of the video frame and are low-resolution and blurry.

    We mitigated this challenge by training our face mask classifier on FaceMask100K, a large-scale, diverse “mask/ no mask” dataset, collected by Neuralet. We also used pose estimation algorithms to detect faces in CCTV video streams more accurately. You can read our face mask article to learn more about Neuralet’s Face Mask Detector application.

    To the best of our knowledge, our face mask classifier outperforms all the currently available face mask classifiers that can work on CCTV video streams.

    Supported devices

    To run Neuralet’s Face Mask Detector application, you will need to have one of the following devices:

    You can use Docker to install this application on your device with minimal effort. Follow the instructions on our GitHub repository to learn more.

    Explore more

    We have open-sourced Neuralet’s Extended Synthetic Dataset to facilitate continued work in this space. This synthetic dataset is collected from WIDER FACE, CelebA, and SM-Synthetic datasets and consists of 23K images. The images in this dataset are labeled for “mask/ no mask” classification. A dataset of 50K “mask/ no mask” images created from synthesizing 54 types of face masks on faces from the CelebA dataset is also available for download here.

    You can read our two-part face mask article to learn more about the datasets and the path that we followed to construct a real-world “mask/ no mask” dataset and train a face mask classifier that can also work well on the real-world data. We explained our face detection system and described the steps to deploy the Face Mask Detector application on the edge in the second part of this article.

    Neuralet’s face mask detection models are available for download on our GitHub repo. Select and download the model according to the platform you are using:

    You can read the application source code for implementation details.


    Creative Commons License
    This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

    This project is sponsored by Lanthorn. Visit Lanthorn.ai to learn more about our AI solutions.

    All released datasets (Extended Synthetic dataset, Neuralet FaceMask50K dataset), released models, and Neuralet’s GitHub source code are licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

    Please reach out to us if you need to use the datasets, model, or the code base for commercial purposes; we are happy to help you!

    Get In Touch

    Have a question? Send us a message and we will respond as soon as possible.