AI Project: Distracted Driving Alert
- Aarav Doddapaneni
- Jul 4, 2023
- 3 min read
There is so much hype around Artificial Intelligence with all the latest and greatest tools that have recently been released. But how about actually building an AI model? That is exactly what I did with the help of a mentor. We tried to solve a common problem of distracted driving and came up with a solution to alert the drivers. The first thing my mentor helped me learn was introducing me to some advanced concepts in AI and machine learning. We learned about Natural Language Processing (NLP), Convolutional Neural Networks (CNN), and Computer vision.
Natural Language Processing: NLP simply put is converting human language to numbers that the computer can understand.
Convolutional Neural Networks: CNN is basically a network architecture for deep learning that learns directly from data. CNNs are particularly useful for finding patterns in images to recognize objects, classes, and categories.
Computer Vision: Computer vision is a field of computer science that focuses on enabling computers to identify and understand objects and people in images and videos. This technology is commonly used by self-driving cars such as Tesla to analyze surroundings in real-time.
After learning these concepts we jumped into exploring Python coding language using the Python learner notebooks which are short lessons followed by a prompt.
The next step was to get the data needed for us to analyze for testing and training. The data were images of distracted and attentive drivers from the web. We categorized the data into different types based on the driver's activity like drinking coffee, using the radio, using a mirror, and just being attentive.
Next, my mentor helped me with importing a decision tree and neural network that allowed us to make binary decisions by importing image data. A decision tree is a tree-like structure that represents a series of decisions and their possible consequences. It is used in machine learning for classification and regression tasks. It looks like a tree with multiple stems and roots that make decisions.

A neural network is just a more advanced version of this, and it looks more like a web, with multiple loops and weighted decisions. These are helpful because they help us analyze the image data efficiently.
Finally, we put the analyzed imaged data (training data) into a saliency map image software. A Saliency map is an image that highlights the regions that are important in the neural network’s decision.

Drinking Coffee: The hand used to hold the coffee cup, or mug, is highlighted for almost all of them.
Using Mirror: The hand holding the wheel is highlighted most of the time. The non-attentive hand is not.
Using Radio: The tip of the outreached hand is almost always highlighted in all of the data we used.
Attentive: The two hands are being highlighted and sometimes the legs.
Using an existing model which was originally trained on another task as a starting point, we used Python coding to adapt it for our project. This helped us to improve the accuracy of the model and reduce the amount of training data needed.
Now we were finally ready to test our model using the testing data. It started slow with a success rate of 35%, but using transfer learning, which is just repeating data until the model gets it, we got a success rate of 98.7%. In the end, we were able to successfully generate alerts to the drivers 98% of the time.
All in all, it took a lot of work and navigating complicated concepts, but in the end, it was a success and we made a working AI model.
Reference material: https://www.wardsauto.com/industry-voices/nothing-artificial-about-intelligence-reducing-distracted-driving




Comments