You are on page 1of 3

Volume 7, Issue 7, July – 2022 International Journal of Innovative Science and Research Technology

ISSN No:-2456-2165

Driver Drowsiness Detection using Machine


Learning and open CV
Lavanya N Nithin Db 4AD18CS050
Guide, Assistant professor, CSE Syed Hameed Ur Rahman 4AD18CS081
Dept. of Computer Science and Engineering Syed Suhail 4AD18CS082
ATMECE, Mysore. BE CSE, Dept. of CSE ATMECE, Mysore.

Abstract:- Intoxicated driving, sleepiness, and reckless The head forward, among others. Various measures are
driving are the most common causes of accidents and deaths used to assess the degree of driver drowsiness. In their Global
globally, and the major causes of these accidents are usually Status Report on Road Safety, the World Health Organization
drunken driving, drowsiness, and reckless driving. named tiredness, drinking, and carelessness as major causes of
According to the United Nations, road traffic injuries have traffic accidents.
increased to 1.25 billion worldwide, making driver
sleepiness detection a significant issue. A promising area for As a result, the deaths and resulting costs pose a serious
preventing countless sleep-related traffic accidents. This threat to families all over the world. Because of their high cost
research provides a machine-based method for detecting and limited availability, current sleepiness detection systems
tiredness. As a result of the learning algorithms, the driver are not widely employed, rendering them unsuitable for usage
is alerted in real-time. To avoid a collision The Haar in everyday or non-luxury vehicles. As a result, a clever and
Cascade method is used in the model. Along with the viable solution is becoming increasingly necessary. Numerous
OpenCV library to keep track of real-time video the driving autos have a sleepiness detection system. Can swiftly adjust in
and to detect the driver's eyes the system makes use of the the industry Machine-related fields Artificial intelligence and
Eye Aspect Ratio (EAR) notion is used to detect whether or machine learning have aided in the development of several
not the eyes are open. products. Breakthroughs that employ various algorithms Clever
and self-contained model.
Keywords:- Drowsiness, Threshold, Eye Aspect Ratio,
Drowsiness. The Haar Cascade technique, which is paired with several
Python modules to capture and identify drowsiness in real time,
I. INTRODUCTION is proposed in this model. Because the method is optimal in
speed and accuracy, this model is effective at detecting
Driver sleepiness detection is critical in car safety drowsiness.
technologies to avoid road accidents. Many people nowadays
rely on automobiles for everyday commuting, greater living II. METHODOLOGY
standards, comfort, and time restrictions to get to their
objectives. This trend results in heavy traffic in cities and on The suggested system employs Haar Cascades to
roads. As a result of various reasons, the number of traffic recognize items in real time, such as the driver's face and eyes.
accidents will increase. The model makes use of libraries like OpenCV, Dlib, and GPIO
to make the software and the hardware input/output easier.
Drowsy driving may be the primary cause of car accidents.
Early detection of driver drowsiness and notifying with an EYE AR THRESH for the eye aspect ratio to indicate a
alarm is one technique to reduce the incidence of accidents. blink and EYE EAR CONSEC FRAMES for the amount of
Accidents are frequently caused by drivers who are sleep consecutive frames the system will monitor to detect
deprived. To prevent road accidents, technology for detecting drowsiness are the first two constants defined by the software.
driver drowsiness is essential. For both the industrial and
research communities, developing this technology is a major We then set the frame counter 'COUNTER' to 0 and the
undertaking. Boolean 'ALARM ON' to OFF, which keeps track of the
number of frames for open and closed eyes as well as the alarm
While driving, various indicators of driver drowsiness can status. Now we'll set up the Dlib's HOG-based face detector and
be detected, such as the inability to keep one's eyes open, use it to build the facial landmark predictor.
frequent yawning, and moving.

IJISRT22JUL431 www.ijisrt.com 111


Volume 7, Issue 7, July – 2022 International Journal of Innovative Science and Research Technology
ISSN No:-2456-2165
For yawn detection, a YAWN value will be calculated and III. ALGORITHM
compared to a threshold value utilizing the distance between the
upper and lower lips.  This diagram shows how the sleepiness detection system
works in its entirety.
The eSpeak (text to speech synthesizer) module is used to  It explains why each stage in the sleepiness detection
offer pertinent voice alerts when the driver is weary or yawning. process is so important.
 Notice how the camera's brightness and contrast levels are
modified initially.
 The face is then discovered.
 Only the next step is taken if it is successfully previewed.
 The detection of the eyes occurs.
 The eye region is targeted and removed when a decision is
made for proper eye detection.
 Whether the eyes are closed or opened is determined.
 Drowsiness is determined by the info that is saved and
stored.
 Now is the time to assess sleepiness.
 If he is drowsy, the alarm goes off loudly and he gets alerted.

Fig 1: Eye Aspect Ratio

As seen in Figure, the eye aspect ratio controls whether or


not the eyes are open. As the eye is open, the EAR is rather
constant, but when the eye blinks, it swiftly drops to zero; hence
it is used to detect a blink in a single frame. We can also
eliminate image processing procedures by using this simple
equation to obtain the ratio of eye landmark distances. When a
person blinks.

Fig 2: Formula for EAR

EAR is used to determine ocular openness. Now we


compute the convex hull for the left and right eyes by averaging
the eye aspect ratios for both eyes ((left EAR + right EAR) /
2.0). If the eyes are open, we color them green; if they are
closed, we color them red. If the eye aspect ratio is less than the
blink threshold, the condition statement increments the blink
frame counter.

We sound the alarm if the eyes identified are closed for


five frames in a row. Otherwise, the counter is reset to 0. We
loop back to the next frame and repeat the technique for the
current frame until one iteration for a frame is accomplished. Fig 3

IJISRT22JUL431 www.ijisrt.com 112


Volume 7, Issue 7, July – 2022 International Journal of Innovative Science and Research Technology
ISSN No:-2456-2165
IV. ADVANTAGES

 Because the system consumes fewer resources, it is less


expensive.
 Improved driving efficiency and safety.
 Less manual labor.
 The method also saves time and effort for humans
 No driver weariness.

V. CONCLUSION

The proposed method assists the driver in remaining alert


while driving and reduces sleep-related accidents.

The buzzer is in charge of notifying the driver by sending


sound signals, which effectively awakens the driver in real time
to prevent road accidents.

The Haar cascade classifier lowers erroneous eye


detections by calculating the Eye aspect ratio, which is a
problem with models that just use the OpenCV library.

The Eye aspect ratio of consecutive frames will aid us in


removing minor inaccuracies and accurately calculating
drowsiness.

REFERENCES

[1]. Kyong Hee Lee, Whui Kim, Hyun Kyun Choi, Byung Tae
Jan. “A Study on Feature Extraction Methods Used to
Estimate a Driver’s Level of Drowsiness”, IEEE,
February 2019.
[2]. Fouzia, Roopalakshmi R, Jayantkumar A Rathod,
Ashwitha S, Supriya K, “Driver Drowsiness Detection
System Based on Visual Features.” , IEEE, April 2018.
[3]. Shivani Sheth, Aditya Singhal, V.V Ramalingam. “Driver
Drowsiness Detection system using Machine Learning
Algorithms”, IEEE, March 2020.

IJISRT22JUL431 www.ijisrt.com 113

You might also like