In this Python project, we have built a drowsy driver alert system that you can implement in numerous ways. We used OpenCV to detect faces and eyes using a haar cascade classifier and then we used a CNN model to predict the status. The driver abnormality monitoring system developed is capable
Driver Drowsiness Detection System using Convolutional Neural Network
In this Python project, we have built a drowsy driver alert system that you can implement in numerous ways. We used OpenCV to detect faces and eyes using a haar cascade classifier and then we used a CNN model to predict the status.
The driver abnormality monitoring system developed is capable of detecting drowsiness, drunken and reckless behaviours 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.
* Driver drowsiness detection is a car safety technology which helps to save the life of the
driver by preventing accidents when the driver is getting drowsy.
* The main objective is to first design a system to detect driver’s drowsiness by
continuously monitoring retina of the eye.
* The system works in spite of driver wearing spectacles and in various lighting conditions.
* To alert the driver on the detection of drowsiness by using buzzer or alarm.
* Speed of the vehicle can be reduced.
* Traffic management can be maintained by reducing the accidents.
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.
The “haar cascade files” folder consists of the xml files that are needed to detect objects from the image. In our case, we are detecting the face and eyes of the person.
The models folder contains our model file “cnnCat2.h5” which was trained on convolutional neural networks.
We have an audio clip “alarm.wav” which is played when the person is feeling drowsy.
“Model.py” file contains the program through which we built our classification model by training on our dataset. You could see the implementation of convolutional neural network in this file.
“Drowsiness detection.py” is the main file of our project. To start the detection procedure, we have to run this file.
ADVANTAGES
• The detected abnormal behavior is
corrected through alarms in real time.
• Component establishes interface with other
drivers very easily.
• Life of the driver can be saved by alerting
him using the alarm system.
• Speed of the vehicle can be controlled.
• Traffic management can be maintained by
reducing accidents.
• Practically applicable
APPLICATIONS
• This system can be used in factories to alert
the workers.
• If found drowsy, the alarm system gets
activated and the driver is alerted.
• If there is any obstacles it is alerted to the driver.
• This system can also be used for railway
drivers.
FUTURE WORK
The future works may focus on the utilization of
outer factors such as vehicle states, sleeping hours,
weather conditions, mechanical data, etc. for fatigue
measurement. Driver drowsiness poses a major problem
to highway safety.
24 hours operations, high annual mileage, exposure to the
challenging environmental condition, and demanding
work schedules all contribute to the serious safety issue.
Monitoring the driver’s state of drowsiness and
vigilance and providing feedback on their condition so
that they can take appropriate action is one crucial step
in a series of preventive measure to necessary to
address this problem. Currently there is no adjustment in
zoom or direction of the camera during operation. Future
work may be automatically zoom in on eyes once they are
localized. This would avoid trade-off between having
wide field of view in order to locate the eyes, and
narrow view in order to detect fatigue.
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 the following layers:
Convolutional layer; 32 nodes, kernel size 3
Convolutional layer; 32 nodes, kernel size 3
Convolutional layer; 64 nodes, kernel size 3
Fully connected layer; 128 nodes
The final layer is also a fully connected layer with 2 nodes. A Relu activation function is used in all the layers except the output layer in which we used Softmax.
| Item Name | Type | No. of Units | Per Unit Cost (in Rs) | Total (in Rs) |
|---|---|---|---|---|
| Tensor Flow Course zero to mastery | Equipment | 1 | 13449 | 13449 |
| Graphic Card | Equipment | 1 | 55500 | 55500 |
| Total in (Rs) | 68949 |
Natural disasters cause thousands of deaths and property worth millions of dollars are los...
Using the Lecture Attending and Monitoring System, teachers can be able to keep a record o...
We are going to create an HPC Cluster and would deploy it through Docker. The advantage we...
In the new digital era of innovations and technologies, Energy Scavenging (harvesting) and...
Electricity is the basic need for today?s life. Almost all of our appliances are electrica...