Inspiration
We wanted to create something that be helpful to small and local businesses during the pandemic, and one idea we had was to create a device that makes sure everyone visiting this business or store would be wearing a mask for example. Besides that, we also wanted to learn more about neural networks and the tensorflow library, and this project was a great way to do so.
What it does
The device uses an ultrasonic sensor to detect when someone is close by, which sends a signal to the computer program allowing the user to interact with it. Along with that initial signal the program uses the tensorflow model to make a prediction on whether or not the user is wearing a mask. If they are they are welcomed in using with a blue LED light, and if they are not they are prompted to wear one using a red LED light and a buzzer. After the initial prediction, the users are free to make more predictions, and if not the program goes back to its initial state after a hidden set time out runs out.
How we built it
We built it mainly using python and and Arduino. We used the open CV library as well the tensorflow python library along with other libraries in order to build the program aspect of the device. We used tensorflow to create a convolutional neural network that was trained to differentiate between a person wearing a mask, and a person not wearing a mask. The data collected for training and testing was captured using a python script and a webcam. We then used this model in our main script which is responsible for the GUI, making the predictions, and communicating with the Arduino Uno. The Arduino Uno is connected to 2 LEDs (red and blue) used to signal the output of the predictions, as well as a buzzer, which is used as an audible sign. We decided to go with LEDs and a buzzer, to make sure that the user is able to receive the feedback from the prediction. Besides that, the Arduino Uno is also connected to an ultrasonic sensor, which detects when a user is close by to the device, and sends a signal to the program. Additionally, there is also a physical button that can also be used to use the model for another prediction.
Challenges we ran into
- We ran into challenges trying to find data to use for our neural network, so we decided to collect our own data using a python script.
- While training the neural network it ended often overfitting to the training set since most of the data was pretty similar, and we were able to solve that by just tweaking the settings for the neural network and changing the number of convolutions we did, along with the number of runs used to train the model.
- We ran into challenges using the images captured using opencv to images that can be used by our model, and we decided to approach this by temporarily storing each frame captured into the folder, to then be read from the folder in a way that would be easier to use with the tensorflow model, and after it was read, the frame is deleted.
Accomplishments that we're proud of
Some accomplishments we are proud of, are being able to detect if the user is wearing a mask or not with decent accuracy, and having the software and hardware parts of the project work together effectively.
What we learned
While creating this project we learned more about neural networks, convolutions, pooling and some algorithms used in machine learning. Besides that, we learned more about the tensor flow library. During our research we also learned more about other methods to communicate or control an Arduino.
What's next for Mask-On
At its current state, our project can definitely be improved upon in many aspects. Firstly, we could take more time to create a better tensor flow prediction model that is even more accurate than the one we are currently using. We can also use raspberry-pi instead of an Arduino Uno connected to a computer. Additionally, we could improve the hardware aspect of the project by possibly adding a mask and sanitizer dispenser, and possibly create a 3d printed casing for the whole device. To add on, we can also replace the ultrasonic sensor with a LiDAR sensor, which would be more expensive, but more accurate relative to the ultrasonic sensor. Lastly, using the device to record the times at which customer comes to your business could be used to find out the average traffic your store or business receives at a given time in a day.

Log in or sign up for Devpost to join the conversation.