PreprintPDF Available

Driver Drowsiness Detection and Alert System using Python and OpenCV

Authors:
Preprints and early-stage research may not have been peer reviewed yet.

Abstract

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 of fatigue 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.
Page 1/6
Driver Drowsiness Detection and Alert System using
Python and OpenCV
BRINDHA HARINI R ( 1716008@saec.ac.in )
SA Engineering College https://orcid.org/0000-0003-3382-5044
YAMINI R
SA Engineering College
Research Article
Keywords: Driver Drowsiness Detection System, EAR
DOI: https://doi.org/10.21203/rs.3.rs-473967/v1
License: This work is licensed under a Creative Commons Attribution 4.0 International License. 
Read Full License
Page 2/6
Abstract
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 offatigue 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.
I. Introduction
Driver exhaustion can be a signicant 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 inuences. Different strategies for driver drowsiness identication can be partitioned
into two general classications. 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 classication.
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 classication.
I I. Related Works
1]. QiangJi, Xiaojie Yang, "Real-time eye, gaze, and face
pose tracking for monitoring driver vigilance", Journal of
Real-Time Imaging.
Page 3/6
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 classication 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 Classication under
Real Driving Conditions”, 2010 IEEE Intelligent Vehicles
Symposium.
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 classication 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
Page 4/6
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 identied 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.
Page 5/6
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.
Declarations
1. Funding :
Not Applicable
2. Conicts of interest/Competing interests :
Not Applicable
3. Availability of data and material :
Not Applicable
4. Code availability :
Not Applicable
References
Page 6/6
1. QiangJi, PeilinLan, Carl Looney “A Probabilistic Framework for Modeling andReal-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. [7] Alessandro Giusti, Chiara Zocchi, and Alberto
Rovetta, “A Noninvasive System for Evaluating Driver Vigilance Level Examining both Physiological
andMechanical 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, “ExtractingDriver’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 forDriver State Classication
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.
Conference Paper
Full-text available
In this paper, a vision system for monitoring driver's facial features is presented. To begin, the driver's face is first located in the input video sequence. It is then 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 parall so that the precise can be improved. A number of video sequences with the drivers of different ages and genders under various illumination and road conditions were employed to demonstrate the performance of the proposed system. Future work is on how to extend the system to determine the level of vigilance of the driver.
Conference Paper
Experts assume that accidents caused by drowsiness are significantly under-reported in police crash investigations (1-3%). They estimate that about 24-33% of the severe accidents are related to drowsiness. In order to develop warning systems that detect reduced vigilance based on the driving behavior, a reliable and accurate drowsiness reference is needed. Studies have shown that measures of the driver's eyes are capable to detect drowsiness under simulator or experiment conditions. In this study, the performance of the latest eye tracking based in-vehicle fatigue prediction measures are evaluated. These measures are assessed statistically and by a classification method based on a large dataset of 90 hours of real road drives. The results show that eye-tracking drowsiness detection works well for some drivers as long as the blinks detection works properly. Even with some proposed improvements, however, there are still problems with bad light conditions and for persons wearing glasses. As a summary, the camera based sleepiness measures provide a valuable contribution for a drowsiness reference, but are not reliable enough to be the only reference.