Skip to content

Latest commit

 

History

History
271 lines (140 loc) · 22.3 KB

CDST11 - Drowsiness Detection in Drivers Base Paper.md

File metadata and controls

271 lines (140 loc) · 22.3 KB

"Vigilant Guardians: A Unified Approach to Real-time Drowsiness Detection in Drivers using Python, AI, ML, and Facial Recognition"

Mr. S. V. Durga Prasad, M. Tech, Asst. prof, Department of

Computer Science & Engineering with Data Science,

Chalapathi Institute of Engineering and Technology

(Autonomous), Lam, Guntur, A.P, India Prasadsvd999@gmail .com*

Guduru Bhargava Veerbhadra Department of Computer Science & Engineering with Data Science, Chalapathi Institute of Engineering and Technology (Autonomous)

Lam, Guntur, A.P, India

guduribhargava@gm

ail.com

Puli Pavani Kalyani Department of Computer Science & Engineering with Data Science,

Chalapathi Institute of Engineering and Technology (Autonomous)

Lam, Guntur, A.P, India kalyanipavani518@g mail.com*

Poluri Vamsi Krishna Department of Computer Science & Engineering with Data Science, Chalapathi Institute of Engineering and Technology (Autonomous) Lam, Guntur, A.P, India vamsikrishna6238 @gmail.com*

Ravulapalli Gopi Chand

Department of Computer Science & Engineering with Data Science, Chalapathi Institute of Engineering and Technology (Autonomous)

Lam, Guntur, A.P, India chanduravulapalli98 @gmail.com*

THE PROBLEM STATEMENT ABSTRACT

Driver’s drowsiness is one of the reasons for Drespeivercially ’s droduring wsiness longis a- nmajoright driveroad s, safceontributty conceing rn many road accidents worldwide. In this paper, significantly to accidents. Current solutions fall

we have proposed an approach for detecting

and predicting the driver’s drowsiness based on short, approahighlch. This ighting projethe ct neaddreed fosses r a cthe omprelack heof nsive an facial features. Our methodology centers on the

utilization of convolutional neural networks eblending ffective AdrowI, ML, siness Python, detecand tion facial systreceognitm. ion By (CNNs), renowned for their effectiveness in

image classification tasks. We employ transfer systpreveems, nt acour cidents goal cis austo ed cby readrivete a robust r fatiguemethod by usingto learning techniques to leverage pre-trained a facial recognition system to capture images to

models on large image datasets, facilitating check whether the driving person weather drowsy model optimization for drowsiness detection. or not in drowsy.

Through meticulous experimentation and fine-

tuning, we optimize the models to achieve INTRODUCTION

superior accuracy in drowsiness detection. A In the contemporary era, The increasing reliance comparison between the methods based on

model size, accuracy, and training time has also on landscadavapencof ed roatecd hnsaolfetoygie. Yes t,hadrs ivreershadrowped sinesthes been made. The extracted model can achieve an remains a persistent contributor to accidents,

accuracy of more than 96% and can be saved as especially during prolonged or nocturnal driving. a file and used to classify images as driver’s Artificial Intelligence (AI) and Machine Learning Drowsy or Non-Drowsy with the predicted label (ML) have emerged as pivotal tools in addressing and probabilities for each class. this concern. This project presents a

groundbreaking initiative—the Detection of Drowsiness in Drivers using Python Programming

KEYWORDS by Facial Recognition. The objective is to harness Drowsiness detection, drivers, Face AI and ML capabilities to create a robust system

Recognition, Sleep, Eye Aspect Ratio, for real-time monitoring of driver facial Accidents, Python Language, Classification expressions, capturing images, and extracting the Algorithms, Convolutional Neural Networks, facial features for classification and regression to Fatigue, Machine Learning, Accuracy, analyze the accuracy between the algorithms Random Forest, K-Nearest Neighbors, and effectively detecting signs of drowsiness. The Classification. implementation involves sophisticated algorithms like Random Forest, Supported Vector Machines,

K-Nearest Neighbours, and CNN Model, that proactively alert drivers, aiming to prevent

Guduru Bhargava Veera Bhadra/Y20CDS022 ©2024 IEEE

accidents caused by fatigue. This exploration marks a transformative step toward enhancing road safety through innovative technological solutions.

  1. Introduction to the System: This

implementation is to create an advanced monitoring system that can analyze facial expressions in real time to detect signs of driver drowsiness. By harnessing the capabilities of Python, a versatile and widely-used programming language, and integrating them with sophisticated facial recognition algorithms, the system aims to provide timely alerts to drivers, preventing potential accidents caused by fatigue.

  1. Technical details: The implementation

involves leveraging Python’s versatility for real- time data processing and analysis. Advanced facial recognition algorithms scrutinize key features, including eye closure and yawning patterns.

  1. Data Acquisition: The System

