0% found this document useful (0 votes)
12 views47 pages

Real-Time Drowsiness Detection System

Uploaded by

eeshu.2004
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views47 pages

Real-Time Drowsiness Detection System

Uploaded by

eeshu.2004
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

SAFE DRIVE: REAL-TIME DROWSINESS DETECTION AND EMERGENCY RESPONSE SYSTEM

PROJECT REPORT
On

Safe Drive: Real-time Drowsiness Detection and Emergency


Response System
Submitted in Partial Fulfilment of Award of
BACHELOR OF TECHNOLOGY
In

Information Technology
By

Shreyas S Y

Eeshwari devi

K. Sai Rishita

Under the Supervision of


Dr. M. Senbagavalli
Associate Professor, CSE Department

ALLIANCE SCHOOL OF ADVANCED COMPUTING ALLIANCE


UNIVERSITY
BENGALURU
MAY 2025

Department of Information Technology, Alliance School of Advanced Computing i


SAFE DRIVE: REAL-TIME DROWSINESS DETECTION AND EMERGENCY RESPONSE SYSTEM

DEPARTMENT OF INFORMATION TECHNOLOGY


ALLIANCE COLLEGE OF ENGINEERING AND DESIGN

CERTIFICATE
This is to certify that the project work entitled “Safe Drive: Real-time Drowsiness Detection
and Emergency Response System” submitted by Shreyas S Y (2021BIFT07AED012),
[Link] Devi (2021BIFT07AED005) and K. Sai Rishita (2021BIFT07AED019), in
partial fulfilment for the award of the degree of Bachelor of Technology in Information
Technology at Alliance University, is a Bonafide work accomplished under our supervision and
guidance during the academic year 2024-2025. This report embodies the results of original work
and studies conducted by students and the contents do not form the basis for the award of any
other degree to the candidate or anybody else.

Dr. M. Senbagavalli Dr. [Link]


Associate Professor Professor
(Supervisor) (Head of Department)

External Examiners:

1. Name: Signature:

2. Name: Signature:

Department of Information Technology, Alliance School of Advanced Computing ii


SAFE DRIVE: REAL-TIME DROWSINESS DETECTION AND EMERGENCY RESPONSE SYSTEM

DEPARTMENT OF INFORMATION TECHNOLOGY AND


ENGINEERING ALLIANCE COLLEGE OF ENGINEERING AND
DESIGN DECLARATION

We hereby declare that the project entitled “Safe Drive: Real-time Drowsiness Detection
and Emergency Response System” submitted by us in the partial fulfilment for the award of
the degree of Bachelor of Technology in Information Technology at Alliance School of
Advanced Computing, Alliance University, is a record of our work carried under the
supervision and guidance of Dr. M. Senbagavalli, Associate Professor, Department of CSE.
We confirm that this report truly represents the work undertaken as a part of our project work.
This work is not a replication of work done by any other person. We also confirm that the
contents of the report and the views contained therein have been discussed and deliberated
with the faculty guide.

NAME OF THE STUDENT REGISTRATION NUMBER SIGNATURE

Shreyas S Y 2021BIFT07AED012

[Link] Devi 2021BIFT07AED005

K. Sai Rishita 2021BIFT07AED019

Department of Information Technology, Alliance School of Advanced Computing iii


SAFE DRIVE: REAL-TIME DROWSINESS DETECTION AND EMERGENCY RESPONSE SYSTEM

ACKNOWLEDGEMENT
We would like to express our sincere gratitude to all those who supported and guided us throughout the
completion of this project. This final year project has been a significant learning experience, and we are
deeply thankful to everyone who contributed to its success.

First and foremost, we extend our heartfelt thanks to our project guide, Dr. M. Senbagavalli, for their
invaluable guidance, constant support, and insightful feedback at every stage of this project. Their expertise
and encouragement were instrumental in shaping the direction and execution of this work.

Additionally, we would like to thank the Head of Department, Dr. [Link], Program Co- Ordinator and
all the faculty members of the Information Technology department at Alliance University for providing
a supportive learning environment and necessary resources.

A special note of thanks to our teammates and friends for their collaboration, ideas, and motivation during
challenging times. We also appreciate the support and encouragement from our family, who have always
been a source of strength and inspiration.

Lastly, we would like to acknowledge all the authors and researchers whose work we referred to while
carrying out this project.

Shreyas S Y
2021BIFT07AED012
Information Technology
Alliance School of Advanced Computing

[Link] Devi
2021BIFT07AED005
Information Technology
Alliance School of Advanced Computing

K. Sai Rishita
2021BIFT07AED012
Information Technology
Alliance School of Advanced Computing

Department of Information Technology, Alliance School of Advanced Computing iv


SAFE DRIVE: REAL-TIME DROWSINESS DETECTION AND EMERGENCY RESPONSE SYSTEM

PREFACE
With the increasing reliance on remote access and device management in cybersecurity workflows, the need
for secure and ethically designed tools has become more critical than ever. This project addresses these
challenges by offering a security-focused alternative—an Ethical Remote Administration Tool engineered
with robust encryption, secure authentication mechanisms, and strict access control protocols.

The primary motivation behind this project was to create a legitimate and ethical alternative to malicious
remote administration tools, enabling IT professionals and cybersecurity experts to perform authorized
remote management tasks without compromising user privacy or system integrity. This report outlines the
problem statement, research undertaken, system design, development process, and final implementation.

The journey of working on this project has been one of immense learning and growth. It allowed us to apply
theoretical knowledge to a practical use case, analyse real-world cybersecurity challenges, and build a
solution adhering to ethical and legal standards.

We would like to express our sincere gratitude to our project guide, faculty members, and peers for their
valuable support and guidance throughout the project. We are also thankful to our institution for providing
the necessary infrastructure and academic environment to successfully complete this work.

We hope this project serves as a useful contribution to the domain of ethical cybersecurity tools and remote
system management.

Department of Information Technology, Alliance School of Advanced Computing v


SAFE DRIVE: REAL-TIME DROWSINESS DETECTION AND EMERGENCY RESPONSE SYSTEM

ABSTRACT

One of the primary causes of road accidents in the world, driver fatigue often leads to severe injuries, deaths,
and material loss. Safe Drive presents a real-time driver fatigue detection system based on computer vision
and deep learning methods for monitoring and assessing signs of driver fatigue in this urgent issue. The
system employs a standard webcam for persistent facial monitoring and is designed to operate with hardly
any hardware.
The primary detection method involves tracking the Eye Aspect Ratio (EAR) and head position. In an effort
to measure whether or not the driver is becoming drowsy, the EAR tracks facial landmarks that establish
whether or not the eyes of the driver are closing by the second. In an attempt to detect nodding or abnormal
tilts, which often occur when a driver is falling asleep, head orientation is assessed concurrently. To ensure
high-quality detection accuracy and performance, such visual cues are processed in real-time with the help of
Python, OpenCV, Dlib, and TensorFlow.

The driver is immediately informed by an auditory alarm when such signs of drowsiness are detected by the
device. Additionally, it delivers the vehicle location to a predetermined contact through an emergency SMS
based on GPS location, enabling speedy intervention. Safe Drive is an effective solution for public transport,
personal cars, and fleet business because it is light, affordable, and easy to implement in existing vehicle
technology.

Department of Information Technology, Alliance School of Advanced Computing vi


SAFE DRIVE: REAL-TIME DROWSINESS DETECTION AND EMERGENCY RESPONSE SYSTEM

LIST OF FIGURES

Figure No. Description Page No

Figure 3.1 System Architecture Design 7


Figure 4.1 Firebase Authentication console showing configured 11
admin roles (RBAC for the Ethical RAT)
Figure 5.1 Firestore device document 14
Figure 5.2 Telegram alert sample 15
Figure 5.4 Android permission screen 18

Department of Computer Science and Engineering, Alliance School of Advanced Computing vii
SAFE DRIVE: REAL-TIME DROWSINESS DETECTION AND EMERGENCY RESPONSE SYSTEM

LIST OF TABLES

Table No. Description Page No.


Table 3.1 Hardware requirements 8
Table 3.2 Software requirements 8-9
Table 5.1 Performance metrics 17
Table 6.1 Test Case 1: Firebase authentication and command routing 19
Table 6.2 Test Case 2: Battery Status Retrieval 20
Table 6.3 Test Case 3: Location Tracking Accuracy 21
Table 6.4 Test Case 4: Notification Capture 22
Table 6.5 Test Case 5: Service Persistence 22
Table 6.6 Test Case 6: Tamper resistance 23
Table 6.7 Test Case 7: Network Resilience 24
Table 6.8 Test Case 8: Invalid Command Handling 25
Table 6.9 Test Case 9: Permission Denial Simulation 25
Table 6.10 Testing Summary 26

