Real-TimeDriverDrowsinessDetectionusingComputerVision
Real-TimeDriverDrowsinessDetectionusingComputerVision
net/publication/355651503
CITATIONS READS
28 2,851
1 author:
Mahek Jain
R.V. College of Engineering
3 PUBLICATIONS 74 CITATIONS
SEE PROFILE
All content following this page was uploaded by Mahek Jain on 26 October 2021.
Abstract: The proposed system aims to lessen the number of This paper is focused on designing a drowsiness detection
accidents that occur due to drivers’ drowsiness and fatigue, which system that functions efficiently and is affordable. The
will in turn increase transportation safety. This is becoming a method that is needed in the present scenario detects
common reason for accidents in recent times. Several faces and drowsiness based on the eyes and mouth geometric features.
body gestures are considered such as signs of drowsiness and
fatigue in drivers, including tiredness in eyes and yawning. These
This paper proposes to achieve the same, by developing a
features are an indication that the driver’s condition is improper. drowsiness detection system to monitor and prevent a
EAR (Eye Aspect Ratio) computes the ratio of distances between destructive outcome from the negligence of fatigue. There are
the horizontal and vertical eye landmarks which is required for an increasing number of accidents on roads today and driver
detection of drowsiness. For the purpose of yawn detection, a drowsiness is an important factor and this has been accepted
YAWN value is calculated using the distance between the lower lip extensively. The exact number of accidents caused by
and the upper lip, and the distance will be compared against a
threshold value. We have deployed an eSpeak module (text to
driver’s drowsiness is difficult to decide because it is
speech synthesizer) which is used for giving appropriate voice underestimated most of the time. The transition from being
alerts when the driver is feeling drowsy or is yawning. The fatigued to dozing off is subtle and generally goes unnoticed
proposed system is designed to decrease the rate of accidents and by the driver. This explains why it is important to do more
to contribute to the technology with the goal to prevent fatalities work in this field with an aim to reduce the occurrence of
caused due to road accidents. accidents related to drowsiness and motivate ourselves to
Keywords: Drowsiness, eSpeak module, Eye aspect ratio, Yawn
develop a driver drowsiness detection system.
Detection.
The limitations of the paper are that the Raspberry Pi real-time. The other objectives include designing a system
camera was used and because of this, the system could not that detects drowsiness of drivers by monitoring the eyes of
work during the nighttime. A night-vision camera should the driver regularly, especially the retina. The system should
have been used. From [2] titled “Real-time monitoring of give an alert to the driver when the driver yawns frequently or
driver drowsiness on mobile platforms using 3D neural when the driver’s eyes remain closed for a few seconds. The
networks”. In this paper, they have used depth-wise separable system works even when a driver is wearing spectacles. The
3D convolution operations to detect drowsiness in drivers system is not affected by bad lighting conditions.
from real-time face video and also, they have identified micro
sleeps and alerted the drivers. The results obtained show that IV. METHODOLOGY
the method can decide which features are important and it
Firstly, the face is localized in the image using facial
does not depend on the developer to pre-specify a set of
landmark detection. Then, shape prediction methods are used
features because they might miss some features like nose
to detect important features on the face. Face detection [14] is
wrinkles, eyelid movement, and other facial gestures. The
done by OpenCV built in HAAR cascades, which are
limitations of the paper are that the dataset which is used
pre-trained. In the next step, to estimate the location of 68 (x,
consists of just 18 persons and also, the frames were not
y)-coordinates that map to facial structures, a facial landmark
labeled properly.
detector which is pre-trained and included in the dlib library
From [3] titled “The detection of drowsiness using a driver
is used. It is also trained on the iBUG 300-W dataset. The
monitoring system”. In this paper, they have made use of a
EAR [8] is computed using the ratio of distances between the
driver monitoring system (DMS) to detect drowsiness along
horizontal and vertical eye landmarks for drowsiness
with different kinds of sensors. They have also collected data
detection. For the purpose of yawn detection [9], a YAWN
in the form of signals from other vehicle-based sensors. The
value will be calculated using the distance between the upper
results obtained show that the models were effective at
and the lower lip, and the distance will be compared against a
dividing the drowsiness into three levels - low, moderate, and
threshold value. eSpeak module (text to speech synthesizer)
severe drowsiness. But, while differentiating between
is used for giving appropriate voice alerts when the driver is
moderate and severe levels, the model was not efficient
feeling drowsy or is yawning.
enough. The limitations of the paper are that the model was
not effective while differentiating moderate drowsiness from
V. SOFTWARE REQUIREMENTS SPECIFICATION
severe drowsiness. Another limitation is that the size of the
sample used in this paper is small. The proposed system must be able to detect drowsiness
From [4] titled “Driver Drowsiness Detection System given a proper real-time driving environment. The
Using Computer Vision”. The objective of the paper is to performance will depend upon the quality of the camera as
detect driver drowsiness by analyzing human eye blinks well. The proposed system due to its well-designed and
using a recent facial landmark detection and to make use of easy-to-use interface can be used by both day-time and
E.A.R(eye aspect ratio) for easy, fast, and efficient blink night-time drivers. Users can follow up the interface step by
detection. The results showed that the system was successful step for their purpose. The proposed system must be available
in driver drowsiness detection by providing a reliably precise for use to the user as and when needed provided that the
enough estimation of the level of eye openness. This alert user’s system meets the specified requirements. The
system can be used in real-time due to a very negligible proposed system must be able to recover from failure in case
performance cost experienced in facial landmark detection. of the application crashing abruptly and become ready-to-use
The limitations of the paper are that a fixed blink duration is after recovery. The prototype of the drowsiness detection
assumed even though everyone’s blink duration lasts system will be implemented on the Raspberry
differently. EAR is estimated from two-dimensional data Pi microcontroller board, along with the necessary peripheral
which cannot account for out-of-plane head orientation and hardware, and Python 3 will be used to implement the
the model depends only on eyes for drowsiness detection. software functionality of drowsiness detection.
From [5] titled “Drowsiness Detection Based on Eye
Closure and Yawning Detection”. In this paper, driver’s eye VI. SYSTEM DESIGN
and mouth movements are tracked using Haar-cascade A. System Architecture
classifiers. This will help to detect the closing of eyes and
When the driver is driving, the driver’s face is captured by
frequency of yawning. The system also generates alarm
a camera and it is converted into a video stream. The
sounds if the driver is drowsy or already asleep. As a result, in
application then analyzes the video to detect drowsiness and
85% of the cases, the system detects faces and facial features
fatigue and also checks the level of drowsiness. In this stage,
which are required, accurately. The system is prompt in
the main parts which should be considered for analysis are:
detecting drowsiness once the feature detection of the face is
the driver’s face tracking, driver’s fatigue state, and
positive. The limitation of the paper is that it is observed that
recognition of key regions of the face based on eye closure
the system's accuracy decreases in bad lighting conditions.
and yawning [10]. Finally, if the drowsiness is detected, a
warning voice alert is given.
III. OBJECTIVES
The main objective is to develop a system that is accurate
to detect a driver’s drowsiness based on eyelid movement and
yawning and is reliable to give appropriate voice alerts [6] in
Fig. 1 depicts High-Level System Architecture consisting covering all the key facial landmarks including eyes, mouth,
of the input to the model and the preprocessing and nose, etc. [19] But with regards to this project our region of
evaluation in stages. Stage 1 involves pre-processing of video interest (ROI) includes only the eyes and lips region which
stream for human face tracking. Stage 2 involves extraction can be extracted using python slicing techniques.
of facial key regions such as eyes and mouth. Stage 3
Table- I: iBUG 300w Dataset split up
involves detection of drowsiness symptoms like eye closure,
blinking, and yawning. Total Images Number of Annotated faces
involved
293 1
53 2
53 [3,7]
B. Performance Analysis
To achieve the expected results, a large number of pictures
were taken and their accuracy in drowsiness (using EAR
calculation) and yawn detection [11] was analyzed.
Sample 1: Face improperly aligned
Table- II: Performance Analysis drowsiness. [18] The outer factors may be weather
I/P Drowsiness Yawn Detection
conditions, state of the vehicle, time of sleeping and,
Detection mechanical data. Driver drowsiness is among the major
Sample 1 Not detected Not detected threats to road safety, and in the case of commercial motor
(improper face (improper face vehicle operators, the problem is particularly severe. The
alignment) alignment) factors that contribute to this serious safety issue are
Sample 2 96% 98% twenty-four-hour services, unpredictable conditions of the
Sample 3 99% 99% environment, high annual mileage, and an increase of work
The following parameters are considered for performance schedules that are demanding. One important step of
analysis: preventive measures that are needed to solve this problem is
• Drowsiness Detection Accuracy = total no. of times alert by continuously observing the driver’s drowsiness state [17]
raised when eyes closed / (total no. of times alert raised and giving information about their state to the driver so that
when eyes closed + total no of times alert didn’t raise they can take necessary action. Presently, no adjustment can
when the eyes are closed) be done concerning the zoom or direction of the camera
• Yawn Detection Accuracy = total no. of times alarm during the system operation. [20] In the future, more work
raised when user yawns / (total no. of times alarm raised can be done to automate the zoom on the eyes after they are
when user yawns + total no of times alarm didn’t raise localized.
when the user yawns).
C. System Testing LIMITATIONS
The following table represents five test cases that were The accuracy of the model degrades if the eye frames are
conducted while doing this project for drowsiness and yawn not captured clearly due to any kind of obstacles such as
detection of the driver. goggles or spectacles having reflection). Camera operations
Table- III: System Testing such as auto adjustments with respect to zoom and rotation
are not considered in conducting experiments. Once the eyes
Test Cases Eyes Eye Yawn
Result are localized, zooming in automatically will help increase the
Detected closure detected
accuracy. The accuracy of detection of eyes and mouth
Case 1 No No No No result
reduces when the driver is not facing the camera.
Case 2 Yes No No No result
Case 3 Yes Yes No Voice alert
ACKNOWLEDGMENT
Case 4 Yes No Yes Voice alert
Case 5 Yes Yes Yes Voice alert We thank Anirudh Devpura for his assistance in checking the
According to the methodology of the system, when the case results of the experiment. We thank the professors of RV
eyes are closed for more than the set threshold number of College and Engineering for their advice and suggestions.
frames or when the driver is yawning [12], then the driver is
feeling tired. Henceforth, one of these distinguished cases REFERENCES
arises, and the corresponding result happens. The accuracy as 1. Rahul Atul Bhope, “Computer Vision based drowsiness detection for
measured in the performance analysis phase is almost found motorized vehicles with Web Push Notifications”, IEEE 4th
to be 100% in the case when the face is properly aligned and International Conference on Internet of Things, IEEE, Ghaziabad,
India, 2019.
no wearable obstacle is present. Accuracy drops down a little 2. Jasper S. Wijnands, Jason Thompson, Kerry A. Nice, Gideon D. P,
when an obstacle is present (e.g., Hat). Ambient lighting Aschwanden & Mark Stevenson, “Real-time monitoring of driver
conditions are very essential for getting proper results. In drowsiness on mobile platforms using 3D neural networks”, Neural
case, the user’s eye closure and yawn occur simultaneously, a Computing and Applications, 2019.
3. Chris Schwarz, John Gaspar, Thomas Miller & Reza Yousefian, “The
voice alert is raised but the system behaves in an erroneous detection of drowsiness using a driver monitoring system” , in Journal
and unsynchronized fashion. Hence, such a situation should of Traffic Injury Prevention (Taylor and Francis Online), 2019.
be avoided to prevent any inconsistent results. 4. Aditya Ranjan, Karan Vyas, Sujay Ghadge, Siddharth Patel, Suvarna
Sanjay Pawar, “Driver Drowsiness Detection System Using Computer
Vision.”, in International Research Journal of Engineering and
VIII. CONCLUSION AND FUTURE SCOPE Technology(IRJET), 2020.
5. B.Mohana, C.M.Sheela Rani, “Drowsiness Detection Based on Eye
The model is capable of detecting drowsiness by Closure and Yawning Detection”, in International Research Journal of
monitoring the eyes and mouth. Shape prediction methods Engineering and Technology(IRJET), 2019.
[16] are used to detect important features on the face. The 6. Driver Alert Control (DAC). (2016, Feb 10). Retrieved from
http://support.volvocars.com/uk/cars/Pages/owners-manual.
inputs given to these methods are facial landmarks which are aspx?mc=Y555&my=2015&sw=14w20&article=2e82f6fc0
obtained from facial landmark detection. This module deals d1139c2c0a801e800329d4e
with the EAR function which computes the ratio of distances 7. Z. Mardi, S. N. Ashtiani, and M. Mikaili, “EEG-based drowsiness
detection for safe driving using chaotic features and statistical tests,”
between the horizontal and vertical eye landmarks. An Journal of Medical Signals and Sensors, vol. 1, pp. 130–137, 2011.
eSpeak module (text to speech synthesizer) is also deployed 8. T. Danisman, I.M. Bilasco, C. Djeraba and N. Ihaddadene, “Drowsy
which is used for giving appropriate voice alerts when the driver detection system using eye blink patterns,” Universite Lille 1 &
Telecom Lille 1, Marconi, France, 2010.
driver is feeling drowsy or is yawning. The whole project is
designed to decrease the rate of accidents and to contribute to
the technology with the goal to prevent fatalities caused due
to road accidents. The future work of this paper can be
focused on the use of outer factors for measuring fatigue and
AUTHORS PROFILE