Driver Drowsiness Detection using Machine Learning Approach

-Drowsiness of drivers is one of the significant cause of road accidents. Every year, there is an increase in the amount of deaths and fatal injuries globally. By detecting the driver’s drowsiness, road accidents can be reduced. This paper describes a machine learning approach for drowsiness detection. Face detection is employed to locate the regions of the driver’s eyes, which are used as the templates for eye tracking in subsequent frames. Finally, the tracked eye’s images are used for drowsiness detection in order to generate warning alarms. This proposed approach has three stages: detecting Face, detecting Eyes and detecting drowsiness. Image processing is used to recognize the face of the driver and then its extracts the image of the eyes of the driver for detection of drowsiness. The HAAR face detection algorithm takes as captured frames of image and then the detected face is considered as output. Next, CHT is used for tracking eyes from the detected face. Using EAR (Eye Aspect Ratio) the eye state is detected. The proposed system was tested by implementing the proposed approach on a Raspberry pi 3 Model B with 1GB RAM with use of Logitech HD Webcam C270. The system uses frames for face and eye tracking, and the average correct rate for eye location and tracking could achieve 95.0% based on some test videos. Thus, the proposed approach for a real-time of driver drowsiness detection is a low cost and effective solution method.


INTRODUCTION
Driver fatigue is one of the main causes of car accidents.If the driver's fatigue state can be predicted at an early stage and a sleep warning can be given to the driver, the probability of an accident can be reduced.This paper presents a driver drowsiness detection system using machine learning.In the first stage, face recognition and eye recognition were separated.Our main contribution to the research of the material used to complete the high mast.The first contribution of this paper is a new image representation that is extremely forgiving, called the integral image.Fast measurement.It uses the technique of remembering Haar Basis functions.To calculate these features very quickly at various scales, a representative image example is shown.A normal image can be calculated from an image using some function of each pixel.The second source is a way to create a distribution by selecting a small set of key features using AdaBoost.To achieve fast classification, the learning process must exclude most of the available features and focus on a small set of important features.This option is achieved by making a simple change to the AdaBoost process.The third benefit of this article is a way to continuously combine multiple classifications into a cascading model; This makes measurement faster by focusing on a narrowed area of the image.This object detection process classifies images based on the importance of key features.It is based specifically on our features.The threecube feature adds the numbers in the outer two rectangles and subtracts the numbers in the • Email: editor@ijfmr.com

IJFMR240112245
Volume 6, Issue 1, January-February 2024 2 middle rectangle.Finally, four rectangular faces calculate the difference between pairs of diagonals.

Figure1.1ExamplesforHAAR
It is based on a rectangular closed window as shown in Figure 1.1.Subtract the number of pixels in the white rectangle from the number of pixels in the gray rectangle.

A. IntegralImage
Quickly calculate the rectangle using the center of the image.The main image at position z, y has 2, the sum of the pixels above and to the left of y (inclusive): ii(x, y) = Σ z, y) is the corresponding image and i(z, y) )) ) is the original image.Usingthefollowingpair ofrecurrences: s(x,y)=s(x,y-1)+i(x,y)(1)ii(x,y)=ii(x-1,y) + s(x,y) ( Figure1.2Pixels (where s(z, y) is the summation line, s(z, 1) = 0 and ii(-1, y) = 0) The summation plot can be calculated from the entire old image in one go.

B. Learning Techniques
Given specific techniques and training on positive and negative images, any machine learning method can be used to learn classification.In this system, a variant of AdaBoost is used to select a small set of features and train the classifier.
• Todetectthealcoholintoxicationlevelofthe driver I. PROBLEMSTATEMENT Accidents occur on the roads for many reasons.The main cause of car accidents is driver fatigue.

II. METHODOLOGY A. OverviewDesign
The main idea of driver fatigue detection is to capture the driver's eyes through the camera and accurately calculate the driver's sleepiness by completing the time.To meet these requirements, appropriate materials must be selected.For the base computer, choose Raspberry Pi 3 Model B. 3. Eye area is used to calculate the eye ratio to determine whether the eye is closed.4. If visual comparison shows the eyes have been closed long enough, the alarm will sound to wake the driver and the light will flash to notify the driver behind.

C. FaceDetection
The planning process begins with capturing the video frame by frame.The system will detect the face in each frame of the image.This is done using the HAAR algorithm for face detection.First load the data stage, then pass the received frame to edge processing, which detects all objects in different parts of the frame.Instead of checking for objects of all sizes, specify that the edge detector will only detectobjects of that size (for example, a face).The output of this module is the frame in which the face is detected.

HAARCascadeClassifier
It is one of the first vehicles to detect the driver's face.It is one of the few detection methods that can identify human faces.Paul Viola and Michael Jones developed this method.He examined thousands of faces in different lighting conditions.Ten subjects received the HAAR Cascade test Classifier

RegionofInterest
Regions of Interest (ROI) focus more on the driver's face.The formula for the temperature difference can be written as: T= (100-|FC/2|)/100 where T is the temp valueand FCistheface degree.

D. EyeDetection
After the face detection system detects a human face, the eye detection function tries to detect the driver's eyes.After detecting the face, find the eye area with the following methodAssuming that the eyes are only visible in the upper part of the face, the eye region of interest (ROI) is extracted and marked as the region of interest by cropping the mouth and hair starting from the upper part of the face.Quickly eyeball correctly.

Figure1.6EARKeypoints
The equation expressing this relationship is called the eye-to-eye ratio (EAR) and is given as: The numerator of this equation calculates the distance to theeye vertically, and the denominator calculates the distance to the eye horizontally.In this model, the threshold is set to 300.If the EAR is below 300, the driver is detected to be drowsy.

Figure1
Figure1.3RaspberryPi 3ModelB C. Software Raspberry Pi 3 Model B and Raspberry Pi Camera are used due to their higher CPU performance and higher frame rate.Raspberry Pi 3 Model B supports C++ and OpenCV libraries.OpenCV version 3.1.0is designed for many computer vision-related tasks.The OpenCV library supports HAAR cascade classifiers, twisted affine and template matching..
Figure1.5Eyedetectionresult E. EyeStateandDrowsinessDetection To detect fatigue, first check whether your eyes are closed or open.Eye Test (EAR) is used to determine whether the driver's eyes are open or closed.When calculating EAR, use the Euclidean formulatocalculatethedistance between the main points of the eye.