Inspiration
Our inspiration for this project comes from a strong commitment to road safety. Drowsy driving is a major issue that poses a significant threat to drivers and other road users. We aimed to develop an algorithm that can effectively detect drowsy drivers in real-time, potentially preventing accidents and saving lives.
What it does
Our project focuses on creating an algorithm that detects drowsy drivers. It utilizes deep learning algorithms to analyze images and determine if a driver is exhibiting signs of drowsiness while driving. By monitoring the driver's state, we aim to provide timely warnings or alerts to ensure their safety and the safety of others on the road.
How we built it
To develop our drowsy driver detection algorithm, we collected a dataset of images that featured both non-drowsy male and female drivers and drowsy male and female drivers. This dataset was essential for training and testing our algorithm. We used machine learning techniques, including deep learning with neural networks, to build and fine-tune our model. Additionally, we leveraged open-source libraries and frameworks such as TensorFlow and Keras for the development process.
DATASET CONSOLIDATION: We prepared a custom dataset by aggregating several dosing drivers' videos from youtube, and converted them into frames to prepare our training and testing data that consisted of 2 classes (drowsy, not drowsy).
TRAINING PHASE: For the training phase, we initially performed data augmentation on the training data so that the model can generalize itself to different angles of the inputs. We then built a CNN model from scratch that consists of two hidden layers, applied dropouts and Pooling layers to prevent overfitting. A comprehensive evaluation has been performed by using several combinations of hyperparameters such as the activation function, optimizer, number of kernels and dropout; and the best combination of the hyperparameters has been chosen for testing.
TESTING PHASE: We tested the model on a drowsy driver's video found on Youtube, and ensured that the application is able to send out notification messages to a predefined number using the TWILIO API, alarming that the driver is drowsy and he's potentially in danger. Finally, the model has been evaluated using metrics such as accuracy, loss, precision and recall.
Challenges we ran into
One of the primary challenges we encountered during this project was gathering a high-quality and diverse database of images for training. Ensuring that the dataset accurately represented various scenarios of drowsy and non-drowsy driving was critical for the algorithm's effectiveness. Identifying and labeling images as drowsy or non-drowsy required careful consideration and manual effort. Difficulty getting started little to no knowledge of Machine Learning due to the time restraint we couldn't have added a feature for Twilio
Accomplishments that we're proud of
We're proud to have developed a functional codebase for our drowsy driver detection system. It's a significant step toward our goal of improving road safety. Our code can analyze images in real-time and make predictions regarding a driver's state, and we believe it has the potential to make a positive impact. A working solution in almost 10 hours a significant amount of effort was required to tune the hyperparameters and we were able to achieve an accuracy of 70 % we know there is still a lot of improvement and we will try to implement post hackathon we also used project management tools like Kanban and github
What we learned
Through the course of this project, we deepened our understanding of working with large databases and gained valuable experience in training and evaluating machine learning models. We also improved our skills in using computer vision techniques to address real-world problems. How to create a CNN This was also our first Hackathon so it was a first working in a coding team
What's next for Team Detection
Our future goals involve expanding and enhancing our drowsy driver detection system. We plan to gather a larger and higher-quality database to further train and improve our algorithm's accuracy. Additionally, we aim to integrate our system with vehicles and driver assistance technologies, making it readily available for widespread use and contributing to a safer road environment.
Built With
- keras
- numpy
- open-cv
- python
- scikit-learn
- tensorflow
- twilio

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