Driver Drowsiness Detection and Alert System using
Python and OpenCV
BRINDHA HARINI R ( email@example.com )
SA Engineering College https://orcid.org/0000-0003-3382-5044
SA Engineering College
Keywords: Driver Drowsiness Detection System, EAR
License: This work is licensed under a Creative Commons Attribution 4.0 International License.
Read Full License
Driver Drowsiness is the one of the reasons for increase in accident rates. Various facial recognition
methods have been proposed to detect and alert the driver in-order to avoid accidents. Hence, this system
is proposed to reduce the number of accidents due to drivers fatigue and hence increase the
transportation safety. This system deals with automatic driver drowsiness detection based on visual
information captured by the system.
The driver is lively captured after which the images are further processed, and the fatigue is checked for. It
creates an alarm for the driver immediately in case offatigue detection, also an implementation to alert
the vehicles owner and others concerned about the safety are alerted as well. The system enhances the
safety measures by which accidents due to drivers drowsiness can be minimized.
Driver exhaustion can be a signicant variable in an expensive number of vehicle accidents. Road
Accidents in India cause nancial losses around Rs.9.34 billion every year. It can be seen there are around
2,700 road accidents consistently which is one death per every four hours. It has been gured around 25%
of car crashes with driver fatalities are due to driver’s drowsiness.
It was uncovered that driving execution quickly drop with expanded tiredness which result in making
more than 20% of all vehicle accidents. Less attention and focus while driving, heads the driver to being
distracted and the likelihood of street accident goes high. Drowsiness related accidents have all the
earmarks of being more serious as the driver isn’t capable of taking any preventive measures at that
moment. Because of the danger that the drowsiness presents on the road, strategies need to be created
for checking in its inuences. Different strategies for driver drowsiness identication can be partitioned
into two general classications. The techniques in the rst gathering recognizes the level of the tiredness
focused around the physiological changes of the body. Eye status, speech properties, and the time
interval between the eye being closed, head position, sitting carriage, heart rate, and brain signals are
simply a couple of illustrations of the strategies in the rst classication.
Techniques in the second category estimate that the driver's drowsiness level by following these
progressions. Steering angle and the distance from the following vehicle, lateral position of the vehicle,
longitudinal speed, longitudinal speeding up, and lane departure are utilized as a part of the technique of
the second classication.
I I. Related Works
1]. QiangJi, Xiaojie Yang, "Real-time eye, gaze, and face
pose tracking for monitoring driver vigilance", Journal of
This paper proposes a real-time prototype computer vision system for monitoring driver vigilance. The
main component include a remotely located video CCD camera, a specially designed hardware system for
real-time image acquisition and for controlling the illuminator and the alarm system, and various
computer vision algorithms for simultaneously, real-time and non-intrusively monitoring various visual
bio-behaviors that typically characterize a driver's level of vigilance. The visual behaviors include eyelid
movement, face orientation, and gaze movement (pupil movement). The system was implemented in an
environment with subjecting to different ethnic backgrounds, different genders, ages, with/without
glasses, and under different illumination conditions, and it was found very robust, reliable and accurate.
2]. Guang-Yuan Zhang, Bo Cheng, Rui-JiaFeng, Jia-Wen Li
“Real-time driver eye detection method using Support
Vector Machine with Hu invariant moments”, International
Conference on Machine Learning and Cybernetics.
In the making of advanced vehicle safety systems, monitoring the driver vigilance level and issuing an
alert when he is not paying adequate attention to the road is a promising way to prevent or avoid the road
accidents. In such a system, developing a reliable real-time driver eye detection method is a crucial part. A
real-time eye detection method using support vector machine (SVM) with Hu invariant moments is
proposed here. The test sets from the experiment were used to validate the classication results. The
validation results and conclusions about the performance of the method were presented in this paper.
3]. Fabian Friedrichs and Bin Yang, “Camera based
Drowsiness Reference for Driver State Classication under
Real Driving Conditions”, 2010 IEEE Intelligent Vehicles
To develop warning systems that detect reduced vigilance based on the behavior of driving, a reliable and
accurate drowsiness reference is necessary. Studies show that measures of the driver's eyes are capable
of detecting drowsiness under simulator or experimentational conditions. Here, the performance of the
latest eye tracking based invehicle fatigue prediction measures are evaluated. These measures are
assessed statistically and by a classication method based on a large dataset of 90 hours of real road
drives. The results show that eye-tracking based drowsiness detection works well for some drivers as
long as the blinks detection works properly.
4]. M. Wang, H. P. Chou, C. F. Hsu, S. W. Chen, and C. S. Fuh,
“Extracting Driver’s Facial Features During Driving ”, 2011
14th International IEEE Conference on Intelligent
Transportation Systems Washington, DC, USA.
A vision system for monitoring driver's facial features is discussed here. To begin with, the driver's face is
located in the input video sequence. Then it is tracked over the subsequent images. The facial features of
eyes, mouth and head are kept detecting in the course of face tracking. Feature detection and tracking are
performed in parallel, so that the precise can be improved.
5]. Momin and Parag P. Abhyankar “Current Status and
Future Research Directions in Monitoring Vigilance of
Individual or Mass Audience in Monotonous Working
Environment” International Journal on Soft Computing
(IJSC) Vol.3, No.2, May 2012
Working in monotonous environment often causes lack of concentration or fatigue in an operator and
many times such non-vigilance leads to accidents. That is why, early detection of fatigued state has
become crucial in monotonous working environments like driving vehicle, operating machines etc. Such
fatigued state often gets developed gradually and can be identied by certain symptoms. Different types
of symptoms help in measuring non-vigilance in different ways.
I I I. Proposed Sysytem
The proposed system is a driver face monitoring system that can detect driver fatigue and distraction by
processing of eye and face regions. After image acquisition, face detection is the rst stage of
processing. Then, the regions of eye and mouth are detected using the DLIB library and the symptoms of
fatigue are extracted from those regions.
In the proposed system, the main focus and concentration is on the eye status of the individual driving
the car. It consists of a parameter called the Eye Aspect Ratio also known as EAR which is an important
parameter as it’s value plays a key role in the drowsiness detection process. A threshold value is also
assigned at the beginning for the Eye Aspect Ratio. It compares the frequency of the eye to the assigned
threshold value. If the value is above, an alarm is generated. Similar to the EAR, when the mouth region is
detected, a threshold value is set and if the value is above the threshold frequency, again an alarm is
generated to alert the driver. Lastly, an alert is sent using an email to the concerned person.
In the EAR graph as shown above, the EAR becomes zero when the eye is closed and remains constant
when it is open. The EAR Ratio will have some certain variance among, the population depending on the
individuals. It fully varies on the uniform scale of the image and in rotation of the face. The EAR is
averaged as both the eyes can blink synchronously.
I V. Experimental Analysis
The Threshold value is set to 0.25,
Case I :
If the EAR = 0.37, which is clearly above the EAR Threshold value (0.25) set for the system. This means
that driver is safe and there is clearly no symptoms of drowsiness.
Case II :
If the EAR= 0.20, which is clearly below the EAR Threshold of the Drowsiness Detection system. Hence, it
creates an alarm as the driver is in half drowsy stage.
Case III :
If the EAR= 0.15, which is clearly a lot below the EAR Threshold (0.25) of the system. Unlike the previous
case, here a “DROWSINESS ALERT!” warning is displayed along with a loud alarm sound.
1. Funding :
2. Conicts of interest/Competing interests :
3. Availability of data and material :
4. Code availability :
1. QiangJi, PeilinLan, Carl Looney “A Probabilistic Framework for Modeling andReal-Time Monitoring
Human Fatigue”, IEEE Transactions on Systems, Man, and Cybernetics .
2. Lifang Deng; XingliangXiong; Jin Zhou; Ping Gan; Shixiong Deng; “Fatigue Detection Based on
Infrared Video Pupillography”, 4th International Conference on Bioinformatics and Biomedical
Engineering (iCBBE), Publication Year: 2010.  Alessandro Giusti, Chiara Zocchi, and Alberto
Rovetta, “A Noninvasive System for Evaluating Driver Vigilance Level Examining both Physiological
andMechanical Data”, IEEE Transactions on Intelligent Transportation Systems, March 2009.
3. M. Wang, H. P. Chou, C. F. Hsu, S. W. Chen, and C. S. Fuh, “ExtractingDriver’s Facial Features During
Driving ”, 2011 14th International IEEE Conference on Intelligent Transportation Systems
Washington, DC, USA.
4. Fabian Friedrichs and Bin Yang, “Camerabased Drowsiness Reference forDriver State Classication
under Real Driving Conditions”, 2010 IEEE Intelligent Vehicles Symposium.
5. Chin-Teng Lin; Yu-Chieh Chen; Ruei-Cheng Wu; Sheng-Fu Liang; Teng-Yi Huang; "Assessment of
driver's driving performance and alertness using EEGbased fuzzy neural networks ", IEEE
International Symposium on Circuits and Systems, 2005.