Inspiration
According to CDC.gov, about 6000 fatal crashes each year may be caused by drowsy drivers and the Global News published in 2018 that distracted driving is indeed the number one cause of deaths on Ontario roads. For some reason, people seem to multitask when they drive, making them more prone to accidents. We plan got the idea to investigate how artificial intelligence could automatically detect the distracted activity of the drivers and, based on the type of distraction, alert them as a safety precaution and which can be implemented in embedded architecture for production purposes.
What it does
AntiDistracto, as the name suggests tries its best to keep you from being drowsy or distracted. It is a user-friendly and scalable platform that analyzes drowsy and distracted faces and plays an alert sound to wake them up.
How we built it
Back end: Google Cloud Platform and Python. We got data from an open-source dataset (https://www.kaggle.com/c/state-farm-distracted-driver-detection/data) and used this to train an autoML model to help us classify input images as distracted or not. We trained on 10 categories and deployed the model on the google cloud. The data had to be prepared for autoML to train and we trained for 5 hours. For drowsiness detection, we used OpenCV and haar cascades and created a framework using that.
Front end: AntiDistracto uses Flask to send a POST request based on the input image to the ML model to detect if the person in the image is distracted or not. It then populated the webpage hosted on Django with the GET request received from the ML model. Using Django also included mapping functionalities of triggering OpenCV and the request logic. In the end, there were some UI changes implemented using HTML and CSS.
Challenges I ran into
Cleaning up data to be able to train was a bit hard, and we had trouble interacting with the autoML Cloud Vision API, possibly because it is still a beta feature. Doing ML on GCP was also new for us.
Accomplishments that I'm proud of
Making things work, after having tons of trouble interfacing backend and front end Successfully implemented the frontend features/components/routing with Django Explored the amazing uses of OpenCV Working with GCP's machine learning stack
What I learned
Doing machine learning on the cloud is really cool and convenient and computer vision is really powerful too!
What's next for AntiDistracto
Seamlessly fitting inside the vehicle utilizing embedded architecture
Subtle alerts based on announcements, beeps that are customizable by the driver and don’t interfere with the driving experience
Features to incorporate movement of the vehicle to avoid false alerts
Log in or sign up for Devpost to join the conversation.