DriveAlive
A drowsiness detection system powered by machine learning and convolutional neural networks, designed for rideshare drivers.
Team
Dave (🙋🏻)
Hadley Dalton
Ivery Chen
Healey Koch
Timeline
a 3 week project, May 2024
Skills / Tools
Computer Vision, Python, Figma, Javascript
Drowsy driving ranks among the top causes of traffic accidents, significantly affecting road safety. Providing early warnings to sleepy drivers could prevent numerous accidents on the roads. Providing early warnings to sleepy drivers has the potential to prevent numerous accidents. According to data from the U.S. Department of Transportation over the past decade, car accidents, including both injuries and fatalities, are on the rise. It is crucial that we, as software engineers, leverage our skills to promote safer driving. Specifically, with the increasing dependency on rideshare services like Uber and Lyft, it is essential to implement non-intrusive safety measures to prevent drowsy driving among drivers providing these services.
My role in the team involved reviewing existing research on similar topics, gathering relevant datasets, and implementing a Convolutional Neural Network with data augmentation. Additionally, I took the lead in designing the detection algorithm. For this project, we aimed to develop a proof-of-concept site that enables users to upload or stream a video, which then analyzes and suggests whether someone is driving drowsy.
Research from American University reveals an unexpected finding: contrary to common belief, the eyes of a drowsy individual blink less frequently than the norm. However, this phenomenon occurs because most instances of eye closure persist for longer durations. At DriveAlive, we term these "drowsy blinks," and these prolonged eye closures are indicative of fatigue.
We determine how many "drowsy blinks" one exhibits in a short, seconds-long clip. First, the system identifies the face area in every frame of the video within each second. Then, it pinpoints the eye area using a facial landmarks detector. Next, it calculates and analyzes the eye aspect ratio for each frame. Afterward, three classifiers—linear SVM and sequential neural network—are used to enhance accuracy. The data is then classified to determine whether the driver's eyes are open or closed. The system detects closed eyes for a set period within each second, tallying the amount of drowsy blinks persisting within or throughout the seconds. The amount of drowsy blinks per minute is then quantified. More than even one drowsy blink should urge you to reconsider driving.
The primary dataset used for this project is the Drowsiness Detection Dataset from Kaggle:
Labeled based on whether eyes are closed or opened
Generated using MRL and Closed Eyes in Wild (CEW) dataset
2,500 images for closed and open eyes
The implementation process consisted of three main steps:
Training a Convolutional Neural Network (CNN) on images of open and closed eyes.
Utilizing Haar Cascades to detect the face and isolate the eyes, which were then fed into the CNN for classification.
Identifying drowsiness by counting instances where the eyes remained closed for 15 frames (approximately half a second), classifying it as a “drowsy” blink.
We developed a web page with a user interface as a proof-of-concept product!
A score of 1 indicates 0 drowsy blinks per second. A score of 2 represents between 0 and 0.25 drowsy blinks per second, while a score of 3 signifies over 0.25 drowsy blinks per second. After the 5th epoch, the model achieved nearly 98% accuracy in classifying open and closed eyes using the preprocessed dataset, enhanced with data augmentation for improved generalizability.