Driver Attentiveness Detection Using OpenCV and Machine Learning
M. Amareswara Kumar, Shaik Sana Abida, Nayini Mounika, Yadiki Indu,
Shaik Afrin and Shaik Shahena
Department of Computer Science and Engineering, Santhiram Engineering College, Nandyal518501, Andhra Pradesh,
India
Keywords: Driver Monitoring, Drowsiness Detection, Computer Vision, Real‑Time Alert System.
Abstract: In today's ever-evolving world, where technology plays a crucial role, the "Driver Attentiveness Detection
System with Open CV Using Machine Learning" aims to pave the way for a safer driving experience. The
project uses Open CV based computer vision techniques and machine learning algorithms to identify early
signs of driver drowsiness and distraction. The intelligent monitoring system can analyze and determine
whether the driver is looking at the road or yawning and communicate any potential out-of-control situation
to the driver using facial features and indicating different aspects like the position of (head, eyes) and blinking
rate/jaw yawning frequency. The advanced model is fed with real-time video feed from a camera placed inside
the vehicle and has been programmed to recognize facial landmarks to identify alert and drowsy states. Upon
detection of drowsiness or distraction, it immediately conjures real-time alerts via alarms or notifications,
redirecting the driver’s focus. This project addresses this issue with the purpose of reducing road accidents,
which are one of the leading causes of human deaths and injury. Automated monitoring and AI-driven
decision-making provide a strong solution for driver protection, especially for long distance drivers, fleet
drivers and self-driving vehicles.
1 INTRODUCTION
“Driver Attentiveness Detection System with Open
CV Using Machine LearningThe above concept of
driver behavior monitoring system for real time
monitoring of driver behavior will help to become a
big breakthrough in traffic safety (Charbonnier et al.,
2008; Borghini et al., 2012). Road Condition
Monitoring system is used inside the vehicle so as not
to lose the alertness of drivers so that they can react
well and proper while driving because the cause of
most traffic accidents is because of fatigue and
distraction (Jap et al., 2009; Abdul Rahmat et al.,
2012). Using computer vision and machine learning,
this initiative also fills a vital gap in the area of
transportation safety (Chaitanya et al., 2024).
This technology is then utilizing a camera which
is being placed at a prime location in the car which
transmits live video clips of the driver for processing.
The system uses algorithms that detect facial
landmarks to examine features such as the position of
the head, the frequency of blinking and eye
movement (Charbonnier et al., 2008). By tracking
these cues, the system is able to distinguish between
when one is in alert versus inattentive phases. When
the driver becomes inattentive or sleepy, the system
triggers real-time alarms urging the driver to pay
attention and keep his/her eyes on the road (Borghini
et al., 2012).
Open CV is a library of programming functions
used for real-time computer vision, helps analyze
video streams and tracking the driver actions over the
time. Behavior classification has been performed
using multiple machine learning algorithms
specifically with the help of Convolutional Neural
Network (CNN's) methods which efficiently
recognize the signs of drowsiness and distraction (Jap
et al., 2009; Devi et al., 2023). The emotional state
and recommendation level of the driver is analyzed
by facial recognition algorithms. These technologies
create a complete framework for the improvement of
driver safety, as well as the capacity for airlines and
other long-distance fleets to create intelligent,
responsive vehicles (Parumanchala Bhaskar et al.,
2024).
640
Kumar, M. A., Abida, S. S., Mounika, N., Indu, Y., Afrin, S. and Shahena, S.
Driver Attentiveness Detection Using OpenCV and Machine Learning.
DOI: 10.5220/0013870600004919
Paper published under CC license (CC BY-NC-ND 4.0)
In Proceedings of the 1st International Conference on Research and Development in Information, Communication, and Computing Technologies (ICRDICCT‘25 2025) - Volume 1, pages
640-644
ISBN: 978-989-758-777-1
Proceedings Copyright © 2025 by SCITEPRESS Science and Technology Publications, Lda.
2 LITERATURE REVIEW
2.1 Machine Learning
An area within AI, machine learning (ML) is the field
of study that gives computers the ability to learn
without being explicitly programmed. In
conventional programming, all instructions for
executing a task are given explicitly to the program.
These processes fall into one of three categories:
supervised learning training models on labeled data;
unsupervised learning finding patterns in unlabeled
data; or reinforcement learning motivating agents to
learn through trial and error. Jacobs University, for
instance, has adopted machine learning with a
vengeance, applying it to predictive analytic, fraud
detection, recommend systems, speech recognition,
and other areas. Which makes it specifically
beneficial for industries like cyber security, health
care or any form of automation aimed at better
decision making based on the real-time processing
and analysis of extremely large data sets (Mahammad
et al., 2024; Sunar & Viswanatham, 2018).
2.2 The Use of Open CV to Promote
Attentiveness
Open CV also monitors facial features from a video
feed from the driver to calculate driver attentiveness.
To assess if a driver is distracted, it watches for key
indicators such as head position, mouth openings and
eye blinks (Charbonnier et al., 2008; Devi et al.,
2023). This enables timelier alerts that increase
safety.
Open CV tracks how far away the driver’s head
turns from the road, and can send alerts to the driver
to re-engage their concentration. The company's
diligent video analysis makes certain that any signs
of inattention or drowsiness are instantly detected,
which is crucial in preventing accidents (Borghini et
al., 2012).
Accuracy can also be improved using Open CV
along with machine learning algorithms. With
knowledge drawn from such a large pool of data, the
system can identify various degrees of driver
attention and cater to personalities. If it detects
distraction, open CV can also provide alerts sounds or
visual signals on the dashboard to remind the driver
to pay attention (Jap et al., 2009; Paradesi Subba Rao,
2024).
2.3 The Use of Machine Learning to
Promote Driver Attentiveness
Machine learning analyzes data from cameras to
assess where the drivers are looking, and what they
are doing with their phones, to monitor their attention
(Charbonnier et al., 2008; Chaitanya et al., 2024).
That visual data is then run through algorithms, in
this case, traditional neural networks (CNN’s)
searching for signs of distraction, like looking at a
phone or generally turning your head away from the
road (Devi et al., 2023).
2.3.1 Analysis of Head Movements
The system tracks the position of the head to see
whether the driver gaze has been diverted, in other
words, not looking. It determines whether the drivers
attention is on the road or elsewhere by monitoring
angles and head positions. The algorithms can also
detect when a driver is using a mobile phone by
recognizing certain movements, reaching for the
phone and looking down at it (Borghini et al., 2012).
2.3.2 Real-Time Feedback
These technologies combine to offer monitoring in
real-time. The driver may receive alerts reminding
them to keep their eyes on the road if the system
detects distraction (Parumanchala Bhaskar et al.,
2024).
2.3.3 Data Collection and Training
To increase precision, the system is trained using
sizable image collections that depict drivers in
various attentiveness levels. The models improve
over time by learning from
fresh data (Mr. M.
Amareswara Kumar, 2024; Meem, 2023).
3 METHODOLOGY
This section describes the methodology used to detect
the driver attentiveness; in particular, section 3.1
describes the project architecture, section 3.2
describes the data set information, section 3.3
describes the feature extraction approach.
3.1 Architecture
Figure 1 illustrates the System Architecture.
Driver Attentiveness Detection Using OpenCV and Machine Learning
641
Figure 1: System Architecture.
3.2 Dataset Information
Video Data: A set of videos that show different
driving situations that show both attentive and
inattentive driving.
Labels of Ground Truth: Examples of attentive
driving include situations in which the motorist is
closely observing the road.
Distracted (0): Situations in which the motorist is
distracted by something, such as looking away or
using a cell phone.
3.3 Feature Extraction
F1: Eye Attention: Open and closed eye
states are analyzed to assess attentiveness;
loss of concentration or closed eyes indicate
distraction.
F2: Mouth Movement: Tracking mouth
movements to identify chatting or other
behaviors that might be signs of a phone-
related distraction.
F3: Head Positioning: Examine the tilt and
direction of the head; notable departures
from a forward-facing posture may suggest
preoccupation.
F4: Temporal Analysis: Assesses the length
and frequency of interruptions to gain
insight into trends in inattention over time.
F5: Driver State Classification: For machine
learning purposes, categorize driving
behavior occurrences into "attentive" (1) or
"distracted" (0) categories throughout the
model training phase.
The system seeks to efficiently monitor driver
attentiveness and eventually improve road safety by
adhering to this standardized technique.
4 IMPLEMENTATION AND
RESULTS
In this section the implementation details are
mentioned to detect the jamming attacks. 4.1 Section
contains the model selection and 4.2 section contains
the results of the implements.
4.1 Model Selection
4.1.1 Supervised Learning Algorithms
Model 1: CNNs (convolutional neural networks).
CNNs are perfect for analyzing the eye and facial
states of drivers because they work especially well
with image data. Pooling layers lower dimensionality,
convolutional layers learn spatial hierarchies of
features, and fully connected layers categorize the
driver's attentiveness. Real-time processing is a
ICRDICCT‘25 2025 - INTERNATIONAL CONFERENCE ON RESEARCH AND DEVELOPMENT IN INFORMATION,
COMMUNICATION, AND COMPUTING TECHNOLOGIES
642
strength of CNNs, which enables prompt feedback on
driver conditions.
Model 2: SVM (support vector machine).
SVM uses features like head posture and eye aspect
ratio that are taken from images to distinguish
between alert and sleepy states. Classifying intricate
patterns in driver behavior can be accomplished with
SVM because it works well in high-dimensional
spaces, despite its potential for slower data
processing.
Model 3: Random Forests.
Random Forests use a collection of decision trees to
improve classification accuracy. The XGBoost model
is resistant to overfitting and deals efficiently with
diverse features of driver attentiveness such as head
positioning and eye openness by averaging multiple
trees.
Model 4: K-Nearest Neighbors (KNN).
KNN classifies the driver's status based on the
similarity of its behavior with the closest data points.
If most of the surrounding points are attentive, the
new observation is classified as attentive, while if
they are drowsy, the new observation is classified as
drowsy. KNN will rapidly classify data based on the
distance to existing data points in real-world
scenarios and is simple to explain and implement.
Model 5: Decision Tree Classifier.
In a basic model, the Decision Tree classifier can be
very simple and intuitive for classification. This
allows one to visualize the decision-making process
behind driver attentiveness in an easy manner by
splitting the data into branches based on specific
features.
The sixth model is Multi-Layer Perceptron (MLP).
4.1.2 Unsupervised Learning Algorithms
Unsupervised learning algorithms, which do not
require labelled data, are primarily used for
clustering and anomaly detection in driver
attentiveness detection.
Model 7: K-Means Clustering.
K-Means clustering can be used to help classify
different levels of driver attentiveness using feature
vectors extracted from facial images. By using a
clustering algorithm this enables us to hear the
signals of frequent behaviors in the drivers such as
awake, drowsy, distracted, etc.
PCA can be useful for visualizing and
understanding high-dimensional datasets after the
dimensionality reduction and feature extraction. In
the case of driver attentiveness detection, PCA can
reduce the size of the feature space, which can aid in
the identification of significant patterns and links
between the photo-derived features.
4.2 Results
Figure 2: Roc-Auc Scores of Test Data.
ROC-AUC curve (figure 2) is a graphical
representation of the true positive rate against the
false positive rate. The ROC-AUC curve represents
the true positive rate against the false positive rate at
various threshold settings and was implemented to
test the models. Performance: The models'
effectiveness in predicting driver inattention varied,
but Random Forest and Support Vector machine
yielded the highest accuracies according to the
aforementioned metrics. This systematic study
illustrates the multiple ML models as well as
potential applications involved in driver attention
monitoring. Each model performs a different function
when it comes to assessing head, eye and mobile
phone movements during driving.
Driver Attentiveness Detection Using OpenCV and Machine Learning
643
5 CONCLUSIONS
Here in this research, we proposed a machine learning
model and OpenCV solution to detect the driver
attention. Models that performed best at connecting
with driver inattention were classified as Random
Forest and Support Vector Machine classifiers. We
perform classification tasks using performance
measures on these features, which will gather key
face attributes such as yawning, head tilt, and eye
gazes to reflect how well our methodology can
differentiate between attentive and distracted states.
This real-time monitoring system provides timely
alerts, greatly enhancing road safety and is useful for
fleet management, autonomous vehicles and long-
distance drivers.
REFERENCES
A. Abdul Rahmat, M. Siti Atiqah, L. Fauziana, and Z.
Ahmad Noor Syukri, "MIROS crash investigation and
reconstruction: annual statistical 2007-2010," 2012.
B. T. Jap, S. Lal, P. Fischer, and E. Bekiaris. "Using EEG
spectral components to assess algorithms for detecting
fatigue," Expert Systems with Applications, vol. 36, pp.
2352-2359, 2009.
Chaitanya, V. Lakshmi, et al. "Identification of traffic sign
boards and voice assistance system for driving." AIP
Conference Proceedings. Vol. 3028. No. 1. AIP
Publishing, 2024
Devi, M. Sharmila, et al. "Extracting and Analyzing
Features in Natural Language Processing for Deep
Learning with English Language." Journal of Research
Publication and Reviews 4.4 (2023): 497-502
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,"
Neuroscience & Biobehavioral Reviews, 2012.
Mahammad, Farooq Sunar, et al. "Key distribution scheme
for preventing key reinstallation attack in wireless
networks." AIP Conference Proceedings. Vol. 3028.
No. 1. AIP Publishing, 2024.
Mr.M.Amareswara Kumar, "Baby care warning system
based on IoT and GSM to prevent leaving a child in a
parked car" in International Conference on Emerging
Trends in Electronics and Communication Engineerin-
g-2023, API Proceedings July-2024.
Mr.M.Amareswara Kumar, Effective Feature Engineering
Technique For Heart Disease Prediction With Machine
Learning" in International Journal of Engineering &
Science Research, Volume 14, Issue 2, April-2024 with
ISSN 2277-2685.
Paradesi Subba Rao, "Detecting malicious Twitter bots
using machine learning" AIP Conf. Proc. 3028, 020073
(2024), https://doi.org/10.1063/5.0212693
Parumanchala Bhaskar, et al. "Incorporating Deep Learning
Techniques to Estimate the Damage of Cars during the
Accidents" AIP Conference Proceedings.
S. Charbonnier, A. Picot, and A. Caplier, "On-line
automatic detection of driver drowsiness using a single
electroencephalographic channel," in Engineering in
Medicine and Biology Society, 2008. IEEE 30th
Annual International Conference on Business and
Management, 2008, pp. 3864–3867.
Sunar, Mahammad Farooq, and V. Madhu Viswanatham.
"A fast approach to encrypt and decrypt of video
streams for secure channel transmission." World
Review of Science, Technology and Sustainable
Development 14.1 (2018): 11-28.
ICRDICCT‘25 2025 - INTERNATIONAL CONFERENCE ON RESEARCH AND DEVELOPMENT IN INFORMATION,
COMMUNICATION, AND COMPUTING TECHNOLOGIES
644