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

PROJECT TITLE:

ACCIDENT AVOIDANCE SYSTEM USING DROWSINESS DETECTION BASED ON ML &


IP

INTRODUCTION:
In today’s modern world, transportation and the need for the use of the cars, bikes and motor
cycles has tremendously increased over past few decades. The ever increase in the population
is one of the reason behind the growing number of vehicles. In today’s world the use of
transportation requires lot of safety system and maintenance. Currently we are using vehicles
with safety system that includes use of the brakes, air bags, seat belt etc. But these are only
helpful post-accident and lack to alert the driver before the accident occurs. Driver fatigue
detection system can be used for preventing the above problems without endangering human
life and hence is one of the effective ways to stop accidents. In driver fatigue or Drowsiness
detection system it depends on the motion of eye Blinking period, the time interval between
them and also the movement pattern of the head. The system does not break down and it can
be used for more advanced driver visual attention monitoring.

With this Python project, we will be making a drowsiness detection system. A countless number
of people drive on the highway day and night. Taxi drivers, bus drivers, truck drivers and people
traveling long-distance suffer from lack of sleep. Due to which it becomes very dangerous to
drive when feeling sleepy.

The majority of accidents happen due to the drowsiness of the driver. So, to prevent these
accidents we will build a system using Python, OpenCV, and Keras which will alert the driver
when he feels sleepy.

Drowsiness detection is a safety technology that can prevent accidents that are caused by
drivers who fell asleep while driving. The objective of this intermediate Python project is to
build a drowsiness detection system that will detect that a person’s eyes are closed for a few
seconds. This system will alert the driver when drowsiness is detected.
METHODOLOGY:
Driver Drowsiness Detection System

In this Python project, we will be using OpenCV for gathering the images from webcam and
feed them into a Deep Learning model which will classify whether the person’s eyes are ‘Open’
or ‘Closed’. The approach we will be using for this Python project is as follows:

Step 1 – Take image as input from a camera.

Step 2 – Detect the face in the image and create a Region of Interest (ROI).

Step 3 – Detect the eyes from ROI and feed it to the classifier.

Step 4 – Classifier will categorize whether eyes are open or closed.

Step 5 – Calculate score to check whether the person is drowsy.

DRIVER DROWSINESS DETECTION DATASET:


The dataset used for this model is created by us. To create the dataset, we wrote a script that
captures eyes from a camera and stores in our local disk. We separated them into their
respective labels ‘Open’ or ‘Closed’. The data was manually cleaned by removing the unwanted
images which were not necessary for building the model. The data comprises around 7000
images of people’s eyes under different lighting conditions. After training the model on our
dataset.

Dataset: Driver Drowsiness Dataset

MODEL ARCHITECTURE:
The model we used is built with Keras using Convolutional Neural Networks (CNN). A
convolutional neural network is a special type of deep neural network which performs
extremely well for image classification purposes. A CNN basically consists of an input layer, an
output layer and a hidden layer which can have multiple layers. A convolution operation is
performed on these layers using a filter that performs 2D matrix multiplication on the layer and
filter.

The CNN model architecture consists of 4 layers


PROJECT PREREQUISITES / REQUIREMENTS:
The requirement for this Python project is a webcam through which we will capture images.
You need to have Python (3.6 version recommended) installed on your system, then using pip,
you can install the necessary packages.

1. OpenCV – pip install opencv-python (face and eye detection).


2. TensorFlow – pip install tensorflow (keras uses TensorFlow as backend).
3. Keras – pip install keras (to build our classification model).
4. Pygame – pip install pygame (to play alarm sound).
5. SMS Python Quickstart -- With just a few lines of code, your Python application can send
Alert SMS messages with Programmable Messaging.

STEPS FOR PERFORMING DRIVER DROWSINESS DETECTION:


Step 1 – Take Image as Input from a Camera

With a webcam, we will take images as input. So to access the webcam, we made an infinite
loop that will capture each frame. 

Step 2 – Detect Face in the Image and Create a Region of Interest (ROI)

