Nothing Special   »   [go: up one dir, main page]

Driver Drowsiness Detection and Alert System

Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

International Journal of Scientific Research in Computer Science, Engineering and Information Technology

ISSN : 2456-3307 (www.ijsrcseit.com)


doi : https://doi.org/10.32628/CSEIT2173171
Driver Drowsiness Detection and Alert System
Swapnil Titare 1, Shubham Chinchghare1, K. N. Hande2
1 Department of Computer Science and Engineering, Priyadarshini Bhagwati College of Engineering, Nagpur,
Maharashtra, India
2Head of the Department, Department of Computer Science and Engineering, Priyadarshini Bhagwati College
of Engineering, Nagpur, Maharashtra, India

ABSTRACT

Article Info Nowadays, accidents occur during drowsy road trips and increase day by day; It
Volume 7, Issue 3 is a known fact that many accidents occur due to driver fatigue and sometimes
Page Number: 583-588 inattention, this research is primarily devoted to maximizing efforts to identify
drowsiness. State of the driver under real driving conditions. The aim of driver
Publication Issue : drowsiness detection systems is to try to reduce these traffic accidents. The
May-June-2021 secondary data collected focuses on previous research on systems for detecting
drowsiness and several methods have been used to detect drowsiness or
Article History inattentive driving.Our goal is to provide an interface where the program can
Accepted : 18 June 2021 automatically detect the driver's drowsiness and detect it in the event of an
Published : 26 June 2021 accident by using the image of a person captured by the webcam and examining
how this information can be used to improve driving safety can be used. . a
vehicle safety project that helps prevent accidents caused by the driver's sleep.
Basically, you're collecting a human image from the webcam and exploring how
that information could be used to improve driving safety. Collect images from
the live webcam stream and apply machine learning algorithm to the image and
recognize the drowsy driver or not.When the driver is sleepy, it plays the buzzer
alarm and increases the buzzer sound. If the driver doesn't wake up, they'll send
a text message and email to their family members about their situation. Hence,
this utility goes beyond the problem of detecting drowsiness while driving. Eye
extraction, face extraction with dlib.
Keywords: Eye extraction, Dlib, Facial Extraction, Drowsiness, Machine
Learning, EAR, Python, Face Detection

I. INTRODUCTION concentration, activity, alertness, and alertness, and


causes the driver to make slow decisions and
The car accident is the leading cause of death, killing sometimes not make decisions. Drowsiness affects
around 1.3 million people each year. Most of these mental alertness and reduces the driver's ability to
accidents are caused by driver distraction or drive a vehicle safely and increases the risk of human
drowsiness. Drowsiness decreases the driver's error, which can lead to death and injury [5]. the

Copyright: © the author(s), publisher and licensee Technoscience Academy. This is an open-access article distributed under the 583
terms of the Creative Commons Attribution Non-Commercial License, which permits unrestricted non-commercial use,
distribution, and reproduction in any medium, provided the original work is properly cited
Swapnil Titare et al Int. J. Sci. Res. Comput. Sci. Eng. Inf. Technol, May-June - 2021, 7 (3) : 583-588

error rate for the driver had decreased. Countless


people drive long distances on the road day and night.
Lack of sleep or distractions such as talking on the II. METHODS AND MATERIAL
phone, talking to the passenger, etc. can cause an
accident. To avoid these accidents, we propose a Tools & Image Processing Methods
system that will warn the driver if they are distracted
or drowsy. Open CV: OpenCV (Open-Source Computer Vision)
is the Swiss Army Knife of Computer Vision, it has a
wide range of modules that can help us with many
Computer Vision problems, but perhaps the most
useful part of OpenCV is its architecture. and
memory management. It gives you a framework in
which to work with pictures and videos however you
want, using OpenCV algorithms or your own,
without worrying about allocating and reallocating
memory for your pictures. optimized and can be used
Fig: Drowsy Driver for real-time video and image processing The highly
optimized image processing function of OPENCV is
Face and brand recognition is used with the help of used by the author for real-time image processing of
image processing of facial images captured by the live video streaming from the camera.
camera to identify distractions or drowsiness. To
solve the problem, we came up with the DLib: Dlib is a modern C toolkit with algorithms and
implemented solution in the form of image tools for machine learning to create complex C ++
processing. Perform image editing. , OpenCV and software to solve real problems. It is used in a wide
Dlib open source libraries are used. Python is variety of fields in both industry and academia,
employed because the language to implement the including robotics, embedded devices, cell phones,
idea. associate degree infrared camera is used to and large, high-performance computing
endlessly track the driving force' facial markings and environments. Lib's open source licenses allow you to
eye movements. This project mainly focuses on the use it in any application for free.The author uses the
driver's eye markings. Driver. Eye characteristics are open source Dib library for the CNN (Neural
continuously tracked to detect drowsiness. Images are Networks) implementation. The author uses highly
captured by the camera, these images are forwarded optimized prediction functions and detectors of
to an image processing module that performs face previously learned face shapes to detect facial
recognition to detect distraction and drowsiness of features.
the driver. sThe following use cases are covered in
this project. If the driver's eyes are closed for a EAR (Eye Aspect Ratio)
limited period of time, the driver is considered
drowsy and the corresponding audible alarm is used The numerator of this equation calculates the
to warn the driver. distance between the vertical landmarks of the eye,
while the denominator denotes. calculates distance
between the horizontal eye reference points,

