Driver Drowiness
Driver Drowiness
Driver Drowiness
ABSTRACT
This document is a review report on the research conducted and the project made in the
field of computer engineering to develop a system for driver drowsiness detection to
prevent accidents from happening because of driver fatigue and sleepiness. The report
proposed the results and solutions on the limited implementation of the various techniques
that are introduced in the project. Whereas the implementation of the project give the real
world idea of how the system works and what changes can be done in order to improve the
utility of the overall system.
Furthermore, the paper states the overview of the observations made by the authors in
order to help further optimization in the mentioned field to achieve the utility at a better
efficiency for a safer road.
[1]
DRIVER DROWSINESS DETECTION SYSTEM
Contents
1 Introduction 8
1.1 PURPOSE . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.1.1 HUMAN PSYCHOLOGY. . . . . . . . . . . . 8
1.1.2 CURRENT STATISTICS . . . . . . . . . . . . . . . . . . . 9
1.2 DOCUMENT CONVENTIONS . . . . . . . . . . . . . . . . 9
1.3 INTENDED AUDIENCE. . . . . . . . . . . . . . . 9
1.4 PRODUCT SCOPE. . . . . . . . . . . . . . . 10
1.5 PROBLEM DEFINITION. . . . . . . . . . . . . . . 10
2 Literature Survey 11
2.1 SYSTEM REVIEW . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
2.2 TECHNOLOGY USED. . . . . . . . . . . . . . . 11
4 Requirement Analysis 13
4.1 PYTHON . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
4.1.1 LIBRARIES . . . . . . . . . . . . . . . . . . . . 13
4.2 OPERATING SYSTEM . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
4.3 HARDWARE . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
4.3.1 LAPTOP . . . . . . . . . . . . . . . . . . . . 13
4.3.2 WEBCAM . . . . . . . . . . . . . . . . . . . . 13
5 System Design 14
5.1 USE CASE MODEL . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
5.2 ACTIVITY DIAGRAM . . . . . . . . . . . . . . . . . . . . . . . . . 15
1 5.3 CLASS DIAGRAM . . . . . . . . . . . . . . . . . . . . . . . . . 16
6 System Testing 17
6.1 TEST CASES & TEST RESULTS . . . . . . . . . . . . . . . . . . . . . . 17
[2]
DRIVER DROWSINESS DETECTION SYSTEM
7 Project Planning 18
7.1 SYSTEM MODEL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
8 Implementation 19
9 Screenshots of Project 21
9.1 NON-DROWSY STATE . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
9.2 DROWSY STATE . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
11 References 23
[3]
DRIVER DROWSINESS DETECTION SYSTEM
List of Figures
5.1 USE CASE MODEL . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
[4]
DRIVER DROWSINESS DETECTION SYSTEM
Chapter 1
Introduction
PURPOSE
Humans have always invented machines and devised techniques to ease and
protect their lives, for mundane activities like traveling to work, or for more
interesting purposes like aircraft travel. With the advancement in technology,
modes of transportation kept on advancing and our dependency on it started
increasing exponentially. It has greatly affected our lives as we know it. Now, we
can travel to places at a pace that even our grandparents wouldn’t have thought
possible. In modern times, almost everyone in this world uses some sort of
transportation every day. Some people are rich enough to have their own vehicles
while others use public transportation. However, there are some rules and codes
of conduct for those who drive irrespective of their social status. One of them is
staying alert and active while driving.
Neglecting 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. In order 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, in order to
improve their implementations and to further optimize the solution, this project
has been done.
[5]
DRIVER DROWSINESS DETECTION SYSTEM
Our current statistics reveal that just in 2015 in India alone, 148,707
people died due to car related accidents. Of these, at least 21 percent were
caused due to fatigue causing drivers to make mistakes. This can be a relatively
smaller number still, as among the multiple causes that can lead to an accident,
the involvement of fatigue as a cause is generally grossly underestimated. Fatigue
combined with bad infrastructure in developing countries like India is a recipe for
disaster. Fatigue, in general, is very difficult to measure or observe unlike
alcohol and drugs, which have clear key indicators and tests that are available
easily. Probably, the best solutions to this problem are awareness about
fatigue-related accidents and promoting drivers to admit fatigue when needed.
The former is hard and much more expensive to achieve, and the latter is not
possible without the former as driving for long hours is very lucrative.
When there is an increased need for a job, the wages associated with it
increases leading to more and more people adopting it. Such is the case for
driving transport vehicles at night. Money motivates drivers to make unwise
decisions like driving all night even with fatigue. This is mainly because the
drivers are not themselves aware of the huge risk associated with driving when
fatigued. Some countries have imposed restrictions on the number of hours a
driver can drive at a stretch, but it is still not enough to solve this problem
as its implementation is very difficult and costly.
DOCUMENT CONVENTIONS
INTENDED AUDIENCE
The intended audience for this document are the development team, the project
evaluation jury, and other tech-savvy enthusiasts who wish to further work on the
project.
[6]
DRIVER DROWSINESS DETECTION SYSTEM
PRODUCT SCOPE
There are many products out there that provide the measure of fatigue level in the
drivers which are implemented in many vehicles. The driver drowsiness detection
system provides the similar functionality but with better results and additional
benefits. Also, it alerts the user on reaching a certain saturation point of the
drowsiness measure.
PROBLEM DEFINITION
Fatigue is a safety problem that has not yet been deeply tackled by any country in
the world mainly because of its nature. Fatigue, in general, is very difficult to
measure or observe unlike alcohol and drugs, which have clear key indicators
and tests that are available easily. Probably, the best solutions to this problem
are awareness about fatigue-related accidents and promoting drivers to admit
fatigue when needed. The former is hard and much more expensive to achieve,
and the latter is not possible without the formeras driving for
long hours is very lucrative.
[7]
DRIVER DROWSINESS DETECTION SYSTEM
Chapter 2
Literature Survey
SYSTEM REVIEW
This survey is done to comprehend the need and prerequisite of the general
population, and to do as such, we went through different sites and applications
and looked for the fundamental data. Based on these data, we made an audit that
helped us get new thoughts and make different arrangements for our task. We
reached the decision that there is a need of such application and felt that there is
a decent extent of progress in this field too.
TECHNOLOGY USED
[8]
DRIVER DROWSINESS DETECTION SYSTEM
Chapter 3
Python:
Python 3
Libraries
Numpy
Scipy
Playsound
Dlib
Imutils
opencv, etc.
Operating System
Windows or Ubuntu
[9]
DRIVER DROWSINESS DETECTION SYSTEM
Chapter 4
Requirement Analysis
[10]
DRIVER DROWSINESS DETECTION SYSTEM
Chapter 5
System Design
FIGURE 1
[11]
DRIVER DROWSINESS DETECTION SYSTEM
ACTIVITY DIAGRAM
FIGURE 2
[12]
DRIVER DROWSINESS DETECTION SY
CLASS DIAGRAM
FIGURE 3
[13]
DRIVER DROWSINESS DETECTION SY
Chapter 6
System Testing
Test Test Case Title Test Condition System Behavior Expected Result
ID
Straight Face,
Good Light, With
T01 NSGY Glasses Non Drowsy Non Drowsy
Tilted Face, Good
T02 YTGN Light, No Glasses Drowsy Drowsy
Tilted Face, Good
Light, With Glasses
T03 YTGY Drowsy Drowsy
[14]
DRIVER DROWSINESS DETECTION SYSTEM
Chapter 7
Project Planning
SYSTEM MODEL
The framework is created utilizing the incremental model. The center model of
the framework is first created and afterwards augmented in this way in the wake
of testing at each turn. The underlying undertaking skeleton was refined into
expanding levels of ability.
[15]
DRIVER DROWSINESS DETECTION SYSTEM
Chapter 8
Implementation
In our program we used Dlib, a pre-trained program trained on the
HELEN dataset to detect human faces using the pre-defined 68
landmarks.
After passing our video feed to the dlib frame by frame, we are able to detect
left eye and right eye features of the face.
[16]
DRIVER DROWSINESS DETECTION SYSTEM
Eyes with horizontal and vertical distance marked for Eye Aspect Ratio
calculation.
Now we check if the aspect ratio value is less than 0.25 (0.25 was
chosen as a base case after some tests). If it is less an alarm is sounded
and user is warned.
[17]
DRIVER DROWSINESS DETECTION SYSTEM
Chapter 9
Screenshots of Project
Non-drowsy Person:
Non-drowsy state
Drowsy Person:
[18]
DRIVER DROWSINESS DETECTION SYSTEM
Chapter 10
Conclusion
Future Scope
The model can be improved incrementally by using other parameters like blink
rate, yawning, state of the car, etc. If all these parameters are used it can improve
the accuracy by a lot.
We plan to further work on the project by adding a sensor to track the heart rate
in order to prevent accidents caused due to sudden heart attacks to drivers.
Same model and techniques can be used for various other uses like Netflix and
other streaming services can detect when the user is asleep and stop the video
accordingly. It can also be used in application that prevents user from sleeping.
[19]
DRIVER DROWSINESS DETECTION SYSTEM
References
[1] COMPUTATIONALLY EFFICIENT FACE DETECTION; B.
SCHLKOPF-A. BLAKE, S. ROMDHANI, AND P. TORR.
[5] http://ncrb.gov.in/StatPublications/ADSI/ADSI2015/chapter1A%20traffic
%20accidents.pdf
[6] http://www.jotr.in/text.asp?2013/6/1/1/118718
[7] http://dlib.net/face_landmark_detection_ex.cpp.html
[20]