To detect the face in the image, we need to first convert the image into grayscale as the
OpenCV algorithm for object detection takes gray images in the input. We don’t need color
information to detect the objects. We will be using haar cascade classifier to detect faces.

Step 3 – Detect the eyes from ROI and feed it to the classifier

The same procedure to detect faces is used to detect eyes. First, we set the cascade classifier
for eyes in leye and reye respectively

Step 4 – Classifier will categorize whether Eyes are open or closed

We are using CNN classifier for predicting the eye status. 

Step 5 – Calculate Score to check whether Person is Drowsy

The score is basically a value we will use to determine how long the person has closed his eyes.
So if both eyes are closed, we will keep on increasing score and when eyes are open, we
decrease the score. We are drawing the result on the screen using function which will display
real time status of the person.

BLOCK DIAGRAM:

PROPOSED METHOD
There are several different algorithms and methods for eye tracking, and monitoring. Most of
them in some way relate to features of the eye (typically reflections from the eye) within a
video image of the driver. The original aim of this project was to use the retinal reflection as a
means to finding the eyes on the face, and then using the absence of this reflection as a way of
detecting when the eyes are closed. Applying this algorithm on consecutive video frames may
aid in the calculation of eye closure period. Eye closure period for drowsy drivers are longer
than normal blinking. It is also very little longer time could result in severe crash. So we will
warn the driver as soon as closed eye is detected.

ADVANTAGES:
 Region of interest is clear to identify
 Bounding box creation and tracking

APPLICATIONS:
 Real time tracking applications
 Classification of small particles
HARDWARE REQUIRMENTS:
 Camera
 Personal computer

SOFTWARE REQUIREMENTS:
 Python 3.7 or above versions
 Anaconda software 

CONCLUSION
The driver abnormality monitoring system developed is capable of detecting drowsiness,
drunken and reckless behaviors of driver in a short time. The Drowsiness Detection System
developed based on eye closure of the driver can differentiate normal eye blink and drowsiness
and detect the drowsiness while driving. The proposed system can prevent the accidents due to
the sleepiness while driving. The system works well even in case of drivers wearing spectacles
and even under low light conditions if the camera delivers better output. Information about the
head and eyes position is obtained through various self-developed image processing
algorithms. During the monitoring, the system is able to decide if the eyes are opened or
closed. When the eyes have been closed for too long, a warning signal is issued. Processing
judges the driver’s alertness level on the basis of continuous eye closures.

REFFERENCES
[1] Miaou, “Study of Vehicle Scrap page Rates,” Oak Ridge National Laboratory, Oak Ridge, TN,,
S.P.,April 2012.

[2] Wreggit, S. S., Kim, C. L., and Wierwille, W. W., Fourth Semi-Annual Research Report”,
Research on Vehicle-Based Driver Status Performance Monitoring”, Blacksburg, VA: Virginia
Polytechnic Institute and State University, ISE Department, January 2013.

[3] Bill Fleming, “New Automotive Electronics Technologies”, International Conference on


Pattern Recognition, pp. 484- 488,December 2012.

[4] Ann Williamson and Tim Chamberlain,“Review of on-road driver fatigue monitoring
devices”, NSW Injury Risk Management Research Centre, University of New South Wales, , July
2013.
[5] E. Rogado, J.L. García, R. Barea, L.M. Bergasa, Member IEEE and E. López, February, 2013,
“Driver Fatigue Detection System”, Proceedings of the IEEE International Conference on
Robotics and Biometics, Bangkok, Thailand.

[6] Boon-Giin Lee and Wan-Young Chung, Member IEEE, “Driver Alertness Monitoring Using
Fusion of Facial Features and Bio-Signals”, IEEE Sensors Journal, VOL. 12, NO. 7, July 2012.

[7] H. Singh, J. S. Bhatia, and J. Kaur, “Eye tracking based driver fatigue monitoring and
warning system”, in Proc. IEEE IICPE, New Delhi, India, Jan. 2014. 

You might also like