Volume 7, Issue 3, May-June-2021 | http://ijsrcseit.com 584


Swapnil Titare et al Int. J. Sci. Res. Comput. Sci. Eng. Inf. Technol, May-June - 2021, 7 (3) : 583-588

weighting the denominator accordingly since there is


only one. The aspect ratio of the eye is roughly
constant when the eye is open, but quickly drops to
zero when you blink.When the person blinks, the
aspect ratio of the eyes drops dramatically and
Fig: - LBPH
approaches zero. As shown in Figure 2, the aspect
ratio of the eyes is constant, then quickly drops to
In Figure , the result will be the same as before. in
zero and then increases again, suggesting that a single
larger cells to determine the frequency of occurrence
blink has occurred.
of values, which speeds up the process. By analyzing
the results in the cell, edges can be identified as the
values change. By calculating the values for all cells
and concatenating the histograms, feature vectors can
be obtained. The input images are classified according
to the same procedure and compared with the data
set, and the distance is determined. By setting a
threshold, you can tell if the face is familiar or
unfamiliar.Eigenface and Fisherface calculate the
dominant features of the entire training set, while
LBPH analyzes them individually.
Fig : Eyes Points
Face Recognition
Algorithm Steps
The following sections describe the face recognition
algorithms Eigenface, Fisherface, Histogram of Local
Step 1 – Take image as input from a camera.
Binary Pattern and their implementation in OpenCV:
Histogram of Local Binary Pattern (LBPH) Local Step 2 – Recognize the face in the image and create a
binary patterns were used as classifiers in Computer region of interest (ROI).
Vision and 1990 by Li. suggested Wang [4] The
combination of LBP with histogram-oriented Step 3 – Recognize the eyes from the ROI and send
gradients was introduced in 2009, which improved them to the classifier
the performance in certain data sets [5]. For feature
Step 4 – The classifier classifies whether the eyes are
coding, the image is divided into cells (4 x 4 pixels)
open or closed
using a surrounding pixel clockwise or
counterclockwise. The values are compared with the Step 5 – Calculate the score to be verified. when the
central ones shown in Figure 6. The intensity or person is sleepy.
brightness value of each neighbor is compared to the
central pixel. Depending on whether the difference is
greater or less than 0, the location is assigned a 1 or 0.
an 8-bit value for the cell.The advantage of this
technique is that even if the brightness of the image
is .

Volume 7, Issue 3, May-June-2021 | http://ijsrcseit.com 585


Swapnil Titare et al Int. J. Sci. Res. Comput. Sci. Eng. Inf. Technol, May-June - 2021, 7 (3) : 583-588

Flowchart III.RESULTS AND DISCUSSION

In this system we have divide into several modules


shown below

1. Login Module - In this module user will able to


enter in system and available to start the
drowsiness system and system will start the
camera and start monitoring the driver. In this
module user has to provide there credentials such
as username and password.

Fig : Login Page

Fig: Drowsiness Detection 2. Registration Module - In this module user able


to register his details such as its contact number,
With a webcam we take pictures as input. To access
email and also his family member details and their
the webcam, we created an infinite loop that captures
number and emails which going to use to make
each frame. We will use the method provided by
them alert by sending email and SMS in stage of
OpenCV to access the camera and configure the
drowsiness.
capture object, we will read each frame and store the
image in a frame variable. In order to recognize the
face in the image, we must first convert the image to
grayscale, as the OpenCV algorithm for object
recognition uses gray images as it is input. We don't
need any color information to recognize the objects.
We use a hair cascade classifier to identify faces.
Then we do face recognition. Returns an array of
detections with x, y coordinates and the height and
width of the bounding box of the object. Now we can Fig : Registration Page
iterate over the faces. and draw contour boxes for
each face. 3. Eye Extraction Module -In this module it will
detect the eyes and face landmarks from live
webcam feed and apply algorithms on image to
detect driver drowsy or not.