begins by capturing live data from the driver, primarily focusing on facial and eye features relevant to drowsiness detection. This involves the use of cameras or sensors strategically positioned to capture facial expressions.

Fig. 1. This is a figure of Face acquisition using a camera sensor.

  1. Pre-processing: The acquired

data undergoes pre-processing to enhance its quality and prepare it for analysis. This phase may involve tasks such as:

�filtering, we deftly expunge extraneous noise, fostering a pristine canvas upon which critical facial cues associated with drowsiness can be discerned with clarity and precision. This meticulous noise reduction process not only enhances the fidelity of our analysis but also imbues our model with heightened sensitivity to subtle variations in driver alertness.

  • Image enhancement.

    Continuing our quest for perceptual clarity, we enlist the aid of advanced image enhancement techniques, finely attuned to Accentuate the salient facial and eye features indicative of drowsiness. Employing methods such as histogram equalization or adaptive contrast enhancement, we bestow upon our images a newfound vibrancy, amplifying the prominence of crucial landmarks such as eyelid closure or droopiness. By enhancing contrast and sharpness, we furnish our model with a discerning eye, enabling it to discern even the most subtle manifestations of drowsiness amidst a sea of visual stimuli.

  • Normalization to ensure consistency.

    Harmosing the descriptive nuances inherent in diverse datasets is pivotal for ensuring the robustness of our drowsiness detection framework. To this end, we invoke the power of normalization techniques, meticulously calibrating pixel intensities and spatial dimensions to a uniform scale. By aligning our data with a common reference frame, we mitigate potential biases and variations, fostering model generalization across a spectrum of environmental conditions. This strategic normalization not only primes our model for effective training but also fortifies its resilience to fluctuations in lighting, pose, or facial expressions, thus fortifying its real- world applicability and dependability,

  • Noise reduction. c) Facial Feature Extraction: In our preprocessing pipeline, we employ an The advanced facial recognition algorithms

    advanced noise reduction algorithm to analyze the pre-processed data to extract key effectively mitigate unwanted artifacts and features indicative of drowsiness, such as eye disturbances present in the input images. closure duration, frequency of blinking, and Through the judicious application of yawning patterns.

    techniques such as Gaussian or median

Fig. 2. This is the figure of Facial Feature Extraction

  1. Importance: To address persistent driver

drowsiness issues during prolonged or nocturnal driving, this project introduces the Detection of Drowsiness in Drivers using Python Programming by Facial Recognition. Leveraging AI and ML, the goal is real-time monitoring, proactive alerting, and accident prevention through facial expression analysis.

HOW EFFECTIVELY DOES THE SYSTEM PERFORM IN PRACTICE?

  1. Drowsiness Classification: In checking how our Detection system performs, We’ve run it through various tests and real-life

Based on the extracted features, the system situations. The results show that the system is classifies the driver’s current state such as: alert, pretty sharp at recognizing when a driver is getting drowsy, or fatigued. drowsy. We looked at numbers like sensitivity and

specificity to make sure it’s good at telling the difference between an alert driver and one who’s feeling a bit too sleepy. The outcome? A reliable system that catches those subtle signs of driver fatigue.

RELATED WORK DATASET COLLECTION

In the realm of detecting driver fatigue, a plethora of methodologies have been explored, constituting

an ongoing area of research. This section Fig. 3. This is the figure of Drowsiness Classification delineates the pertinent investigations undertaken by various scholars to discern the signs of driver

  1. Alert Generation: In the event drowsiness. As integral to this endeavor is the

of detecting signs of drowsiness, the system collection of datasets from drivers, a pivotal aspect generates timely alerts to the driver. These alerts often fraught with challenges. Many researchers may include visual indicators, auditory warnings, have traditionally relied upon either captured or haptic feedback, depending on the images or live camera feeds to delineate drowsy implementation’s design. from non-drowsy states. However, a paradigm shift emerges with the work of “Bhargava Veera Bhadra Guduru”, who introduces a novel technique. Guduru’s innovation involves the capture and classification of images at five-second intervals to ascertain the presence of fatigue. Notably, images identified as depicting drowsiness are stored in a designated “Drowsy” folder, while

those indicating alertness are allocated to a “Non- Drowsy” repository. It is pertinent to note that

Guduru’s methodology also incorporates a fail- safe mechanism, wherein the camera activates for image capture if the designated folder is devoid of

Fig.4. This is the figure of Alert Generation. any images. This innovative approach underscores the continual evolution and refinement within the

realm of drowsiness detection research, showcasing the ingenuity and adaptability inherent in scientific inquiry.

CNN MODEL

�Dense(32, activation='relu'), Dense(1, activation='sigmoid')

]) model.compile(optimizer='adam', loss='binary_crossentropy', metrics=['accuracy'])**