Department of Information Technology Alliance School of Advanced Computing viii


Ethical Remote Administration Tool for Android

LIST OF ABBREVIATIONS AND SYMBOLS USED

RAT: Remote Administration Tool


API: Application Programming Interface
GUI: Graphical User Interface
OS: Operating System
AES: Advanced Encryption Standard
RBAC: Role-Based Access Control
MDM: Mobile Device Management
CTF: Capture the flag
✔: Success/Enabled
±: Accuracy range
ms: Milliseconds
m: Meters

Department of Information Technology, Alliance School of Advanced Computing ix


Ethical Remote Administration Tool for Android

TABLE OF CONTENTS

Certificate ii
Declaration iii
Acknowledgment iv
Preface v
Abstract vi
List of Figures vii
List of Tables viii
List of Abbreviations and Symbols Used ix
Table of Contents x

1. INTRODUCTION 1-3
1.1 Role of Drowsiness in Road Accidents 1
1.1.1 Current Safety Systems Are Reactive 2
1.1.2 Objective of proactive detection 2
1.2 Motivation Behind the Project 2
1.3 Project Objectives 3
1.4 Security And Ethical Considerations 3

2. LITERATURE SURVEY 4-5


2.1 Literature Review 4
2.2 Limitation of the existing system 5
2.3 Scope of the project 5

3. SYSTEM DESIGN 6-9


3.1 Problem Definition 6
3.2 System Architecture 6-7
3.3 Requirement Specification 8-9
3.3.1 Hardware Requirements 8
3.3.2 Software Requirements 9

Department of Information Technology, Alliance School of Advanced Computing x


Ethical Remote Administration Tool for Android

4. SYSTEM IMPLEMENTATION 10-12


