Introducing Francesco.ai

Face mask detection system

Welcome to Francesco, a machine learning face mask detection system that uses a software stack in Python, Tensorflow, Keras API and OpenCV! Francesco can also be applied on many embedded systems as it also uses MobileNet: Efficient Convolutional Neural Networks for Mobile Vision Applications.

The main concept that Francesco uses is that of a convolutional neural network, or CNN for short, a neural network that uses convolution, usually for analyzing images. It starts by applying filters that can help distill some features of the image using different kernels. These filters can be improved in the same way as other weights in the neural network, by adjusting their kernels based on the error of the output. Then, the resulting images are pooled, after which the pixels are fed to a traditional neural network as inputs (a process called flattening).

It then feeds the model into openCV where it uses my laptop's webcam (or any camera attached to the main program for that matter) to detect whether a person is wearing a mask or not in real time!

I hope you enjoy the demo!

Inspiration behind Francesco

In these troubled times of the COVID-19 Pandemic, you have to wear a mask to protect not only yourself, but for others around you as well.

Protection of the face is a must whenever you leave your houshold. However, due to the recurrent times of me forgetting my mask (and almost getting caught by the local police for not wearing my mask), I had to devise some sort of way to make sure I don't forget my mask. That is when I decided to build a face mask detection system. But, I had asked myself "How am i able to do this?".

At that point, after seaching up on how face detction and object detection systems worked, I had entered the amazing world of artificial intelligence and machine learning. I had taken the initiative of learning amazing tools like Tensorflow, KerasAPI and OpenCV which are very popular in the ML/AI world. I must say, I really love OpenCV as it would really help me in my thirst for auotnomous self driving cars.

Lessons learned from the project

Due to the lack of resources of not having a NVIDIA Jetson and an Arduino board, I could not use an external video camera system (which I had initially intended to use). I was just left with my old laptop that rigged 30 mins before I always left the house (just in case). This happened for a few weeks until I had gotten the habit to always wear my mask. Nonetheless, I had integrated MobileNET, so that if I wish in the future to build a the setup, I may do so seamlessly.

Apart from hardware issues, I had alot of bugs when I initially started off (I mean who doesn't love some code bugs :o ). I also had a very bad time with my model. At first I had gotten about 75% accuracy. After that I had started to tinker with the amount of filters and the amount of pooling needed for the CNN and had figured out that having 130 dense filters and a 7X7 pool size was perfect, as I had attained ~96% accuracy!