Driver Drowsiness Detection

Gangesh Basker

Gangesh Basker

Hosur, Tamil Nadu

The drowsiness detection system monitors the driver's condition and issues an alert if it detects signs of drowsiness using CNN - Python, OpenCV. This system aims to reduce the number of accidents on the road by detecting the driver's drowsiness and warning them using an alarm. ...learn more

Project status: Under Development

oneAPI, Artificial Intelligence

Intel Technologies
oneAPI

Docs/PDFs [2]Code Samples [1]

Overview / Usage

The number of accidents occuring has been increased a lot recently and one of the major reasons for it is drowsiness Therefore, there is a need for a better solution that can detect driver drowsiness accurately and unobtrusively, and provide timely feedback or intervention to prevent accidents.

Here, we used Python, OpenCV, and Keras(Tensorflow) to build a system that can detect features from the face of the drivers and alert them if they ever fall asleep while driving. The system detects the eyes and prompts if it is closed or open. If the eyes are closed for 10 seconds, it will play the alarm to get the driver's attention to stop because the system has detected drowsiness. We have built a model of CNN network trained on a dataset using OneAPI that can detect closed and open eyes. Then OpenCV is used to get the live feed from the camera and run every frame through the CNN model to process it and classify whether it is opened or closed eyes.

We have built an app using Flutter. Flutter helps Build, test, and deploy beautiful mobile, web, desktop, and embedded apps from a single codebase. It is a cross-platform app development framework by Google which goes hand in hand with the model to help ensure the safety of the user and other commuters.

As soon as the model detects drowsiness, the model will send an API request call to the client app, which notifies the user to take some rest and shows the navigation option to the nearest resting places. If the user isn't drowsy, the app will give 10 seconds buffer time within which the user can confirm that he isn't sleepy by pressing the prompt on the screen. If the user is drowsy he will get a option for getting driving assistance from the nearby driving service providers. If the user has been detected drowsy more than three times within 10 minutes, a notification is sent to the highway patrol and the nearby drivers as a concern for the safety of other drivers and the drowsy driver.

Methodology / Approach

1. Pre-install all the required libraries

  1. OpenCV

  2. Keras

  3. Numpy

  4. Pandas

  5. OS

**2️. Understand the dataset **The dataset which was used is a subset of the dataset from(https://www.kaggle.com/datasets/dheerajperumandla/drowsiness-dataset) It has 4 folder which are

  1. Closed_eyes - having 726 pictures

  2. Open_eyes - having 726 pictures

  3. Yawn - having 725 pictures

  4. no_yawn - having 723 pictures

3. Data preprocessing

  1. preprocess the images from the closed_eye, open_eye, yawn and no_yawn folder.

  2. Resizing all the images to the same dimensions and converting the images into numpy arrays.

  3. The dataset will be split into training, validation, and testing sets.

4. Build and train the CNN model

The CNN model is designed and trained to classify images as either the driver's eye is opened or closed.

5️. Train the model using Intel OneAPI to get better results

  • Today’s compute systems are heterogeneous and include CPUs, GPUs, FPGAs, and other accelerators. The different architectures exhibit varied characteristics that can be matched to specific workloads for the best performance.
  • Having multiple types of compute architectures leads to different programming and optimization needs. oneAPI and SYCL provide a programming model, whether through direct programming or libraries, that can be utilized to develop software tailored to each of the architectures.
  • Advantages of using OneAPI :
    • We can use Single code for both CPU and GPU (heterogeneous computing)
    • To implement machine learning based IoT projects easily with less hardwares as the machine learning part happens in cloud
    • To process files faster ie. it takes less time to run the epochs
    • One API allows users to transcend Hardware restrictions and provide better performance for low powered computers
    • Accuracy will improve while using OneAPI

Technologies Used

Tensorflow

Open CV

Dart

OneAPI

Pandas

Keras

Intel OneDNN

Flutter

Documents and Presentations

Repository

https://github.com/gangeshbaskerr/DriverDrowsinessDetection-OneAPI

Collaborators

There are no people to show.

Comments (0)