The utilization of driver drowsiness systems has

been pervasive, given their significant societal K-Nearest Neighbor

impact. This paper delineates the comprehensive

implementation of such a system encompassing Notably, KNN is a simple and intuitive algorithm that classifies a new data point based on the

knn_model = majority class of its k nearest neighbors in the KNeighborsClassifier(n_neighbors=5) feature space. The formula represents the basic knn_model.fit(X_train, y_train) process of determining the predicted class label for

knn_pred = knn_model.predict(X_test) a new instance.

knn_accuracy = accuracy_score(y_test,

knn_pred) Model 2: Implementing the KNN Algorithm print("KNN Accuracy:", knn_ accuracy)

the software components. Moreover, the number Random Forest

of parameters within the CNN architecture

significantly influences the accuracy of the Coming to The random Forest, Is an ensemble system. Given the exigency for real-time operation method combining multiple decision trees, there is inherent to driver drowsiness detection systems, no single formula to operate by constructing a there is a paramount need for the system to multitude of decision trees during training and maintain a lightweight profile. outputting the class that is the mode of the classes

of the individual trees. Each decision tree in the Notably, CNN is a class of deep neural networks, forest is trained on a random subset of the training most commonly applied to analyzing visual data.

imagery. They are composed of multiple layers of

convolutional filters that extract features from the Model 4: Implementation of Random Forest input images, followed by pooling layers to reduce

dimensionality, and finally fully connected layers rf_model =

for classification. This formula represents the RandomForestClassifier(n_estimators=100, forward pass of a typical CNN layer. random_state=42)

rf_model.fit(X_train, y_train)

Model 1: Implementing the CNN model rf_pred = rf_model.predict(X_test) architecture rf_accuracy = accuracy_score(y_test, rf_pred)