4.1 Overview of the Modules 10
4.2 Description of the Modules 10-12
4.2.1 Module 1: Camera Module – Video Input
4.2.2 Module 2: EEG Module – Brain Activity Monitoring (Optional 10
4.2.3 Module 3: Deep Learning Models – VGG-16 (V4)
4.2.4 Module 4: Alert System – Alarm + GPS-based SMS Notification

5. RESULTS AND DISCUSSION 13-18


5.1 Description Of Results 13-16
5.1.1 Functional Implementation and Validation 13-14
5.1.2 Security & Ethical Compliance 15-16
5.2 Graphical Representation and Analysis 17-18

6. TESTING 19-26
6.1 Description 19
6.2 Test Case and Result 19-25
6.2.1 Functional Test Case 19-22
6.2.2 Security and Reliability Tests 22-23
6.2.3 Negative Testing 24-25
6.3 Summary Of Testing 26

7. CONCLUSION AND FUTURE ENHANCEMENTS 27-31


7.1 Conclusion 27
7.2 Limitation Of the Project 28
7.3 Advantages Of the Project 28-29
7.4 Application Of the Project 29
7.5 Future Enhancements 30-31

APPENDICES
Appendix A: Front Page of the Conference Paper
Appendix B: Conference Acceptance Letter
Appendix C: Source Code

References and Bibliography 33-34

Department of Computer Science and Engineering, Alliance School of Advanced Computing xi


Ethical Remote Administration Tool for Android

CHAPTER 1
INTRODUCTION

Road safety continues to be a major global concern, with drowsy driving being one of the most dangerous yet
overlooked causes of traffic accidents. According to studies and traffic safety reports, driver fatigue
contributes to a significant percentage of fatal crashes, particularly on highways and during late-night or early
morning hours. Unlike distractions or intoxication, drowsiness is a gradual and often unnoticed condition,
making it even more hazardous. A driver experiencing fatigue may show slower reaction times, impaired
judgment, and may eventually fall asleep at the wheel without realizing it.

Current vehicle safety systems are predominantly reactive—they alert drivers only when a mistake has already
been made, such as veering off a lane or approaching another vehicle too closely. These technologies, while
useful, fail to address the root cause: the deteriorating state of the driver before the error occurs. As such, they
do little to prevent accidents that stem from driver fatigue.

In light of these limitations, there is an urgent need for proactive solutions that monitor the driver's
physiological and behavioral signs in real time. Detecting early symptoms of drowsiness can enable timely
intervention before the driver becomes a danger to themselves or others.

This project, Safe Drive, aims to fill this critical gap by introducing a non-intrusive, real-time drowsiness
detection system. Using a basic webcam and computer vision techniques, the system tracks facial cues such as
eye closure patterns and head posture to assess alertness. Upon detecting fatigue, it not only sounds an audible
alarm but also sends GPS-based emergency alerts, enabling both immediate and external response. The goal is
to enhance driver safety through early detection and intervention, ultimately reducing the number of fatigue-
related road accidents.

1.1 Role of Drowsiness in Road Accidents


Drowsiness plays a critical and often underestimated role in road accidents worldwide. When a driver becomes
fatigued, their ability to remain alert, make quick decisions, and react promptly to changing traffic conditions is
significantly impaired. Drowsy drivers experience slower reaction times, brief periods of “microsleep” where
they lose awareness for a few seconds, and a general lack of focus—all of which can lead to dangerous situations
such as drifting into other lanes, missing traffic signals, or failing to notice obstacles on the road.
Unlike alcohol or drug impairment, drowsiness is harder to detect both by the driver and external observers.
Many drivers overestimate their ability to stay awake and underestimate the risks associated with fatigue. This
overconfidence can be fatal, especially during long drives, monotonous routes, or nighttime travel, where the
likelihood of falling asleep at the wheel increases. Globally, drowsiness is a major and often underappreciated
cause of traffic accidents. A driver's ability to remain alert, make quick judgments, and react rapidly to changing
traffic conditions is greatly impaired when they are tired. A tendency to be unfocused overall, slower response
times, and short periods of "microsleep" while they become unconscious for a few seconds are all signs of
drowsy driving, which can lead to dangerous situations such as drifting into other lanes,verlooking traffic
signals, or not noticing roadblocks.

Department of Information Technology, Alliance School of Advanced Computing 1


Ethical Remote Administration Tool for Android

1.1.1 Why Current Safety Systems Are Reactive

Most safety features present in contemporary vehicles are aimed at assisting drivers and preventing accidents.
They include features such as automatic emergency braking, adaptive cruise control, blind-spot monitoring,
and lane departure warning. Most of these technologies are reactive, as they respond after a possibly
dangerous situation has already begun to unfold, even though there is no denying that they have enhanced
road safety.

Lane departure warning systems, for instance, won't alert the driver until the vehicle starts drifting out of its
lane. Similarly, collision avoidance systems come on only when the vehicle gets too close to another object
or another vehicle. Because these systems aren't monitoring the emotional or physical condition of the driver,
they can't predict or prevent the behaviors that lead to these types of situations.
Furthermore, many safety systems assume the driver is alert and capable of taking corrective action.
This assumption fails in the case of fatigue, where reaction time is significantly delayed or non-
existent. As a result, these technologies, though helpful in general driving scenarios, fall short when
it comes to proactively addressing driver drowsiness.
To truly prevent accidents caused by fatigue, a shift from reactive to proactive safety mechanisms
is essential. Systems must be able to continuously monitor the driver’s condition and detect early
signs of drowsiness—before dangerous behavior occurs. This gap in current vehicle safety
technology highlights the importance and relevance of projects like Safe Drive, which aim to
anticipate risk rather than merely react to it.

1.1.2 Objective of proactive detection

The key objective of proactive detection within automated driver safety systems is to identify and mitigate
signs of fatigue prior to leading to unsafe driving habits or accidents. Proactive detection focuses on the
driver's internal state, namely attentiveness and concentration levels, as opposed to automated systems that
react to external vehicle motion or road conditions

Typically evolving over time, drowsiness can go unnoticed by the driver. By identifying behavioral and
physiological signs such as slow blinking, extended eye closure, or nodding of the head before the driver
loses full control, proactive detection aims to intervene early. Rather than merely mitigating the severity of
accidents, the system is able to prevent them by recognizing these early warning signs and taking action.
This approach makes car safety a proactive approach instead of a damage-control process. The system is
like an in-the-moment check that continuously analyzes the driver's appropriateness to operate the car safely
instead of warning the driver once there is an error. This promotes a safer driving environment alongside
reducing the likelihood of accidents.
Department of Information Technology, Alliance School of Advanced Computing 2
Ethical Remote Administration Tool for Android

1.2 MOTIVATION BEHIND THE PROJECT:

One of the most serious public safety issues is the increasing number of traffic accidents caused by fatigued
drivers. Fatigued driving remains a significant issue despite advances in vehicle safety technologies, particularly
since it is brought about by the driver's physical and mental condition and not by the performance of the vehicle
or road conditions. The need for a reliable, real-time system that actively monitors a driver's level of attention
and provides immediate intervention before accidents occur is what drove this idea.

These reactive systems often fail to prevent accidents related to fatigue because they do not consider the driver's
level of alertness. In contrast, a system that can anticipate tiredness through the use of behavioral cues, like
head nodding and eye closure, may save lives by totally preventing accidents.

The goal of creating an accessible and easy-to-implement solution is another impetus for this project. The
system can be deployed without the expense of expensive sensors or specialized equipment by leveraging open-
source libraries such as OpenCV, Dlib, and TensorFlow in combination with low-cost hardware such as
ubiquitous cameras. This makes it suitable for individual drivers as well as commercial fleets and public transit.

Department of Information Technology, Alliance School of Advanced Computing 3


Ethical Remote Administration Tool for Android

1.3 PROJECT OBJECTIVES:

1. Real-Time Facial Monitoring.

2. Eye Aspect Ratio (EAR) Analysis.

3. Head Posture Detection.

4. Integration of Computer Vision and Deep Learning.

5. Real-Time Alert Mechanism.

6. Emergency SMS Alert with GPS.

7. Cost-Effective and Scalable Design

8. Improving Overall Road Safety

1.4 SECURITY AND ETHICAL CONSIDERATIONS:

The development of the Safe Drive system involves the collection and analysis of personal data, specifically
the driver’s facial features and behavior, which raises important security and ethical concerns. These
considerations must be addressed to ensure the system respects user privacy, adheres to legal regulations,
and is ethically sound. Data Privacy and Security.
The system primarily relies on real-time facial recognition and head tracking to detect drowsiness, which
means sensitive biometric data is being captured. To protect this data:Data Encryption: All data related to
facial features and driver behavior should be encrypted both in transit and at rest to prevent unauthorized
access or [Link] Processing: Wherever possible, the data should be processed locally on the device
rather than transmitted to external servers. This minimizes the risk of data exposure during transmission. To
respect user autonomy and privacy, it is essential that the driver is fully informed about the system's
functionality and the type of data it collects. Consent should be explicitly obtained before activation. Drivers
should also be given the option to opt-out of the system or disable it when preferred. A clear and accessible
privacy policy should be presented to users outlining how their data will be handled, stored, and protected.

Department of Information Technology, Alliance School of Advanced Computing 4


Ethical Remote Administration Tool for Android

CHAPTER 2
LITERATURE SURVEY

2.1 LITERATURE REVIEW

Over the past decade, numerous approaches have been proposed to detect driver drowsiness using advanced
technologies such as deep learning, biomedical signals, and sensor-based monitoring. This section reviews
significant work in the field, focusing on four main categories: CNN-based detection systems, LSTM for
temporal analysis, EEG-based systems, and IR camera applications.

CNN-Based Detection Systems


Convolutional Neural Networks (CNNs) have become a popular method for visual-based drowsiness detection
due to their powerful image recognition capabilities. Researchers have employed CNNs to classify driver
facial features—particularly the eyes and mouth—to detect signs of fatigue such as prolonged eye closure or
yawning. CNNs can automatically learn spatial hierarchies of features from raw input images, making them
highly effective in identifying subtle visual cues.

For example, some models use a pre-trained CNN architecture like VGG16, ResNet, or MobileNet, fine-tuned
on driver monitoring datasets to detect closed eyes or drowsy expressions. These systems demonstrate high
accuracy in real-time conditions and work efficiently with low-resolution webcam input, making them ideal
for in-vehicle implementation.

LSTM for Temporal Analysis


Long Short-Term Memory (LSTM) networks are a type of recurrent neural network (RNN) well-suited for
analyzing sequential data. In the context of driver monitoring, LSTM networks are often used in combination
with CNNs to observe patterns over time—such as the frequency and duration of eye blinks or head nods.

While CNNs excel at extracting spatial features from images, LSTMs help model the temporal dynamics,
distinguishing between a natural blink and a longer eye closure indicating drowsiness. This hybrid CNN-
LSTM architecture has been shown to significantly improve the robustness of fatigue detection systems by
reducing false positives in dynamic real-world conditions.

EEG-Based Systems
Electroencephalogram (EEG)-based systems monitor electrical activity in the brain to detect drowsiness.
These systems offer a high degree of accuracy, as changes in brain wave patterns (especially an increase in
theta and alpha waves) are direct indicators of reduced alertness.

Although highly accurate, EEG systems are intrusive and often impractical for regular use in vehicles. They
require the driver to wear electrodes or a headband, which can be uncomfortable and distracting. However,
these systems are widely used in research and clinical settings to validate other non-invasive models or as part
of hybrid systems that combine visual and neural data.

IR Camera Applications
Infrared (IR) cameras enable night-time monitoring and function effectively in low-light conditions, making
them ideal for 24/7 driver monitoring. Unlike regular webcams, IR cameras can detect pupil dilation, eye
closure, and even subtle facial expressions in the dark, without the need for external lighting.
Several commercial Advanced Driver Assistance Systems (ADAS) integrate IR cameras with gaze tracking
algorithms to assess driver alertness. However, the higher cost of IR hardware limits its adoption in low-
budget or personal vehicle applications. Despite this, IR-based systems are known for their reliability and are
often used in premium vehicle safety solutions.
Department of Information Technology, Alliance School of Advanced Computing 5
Ethical Remote Administration Tool for Android

These varied approaches—ranging from deep learning to biomedical and infrared technologies—highlight the
diverse strategies in the field of driver drowsiness detection. Each method has its strengths and trade-offs in
terms of accuracy, cost, usability, and real-world applicability. The Safe Drive system builds upon this body
of work by focusing on a non-intrusive, cost-effective, and real-time solution that leverages CNN and head
posture detection using standard webcam input.

2.2 LIMITATIONS OF THE EXISTING SYSTEM

High Cost

Many advanced drowsiness detection systems rely on expensive hardware such as infrared (IR) cameras,
thermal sensors, or EEG headsets. These components significantly increase the overall cost of
implementation, making such systems economically unfeasible for budget-conscious consumers or large-scale
deployment in commercial fleets. Additionally, systems integrated into premium vehicles often use
proprietary technologies, limiting their scalability or retrofitting into older car models. The cost barrier
remains one of the primary reasons these safety systems are not yet mainstream.

User Discomfort

Some detection systems, particularly those based on EEG or other wearable sensors, require the driver to wear
headgear or attach electrodes, which can be intrusive and uncomfortable for extended periods. Such methods
are impractical for daily driving and may even discourage drivers from using the system. Even camera-based
systems, if poorly designed, may involve obtrusive mounting or require constant driver adjustment. Ensuring
continuous monitoring while maintaining user comfort remains a key challenge for developers.

Low Availability in Consumer Vehicles

Currently, most robust drowsiness detection systems are limited to high-end or luxury vehicles equipped with
Advanced Driver Assistance Systems (ADAS). These systems are not yet standard features in most mid-range
or entry-level vehicles, especially in developing countries. Moreover, aftermarket solutions are scarce or lack
accuracy, making the technology largely inaccessible to the average driver. The absence of universal or
standardized drowsiness monitoring features limits the potential safety impact of these innovations.

Addressing these limitations is central to the design of the Safe Drive project, which aims to deliver a cost-
effective, non-intrusive, and easily deployable solution using affordable hardware and open-source software
frameworks.
2.3 SCOPE OF THE PROJECT
The proposed project aims to address the above limitations by: Developing a secure and lightweight
remote administration system tailored for Android devices using an optimized SSL or AES-
encrypted RFB protocol. Incorporating user authentication with multi-factor support to enhance
protection against unauthorized access. Introducing real-time behavior analysis and anomaly
detection to detect malicious actions or data exfiltration attempts. Enabling multi-server support and
administrative session management, making the system scalable for IT teams. Promoting user
awareness through built-in threat notifications and secure usage guidelines within the app interface.

Department of Information Technology, Alliance School of Advanced Computing 6


Ethical Remote Administration Tool for Android

CHAPTER 3
SYSTEM DESIGN
3.1 PROBLEM DEFINITION:

The Driver drowsiness is a leading cause of road accidents worldwide, often resulting in severe injuries,
fatalities, and economic loss. The challenge lies in the timely and accurate detection of fatigue while ensuring
the driver's comfort and safety. Traditional systems either react too late or require expensive and intrusive
hardware, making them impractical for widespread use.

The core problem this project addresses is the need for a real-time, non-intrusive system that can accurately
detect signs of driver drowsiness and initiate an effective response mechanism. Specifically, the solution
must meet the following criteria:

Non-Intrusive Fatigue Detection:


The system must monitor the driver’s facial features (especially eyes and head position) using a standard
webcam, without requiring physical contact or the use of wearable devices. This ensures driver comfort and
system usability across different driving scenarios.
Real-Time Response:
The system must process data continuously and provide immediate feedback through visual and audible
alerts when drowsiness is detected. Timeliness is critical, as even a few seconds of delayed reaction can lead
to catastrophic consequences.
Emergency Notification with Location Tracking:
If the driver remains unresponsive or continues to exhibit signs of drowsiness, the system must escalate by
sending an automated SMS alert, including the driver’s real-time GPS location, to a pre-designated
emergency contact. This ensures that help can be dispatched promptly in case of a potential accident.

3.2 SYSTEM ARCHITECTURE:

T The Safe Drive system is designed with a modular architecture that combines computer vision, deep
learning, and communication technologies to detect driver drowsiness and respond in real time. The
architecture consists of four key components that work together seamlessly:

1. Camera Module – Driver Face Capture


A standard webcam is used to continuously capture real-time video of the driver’s face. Positioned to focus
on the driver’s eyes and head, the camera serves as the primary input device for the system. This module
ensures that visual data is acquired without requiring specialized hardware like IR or thermal cameras,
keeping the system cost-effective and accessible.

2. Facial Landmark Detection


The video feed is processed using OpenCV and Dlib libraries to identify key facial landmarks, such as the
eyes, eyebrows, nose, and mouth. Dlib’s pre-trained shape predictor model enables accurate detection of 68
facial landmarks, which are critical for tracking the eyes and head posture.
Department of Information Technology, Alliance School of Advanced Computing 7
Ethical Remote Administration Tool for Android

3. Eye Aspect Ratio (EAR) Calculation


The Eye Aspect Ratio (EAR) is calculated using the coordinates of specific eye landmarks. EAR is a
mathematical representation of the eye’s openness, and it remains relatively constant when the eye is open,
but drops significantly when the eye closes. By monitoring changes in EAR over time, the system can detect
prolonged eye closure or slow blinking—strong indicators of fatigue or microsleep episodes.

Additionally, the head orientation is analyzed to detect nodding or tilting, which further supports the
drowsiness inference.

4. Alert Module and SMS Trigger


When the EAR falls below a predefined threshold for a specific number of frames, the system concludes
that the driver is drowsy. This triggers a real-time audible alarm to alert the driver immediately.

If the driver does not respond and signs of fatigue persist, the system activates the emergency alert module,
which uses a GPS module to fetch the current location and sends an automated SMS to a registered
emergency contact. The SMS contains the driver’s live coordinates, allowing responders or family members
to locate and assist the driver promptly.

Department of Information Technology, Alliance School of Advanced Computing 8


Ethical Remote Administration Tool for Android

System Architecture Diagram

Fig 3.1: System Architecture Diagram

Department of Information Technology, Alliance School of Advanced Computing 9


Ethical Remote Administration Tool for Android

3.3 REQUIREMENT SPECIFICATIONS

3.3.1 Hardware Requirements

Table 3.1: Hardware requirements

Component Software

Webcam OpenCV

(PC/laptop) Python 3.x , Dlib, TensorFlow

GPS Module (optional) Twilio/requests for SMS

3.3.2 Software Requirements


Table 3.2: Software requirements

Category Details

Programming language Python

Development IDE (CNN-based detection systems)

Encryption libraries Dlib, TensorFlow, Twilio/requests for


SMS

Department of Information Technology, Alliance School of Advanced Computing 10


Ethical Remote Administration Tool for Android

CHAPTER 4
SYSTEM IMPLEMENTATION

4.1 OVERVIEW OF THE MODULES

4.2 Once drowsiness is detected—either through facial analysis, EEG input, or both—the system
triggers an immediate alert to prevent accidents. A loud audible alarm or buzzer sounds within
the vehicle to draw the driver’s attention and encourage re-engagement with the road. If the
driver remains unresponsive and the system continues to detect signs of fatigue, it escalates the
situation by retrieving the driver’s real-time GPS location. Using this information, Safe Drive
automatically sends an emergency SMS to a pre-registered contact, including the driver’s current
coordinates and a distress message. This ensures that help can be dispatched quickly, providing
a critical safety net in potentially dangerous scenarios.

4.3 DESCRIPTION OF THE MODULES

4.3.1 Module 1: Camera Module – Video Input


This module uses a standard webcam to continuously capture real-time video of the driver’s face. It serves as
the primary source of visual data for subsequent facial analysis. Positioned for maximum facial visibility, the
camera operates under various lighting conditions and is suitable for installation in both commercial and
personal vehicles.

Fig 4.1: Camera Detecting the facial Gesture

Department of Computer Science and Engineering, Alliance School of Advanced Computing


11
Ethical Remote Administration Tool for Android

4.3.2 Module 2: EEG Module – Brain Activity Monitoring (Optional)

To enhance detection accuracy, especially in sensitive or research-oriented deployments, Safe Drive


optionally integrates an EEG (Electroencephalogram) module that monitors the driver’s brainwave activity.
EEG sensors track cognitive signals, particularly the increase in theta and alpha wave activity—known
indicators of drowsiness and declining mental alertness. The raw EEG data is processed using lightweight
machine learning algorithms such as Support Vector Machines (SVM) or shallow neural networks to classify
the user’s mental state. This prediction is then fused with visual data from the camera module, allowing for a
multi-modal detection system. The integration of EEG significantly improves reliability in conditions where
facial features may be partially obscured or affected by lighting—such as at night or when the driver is
wearing sunglasses.

4.3.3 Module 3: Deep Learning Models – VGG-16 (V4)


Purpose: The processed image data is passed through an enhanced deep learning model based on the VGG-
16 (V4) architecture, a robust convolutional neural network known for its high performance in image
classification tasks. In the Safe Drive system, this model is trained on a diverse dataset that includes various
facial expressions and states such as alertness, drowsiness, yawning, and blinking. These features allow the
model to accurately classify the driver's level of alertness. The V4 version of VGG-16 includes architectural
optimizations for deeper layer activation and faster convergence during training, which significantly boosts
accuracy while maintaining real-time inference capabilities. Its efficient design ensures that the model
performs reliably even on mid-range hardware platforms, making it practical for integration into everyday
vehicles.

Figure 4.2: Deep Learning Model Accuracy

Department of Computer Science and Engineering, Alliance School of Advanced Computing


12
Ethical Remote Administration Tool for Android

4.3.4 Module 4: Alert System – Alarm + GPS-based SMS Notification

Purpose Once drowsiness is detected, either through facial analysis, EEG input, or both—the system triggers
an immediate alert to prevent accidents. A loud audible alarm or buzzer sounds within the vehicle to draw the
driver’s attention and encourage re-engagement with the road. If the driver remains unresponsive and the
system continues to detect signs of fatigue, it escalates the situation by retrieving the driver’s real-time GPS
location. Using this information, Safe Drive automatically sends an emergency SMS to a pre-registered
contact, including the driver’s current coordinates and a distress message. This ensures that help can be
dispatched quickly, providing a critical safety net in potentially dangerous scenarios.

Figure 4.3: Alert System – Alarm + GPS-based SMS Notification

Department of Computer Science and Engineering, Alliance School of Advanced Computing


13
Ethical Remote Administration Tool for Android

CHAPTER 5
RESULTS AND DISCUSSION

1.1 DESCRIPTION OF RESULTS

This The Safe Drive system was evaluated across multiple performance metrics to determine its effectiveness
in real-world and simulated driving conditions. The results confirm the system's ability to accurately and
reliably detect drowsiness while maintaining low latency and minimal false alerts. The analysis covers key
performance indicators including accuracy, false positive rate, response time, performance in low-light
scenarios, and confusion matrix outcomes.

1. Accuracy

The The overall accuracy of the system was measured at 93%, indicating a high level of correctness in
classifying drowsy and alert states. This figure was derived through extensive testing using a combination
of real-time video inputs, pre-recorded datasets, and live simulations. The integration of VGG-16 (V4) and
EAR thresholding contributed significantly to this high detection accuracy.

Figure 5.1:Accuracy of project

Department of Computer Science and Engineering, Alliance School of Advanced Computing 13


Ethical Remote Administration Tool for Android

2 Image Training and Epoch Analysis

The deep learning component of the Safe Drive system, based on the VGG-16 (V4) architecture, was
trained on a custom dataset containing thousands of labeled images representing various driver states —
including alert, drowsy, yawning, blinking, and eyes closed. The model was trained over multiple
epochs, and its performance was evaluated using training and validation metrics.

Dataset
Total images: ~10,000

Classes: Alert, Drowsy, Yawning, Eyes Closed, Blinking

Split: 70% training, 20% validation, 10% test

Training Parameters
Epochs: 30
Batch Size: 32
Optimizer: Adam
Learning Rate: 0.0001
Loss Function: Categorical Crossentropy
Input Size: 224x224 pixels

Training Observations

Over the course of training:


Training accuracy steadily increased from ~65% in the first few epochs to over 95% by epoch 30.
Validation accuracy stabilized around 92-94%, indicating strong generalization and minimal overfitting.

Training loss dropped consistently, while validation loss plateaued after ~25 epochs, suggesting an
optimal early stopping point.

The final test accuracy reached 93%, matching real-time performance evaluation.

Epoch Performance Graphs (suggested visuals):


Training vs. Validation Accuracy over Epochs
A line graph showing both curves converging toward 90–95%, confirming learning stability.

Training vs. Validation Loss over Epochs


Shows steady decline in training loss and minimal divergence from validation loss, implying a well-
regularized model.

Department of Computer Science and Engineering, Alliance School of Advanced Computing


18
Ethical Remote Administration Tool for Android

Fig 5.2 : Image Training and Epoch Analysis

2. Notification Monitoring Module

The NotificationListenerService captured alerts from apps (e.g., WhatsApp, SMS, system
notifications) and forwarded them to Firestore and Telegram.

Test Case: A WhatsApp message ("Emergency") generated the following log:

{ "package": "[Link]",

"message": "Hello", "timestamp":

1744686100000

Telegram Alert:

Notification Captured App:

WhatsApp Content: Hello

Limitation: Required manual Notification Access permission in Android Settings. Discussion: This feature
supports Objective 3 (notification tracking for cybersecurity analysis).

Department of Computer Science and Engineering, Alliance School of Advanced Computing


19
Ethical Remote Administration Tool for Android

Fig 5.3: Notification & Emergency contact

Department of Computer Science and Engineering, Alliance School of Advanced Computing


20
Ethical Remote Administration Tool for Android

CHAPTER 6
TESTING

6.1 DESCRIPTION
Testing is a crucial phase in the development of any software or hardware-integrated system, especially
one designed for real-time safety applications like Safe Drive. The goal of testing this system is to validate
its accuracy, responsiveness, robustness under varying conditions, and integration with alert mechanisms
such as sound and SMS.:

6.1.1Objectives of Testing

1. Verify the accuracy of drowsiness detection through facial landmarks and EAR calculations.

2. Ensure real-time response of alerts (alarm and SMS).

3. Evaluate robustness under different lighting conditions and user movements.

4. Validate emergency SMS transmission including accurate location data.

5. Test fail-safe behaviour when system inputs are unavailable (e.g., no GPS, no face detected).

Test Setup

Hardware: Standard laptop webcam, smartphone for receiving SMS, GPS module for location
[Link]: Python 3.x, OpenCV, Dlib, TensorFlow, Twilio API or requests module for SMS,
Local Server for [Link]: Tests conducted under varied lighting (natural, low light), user
behaviors (awake, blinking, nodding off), and with multiple users.

6.1.2 Observations and Analysis

The system correctly identifies drowsiness based on prolonged eye closure (typically EAR < 0.25
for more than 3 seconds).False positives are rare but can occur in extremely low-light [Link]
integration works well, though reliance on mobile networks can affect SMS delivery speed.

Alarm latency from detection to sound alert is typically 0.5–1.2 [Link] learning model tested
(e.g., VGG-16) performed slightly slower than the traditional EAR method but gave higher
accuracy in detecting yawning and eye narrowing.

Department of Computer Science and Engineering, Alliance School of Advanced Computing


21
Ethical Remote Administration Tool for Android
6.2 TEST CASES AND RESULTS

6.2.1 Functional Test Cases

Test Case Input Expected Output Actual Output

TC1 Prolonged eye closure Alarm and SMS

TC2 Blinking No alert

TC3 Low lighting Accurate detection (improved with IR)

TC4 GPS signal loss Fallback to last known location

Table 6.1: Test Case 1: Testing Protocol

TC1 – Prolonged Eye Closure


This test simulates a drowsy driver scenario where the eyes remain closed for an extended duration, exceeding
the defined EAR (Eye Aspect Ratio) threshold. The system successfully detects this as a sign of fatigue. Upon
confirmation, it activates the audible alarm and sends an emergency SMS with the driver's GPS location. This
confirms the effectiveness of the system’s core functionality—real-time, non-intrusive fatigue detection
followed by immediate response. The test validates both the accuracy of the vision-based model and the
reliability of the alert and communication modules during a critical safety event.

TC2 – Blinking
This test ensures that the system can distinguish between normal blinking and actual signs of drowsiness. A
subject performs rapid eye blinking without showing signs of fatigue. The EAR fluctuates briefly but does not
cross the drowsiness threshold over the required number of frames. The system correctly interprets this behavior
as non-drowsy and refrains from triggering any alert. This verifies the model’s robustness in avoiding false
positives, which is critical for minimizing unnecessary driver distractions and maintaining trust in the system’s
accuracy during regular driving behavior.

TC3 – Low Lighting


This test evaluates the system's performance under poor lighting conditions using a standard webcam. The visual
input suffers from reduced clarity, causing a slight drop in detection accuracy. While the system still functions,
its reliability is somewhat affected, resulting in occasional misclassifications. However, when an infrared (IR)
camera is used under the same conditions, the detection accuracy significantly improves. This test highlights
the system’s need for better imaging hardware in low-light environments and confirms that integrating an IR
camera can greatly enhance nighttime or tunnel-driving performance.

TC4 – GPS Signal Loss


This test assesses the system’s behavior when GPS connectivity is lost during an emergency alert. The system
is designed with a fallback mechanism that stores the last known GPS location prior to disconnection. When
drowsiness is detected but no live GPS data is available, it uses the cached coordinates to send the emergency
SMS. This ensures that location reporting remains functional even in areas with poor GPS coverage, such as
tunnels or remote highways. The test confirms that the emergency response feature remains reliable even under
network or signal disruptions.

Department of Computer Science and Engineering, Alliance School of Advanced Computing


22
Ethical Remote Administration Tool for Android

6.2.2 Performance Metrics


1. Detection Accuracy (EAR-based): 91.6%

Using the Eye Aspect Ratio (EAR) method for visual drowsiness detection, the

system achieved an accuracy of 91.6%. This demonstrates the effectiveness of

threshold-based logic in identifying prolonged eye closures and blinking patterns

associated with fatigue.

2. Deep Learning Model Accuracy (VGG-16): 94.2%

The enhanced VGG-16 (V4) model used for classifying facial states (e.g., drowsy,

alert, yawning) achieved a high accuracy of 94.2% during testing. This deep learning-

based approach increased detection reliability, particularly in scenarios where

traditional methods might fail due to partial occlusion or variations in facial

expressions.

3. False Alarm Rate: 3.8%

The system maintained a low false alarm rate of 3.8%, indicating minimal incorrect

drowsiness alerts. This is critical to maintaining driver trust and avoiding unnecessary

distractions during driving.

4. System Uptime During Tests: 100%

Throughout all test sessions, the system maintained 100% uptime, showing stable

performance with no crashes, interruptions, or critical failures. This confirms its

readiness for real-time, continuous use in both short and long driving durations.

Department of Computer Science and Engineering, Alliance School of Advanced Computing


23
Ethical Remote Administration Tool for Android

5. SMS Delivery Success Rate: 97.5%

Out of all triggered emergency alerts, 97.5% of SMS messages were successfully

delivered to designated contacts. Failures were mostly attributed to network issues,

and the system includes retry mechanisms and fallback logic for increased .

6. Limitations Noted During Testing

• Sunglasses significantly hinder landmark detection.

• Highly uneven lighting can create false EAR calculations.

Test Description Input Condition Expected Outcome Actual Status


Case Outcome
ID

TC-01 EAR below threshold Simulate eye Audible alarm + SMS Pass
> 3 secs closure alert triggered

TC-02 Rapid eye blinking Simulate blinking No alert should trigger Pass

TC-03 User head tilt + closed Drowsy posture Alarm + SMS should Pass
eyes and closed eyes trigger

TC-04 Bright daylight test Normal daylight System should detect Pass
condition accurately

TC-05 Low-light without IR Dim lighting Detection rate drops, Partial


cam system still alerts

TC-06 No face in frame Webcam pointed Alert: “Driver not Pass


away detected” + no SMS

TC-07 GPS module disabled No GPS SMS with “Location not Pass
available” message

TC-08 Normal driving User awake and No false alerts should Pass
scenario attentive occur

TC-09 Continuous usage test System idle but No memory leaks, stable Pass
(30 mins) active performance

TC-10 Distraction instead of Look away for 10 No alert unless EAR Pass
sleep (looking away) sec drops simultaneously

Table 6.2: Success And Limitations

Department of Computer Science and Engineering, Alliance School of Advanced Computing


24
Ethical Remote Administration Tool for Android

6.3 Recommendations for Improvement

1. Integrate Infrared or Night Vision Camera for Better Low-Light Performance

To enhance system reliability during nighttime driving or in poorly lit environments, integrating an infrared
(IR) or night vision camera is recommended. Standard webcams tend to lose accuracy in low-light conditions,
which may affect the detection of facial landmarks. IR cameras, however, can capture clear facial features
even in darkness without requiring visible light. This would significantly improve drowsiness detection
accuracy and ensure continuous monitoring around the clock. By incorporating IR technology, the Safe Drive
system can become more versatile and suitable for long-distance truckers, night-shift drivers, and users in
regions with poor ambient lighting.

2. Add Backup SMS via GSM Module to Remove Dependency on the Internet

Currently, the SMS alert system may rely on internet-based services, which can fail in areas with poor
network coverage. To mitigate this, adding a dedicated GSM module for SMS transmission is recommended.
GSM modules allow direct communication over cellular networks without requiring mobile data or Wi-Fi.
This ensures that emergency alerts with GPS coordinates are sent reliably, even in remote locations. A GSM-
based solution adds redundancy and enhances the system's resilience, making it ideal for rural areas, tunnels,
or highways where internet connectivity may be intermittent or completely unavailable.

3. Include Real-Time Dashboard Interface for Trip Logs and Alert Stats

A real-time dashboard can provide drivers or fleet managers with valuable insights into system activity,
drowsiness events, and alert history. The dashboard could display metrics like trip duration, EAR readings
over time, number of alerts triggered, and SMS delivery status. This feature would support post-trip analysis,
allowing drivers to identify patterns in their fatigue levels. For commercial operators, it can help monitor
driver safety and compliance. A user-friendly interface, either web-based or embedded, would increase system
transparency and usability, encouraging more informed decision-making and preventive measures against
fatigue-related risks.

4. Use Adaptive EAR Thresholding Based on Facial Calibration at Startup

Currently, a fixed EAR threshold is used to detect eye closure, which may not suit all individuals due to
differences in facial structure, eye shape, and blinking habits. Implementing an adaptive thresholding
mechanism that calibrates EAR values during system startup can personalize detection for each driver. The
system can record the user’s average EAR during an initial alert phase and adjust the drowsiness threshold
accordingly. This personalization would reduce false positives and improve sensitivity, especially for users
with atypical eye proportions or facial features, thereby enhancing the overall accuracy and inclusiveness of
the system.

Department of Computer Science and Engineering, Alliance School of Advanced Computing


25
Ethical Remote Administration Tool for Android

Test Case 3: Location Tracking Accuracy

Test ID TC-03

Objective Assess GPS coordinate precision

Precondition High-accuracy mode enabled

Table 6.3: Test case 3 Location Tracking Accuracy

Test Steps:

1. Send GET_LOCATION command.

2. Compare reported vs. actual coordinates (Google Maps).


Result(Expected): Coordinates within ±10m accuracy.
Result(Actual): Outdoor: 5m accuracy (12.3456, 78.9012).
Indoor: 35m accuracy (GPS drift).
Discussion: Limitations align with Android’s location APIs. Suggests future use of Wi-
Fi triangulation.

Department of Computer Science and Engineering, Alliance School of Advanced Computing


26
Ethical Remote Administration Tool for Android

Test Case 4: Notification Capture

Test ID TC-04

Objective Verify stealthy notification logging

Precondition WhatsApp notification received

Table 6.4: Test Case 4 Notification Capture

Test Steps:

1. Send WhatsApp message with location.

2. Check firestore notifications collection.


Result(Expected)
Logs {package: [Link], message: "Test"}.
Result(Actual)
Captured notification.
SystemUI notifications required filtering (e.g., "Charging 37%"). Discussion: Supports
Problem Statement (need for silent monitoring).

Test Scenario: Emergency SMS Trigger After No Response to Alerts


Objective:
To verify that the system sends the driver’s location to the emergency contact if the driver does
not respond to the audible alert after a fixed number of warnings.
Test Case ID: TC5
• Condition Simulated: Prolonged drowsiness without driver response
• Trigger Mechanism: No eye opening or head movement detected after 10 alert beeps
• Expected Behavior:

• System emits 10 continuous audible beeps over a predefined period (e.g., 10–15 seconds).

• If the driver does not react (eyes remain closed or head remains still), the system retrieves the
current GPS coordinates.

• An emergency SMS is sent to the registered contact, including a predefined message and the
live GPS location of the driver.
Ethical Remote Administration Tool for Android

Test Steps:

Start the Safe Drive system.

• Simulate drowsiness by keeping eyes closed and head stationary.

• Allow the system to issue 10 alert beeps.

• Do not respond to the alerts (no movement or eye opening).

• Observe whether the emergency SMS is sent.

• Expected Output:
• SMS sent to emergency contact with a message like:
• “Drowsiness detected. Driver unresponsive. Location: [Latitude, Longitude]”

• Actual Output:
• Functioned as expected. SMS sent successfully after 10 beeps with correct GPS location.

Department of Computer Science and Engineering, Alliance School of Advanced Computing 23


Ethical Remote Administration Tool for Android

Test Case 7: Network Resilience

Test ID TC-07

Objective Test offline command queuing

Precondition Device in Airplane mode

Table 6.5: Test case 7 Network Resilience

Test Steps:

1. Send GET_BATTERY command.

2. Re-enable network after 5 min.


Result(Expected):
Command executes upon reconnection.
Result(Actual):
Firestore offline persistence synced data.
Discussion: Validates Objective 2 (reliable communication).

6.2.2 Negative Testing

Test Case 8: Invalid Command Handling

Table 6.8: Test Case 8 Invalid Command Handling

[Link] Send {command: "INVALID"}.

[Link] Monitor logcat for crashes.

[Link] Result(Expected):Graceful error logging (Unknown command).


Result(Actual):Logged: W/Monitoring: Unknown command:
INVALID.

Department of Computer Science and Engineering, Alliance School of Advanced Computing


24
Ethical Remote Administration Tool for Android

Discussion: Ensures system stability (Objective 4).

Test Case 9: Permission Denial Simulation

Test ID TC-09

Objective Test fallback if location access is revoked

Precondition Revoke ACCESS_FINE_LOCATION

Table 6.6: Test Case 9 Permission Denial Simulation

Test Steps:

1. Trigger GET_LOCATION.

2. Check error handling.


Result(Expected):
Logs E/LOCATION: Permission not granted.
Result(Actual):
Failed gracefully without crashes.
Discussion: Aligns with ethical transparency requirements.

Department of Computer Science and Engineering, Alliance School of Advanced Computing 25


Ethical Remote Administration Tool for Android

6.3 Summary of Testing


Category Description

Detection Accuracy 91.6% (EAR-based), 94.2% (CNN-based)

False Positive Rate Approximately 3.8%

⏱ Alarm Latency ~1 second from detection to alert

SMS Delivery Success 97.5% (via Twilio/requests API)

Low-Light Performance Reduced accuracy without IR support

System Uptime 100% during test sessions

Table 6.7 Testing

Test Category Pass Rate Key Findings

Functional 92% Location accuracy varied by environment.

Security 85% Uninstall protection limited by Android.

Reliability 100% Offline queuing worked flawlessly.


Table 6.8Testing

Department of Computer Science and Engineering, Alliance School of Advanced Computing 26


Ethical Remote Administration Tool for Android

Test Scenario Outcome Status

Eye closure > 3 sec Alarm & SMS triggered Pass

Rapid blinking No alert Pass

Head tilt + closed eyes Alarm & SMS triggered Pass

Low-light (no IR) Degraded accuracy Partial

GPS unavailable SMS with fallback message Pass

No face in frame Warning, no SMS sent Pass

Continuous usage (30+ mins) No crashes, stable operation Pass

Looking away without eye closure No false alert Pass

Table 6.9: Summary of Testing

Department of Computer Science and Engineering, Alliance School of Advanced Computing 27


Ethical Remote Administration Tool for Android

CHAPTER 7
CONCLUSION AND FUTURE ENHANCEMENTS

7.1 CONCLUSION

The Safe Drive system presents a comprehensive, real-time solution for detecting driver drowsiness,
combining affordability, accuracy, and user comfort. By utilizing computer vision techniques like Eye
Aspect Ratio (EAR) monitoring and facial landmark detection, along with deep learning models such as
VGG-16 (V4), it delivers highly accurate fatigue recognition in real-world driving conditions. The
system’s non-intrusive design means it can be easily integrated into standard vehicles using only a basic
webcam and GPS module, making it suitable for both personal and commercial use. Additionally, the
inclusion of an alert mechanism and automated SMS notifications ensures timely responses in critical
situations, even when the driver fails to react. Optional EEG integration further enhances precision in
specialized scenarios, such as research or long-haul trucking. With minimal false alarms, high uptime,
and robust performance even under low-light conditions (especially when paired with IR cameras), Safe
Drive demonstrates that effective drowsiness detection doesn't require expensive or invasive equipment.
Overall, the project proves that technology can play a vital role in reducing fatigue-related accidents,
saving lives, and enhancing the safety of road transport systems..

Key Achievements:

Real-Time Drowsiness Detection


Successfully implemented a system that monitors eye movements and facial landmarks in real time using a standard webcam,
ensuring immediate detection of fatigue.

High Detection Accuracy


Achieved 94.2% accuracy using a VGG-16 (V4) deep learning model and 91.6% with the EAR-based approach, demonstrating
strong performance across various conditions.

Low False Alarm Rate


Maintained a false positive rate of only 3.8%, ensuring that drivers are not distracted by unnecessary alerts.

Emergency Response Capability


Integrated a GPS-based SMS notification system that alerts emergency contacts when prolonged drowsiness is detected, even
if the driver is unresponsive.

Low-Light Adaptability
Verified the system’s capability to function in low-light environments with up to 96% accuracy when paired with an IR camera.

Modular Design
Designed the system to support optional modules like EEG-based brain activity monitoring, allowing flexibility for advanced
applications or research purposes.

High System Reliability


Achieved 100% system uptime during testing, ensuring consistent performance without crashes or interruptions.
Department of Computer Science and Engineering, Alliance School of Advanced Computing
28
Ethical Remote Administration Tool for Android

Affordable and Non-Intrusive


Built the solution using low-cost, widely available components, making it suitable for integration into consumer vehicles without
altering driver behavior.

Backup Functionality
Implemented a fallback mechanism to send SMS using the last known GPS location during signal loss, ensuring consistent
emergency communication.

User-Centered Improvements
Proposed enhancements such as adaptive EAR thresholding, dashboard visualization, and GSM-based messaging to further
increase usability, accuracy, and independence from network limitations.

7.2 LIMITATION OF THE PROJECT

1. Requires Consistent Lighting


The performance of the Safe Drive system depends on consistent lighting conditions. In low-light
environments, such as during night driving or in tunnels, the accuracy of facial landmark detection
may decrease. Although the system performs well under typical lighting, reduced visibility can affect
the detection of eye movements, potentially leading to missed alerts. The addition of infrared (IR)
cameras could help mitigate this limitation, but standard webcams may still face challenges in poor
lighting conditions.
2. Sunglasses May Obstruct Detection
Sunglasses, particularly those with dark lenses or polarized filters, can obstruct the system’s ability to
detect facial landmarks, especially the eyes. This can lead to incorrect readings, as the system relies
heavily on visible eye and facial movement to determine drowsiness. To counteract this, users may
need to be alerted about the impact of sunglasses on the system’s effectiveness, or the system could
incorporate additional detection methods like infrared sensors or EEG to provide better reliability in
such conditions.
3. Internet Dependency for SMS Alerts
The current implementation of the SMS alert system relies on internet connectivity to send emergency
messages. In areas with poor mobile network coverage or no internet access, this functionality might
fail. While the system could use a GSM module for SMS in such cases, the need for consistent
network availability is a limitation for areas where connectivity is unreliable. Adding a backup
communication method, like a GSM-based SMS system, would ensure that the alert system remains
functional regardless of network conditions.

Department of Computer Science and Engineering, Alliance School of Advanced Computing


29
Ethical Remote Administration Tool for Android
7.3 ADVANTAGES OF THE PROJECT
Affordable
The Safe Drive system is designed with cost-effectiveness in mind. It utilizes a standard webcam, GPS
module, and open-source software libraries, making it an affordable solution for both personal and
commercial vehicles. This affordability allows broader adoption, especially in regions where more expensive
drowsiness detection systems are out of reach.

Accurate
With a detection accuracy of 94.2% using deep learning models like VGG-16 and 91.6% using the EAR-
based approach, the system offers reliable drowsiness detection. It can accurately differentiate between signs
of fatigue and regular eye movements such as blinking, minimizing false positives and ensuring driver safety.

Easy to Integrate
The system is designed to work with readily available components like webcams and GPS modules, allowing
it to be easily integrated into both new and existing vehicles without requiring significant hardware
modifications. Its software-based architecture, leveraging Python and popular libraries like OpenCV and
TensorFlow, makes it simple to deploy across a variety of vehicle types.

Non-Intrusive
Unlike traditional driver alert systems that may involve wearing sensors or using additional equipment, Safe
Drive operates seamlessly with minimal intrusion. The system continuously monitors the driver without
requiring active participation or awareness, ensuring that it doesn’t interfere with the driving experience while
still providing crucial safety alerts when needed.

7.4 FUTURE ENHANCEMENTS

Use MobileNet for Edge Deployment


To make the Safe Drive system even more efficient, one promising future improvement is integrating
MobileNet, a lightweight deep learning model designed for edge devices. MobileNet can significantly reduce
the computational resources needed, allowing the system to run on mobile devices or embedded systems in the
car without the need for powerful servers. This would make the system more accessible and scalable,
providing real-time drowsiness detection on lower-cost hardware with minimal latency.

Offline SMS/GSM Modules


To overcome the dependency on internet connectivity for SMS alerts, the future version of Safe Drive could
integrate GSM modules for offline SMS functionality. By using GSM networks, the system would not require
an active internet connection, ensuring that emergency alerts are still sent even in remote areas with poor
network coverage. This enhancement would improve the reliability of the system, making it suitable for use in
regions with unstable internet access or in tunnels and rural areas with limited connectivity.

Enhanced Dataset Diversity


For improved model generalization and robustness, it is essential to expand the training dataset to include a
more diverse range of drivers with varied age groups, ethnicities, and facial structures. This would help the
deep learning models better recognize drowsiness across different demographics. Additionally, the dataset
should include various lighting conditions, environmental factors, and types of facial expressions to enhance
detection accuracy in real-world scenarios, including when the driver wears accessories like glasses or face
masks.

Department of Computer Science and Engineering, Alliance School of Advanced Computing


30
Ethical Remote Administration Tool for Android
Voice Alerts and Dashboard Feedback
Adding voice alerts can provide an additional layer of feedback for the driver. A verbal alert can directly
inform the driver of their drowsy state, helping them stay engaged. Alongside this, implementing a real-time
dashboard interface could display trip logs, fatigue stats, and the system's alert history. This would allow fleet
managers, researchers, or drivers themselves to monitor their alertness levels and take preventive actions
before the drowsiness escalates to a critical level. The dashboard could also offer real-time feedback on
system performance and suggest adjustments when needed.

Final Remarks

The Safe Drive project represents a significant step forward in enhancing road safety by addressing the critical
issue of driver drowsiness. Through the use of real-time computer vision, deep learning techniques, and
integration with GPS for emergency response, it provides a robust, non-intrusive solution that can be easily
deployed in existing vehicles. The system's affordability, accuracy, and minimal hardware requirements make
it accessible to a wide range of users, from individual drivers to fleet operators.
Although there are certain limitations, such as lighting dependency and potential obstructions like sunglasses,
these challenges can be overcome with future enhancements, including the integration of infrared cameras and
offline SMS capabilities. The potential for further improvements, such as the adoption of MobileNet for edge
deployment and the expansion of the dataset to include more diverse driver profiles, promises to make Safe
Drive even more efficient and universally applicable.
In conclusion, Safe Drive stands as a practical and innovative solution to combat fatigue-related road accidents,
contributing to a safer driving environment. With ongoing development and future improvements, it holds the
potential to become an indispensable tool in reducing accidents caused by drowsiness and promoting road safety
worldwide.

Department of Computer Science and Engineering, Alliance School of Advanced Computing


31
Ethical Remote Administration Tool for Android

APPENDICES

A. Source Code (GitHub link or printout)

B. System Diagrams

C. Conference Paper (if published)

D. Screenshot Samples

Department of Computer Science and Engineering, Alliance School of Advanced Computing


32
Ethical Remote Administration Tool for Android

REFERENCES & BIBLIOGRAPHY

[1] Drowsy Driver Detection Using Convolutional Neural Networks (CNN) , K. Patel, R. Mehta,
2021 Used CNN models to detect drowsiness by analyzing eye closures from real-time video feed.

[2] Driver Fatigue Detection Through Eye Movement and Head Posture, L. Wang, S. Gupta,2020
Analyzed head tilt and eye blinking patterns using a combination of feature extraction and machine
learning techniques.

[3] Real-Time Detection of Drowsiness Using Eye and Mouth Analysis , M. Kumar, T. Singh ,
2022 Combined eye closure and yawning detection using machine vision and Haar cascades for
real-time analysis.

[4] Smart Driver Drowsiness Detection Using Internet of Things (IoT),T. Singh, P. Narang,2020
Designed an IoT-based drowsiness detection system by integrating wearable devices, in-car
sensors, and cloud-based analytics.

[5] Wearable Sensors for Driver Drowsiness Detection, P. Zhang, A. Johnson,2021 Developed a
wearable sensor system using electroencephalography (EEG) and heart rate variability (HRV) for
fatigue detection.

[6] Multi-Sensor Data Fusion for Driver Drowsiness Detection,N. Chawla, H. Liu , 2019 Used data
from multiple sensors (EEG, HRV, and eye-tracking) and applied data fusion techniques for
improved drowsiness detection.

[7] Drowsiness Detection Using Machine Learning and Eye State Classification, J. Kim, S. Park,
2020 Implemented SVM (Support Vector Machine) for eye state classification from real-time video
data to predict drowsiness.

[8] Real-Time Driver Monitoring System Using Infrared Cameras , V. Hernandez, M. Lopez, 2022
Used infrared cameras to monitor eye closure and facial temperature variations in low-light
conditions for detecting driver fatigue.

[9] Driver Fatigue Detection Based on Deep Learning and LSTM Networks, R. Acharya, F.
Martinez, 2021 Applied Long Short-Term Memory (LSTM) networks to analyze driver’s eye and
head movement patterns over time to detect fatigue.

[10] Kumar, R., & Kaur, A. (2017)."Driver Drowsiness Detection System Using Machine Learning
Algorithms." International Journal of Advanced Research in Computer [Link] paper discusses
various machine learning algorithms for detecting driver drowsiness using eye aspect ratio (EAR) and facial
landmark detection, similar to he methods used in the Safe Drive system.

[11] Fang, Y., Zeng, X., & Chen, X. (2019)."Real-Time Driver Drowsiness Detection System Based
Convolutional Neural Networks." IEEE Access, 7, 173654-173662This paper explores the use of
Convolutional Neural Networks (CNNs) for real-time drowsiness detection, aligning with the deep learning
approach used in Safe Drive's VGG-16 [Link]: 10.1109/ACCESS.2019.2954467

[12] Barros, P., & Oliveira, M. (2020)."A Comparative Study of Deep Learning Models for Driver Drowsiness
Detection." International Journal of Computer [Link] study compares various deep learning architectures
for drowsiness detection, providing insights into the use of VGG-16 and other models in driver monitoring systems.

Department of Computer Science and Engineering, Alliance School of Advanced Computing


33
Ethical Remote Administration Tool for Android

[13] Liu, Y., & Wu, Y. (2018)."A Survey of Driver Drowsiness Detection Systems." Journal
of Electronics & Information Technology, 40(12), 3141-3151.A comprehensive review of
existing systems for detecting driver fatigue, including the use of facial recognition, eye
tracking, and EEG-based methods.

[14] Shao, H., & Wang, Z. (2021)."A Driver Drowsiness Detection System Based on
Convolutional Neural Networks and Attention Mechanism." Sensors, 21(3), 803.
This paper proposes an advanced CNN model enhanced with an attention mechanism for
improved accuracy in drowsiness detection, relevant to the model enhancements considered
for Safe Drive.

[15] [1704.04861] MobileNets: Efficient Convolutional Neural Networks for Mobile Vision
Applications

[16] [Link]

[17] [Link]

[18] [Link]

[19] The Future for Evidence Based Data in Hand Surgery. | Request PDF

Department of Computer Science and Engineering, Alliance School of Advanced Computing


34

Common questions

Powered by AI

Current reactive vehicle safety systems, such as lane departure warning and collision avoidance, activate only after a potentially dangerous situation has begun, assuming the driver is alert and able to respond. However, these systems do not monitor the driver's condition and thus cannot predict or prevent drowsiness-induced behaviors. Proactive detection systems improve upon this by continuously monitoring the driver's attentiveness through behavioral and physiological signs like slow blinking and head nodding, allowing intervention before an accident occurs. This shift from reactive to proactive systems aims to prevent accidents rather than merely reduce their severity .

The Safe Drive system addresses cost and user comfort issues by leveraging open-source libraries (OpenCV, Dlib, TensorFlow) and low-cost hardware (standard webcams) instead of expensive sensors like IR cameras or EEG equipment. This makes the system both affordable and non-intrusive, enhancing user comfort and enabling broader adoption among individual drivers and commercial fleets without the economic barrier of high-cost technologies .

Using an adaptive Eye Aspect Ratio (EAR) threshold allows the Safe Drive system to personalize drowsiness detection for each driver, taking into account individual facial structures and blinking habits. This personalization reduces false positives and enhances the system's sensitivity and accuracy, especially for drivers with atypical eye proportions, thereby improving overall detection reliability .

Implementing driver drowsiness systems involves critical ethical and legal considerations, such as ensuring data privacy and security by encrypting sensitive biometric data and processing it locally. User consent must be clearly obtained, and drivers should be informed about data collection practices and their rights to disable the system. Additionally, providing a transparent privacy policy is essential to uphold ethical standards and adhere to legal regulations .

The Safe Drive system was tested under different lighting conditions (natural, low light), user behaviors (awake, blinking, nodding off), and with multiple users. Key objectives included verifying the accuracy of drowsiness detection, ensuring real-time alert responses, and validating GPS location transmission, emphasizing the system's robustness across a range of real-world scenarios .

The inclusion of a GSM module is important because it ensures that emergency alerts with GPS coordinates can be sent reliably, without requiring mobile data or Wi-Fi. This adds redundancy and enhances the system's resilience, particularly in remote or poorly connected areas like rural regions, tunnels, or highways, where internet connectivity might be intermittent .

The Safe Drive system ensures data privacy and security by encrypting all facial features and behavioral data both during transmission and at rest. It prioritizes local data processing to minimize exposure risks during data transmission and requires explicit user consent before data collection. Additionally, the system provides drivers with the option to opt out or disable the monitoring, ensuring user autonomy and transparency regarding data usage .

Deep learning enhances driver drowsiness detection systems by providing a more sophisticated analysis of facial states, such as detecting yawning and eye narrowing with higher accuracy than traditional EAR methods. The VGG-16 model used in Safe Drive achieved a 94.2% accuracy rate, outperforming traditional methods, particularly in dealing with partial occlusions or varying facial expressions, leading to more reliable drowsiness detection .

In the absence of live GPS data, the Safe Drive system employs a fallback mechanism that stores the last known GPS location prior to disconnection. This ensures that emergency alerts can still be sent with accurate location information even when real-time GPS data is unavailable, maintaining reliability during network or signal interruptions .

The real-time dashboard feature provides comprehensive insights into the system's activity, including trip duration, frequency of alerts, and EAR readings over time. For users, it allows self-monitoring of fatigue patterns, while fleet managers can track driver safety and compliance, thereby making informed decisions to mitigate fatigue-related risks .

You might also like