Inspiration

As per WHO authorities, the two main routes of transmission of the COVID-19 virus are respiratory droplets and contact. Any person who is in close contact (within 1 m) with someone who has respiratory symptoms (coughing, sneezing) is at risk of being exposed to potentially infective respiratory droplets. Studies of influenza, influenza-like illness, and human coronaviruses provide evidence that the use of a medical mask can prevent the spread of infectious droplets from an infected person to someone else.

Monitoring people for wearing mask is a huge task, and especially, for a country like India, where population is more than a billion! Our problem is aimed at creating a way to spread awareness while monitoring people for wearing their masks.

What it does

Though, we can’t check on each and every person, but what we could do is to maximize the surveillance system as much as possible and one of the best way to improve the system is by automating the system as much as possible. So, our idea is to use the CCTV cameras on Traffic signals to detect if a person driving two wheelers is wearing a mask or not, and if not, then we can first warn him to wear mask and if found again, then fine him using the QR Code, which has to be attached in each and every vehicle(and he would be fined if the QR Code is not attached to the vehicle). The QR code will be provided free of cost and contain a person’s Name and Phone number. Now, comes the question on the availability of CCTV cameras. Highly populated cities are more prone to this problem, so, our main target would be these cities. Third Eye campaign in Chennai has installed 34,293 cameras to monitor the speed activities which can be deployed for our project as well. Bengaluru has also put 5000 surveillance cameras on the road. In the similar manner, highly populated cities have good quantity of cameras for surveillance, which could be used for this project.

The main motive behind this is to prevent the contact from infective respiratory droplets.

How I built it

We have designed a Deep Learning Neural Network which will feed on real time video captured through cctv cameras installed at traffic signals placed in different part of the city. The algorithm was trained on custom made dataset and images from online The first step after obtaining images was to pre-process the image into a one-D array containing RGB values. The values obtained were pre processed and then sent for further computation. The model uses CNN as a deep learning neural network to obtain good accuracy in predicting if a person wearing a Mask. In this step the image is convoluted, pooled and fed into layers of neural network using 'Selu' activation function. Then Flattened, and then sent to fully connected layer and Output layer. The model then predicts probability of a person wearing a mask for each frame of video and if the person is found without a mask, his vehicle will be searched for QR code and then a Warning / Fine will be sent to him digitally. Multiple faces are not supported in one frame.

Challenges I ran into

We had a really small dataset for good training purpose, so we used Data Augmentation techniques like adding 'rotation', 'zoom', 'flip', 'shear', etc in order to increase the size of our dataset to increase accuracy of the model.

Another major challange was Mask Detection. Initially, we only had blue mask dataset and we had to build a custom dataset containing different colors of masks in order to detect variety of masks. Colors like 'yellow', 'purple', etc were added to dataset.

Then 'The beard problem' , in first two trainings, our models performed well on clean shaved people, but bearded people were frequently identified as wearing masks. Which was a huge problem we solved by increasing the images of bearded people in our train and test set and by using Data Augmentation.

Tweaking the 'is_visited' column in the database was a huge problem. We were not able to develop logic to check 24 hrs duration using this column and operations were getting complex. 'day' or ('present_day') column came to rescue while solving this issue, as we used 'time' library's functionality to check current day and compared it to the day of fine/warning stored in the database to see if 24 hrs have passed or, not and then tweaked 'is_visited' column in accordance to that.

Another problem was faced while detecting face mask, when the person was not wearing any mask, the 'no mask' label was not showing up. Later, after tweaking and printing the labels, we found that video frames were too quick and this problem was solved using 'time.sleep' to slower the process.

One major problem was when multiple faces were shown, the program suddenly crashed. We fixed this issue by looping through these faces one by one and saved the program from crashing.

Sending messages while simultaneosly interacting with the database was also a great challange. Here, the Twilio API came to rescue and made jobs very easy for prototype purposes and increased the functionality of the program.

Accomplishments that I'm proud of

The project finally worked after hardwork.

What I learned

I learned a lot about databases, neural nets, increasing code efficiency and effectively working in a team.

What's next for COVID-19-Surveillance-System

Multiple detection can be implemented.

Built With

Share this project:

Updates