During this global pandemic, masks are an essential part of preventing the spread of COVID-19. In public settings, a cheap, fast, and efficient way to detect whether a person is wearing a mask would be useful in order to keep communities safe and healthy globally. My project takes a localized image of a face and uses tinyML to classify whether the person is wearing a mask or not.
For example, here are two pictures of me, one with a mask, one without:
The goal was to be able to classify these pictures into with_mask or without_mask using tinyML. To create this model, I used the software Edge Impulse, which allows you to create tinyML models in your browser. I used a dataset of images from Ashish Jangra on Kaggle to train this model.
First, I created a new project called mask-classification and uploaded all of the data from the dataset into Edge Impulse, randomly distributing it between the train and test sets. I then built the model by going through the tabs on the left sidebar, making only a few small tweaks to the default options provided.
For these steps, the only change I made was changing the number of training cycles from 20 to 10 for a smaller model.
After cropping the pictures of me and running them through the finished model under the "Live classification" tab:
As indicated in the results shown in the bottom left corner of the two pictures above, the model is able to correctly classify a picture of someone into one of the two categories: with_mask or without_mask. The model also received an accuracy of 99.22% when tested on additional data from the dataset.
This model has a size of 709 KB.
My model on Edge Impulse can be found here: https://studio.edgeimpulse.com/public/47957/latest
Comments