Driver Drowsiness detection using Python

Published on . Written by

Driver drowsiness detection using python

This is a python project which will enable us to detect the drowsiness of the driver while he/she is driving a vehicle. The driver expressions are detected and then the dataset is compared to give the desired output on a particular scale. There are a lot of drivers and they all feel lazy or sleepy some times which could lead to fatal accidents. To reduce these accidents, a system should be developed which can identify the expressions of the driver and then alert the person in advance. This could save a lot of lives. This project will be helpful in that case.

Read more..

SLNOTE

Skyfi Labs Projects
Project implementation

Drowsiness detection is not easy by the system as the computer is not smart enough. But with proper programming and datasets, we can create an application which can at least give the result to some accuracy. We will be using the OpenCV to include the images of the laziness or drowsiness expressions. The dataset will compare the captured images and then give the result. Deep learning is required to classify between eye-open and eye-closed.


SLLATEST
  • First, the image will be captured by a camera installed in front of the driver.
  • A region of interest is created where the expressions of the face are read.
  • In the region, eyes are especially detected for the drowsiness.
  • Classify the eye into either open or closed.
  • The time duration of the eye closed is calculated to predict the drowsiness of the driver.
Around 7000 images of drives are collected in the dataset to let the developer compare the values easily. For this project, we will use the CNN (Convolution Neural Network) which will provide a backbone for the project. The CNN basically consists of an input layer and many hidden layers which facilitates different functions. There will be a need of including a lot of database files which are OpenCV, TensorFlow, Keras, and Pygame. 

The method cv2.VideoCapture (0) to access the camera, it will facilitate the project to capture the photos and save it. Now cap.read () will then read the file and store it in a frame variable. The classifier cv2.CascadeClassifier () is used to classify the photos in either eye open or closed. The CNN classifier will categorize the photos into different groups. The score is also calculated for the face of how much the driver is drowsy. To print the result we will use the cv2. PutText () which will display the real-time status of the person. The source code and data files are available for free on the internet. It can be easily obtainable and useable.

Conclusion

This python project developed is very useful in detecting face expressions. Hence it gives us a point of understanding in the field of deep learning. The system works on the CNN which again is a machine learning concept. The developer will need good knowledge over python programming language, machine learning, and data analytics. This project can be made by the student as their first machine learning topic.


SLDYK
Kit required to develop Driver Drowsiness detection using Python:
Technologies you will learn by working on Driver Drowsiness detection using Python:


Any Questions?


Subscribe for more project ideas