Real Time Driver Drowsiness Detection using Deep Learning Algorithm
In recent years, the casualties of traffic accidents caused by driving cars have been gradually increasing. In particular, heavy cargo trucks and high-speed bus accidents that occur during driving in the middle of the night have emerged as serious social problems. In this project, we will develop a
2025-06-28 16:28:54 - Adil Khan
Real Time Driver Drowsiness Detection using Deep Learning Algorithm
Project Area of Specialization Artificial IntelligenceProject SummaryIn recent years, the casualties of traffic accidents caused by driving cars have been gradually increasing. In particular, heavy cargo trucks and high-speed bus accidents that occur during driving in the middle of the night have emerged as serious social problems. In this project, we will develop a system that can monitor the alertness of drivers in order to prevent people from falling asleep at the wheel. The other main aim of this algorithm is to have an efficient performance on a low-quality webcam and without the use of infrared light which is harmful to the human eye. Motor vehicle accidents cause injury and death, and this system will help to decrease the number of crashes due to fatigued drivers. We will apply deep learning algorithms to predict drowsiness and improve drowsiness prediction using facial recognition technology and eye-blink recognition technology. We will improve the model incrementally by using other parameters like blink rate, yawning, state of the car, etc. The proposed algorithm will work in three main stages. In the first stage, the face of the driver is detected and tracked. In the second stage, the facial features are extracted for further processing. In the last stage, the most crucial parameter is monitored which is the eye’s status. In this last stage, it is determined that whether the eyes are closed or open. On the basis of this result, a warning is issued to the driver to take a break.
Project ObjectivesNeglecting our duties towards safer travel has enabled hundreds of thousands of tragedies to get associated with this wonderful invention every year. It may seem like a trivial thing to most folks but following rules and regulations on the road is of utmost importance. While on-road, an automobile wields the most power and in irresponsible hands, it can be destructive, and sometimes, that carelessness can harm lives even of the people on the road. One kind of carelessness is not admitting when we are too tired to drive. To monitor and prevent a destructive outcome from such negligence, many researchers have written research papers on driver drowsiness detection systems. But at times, some of the points and observations made by the system are not accurate enough. Hence, to provide data and another perspective on the problem at hand, to improve their implementations, and to further optimize the solution, this project will be done. We will improve the model incrementally by using other parameters like blink rate, yawning, state of the car, etc.
Project Implementation MethodIn this Python project, we will be using OpenCV for gathering the images from the webcam and feed them into a Deep Learning model which will classify whether the person’s eyes are ‘Open’ or ‘Closed’ and Yawn or Not. The approach we will be using for this Python project is as follows :
Step 1 – Take the image as input from a camera.
Step 2 – Detect the face in the image and create a Region of Interest (ROI).
Step 3 – Detect the eyes from ROI and feed them to the classifier.
Step 4 – The classifier will categorize whether eyes are open or closed.
Step 5 – Calculate score to check whether the person is drowsy.
Approaches and Methodology/Architecture
- Python (including different libraries)
- Jupyter notebook
- Image processing
- Webcam
- Machine learning
- Deep learning algorithms
Driving is a complex task where the driver is responsible for watching the road, taking the correct decisions on time, and finally responding to other drivers' actions and different road conditions. Vigilance is the state of wakefulness and the ability to effectively respond to external stimuli. It is crucial for safe driving. Among all fatigue-related accidents, crashes caused by fell-asleep-drivers are common and serious in terms of injury severity. According to recent statistics, driver fatigue or vigilance degradation is the main cause of 17.9% of fatalities and 26.4% of injuries on roads. Vigilance levels degrade mainly because of sleep deprivation, long monotonous driving on highways, and other medical conditions and brain disorders such as narcolepsy. Majority of the road accidents are mainly due to driver fatigue. Driving for a long period of time causes excessive fatigue and tiredness which in turn makes the driver sleepy or lose awareness. The study states that the cause of an accident falls into one of the following main categories: (1) human, (2) vehicular, and (3) environmental. The driver’s error accounted for 93% of the crashes. The other two categories of causative factors were cited as 13% for the vehicle factor and 34% for environmental factors. It is important to note that in some cases; more than one factor was assigned as a causal factor. The three main categories (human, vehicular, and environmental) are related among each other, and human error can be caused by improper vehicle or highway design characteristics. The recognized three major types of errors within the human error category: (1) recognition, (2) decision, and (3) performance [2]. Decision errors refer to those that occur as a result of a driver’s improper course of action or failure to take action. A recognition error may occur if the driver does not properly perceive or comprehend a situation. To perform all these activities in time and accurately it's necessary that the driver must be vigilant. In Pakistan 10,125 crashes were reported to police including 4193 fatal cases in 2006. According to a study conducted by the Aga Khan University in Karachi, government statistics included only 56% of deaths and 4% of serious injuries and concluded that traffic fatalities are a much more serious health problem than is reported by the official statistics which show a death rate of 11.2 per 100,000. The aim of this project is to develop a computer vision method able to detect and track the face of a driver in a robust fashion, also determine the status of the eyes, and with the highest precision possible. It is to serve as the basis of an automatic driver fatigue monitoring system.
Technical Details of Final DeliverableIn this design, first, the driver’s face image is captured by the use of a camera fixed to the vehicle. Following this, there are four steps to identify drowsiness in the driver, as shown. Firstly, the video input undergoes noise filtering, then the face is detected and cropped out. In the second stage, the eye area is detected from the cropped image of the face. Thirdly the mouth region is detected from the face.
These two tasks work together to enhance the outcomes of face detection. Then the removed mouth and eye closure functions are introduced to the removed mouth and eye regions. These functions perform operations on those regions to determine signs of drowsiness, that is closing of the eye and yawning.
Next, the outcomes will be combined and the driver's fatigue will be determined. If both of the parameters show signs of drowsiness at the same time then the driver is classified as not fit to drive, if either one of the parameters doesn’t show signs of drowsiness then the output is not passed on to the next stage of the process, instead, the reading is taken again. Finally, if a state of drowsiness is determined, then an alarm is activated. The face is then monitored and the operation is repeated in the next captured frames.
Final Deliverable of the Project HW/SW integrated systemCore Industry TransportationOther Industries Education , IT , Security Core Technology Artificial Intelligence(AI)Other Technologies Internet of Things (IoT), Big DataSustainable Development Goals Good Health and Well-Being for People, Industry, Innovation and Infrastructure, Peace and Justice Strong InstitutionsRequired Resources| Item Name | Type | No. of Units | Per Unit Cost (in Rs) | Total (in Rs) |
|---|---|---|---|---|
| Total in (Rs) | 50000 | |||
| raspberry pi 4 | Equipment | 1 | 16000 | 16000 |
| Logitech C920 | Equipment | 1 | 14000 | 14000 |
| UCTRONICS 5 Inch Touch Screen for Raspberry Pi 4 | Equipment | 1 | 10000 | 10000 |
| printing, transportation, overheads | Miscellaneous | 10 | 1000 | 10000 |