Volume 7, Issue 3, May-June-2021 | http://ijsrcseit.com 586


Swapnil Titare et al Int. J. Sci. Res. Comput. Sci. Eng. Inf. Technol, May-June - 2021, 7 (3) : 583-588

Fig : Face Identification

6. Alert Module - If driver will not wake up in 50


alerts alarm music then it send SMS and email to
Fig: Eye Extraction
user family member to inform them that you are
4. Drowsiness Detector Module - In this module it drowsy along with its current photo and location.
will detect the eyes from live webcam feed and
apply algorithms on image to detect driver drowsy
or not.

Fig : Alert Message


Requirement

Software Requirement
1. Front End : Tkinter (Page)
2. Back End : Python
3. Domain : Machine Learning,
Fig Drowsiness Detection 4. Algorithm : LPBH, DLIB, HaarCascade.

Hardware Requirement
5. Face Identification Module - In this module it 1. Processor : i3 or grater
will going to detect the driver identification with 2. RAM : 4GB or greater
the help of face recognition method and with this 3. Hard Disk : 50 GB or greater
authentication it will fetch the driver family 4. Connectivity : LAN or WIFI, Camera
details from database and sent alert message.

IV.CONCLUSION

The proposed gadget on this evaluation affords


accurate detection of driving force fatigue. The
evaluation and layout of driving force drowsiness
detection gadget is presented. The proposed gadget is
used to keep away from numerous avenue accidents
due to drowsy using and it is able to additionally
assist drivers to live wakeful whilst using via way of
means of giving a caution whilst the driving force is

Volume 7, Issue 3, May-June-2021 | http://ijsrcseit.com 587


Swapnil Titare et al Int. J. Sci. Res. Comput. Sci. Eng. Inf. Technol, May-June - 2021, 7 (3) : 583-588

sleepy.the precept concept of drowsiness detection [6]. Rajneesh, “Real Time Drivers Drowsiness
device it detects and offer information of behavioural, Detection and alert System by Measuring EAR,”
vehicular and physiological parameters based totally International Journal of Computer Applications
on it. It seems that in the moments in advance than (0975 – 8887) Volume 181 – No. 25, November-
falling asleep, drivers yawn less, now no longer more, 2018 .
frequently. This highlights the significance of the use [7]. Jay D. Fuletra., “A Survey on Driver’s Drowsiness
of examples of fatigue and drowsiness situations in Detection Techniques” International Journal on
Recent and Innovation Trends in Computing and
which topics without a doubt fall sleep. despite the
Communication ISSN: 2321-8169 Volume: 1
fact that the accuracy charge of using physiological
Issue: 11 ,2013.
measures to discover drowsiness is excessive, those
are pretty intrusive. But this intrusive nature may be
Cite this article as :
resolved via way of means of manner of the usage of
contactless electrode placement. as a result, it would Swapnil Titare, Shubham Chinchghare, K. N. Hande,
be really well worth fusing physiological measures, "Driver Drowsiness Detection and Alert
collectively with Dlib, with behavioural and car- System", International Journal of Scientific Research in
based totally measures in the development of an Computer Science, Engineering and Information
green drowsiness detection device. further, it's far Technology (IJSRCSEIT), ISSN : 2456-3307, Volume 7,
essential to bear in mind the the use of surroundings Issue 3, pp.583-588, May-June-2021. Available at
to obtain most useful effects. doi : https://doi.org/10.32628/CSEIT2173171
Journal URL : https://ijsrcseit.com/CSEIT2173171
V. REFERENCES

[1]. A Study of Heart Rate and Brain System


Complexity and Their Interaction in Sleep-
Deprived Subjects. Kokonozi A.K., Michail E.M.,
Chouvarda I.C., Maglaveras N.M. Bologna, Italy. :
Computers in Cardiology, 2008.
[2]. Effects of partial and total sleep deprivation on
driving performance. Peters R.D., Wagner E.,
Alicandri E., Fox J.E., Thomas M.L., Thorne D.R.,
Sing H.C., Balwinski S.M. 1999.
[3]. Effect of driving duration and partial sleep
deprivation on subsequent alertness and
performance of car drivers. Otmani S, Pebayle T,
Roge J, Muzet A. 2005.
[4]. TemplateMatching. [Online] Apr 21, 2014 [Cited:
Sep 8, 2014.] Real time drowsy driver detection
using haarcascade samples. Dr.Suryaprasad J,
Sandesh D, Saraswathi V.
[5]. Integrated Approach for Nonintrusive Detection
of Driver Drowsiness. Yu, Xun. Duluth : s.n.,
2012.

Volume 7, Issue 3, May-June-2021 | http://ijsrcseit.com 588

You might also like