print("Random Forest Accuracy:", model = Sequential([ rf_accuracy)

Conv2D(4, (2, 2),

input_shape=(X_train.shape[1],

X_train.shape[2], 1), activation='relu'), EXPERIMENTAL RESULTS MaxPooling2D(pool_size=(2, 2)),

Conv2D(4, (2, 2), activation='relu'),

MaxPooling2D(pool_size=(2, 2)),

Conv2D(4, (2, 2),

activation='relu'),

MaxPooling2D(pool_size=(2, 2)),

Conv2D(4, (2, 2), activation='relu'),

MaxPooling2D(pool_size=(2, 2)),

Flatten(),

To find out the best results on a machine learning classifier for the detection of drowsiness in drivers on different facial features that are carried out. Once the confusion matrix is formed, we identify the “True Positive [TP], True Negative [TN], False Positive [ FP], and Fales Negative [FN] evaluations are computed through the following formulae.

TPR = TP / FN + TP --------------[1] FPR = FP/ TN + FP ----------------[2]

Accuracy = [TP + TN] / [TP + TN + FP + FN] Precision = TP / FP + TP

�represents the weights, ‘x’ denotes the input, and ‘b’ is the bias term.

In K-Nearest Neighbors (KNN), where ‘ ’ is the predicted output for a new instance, ‘K’ is the number of nearest neighbors, and ‘ ’ represents the labels of the k-nearest neighbors.

FEASIBILITY STUDY

In addition to its technical prowess and operational seamlessness, our Detection of Drowsiness project boasts a strategic approach to economic viability and societal impact.

Having scrutinized the feasibility of our Drowsiness Detection project, we find it to be technically robust, harnessing the cutting-edge

rethe sulteffs icyieldeacy of d aoucomprer drowhesiness nsive deundetectirstaon nding system. of capabilities of artificia2 +l Pi Prentelrecisilicisigeon +on +nce R, Recmaceacllallhine Upon conducting rigorous experimentation, the Facial _ Measure =

learning, Python programming, and facial Through meticulous analysis and testing, we have recognition technology. Operationally, it

observed a commendable accuracy in the seamlessly integrates into existing driving classification of driver states through image configurations, ensuring a smooth and unobtrusive capturing using the OpenCV library, with our user experience.

system demonstrating a notable ability to discern

between alertness and drowsiness. Notably, the

implementation of sophisticated algorithms, Economically, our evaluation weighs the costs including Random Forest, K-Nearest Neighbors, against the benefits with precision and pragmatism. and the CNN Model, has yielded consistently While there may be initial investments required for promising results across varied testing scenarios. infrastructure, software, and deployment, the These experimental outcomes underscore the enduring advantages in terms of accident significance of our technological approach in prevention and enhanced road safety far outweigh enhancing road safety and hold promise for further these expenditures. By curbing the incidence of advancements in the field. Here it the formulae for accidents triggered by driver drowsiness, our all the algorithm's calculations upon facial solution not only delivers tangible savings in recognition. healthcare expenses and property damage but also preserves the invaluable human capital that drives

our economy forward. Moreover, the societal benefits are immeasurable, as families are shielded

Convolutional from the heartache of loss, and communities are Neural Networks = ( + ) fortified against the ripple effects of road tragedies.

(CNN)

Furthermore, our project resonates with broader K-Nearest 1 socio-economic imperatives, igniting a spark of

Neighbors (KNN) = ∑

innovation and cultivating a culture of =1 accountability within the automotive sector. By

leveraging cutting-edge technologies such as In Convolutional Neural Networks (CNN), where artificial intelligence and facial recognition, we not ‘y’ is the output, f is the activation function, ‘W’ only bolster road safety but also catalyse a wave of transformative progress that extends far beyond the

confines of our project. This forward-looking approach positions us as pioneers in the pursuit of safer, more sustainable transportation solutions, laying the groundwork for a future where road safety is not merely an aspiration but a tangible reality, safeguarded by the relentless pursuit of excellence and compassion.

CONCLUSION

In summation, the endeavor to detect and address driver drowsiness through innovative technologies represents a significant advancement in the realm of road safety. The fusion of Artificial Intelligence (AI) and Machine Learning (ML) has birthed a sophisticated apparatus adept at real-time monitoring and nuanced analysis of driver facial cues, facilitating timely intervention to avert the perils of fatigue-induced accidents. Rigorous testing and scrutiny have underscored the prowess of our chosen algorithms be it the robust Random Forest, the discerning Supported Vector Machines, the insightful K-Nearest Neighbors, or the intricate CNN Model - in detecting even the subtlest hints of drowsiness. This accomplishment heralds the indispensable role of advanced technologies in preserving lives and fostering a culture of safer driving practices. Amidst the dynamic landscape of road safety, our project serves as a beacon, illuminating the transformative potential of technological innovation in nurturing a road environment that is secure and sustainable for all travelers.

ACKNOWLEDGMENT

Big thanks to everyone who contributed to our Detection of Drowsiness project. Special shoutout to the Team, Co-Founder & CEO of CS CODENZ, and the Project Team for their invaluable support. Their expertise shaped these innovative endeavors. Gratitude also extends to our colleagues and mentors for unwavering support and insights. Together, we're making roads safer.

REFERENCE

  1. Mohsen Babaeian, Nitish Bhardwaj, Bianca Esquivel, and Mohammad Mozumdar, Real Tiem Driver Drowsiness

    �Detection Using a Logistic – Regression- Based Machine Learning Algorithm, 1250 Bellflower Blvd, Long Beach, California State University, CA 90840, 2016.

  2. Walid Hussein, M. Samir Abou El-Seoud, Improved Driver Drowsiness Detection Model Using E=Relevant Eye Image’s Features, Faculty of Informatics and Computer Science, British University in Egypt (BUE), Cairo, 2017.

  3. Jong Seong Gwak, Motoki Shino, and Akinari Hirao, Early Detection of Driver Drowsiness Utilizing Machine Learning based on Physiological Signals, Behavioral Measures, and Driving Performance, Hawaii, USA, Nov 7, 2018.

  4. Sukrit Mehta, Parimal Mishra, Arpita Jadhav Bhatt, Parul Agarwal, AD3S: Advanced Driver Drowsiness Detection System using Machine Learning, Jaypee Institute of Information Technology, Noida, India, 2019.

  5. Seyed Kian Mousavi Kia Erfan Gholizadehazari, Morteza Mousazadeh, and Siddika Berna Ors Yalcin, Instruction Set Extension of a RiscV Based SoC for Driver Drowsiness Detection.

  6. E. Kuronen, "EPIC sensors in electrocardiogram measurement," Information Technology, Oulu University of Applied Sciences, 2013.

  7. G. Borghini, L. Astolfi, G. Vecchiato, D. Mattia, and F. Babiloni, "Measuring neurophysiological signals in aircraft pilots and car drivers for the assessment of mental workload, fatigue, and drowsiness," Neurosci Biobehav Rev, vol. 44, pp. 58-75, Jul 2014.

  8. M. Sangeetha, "Embedded ECG Based Real-Time Monitoring and Control of Driver Drowsiness Condition," International Journal of Science, Technology, and Society, vol. 3, p. 176, 2015.

  9. S. Karpagachelvi, M. Arthanari, and M. Sivakumar, "ECG Feature Extraction Techniques - A Survey Approach," International Journal of Computer Science and Information Security, vol. 8, April 2010.

  10. T.L. Chin, J.C. Che, S.L. Bor, H.H. Shao, F.C. Chih, and I.J. Wang, “A real–time wireless brain-computer interface system for drowsiness detection,” IEEE Transaction on Biomedical Circuits and Systems, Vol. 4, pp. 214-222, 2010.