Driver fatigue detection technique using raspberry pi

To improve the public safety and to decrease accidents are of the most important aims of the Intelligent Transportation Systems (ITS). Drivers fatigue is one of the most important factors of road accidents. Fatigue reduces driver concentration and decision making capability to control the automobile

2025-06-28 16:32:12 - Adil Khan

Project Title

Driver fatigue detection technique using raspberry pi

Project Area of Specialization Internet of ThingsProject Summary

To improve the public safety and to decrease accidents are of the most important aims of the Intelligent Transportation Systems (ITS). Drivers fatigue is one of the most important factors of road accidents. Fatigue reduces driver concentration and decision making capability to control the automobile. Different researches show that after 1 hour of continuous driving, usually the driver is fatigued. In the afternoon early hours, after eating lunch and at midnight, driver fatigue and drowsiness is much more than other times. In addition, drug addiction, and using hypnotic medicines can lead to loss of consciousness.

In different countries, different statistics were reported about accidents that happened due to driver fatigue and distraction. Generally, the main reason of about 20% of the crashes and 30% of severe crashes is the driver fatigue and lack of concentration. In single-vehicle crashes (accidents in which only one vehicle is damaged) or crashes involving heavy automobile, up to 50% of accidents are related to driver hypervigilance. According to the current studies, it is expected that the amount of crashes will be reduced by 10%–20% using drivers fatigue detection systems.

Many solutions have been proposed to overcome this problem but they were not been commercialized. To overcome this problem and to commercialize it, there should be a system that will be capable enough to detect the driver’s fatigue.

A device will be introduced for such a system. This device will be placed in front of the driver. However, it will be designed with sensors that will be capable enough to detect driver’s mouth movements to warn if the driver is yawning or sleeping behind the wheel. The device will generate three kinds of signals. That is vibrations, sound and light flashes to tell the driver to stop for a while before continuing to drive farther.

Project Objectives Project Implementation Method

The project works two proposed methodologies.’

  1. Yawn detection
  2. Head movement detection

Face detection:

Face will be detected in real time using camera.

Mouth detection:

Whenever a face is detected, the lower half of the face is used as the search area for mouth.

Multiple Mouth detection problem:

Sometimes in the lower half of the face the nose was also detected as a mouth. To overcome this issue, the bounding box which is located at lower position in the image is selected.

Yawning detection:

The detection of the mouth features consists of a few different parts. Firstly the corners of the mouth are calculated. After that the algorithm tries to detect the upper and lower parts of the lip. This is data that can be used later to try and determine the state of the mouth, if it’s opened or closed. The reason for having different methods for detecting the upper and lower lips is because some of the methods are more suited than the other. If there are perfect lighting conditions and image quality, the methods perform well on both the upper and lower parts of the lip.

Lower lip detection

With the help of our code function (def bottom_lip(landmarks)) achieve point tracking on the lower lip the area needs to be segmented first. What that means is that the area of the lips needs to be masked. The landmarks area in this binary image will represent the detected lip area.

Upper lip detection

Similarly track the upper lip with function (def top_lip(landmarks)) was used and for to get a points from the upper lip.

Now when this is done the points of the upper and lower part of the lips should have been extracted correctly. These points can be of use to help determine the state of the mouth, we set specific distance threshold 45 and if distance between lower and upper lips is greater the threshold it is yawning state.

Head movement detection:

In this phase of the project, the device will detection the driver’s head movement.

The increased popularity of the wide range of application of which head movement detection is a part, such as assistive technology, teleconferencing and virtual reality aiming to provide robust and effective techniques of real-time head movement detection and tracking.

So, which we use to technique head movement detection is computer vision based and introduce a video-based technique for estimating the head position and used it in a good image processing application for real world problem and attention recognition for drivers.

It estimates the relative position between adjacent views in subsequent video frames. scale-invariant Feature Transform (SIFT) descriptors are used in matching the corresponding  feature points, the relative position.

The X and Y coordinates of the head position are determined. We set the specific threshold X and Y coordinates of the head position. If changes the threshold of X, Y coordinates detect the head movement.

The accuracy and performance of the algorithm is very good and very applicable in real application.

Benefits of the Project

Fatigued driving is very dangerous because it can cause severe injuries and deaths. The project’s goal is to build a system that will be capable enough to detect driver’s fatigue in order to reduce accidents.

By the help of this system we can control the number of fatal accidents, thus the system will help the society, in order to prevent them from fatal accidents. Which causes severe injuries and deaths.

Technical Details of Final Deliverable

This project is based on hardware and software. In hardware part Raspberry Pi, Camera, SD card, Digital Display, Buzzers are used. We just need to consider the software and programming parts. There are few software that can perform hand gesture recognition such Python language in which we have to work with OpenCV, Numpy and Dlip libraries in correct way of detecting faces. The approach followed will depend upon further research related project that the system should be reliable and sustainable.

Final Deliverable of the Project HW/SW integrated systemCore Industry TransportationOther IndustriesCore Technology Internet of Things (IoT)Other TechnologiesSustainable Development Goals Good Health and Well-Being for PeopleRequired Resources
Item Name Type No. of Units Per Unit Cost (in Rs) Total (in Rs)
Total in (Rs) 80000
Raspberry Pi 4 Model B 4GB RAM Equipment11700017000
Raspberry Pi 8Mp 8MegaPixel Camera V2.0 Equipment144004400
Logitech HD Pro Webcam C920 Equipment13000030000
Raspberry Pi 3 Shell Case Miscellaneous 1500500
Raspberry Pi Zero Camera Cable Miscellaneous 2300600
Raspberry Pi 5 Inch HDMI TFT Screen LCD Equipment185008500
Raspberry Pi Camera Stand Miscellaneous 120002000
SD Card 32GB Equipment230006000
Smallest 5V Cooling Fan for Raspberry Pi Miscellaneous 119001900
Raspberry Pi Buzzer Loud Sound Equipment25001000
Product Testing Miscellaneous 150005000
Water Sprayer Equipment210002000
ESP-01 ESP8266 Wifi Module Equipment2240480
Arduino Nano V3 Equipment1620620

More Posts