0% found this document useful (0 votes)
4 views96 pages

Major Project Report 8th Sem Finalll

The document is a major project report on the 'AI-Based Driver Drowsiness Detection System' submitted by students from Oriental College of Technology for their Bachelor of Technology degree in Computer Science and Engineering. The project aims to enhance road safety by using AI and machine learning to monitor driver behavior and detect signs of drowsiness and distraction in real-time, providing alerts to prevent accidents. It includes features such as facial expression analysis, emergency alerts, and data logging for driver behavior analysis.
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)
4 views96 pages

Major Project Report 8th Sem Finalll

The document is a major project report on the 'AI-Based Driver Drowsiness Detection System' submitted by students from Oriental College of Technology for their Bachelor of Technology degree in Computer Science and Engineering. The project aims to enhance road safety by using AI and machine learning to monitor driver behavior and detect signs of drowsiness and distraction in real-time, providing alerts to prevent accidents. It includes features such as facial expression analysis, emergency alerts, and data logging for driver behavior analysis.
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

Major Project Report

On
AI-Based Driver Drowsiness Detection System
Submitted in Partial fulfilment for the award of degree of Bachelor of Technology in
Computer Science and Engineering

Rajiv Gandhi Proudyogiki Vishwavidyalaya, Bhopal (M.P.)

Submitted By:
Sania Shukla (0126CS221169)
Satyam Mishra(0126CS221172)
Shruti Dwivedi (0126CS221186)

Under the guidance of


Asst. Prof. Rupali Soni
Department of Computer Science & Engineering

ORIENTAL COLLEGE OF TECHNOLOGY, BHOPAL


Approved by AICTE New Delhi & Govt. of M.P.
Affiliated to Rajiv Gandhi Proudyogiki Vishwavidyalaya, Bhopal (M.P.)
Session: 2025-26
ORIENTAL COLLEGE OF TECHNOLOGY, BHOPAL
Approved by AICTE New Delhi & Govt. of M.P.
Session: 2025-26
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING

CERTIFICATE

This is to certify that the work embodied in this Project Report entitled as “AI-Based

Driver Drowsiness Detection System” being Submitted by Sania Shukla, Satyam

Mishra & Shruti Dwivedi in partial fulfilment of the requirement for the award of

“Bachelor of Technology” in Computer Science & Engineering discipline to Rajiv

Gandhi Proudyogiki Vishwavidyalaya, Bhopal (M.P.), during the academic year 2025-

26 is a record of a bona fide piece of work, carried out under my supervision and

guidance in the Department of Computer Science & Engineering, Oriental College of

Technology, Bhopal.

Head of Department Project Guide Director

Dr. Nikhat Raza Khan Asst. Prof. Rupali Soni Dr K. K. Dwivedi


ORIENTAL COLLEGE OF TECHNOLOGY, BHOPAL
Approved by AICTE New Delhi & Govt. of M.P.
Session: 2025-26
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING

CERTIFICATE OF APPROVAL

This Project “AI-Based Driver Drowsiness Detection System” being submitted by

Sania Shukla, Satyam Mishra & Shruti Dwivedi has been examined by me &

hereby approved for the partial fulfilment of the requirement for the award of

“Bachelor of Technology” in “Computer Science & Engineering” for which it

has been submitted. It is understood that by this approval the undersigned do not

necessarily endorse or approve any statement made, opinion expresses or conclusion

draw there in, but the Project only for the purpose for which it has been submitted.

Internal Examiner External Examiner


Date: Date:
CANDIDATE DECLARATION

We hereby declare that the Project dissertation work presented in the report entitled

as “AI-Based Driver Drowsiness Detection System” submitted in the partial

fulfilment of the requirements for the award of the degree of Bachelor of Engineering

in Computer Science & Engineering of Oriental College of Technology is an

authentic record of our own work. We have not submitted the part and partial of this

report for the award of any other degree or diploma.

Sania Shukla (0126CS221169)


Satyam Mishra(0126CS221172)
Shruti Dwivedi (0126CS221186)

This is to certify that the above statement made by the candidates is correct to the best
of my knowledge.

Asst. Prof. Rupali Soni


Project Guide
Table of Contents

Chapter No. Topic Page

Acknowledgement Abstract i
List of Figures ii
iii
List of Tables iv
1 INTRODUCTION 1
1.1 Brief Introduction 2
1.2 Purpose 3
1.3 Scope 4
1.4 Requirements 5
1.4.1 Functional Requirements 6
1.4.2 Nonfunctional Requirements 7
1.4.3 Technologies Used 9
1.4.4 S/W and H/W Requirements 12
2 PROJECT MANAGEMENT 16
2.1 Project Planning and Scheduling 18
2.2 Project Development Model 19
2.3 Project Plan 20
2.4 Scheduling Representation 21
2.5 Cost Analysis 22
2.5 Risk Management 24
2.5.1 Risk Identification 24
2.5.2 Risk Analysis and Planning of Mitigation 26
3 SYSTEM ANALYSIS 28
3.1Problem Analysis 29
3.2Existing system 31
3.3Problem with existing system 32
3.4The proposed system 33
4 SYSTEM DESIGN 34
4.1DFD 36
4.2ER-diagram 37
4.3Use case diagram 38
4.4Sequence Diagram 39
4.5Class diagram 40
5 TECHNOLOGY 41
5.1About Python 42
5.1.1 Uses 43
5.2 MySQL 44
6 DATABASE 45
6.1 Tables 46
7 POJECT DESIGNING AND CODING 49
8 SOFTWARE TESTING 64
8.1 Objectives of Testing 65
8.2 Testing types 67
8.3 Test Cases 69
8.4 Test applied 71
9 LIMITATION AND FUTURE ENHANCEMENT 73
9.1 Limitations 74
9.2 Future Enhancement 76

CONCLUSION 79
REFERENCES 81
ACKNOWLEDGMENT

We are heartily thankful to the Management of Oriental College of Technology for providing us
all the facilities and infrastructure to take our work to the final stage.

It is the constant supervision, moral support and proper guidance of our respected Director Dr.
K.K. Dwivedi, who motivated throughout the work.

We express a deep sense of gratitude and respect to our learned guide Asst. Prof. Rupali Soni,
Professor in the Department of Computer Science & Engineering, during all phases of our work.
Without his enthusiasm and encouragement this dissertation would not have been completed. His
valuable knowledge and innovative ideas helped us to take the work to the final stage. He has
timely suggested actions and procedures for which we are really grateful and thankful to him.

We express our gratitude to Dr. Nikhat Raza Khan Head of Computer Science & Engineering
Department for providing all the facilities available in the department for his continuous support,
advice, and encouragement during this work and also help to extend our knowledge and proper
guidelines.

Constant help, moral and financial support of our loving parents motivated us to complete the work.
We Express our heartfelt thanks to our all-family members for their co-operation.

We really admire the fond support of our class-mates for their cooperation and constant help. It
gives immense pleasure to acknowledge the encouragement and support extended by them. Last
but not the least we are extremely thankful to all who have directly or indirectly helped us for the
completion of the work.

Sania Shukla (0126CS221169)


Satyam Mishra(0126CS221172)
Shruti Dwivedi (0126CS221186)
i
ABSTRACT

The AI-Based Driver Drowsiness Detection System is a smart road safety solution designed to
reduce accidents caused by driver fatigue, distraction, and lack of attention while driving. The
system uses Artificial Intelligence, Computer Vision, and Machine Learning techniques to monitor
the driver’s facial expressions, eye movements, head position, and behaviour in real time through
a camera-based surveillance system. It detects signs of drowsiness such as frequent eye closure,
yawning, head tilting, and loss of focus, along with distractions like mobile phone usage or looking
away from the road for a long time.

The system uses a camera-based monitoring setup to track the driver’s facial expressions, eye
blinking patterns, eye closure duration, yawning frequency, head movement, and face direction. It
also detects unsafe activities such as mobile phone usage, looking away from the road, and signs
of reduced attention. If the system identifies drowsiness or distracted driving, it immediately
activates warning mechanisms such as alarm sounds, voice alerts, and on-screen notifications to
alert the driver and help prevent possible accidents. In high-risk situations, the system can
automatically trigger emergency alerts through WhatsApp or SMS, sending the driver’s live GPS
location to emergency contacts for faster assistance and response.

The project also includes additional safety features such as accident detection using accelerometer
data, real-time location tracking, and data logging for driver behaviour analysis. These features
improve the overall efficiency of the system and make it more practical for real-world
implementation.

When unsafe behaviour is detected, the system immediately triggers an alert using sound
notifications and warning messages to wake up and alert the driver. In critical situations, the system
can also send emergency alerts through WhatsApp along with live location details to emergency
contacts for quick response and accident prevention. Additional features such as GPS tracking and
accelerometer-based accident detection further enhance the safety capabilities of the project.

ii
LIST OF FIGURES

Fig No. Figure Name Page No.

1 Dataflow Diagram 36

2 E R Diagram 37

3 Use Case Diagram 38

4 Sequence Diagram 39

5 Class Diagram 40

iii
LIST OF TABLES

[Link]. Figure Name Page no.

1 Table 6.1 Driver Information Table 47

2 Table 6.2 Event Record Table 47

3 Table 6.3 Focus Score Table 47

4 Table 6.4 Alert Table 48

5 Table 6.5 Image Capture Table 48

6 Table 9.1 Test Cases 70

iv
1
CHAPTER – 1
INTRODUCTION

1
CHAPTER-1
INTRODUCTION

1.1 BRIEF INTRODUCTION

SafeDriveVision is an Artificial Intelligence-based Driver Monitoring System developed to


improve road safety by detecting driver fatigue and distracted driving behaviour in real time. Driver
drowsiness and inattentive behaviour are among the major causes of road accidents worldwide.
Many accidents occur because drivers become tired, lose concentration, or engage in activities such
as mobile phone usage while driving. Therefore, it becomes necessary to develop an intelligent
system that continuously monitors the driver's condition and provides immediate alerts whenever
unsafe behaviour is detected.

The SafeDriveVision system uses Computer Vision and Machine Learning techniques to analyze
the driver's activities through a camera feed. The system captures real-time video frames and
processes them to identify different behaviours such as eye closure, yawning, head movement,
mobile phone usage, and driver look-away situations. Facial landmark detection techniques are
used to identify important facial points and monitor eye and mouth movements. Object detection
models are used to detect mobile phone usage.

The developed system calculates a focus score based on driver activities and dynamically updates
the driver's safety status. Depending on the driver's condition, the system categorizes the status into
levels such as SAFE, WARNING, and HIGH RISK. Whenever risky behavior is detected, voice
alerts are generated to warn the driver and bring their attention back to driving.

The project is implemented using Python programming language and integrates various
technologies such as OpenCV, Dlib, YOLO object detection, PySide6 for graphical user interface
design, and audio alert mechanisms. The system also stores events and provides a modern
dashboard interface for displaying real-time information.
SafeDriveVision aims to reduce road accidents and improve driving safety by providing an
intelligent and real-time driver assistance solution. The proposed system can be further enhanced
2
in the future by integrating cloud services, GPS tracking, vehicle sensors, and mobile applications
for advanced monitoring and analysis.
real-time location to emergency contacts, allowing faster help and emergency response. This makes
the system more useful not only for prevention but also for post-accident support.

1.2 PURPOSE

The primary purpose of the SafeDriveVision project is to develop an intelligent and efficient driver
monitoring system that enhances road safety by detecting driver fatigue and distracted behavior in
real time. In recent years, road accidents have increased significantly due to driver drowsiness, loss
of concentration, and the use of mobile phones while driving. Such situations can reduce the
driver's ability to react quickly, resulting in serious accidents and loss of life. Therefore, there is a
need for a smart system capable of continuously monitoring the driver's activities and providing
timely alerts whenever unsafe behavior is observed.

The SafeDriveVision system is designed to monitor various driver actions through computer vision
and artificial intelligence techniques. The system continuously captures live video input from a
camera and analyzes facial features and movements to determine the driver's level of attention and
alertness. It identifies events such as eye closure, yawning, excessive head movement, mobile
phone usage, and situations where the driver is not looking ahead.

The project aims to generate immediate voice alerts whenever risky activities are detected so that
the driver can regain focus and avoid potential danger. Another important purpose of the system is
to calculate and maintain a dynamic focus score based on driver behavior. This score helps in
identifying whether the driver is attentive, slightly distracted, or at high risk.

The major objectives of the SafeDriveVision project are:


To monitor driver behavior continuously in real time.
To detect signs of fatigue and drowsiness.
To identify distracted driving activities.
To provide instant voice notifications for detected risks.
To calculate a driver focus score dynamically.
To reduce the probability of accidents caused by human error.
To improve overall driving safety and awareness.
3
The SafeDriveVision system serves as a preventive solution that helps drivers remain attentive and
reduces the chances of accidents caused by fatigue or distraction. This project demonstrates how
Artificial Intelligence can be effectively used in transportation systems for enhancing safety and
improving the driving experience.

1.3 SCOPE

The scope of the AI-Based Driver Drowsiness Detection System is wide and highly relevant in
improving modern transportation safety. This project can be implemented in personal vehicles,
commercial transport, public buses, taxis, trucks, and long-distance travel systems where driver
fatigue is a major risk factor. It helps in reducing accidents caused by drowsiness, distraction, and
lack of attention by continuously monitoring the driver’s behavior in real time.

The system can be used by transport companies to ensure driver safety and improve fleet
management by tracking driver alertness and performance. It is also useful for night-shift drivers,
highway travelers, and heavy vehicle operators who are more likely to experience fatigue during
long driving hours. Educational institutions and research organizations can further use this project
for advanced studies in Artificial Intelligence, Computer Vision, and smart vehicle safety systems.
With future improvements, the project can be integrated with IoT devices, smart dashboards, and
autonomous vehicles for more advanced safety solutions. Features like cloud-based monitoring,
real-time reporting, and AI-based predictive analysis can further increase its effectiveness. The
system also has the potential to be connected with emergency healthcare services and traffic control
systems for faster accident response
.
The system can be used by transport companies to ensure driver safety and improve fleet
management by tracking driver alertness and performance. It is especially useful for night-shift
drivers, highway travelers, delivery drivers, ambulance drivers, and heavy vehicle operators who
often work for long hours and are more likely to experience fatigue. Government transport
departments can also adopt such systems to improve road safety standards and reduce accident
rates on highways and urban roads.

Educational institutions and research organizations can further use this project for advanced studies
in Artificial Intelligence, Computer Vision, Machine Learning, and smart vehicle safety systems.

4
It provides a practical example of real-time AI implementation and helps students understand the
application of image processing and behavior analysis in real-world problems.

1.4 REQUIREMENTS

Requirements represent the conditions, resources, and capabilities necessary for the proper
development and execution of a software system. They define what the system needs in order to
function efficiently and satisfy user expectations. Requirement analysis is one of the most
important phases in software development because it helps in understanding system objectives and
ensuring that the developed product fulfills all user needs.

For the SafeDriveVision project, requirements are identified to ensure smooth functioning of the
system and proper implementation of driver monitoring features. The project requires both
software and hardware resources for real-time processing and analysis. Requirements also help in
determining the technologies, system behavior, and environmental conditions under which the
application will operate.

The SafeDriveVision system requires real-time video processing capability because the system
continuously captures video frames and analyzes driver activities. The system should have
sufficient computational power to process multiple detection algorithms simultaneously without
affecting performance. Since Artificial Intelligence and Computer Vision techniques are involved,
the project also requires appropriate libraries and supporting tools for image processing and
machine learning operations.

Requirements can generally be categorized into different types such as functional requirements,
non-functional requirements, software requirements, and hardware requirements. Functional
requirements define the operations performed by the system, while non-functional requirements
describe system quality attributes such as performance, reliability, and usability. Software
requirements specify the programming languages, libraries, and development tools needed for
implementation, whereas hardware requirements describe physical resources such as processor
speed, memory, storage, and camera specifications.

5
A well-defined requirement specification helps reduce development complexity and ensures proper
planning of resources before implementation. It also minimizes errors during development and
improves the efficiency and reliability of the final system.

1.4.1 FUNCTIONAL REQUIREMENTS

Functional requirements describe the specific functions and services that the system must perform
to satisfy user needs. These requirements define the behavior of the system and specify what the
system should do during operation. Functional requirements focus mainly on the interactions
between the user and the system and describe the operations that are necessary for successful
implementation of the project.

For the SafeDriveVision project, functional requirements define the features responsible for
monitoring driver activities and generating alerts. The system must perform multiple operations
simultaneously to ensure effective real-time monitoring and analysis.

The major functional requirements of the SafeDriveVision system are as follows:

1. Real-Time Video Capture


The system should continuously capture video input through a camera or webcam for monitoring
the driver's activities in real time.

2. Face Detection and Tracking


The system should identify and track the driver's face continuously for analyzing facial movements
and expressions.

3. Eye Closure Detection


The system should monitor eye movements and detect prolonged eye closure conditions that
indicate fatigue or drowsiness.

4. Yawn Detection
The system should detect yawning behavior by analyzing mouth movements and identify signs of
tiredness.

6
5. Mobile Phone Detection
The system should identify the use of mobile phones while driving through object detection
techniques.
6. Driver Look-Away Detection
The system should monitor head orientation and determine whether the driver is looking away from
the road.

7. Focus Score Calculation


The system should dynamically calculate a focus score based on detected driver activities and
behavior patterns.

8. Risk Status Monitoring


The system should classify the driver's condition into categories such as SAFE, WARNING, and
HIGH RISK according to the focus score.

9. Voice Alert Generation


The system should generate audio alerts whenever unsafe driving conditions are detected.

10. Event Capture and Logging


The system should capture screenshots of incidents and maintain records for future analysis.

11. Dashboard Interface


The system should provide a graphical user interface for displaying real-time monitoring
information and alerts.

12. Report Storage


The system should store driver activity details and incident data in a database for future reference.

These functional requirements ensure that the SafeDriveVision system performs all necessary
operations efficiently and fulfills the objectives of driver safety monitoring.

1.4.2 NON-FUNCTIONAL REQUIREMENTS


7
Non-functional requirements describe the quality attributes and operational characteristics of a
software system. Unlike functional requirements, which define what the system should do,
nonfunctional requirements specify how the system should perform. These requirements focus on
system performance, reliability, usability, efficiency, scalability, and other quality-related factors
that ensure smooth operation of the application.

For the SafeDriveVision project, non-functional requirements play an important role because the
system performs real-time processing and monitoring of driver activities. Since the application
continuously analyzes video frames and generates alerts, the system must operate efficiently with
minimal delays and high accuracy.

The major non-functional requirements of the SafeDriveVision system are as follows:

1. Performance
The system should process video frames and detect driver activities in real time without significant
delay. The response time should be fast enough to generate immediate alerts whenever risky
behavior is detected.

2. Reliability
The system should operate continuously and consistently without failure during the monitoring
process. It should provide accurate results under normal operating conditions.

3. Accuracy
The detection algorithms should provide precise and reliable results with minimal false detections.
The system should accurately detect eye closure, yawning, phone usage, and head movement.

4. Usability
The graphical user interface should be simple, interactive, and easy to understand. Users should be
able to operate the system without requiring technical expertise.

5. Scalability

8
The system should support future enhancements and allow integration of additional features such
as cloud storage, GPS tracking, mobile applications, and advanced analytics.

6. Maintainability
The software should be designed using a modular structure so that modifications and debugging
can be performed easily without affecting the complete system.

7. Availability
The system should remain active and accessible whenever monitoring is required and should
minimize downtime.

8. Security
Stored event data, reports, and captured images should be protected against unauthorized access
and misuse.

9. Efficiency
The system should utilize hardware resources efficiently and avoid unnecessary memory or
processing overhead.

10. Portability
The application should be capable of running on different systems and environments with minimal
configuration changes.

These non-functional requirements ensure that the SafeDriveVision system performs effectively
and delivers reliable results while maintaining quality, efficiency, and user satisfaction.

1.4.3 TECHNOLOGIES USED

Technologies are the tools, programming languages, libraries, frameworks, and software
components used during the development of a project. The selection of appropriate technologies
plays an important role in determining the performance, efficiency, and functionality of the system.
The SafeDriveVision project uses different technologies for real-time video processing, object
detection, graphical interface development, and database management.
9
The major technologies used in the SafeDriveVision project are explained below:

1. Python
Python is a high-level, interpreted programming language used as the primary language for
developing the SafeDriveVision system. Python provides simple syntax and extensive library
support, making it suitable for Artificial Intelligence, Machine Learning, and Computer Vision
applications.
Uses:
Main project development
AI implementation
Data processing
Integration of multiple libraries

2. OpenCV
OpenCV (Open Source Computer Vision Library) is an open-source computer vision and image
processing library used for handling real-time video capture and image processing operations.
Uses:
Capturing video frames
Image processing
Face detection support
Real-time monitoring

3. Dlib
Dlib is a machine learning library used for facial landmark detection and facial feature analysis. It
helps identify facial points such as eyes, mouth, nose, and jaw.
Uses:
Facial landmark detection
Eye closure detection
Yawn detection
Head movement analysis

4. YOLO (You Only Look Once)

10
YOLO is an object detection algorithm used to detect objects in real-time images and video
streams. In this project, it is used to detect mobile phone usage while driving.
Uses:
Mobile phone detection
Real-time object identification
Driver distraction detection

5. PySide6
PySide6 is a Python framework used for creating graphical user interfaces. It provides modern and
interactive desktop application components.
Uses:
Dashboard interface development
Displaying real-time statistics
Interactive user interface design

6. NumPy
NumPy is a numerical computation library used for performing mathematical operations on arrays
and matrices.
Uses:
Mathematical calculations
Array processing
Numerical operations

7. SciPy
SciPy is a scientific computing library used for advanced mathematical operations and distance
calculations.
Uses:
Euclidean distance calculations
Eye Aspect Ratio calculation
Mouth Aspect Ratio calculation

8. Pygame

11
Pygame is a multimedia library used for audio processing and sound generation.
Uses:
Voice alerts
Warning notifications
Audio management

9. SQLite
SQLite is a lightweight relational database management system used to store system logs and
monitoring data.
Uses:
Storing incident records
Saving driver reports
Event logging

10. Torch (PyTorch)


PyTorch is an open-source machine learning framework used for deep learning operations and
model execution.
Uses:
Running YOLO model
AI model processing
Object detection support
The combination of these technologies enables the SafeDriveVision system to perform real-time
driver monitoring efficiently and provide accurate results with an interactive user experience.

1.4.4 S/W & H/W REQUIREMENTS

The SafeDriveVision project requires appropriate software and hardware resources for proper
implementation and execution. Since the system performs real-time video processing, facial
landmark detection, object detection, and graphical user interface operations, the availability of
suitable resources is essential for achieving efficient performance. Proper software and hardware
specifications help the system process multiple tasks simultaneously and provide accurate
monitoring results.
12
Software Requirements
Software requirements refer to the programs, operating systems, tools, and libraries necessary for
developing and executing the SafeDriveVision application. The software environment acts as a
platform for integrating Artificial Intelligence algorithms and computer vision functionalities.

1. Operating System
The SafeDriveVision system requires an operating system capable of supporting Python and its
associated libraries. The project is developed and tested on Windows operating systems.
Required specification: Windows 10 or Windows 11
The operating system manages system resources and provides an environment for running the
application and supporting libraries.

2. Programming Language
Python is used as the main programming language for the development of the project. Python
provides easy syntax and extensive support for Machine Learning and Computer Vision
applications.
Required specification: Python version 3.10 or higher
Python is used for implementing detection algorithms, integrating libraries, handling data
processing, and developing system logic.

3. Development Environment
An Integrated Development Environment (IDE) is required for writing, editing, debugging, and
testing source code.
Required specification: Visual Studio Code
Visual Studio Code provides features such as syntax highlighting, debugging support, code
management, and extension integration that simplify software development.

4. Database Management System


The system requires a database for storing monitoring records, incident details, and event logs.
Required specification: SQLite Database
SQLite is lightweight and easy to integrate with Python applications. It helps in storing captured
event information for future analysis.

13
5. Required Libraries and Frameworks
Several libraries and frameworks are required for implementing various functionalities within the
system.
OpenCV is used for image processing and video frame handling.
Dlib is used for facial landmark detection and face analysis.
PyTorch is used for machine learning and executing object detection models.
PySide6 is used for creating the graphical user interface.
NumPy is used for mathematical and numerical computations.
SciPy is used for distance calculations and scientific operations.
Pygame is used for audio processing and alert generation.
These libraries provide the required functionalities for implementing the complete driver
monitoring system.

Hardware Requirements
Hardware requirements define the physical resources needed to execute the SafeDriveVision
application efficiently.

1. Processor
The processor is responsible for handling multiple operations such as video processing, AI
computations, and system execution.
Required specification: Intel Core i3 or above
Recommended specification: Intel Core i5 or above
A higher processing capability improves the speed and efficiency of real-time detection.

2. Random Access Memory (RAM)


RAM is required for storing temporary information during program execution.
Required specification: Minimum 4 GB RAM
Recommended specification: 8 GB RAM
Higher RAM capacity ensures smooth execution of machine learning libraries and video processing
tasks.

3. Storage Space

14
Storage space is required for saving project files, libraries, captured images, and event logs.
Required specification: Minimum 10 GB free storage space
Adequate storage improves system performance and supports future expansion.

4. Camera Device
The camera serves as the primary input source for monitoring driver activities.
Required specification: Webcam with minimum 720p resolution
Recommended specification: HD camera with higher frame rate
A higher-quality camera improves image clarity and detection accuracy.

5. Graphics Support
Graphics capability helps in handling image rendering and machine learning computations.
Required specification: Integrated graphics support
Recommended specification: Dedicated GPU
Dedicated graphics processing units improve the speed of AI operations.

6. Input Devices
Input devices allow users to interact with the application.
Required specification: Keyboard and Mouse
These devices help users operate and control the system functions effectively.
Proper software and hardware configuration ensures smooth implementation of SafeDriveVision
and improves the overall accuracy, performance, and reliability of the driver monitoring system.

15
CHAPTER-2
PROJECT MANAGEMENT

16
CHAPTER-2
PROJECT MANAGEMENT

Project management is the process of planning, organizing, controlling, and monitoring activities
required for the successful completion of a project within a specified time and budget. It ensures
that all resources are utilized efficiently and that the project objectives are achieved effectively.
Proper project management helps in reducing risks, avoiding delays, and maintaining the quality
of the developed system.

In software development, project management plays a significant role because software projects
involve multiple stages such as requirement analysis, system design, coding, testing, and
deployment. Managing these activities in a systematic manner ensures that the project progresses
according to the planned schedule and fulfills all user requirements.

For the SafeDriveVision project, project management was carried out through a structured
development process. Initially, the problem of driver fatigue and distracted driving behavior was
studied and analyzed. After understanding the problem statement, project objectives were
identified and appropriate technologies were selected for implementation.

The development process included several phases beginning with requirement gathering and
analysis. The requirements were studied to determine system functionalities and performance
expectations. After requirement analysis, system design activities were performed, including
planning of modules, interfaces, and data flow within the system.

The implementation phase involved coding and integrating various technologies such as Python,
OpenCV, Dlib, YOLO, PySide6, and database support. During implementation, continuous
monitoring and debugging were performed to ensure proper execution of functionalities. Testing
activities were then conducted to verify system performance and identify any errors or
inconsistencies.

Project management also involved resource planning and risk management activities. Hardware
resources such as camera devices and computing systems were identified, and software resources
including development tools and libraries were selected.
17
2.1 PROJECT PLANNING AND SCHEDULING

Project planning and scheduling is an important activity in software development that involves
identifying project objectives, defining tasks, allocating resources, estimating time, and organizing
project activities in a systematic manner. Proper planning ensures that all development activities
are completed within the specified time and budget while maintaining quality and performance
standards.

In the SafeDriveVision project, planning was carried out before implementation to understand
project requirements and determine the technologies and resources needed for development. The
project was divided into different phases so that each activity could be completed in an organized
manner. This approach helped in reducing complexity and improving development efficiency.
The planning process started with identifying the problem statement related to road accidents
caused by driver fatigue and distracted driving behavior. After understanding the problem, project
objectives were defined and suitable technologies such as Python, OpenCV, Dlib, YOLO, and
PySide6 were selected for implementation.

Scheduling was performed to assign estimated time durations for different development activities.
The project development process was divided into multiple stages, and each stage was assigned a
specific timeline for completion. The scheduling process ensured proper coordination among tasks
and reduced the possibility of delays.

The project schedule for SafeDriveVision is described as follows:

Requirement Analysis: During this phase, project requirements and objectives were identified and
studied. Estimated duration: 1 week.

System Design: During this stage, system architecture, modules, user interface design, and
workflow diagrams were prepared. Estimated duration: 1 week.

Technology Selection and Environment Setup: Required software tools, libraries, and development
environments were selected and configured. Estimated duration: 3 days.

18
Coding and Implementation: The implementation phase involved development of driver
monitoring functionalities including face detection, eye detection, yawn detection, phone detection,
and graphical interface integration. Estimated duration: 2 weeks.

Testing and Debugging: Different testing techniques were applied to identify and correct errors
within the system. Estimated duration: 1 week.

Documentation and Final Report Preparation: Project documentation and report preparation
activities were completed during this stage. Estimated duration: 1 week.

Proper planning and scheduling helped in managing project activities effectively and ensured
timely completion of the SafeDriveVision system while maintaining quality and performance
objectives.

2.2 PROJECT DEVELOPMENT MODEL

A project development model is a structured approach used for planning, designing, developing,
testing, and implementing a software system. It provides a systematic process for executing project
activities in an organized manner. The development model helps in dividing the complete project
into different phases and ensures that each phase is completed successfully before proceeding to
the next stage.

For the SafeDriveVision project, the Waterfall Development Model was adopted for
implementation. The Waterfall model is one of the most widely used software development models
because of its simplicity and sequential approach. In this model, the development process is divided
into multiple stages where the output of one phase becomes the input for the next phase.

The development process for the SafeDriveVision project followed the sequence of requirement
analysis, system design, implementation, testing, and deployment. Initially, the requirements of the
system were gathered and analyzed to understand the objectives and functionalities of the project.
During this stage, the major causes of driver fatigue and distracted driving behavior were studied
and the necessary system requirements were identified.

19
After requirement analysis, the system design phase was performed. During this phase, different
modules and system architecture were designed. Data flow, user interface structure, and processing
methods were planned before implementation.

The implementation phase involved coding and integration of different technologies such as
Python, OpenCV, Dlib, YOLO, PySide6, and database support. Different modules were developed
separately and later integrated into a complete system.

After implementation, testing was performed to verify system functionality and identify any errors
or defects. Different testing methods were applied to ensure proper working of the driver
monitoring system and improve its accuracy and reliability.

Finally, the deployment phase involved execution of the developed system and monitoring its
performance under real-time conditions.

The Waterfall model was selected for this project because the project requirements were clearly
defined in the initial stage and the sequential approach provided better organization and
management of development activities. It also simplified documentation and helped in systematic
completion of the SafeDriveVision project.

2.3 PROJECT PLAN

A project plan is a detailed framework that defines the activities, resources, objectives, and time
required for successful completion of a project. It serves as a roadmap that guides the development
team throughout the project lifecycle and helps in achieving the desired goals within the specified
duration. A proper project plan ensures effective utilization of resources and provides better control
over project activities.

For the SafeDriveVision project, the project plan was prepared to organize the development process
systematically. The complete project was divided into different phases, where each phase focused
on specific activities and objectives. The planning process helped in maintaining a structured
workflow and ensured timely completion of all tasks.

20
The project execution started with requirement gathering and analysis. During this phase,
information related to driver fatigue and distracted driving behavior was collected and studied. The
project objectives and expected system functionalities were identified to determine the scope of the
system.

The next phase involved system design and architecture planning. Different modules such as face
detection, eye closure detection, yawn detection, phone detection, alert generation, and dashboard
design were identified. Data flow and processing methods were also planned during this stage.

After the design phase, technology selection and environment setup activities were performed.
Required software tools, libraries, frameworks, and databases were selected and configured.
Technologies such as Python, OpenCV, Dlib, YOLO, PySide6, and SQLite were integrated for
implementation.

The implementation phase focused on coding and integrating different modules of the system.
Real-time driver monitoring functionalities were developed and connected with the graphical
interface. Event recording and alert generation mechanisms were also implemented during this
stage.
The testing phase involved verifying system functionality and identifying possible errors. Different
testing techniques were applied to evaluate system performance, detection accuracy, and reliability.
Any detected issues were corrected through debugging and optimization.

Finally, documentation and report preparation activities were performed. Detailed documentation
of project requirements, design, implementation, and testing results was prepared to provide a
complete description of the project.

The project plan provided a structured approach for the development of SafeDriveVision and
ensured systematic completion of all project activities within the defined schedule.

2.4 SCHEDULING REPRESENTATION

Scheduling representation is a method used to present project activities and timelines in a structured

21
form. It helps in showing the sequence of tasks, their duration, and the estimated time required for
completion. Scheduling representation provides a clear understanding of project progress and
ensures proper coordination among different activities. It also helps in monitoring project execution
and identifying whether the project is progressing according to the planned schedule.

For the SafeDriveVision project, scheduling representation was used to divide the complete
development process into different phases. Each phase was assigned a specific time duration based
on the complexity and requirements of the task. This representation helped in organizing the
workflow and maintaining systematic progress throughout the project development process.

The schedule representation for the SafeDriveVision project is given below:

Activity Duration Week

Requirement Gathering and Analysis 1 Week Week 1

System Design and Planning 1 Week Week 2

Technology Selection and


3 Days Week 3
Environment Setup
Week 4–
Coding and Implementation 2 Weeks
5

Integration of Modules 1 Week Week 6

Testing and Debugging 1 Week Week 7

Documentation and Report


1 Week Week 8
Preparation

The scheduling representation helps in tracking project activities and maintaining control over
project development. It also assists in resource allocation and ensures timely completion of the
SafeDriveVision system. Proper scheduling reduces delays and improves overall project
efficiency.

2.5 COST ANALYSIS


22
Cost analysis is the process of estimating the expenses required for the development and
implementation of a project. It helps in identifying the resources needed and determining the
overall budget required for successful completion of the system. Cost analysis includes both

hardware and software costs along with other implementation expenses. Proper cost estimation
helps in effective resource allocation and ensures that the project remains within the planned
budget.

Estimated Cost
Component Quantity
(INR)
Laptop/Desktop System 1 ₹45,000
Webcam (HD Camera) 1 ₹2,000
Internet Connection 1 ₹1,000
Software Tools and Open
₹0
Libraries Source

Open
Database Support (SQLite) ₹0
Source

Development Environment Open


₹0
(VS Code) Source
Miscellaneous Expenses - ₹2,000

For the SafeDriveVision project, cost analysis was performed based on the hardware components,
software tools, and development resources required for implementation. Since the project mainly
uses open-source technologies such as Python, OpenCV, Dlib, YOLO, and PySide6, software
expenses are significantly reduced. Most of the required libraries are freely available, which
minimizes the development cost.

The estimated cost analysis for the SafeDriveVision project is given below:
Total Estimated Cost = ₹50,000

The overall development cost of the SafeDriveVision project is relatively low because most
technologies used are open-source and freely available. The major expenses are related to hardware
23
resources such as the computer system and camera device. The use of open-source tools reduces
financial burden and makes the project cost-effective while maintaining high performance and
functionality.

2.5.1 RISK MANAGEMENT

Risk management is the process of identifying, analyzing, and controlling potential problems that
may affect the successful completion of a project. It helps in minimizing uncertainties and reducing
the impact of possible failures during project development and implementation. Risk management
plays an important role in software engineering because software projects may face various
technical, operational, and resource-related issues.

For the SafeDriveVision project, risk management was performed to identify potential challenges
that could affect system performance and reliability. Since the project involves Artificial
Intelligence, Computer Vision, and real-time video processing, different risks were considered
during development. These risks may arise due to hardware limitations, software compatibility
issues, inaccurate detection, or environmental factors.

Proper risk management helps in identifying these issues at an early stage and allows appropriate
preventive measures to be taken. It also improves project quality and reduces development delays.
During the implementation of SafeDriveVision, risks associated with detection accuracy,
processing speed, system performance, and resource availability were analyzed and suitable
mitigation strategies were considered.

The risk management process for the SafeDriveVision project involves risk identification, risk
analysis, and planning appropriate solutions for minimizing the impact of identified risks. Effective
risk management ensures smooth development and increases the overall reliability and efficiency
of the system.

2.5.2 RISK IDENTIFICATION

Risk identification is the process of recognizing and documenting potential problems that may affect the
development and performance of a project. It helps in identifying possible uncertainties before

24
implementation so that preventive actions can be taken in advance. Identifying risks at an early stage
reduces the chances of project failure and improves overall project efficiency.

For the SafeDriveVision project, several risks were identified because the system involves real-time
video processing, Artificial Intelligence algorithms, and computer vision techniques. These risks may
affect the accuracy, performance, and reliability of the system during execution.

The major risks identified in the SafeDriveVision project are described below:

1. Detection Accuracy Risk


The system may generate incorrect results or false detections while identifying driver activities such as
eye closure, yawning, or mobile phone usage. Changes in facial expressions and camera quality may
affect detection accuracy.

2. Hardware Failure Risk


Hardware components such as webcams or computer systems may fail during execution. Hardware
malfunction can interrupt the monitoring process and affect system performance.

3. Performance Risk
Real-time processing requires continuous execution of multiple algorithms simultaneously. Limited
processing capability or insufficient system resources may reduce system speed and increase response
time.

4. Software Compatibility Risk


The project uses multiple libraries and frameworks such as OpenCV, Dlib, PyTorch, and PySide6.
Compatibility issues between software versions may create execution problems.

5. Environmental Risk
External factors such as poor lighting conditions, camera angle variations, and background disturbances
may affect image quality and reduce detection performance.

6. Resource Availability Risk

25
Insufficient memory, storage space, or computational resources may affect the proper functioning of the
system.

7. Data Storage Risk


Event logs and captured records may be lost because of storage failures or database-related issues.

8. Security Risk
Unauthorized access to stored data and monitoring records may affect system confidentiality and
security.

Identifying these risks helps in understanding possible project challenges and supports effective planning
for minimizing their impact during system development and execution.

2.5.3 RISK ANALYSIS AND PLANNING OF MITIGATION

Risk analysis and mitigation planning is the process of evaluating identified risks and developing suitable
strategies to minimize their impact on the project. Risk analysis helps in understanding the severity and
probability of occurrence of each risk, while mitigation planning focuses on implementing preventive
measures to reduce the chances of failure. Effective risk management improves system reliability and
ensures smooth execution of project activities.

For the SafeDriveVision project, different risks were analyzed based on their impact on system
performance and development activities. Appropriate mitigation plans were considered to minimize the
effect of these risks and maintain system efficiency.

Proper risk analysis and mitigation planning help reduce uncertainties during project development. It
also improves system reliability and ensures that SafeDriveVision performs efficiently under different
operating conditions. Effective mitigation strategies support the successful implementation of the project
and reduce the possibility of unexpected failures.

26
Risk Identified Impact on Project Mitigation Strategy

Use optimized algorithms and


Detection May generate false alerts or
proper threshold values to improve
Accuracy Risk incorrect detection results
detection accuracy

Maintain backup devices and


Hardware Failure May interrupt system
regularly check hardware
Risk execution and monitoring
components

System response may Use efficient algorithms and


Performance Risk become slow during systems with better processing
realtime processing capability

Software Libraries and frameworks Use compatible software versions


Compatibility Risk may cause execution issues and perform regular updates

Poor lighting and camera


Environmental Use proper camera placement and
position may reduce
Risk improve lighting conditions
detection quality

Resource Limited memory and storage Ensure sufficient RAM and storage
Availability Risk may affect performance availability

Loss of monitoring records Create regular data backups and


Data Storage Risk
and event logs maintain database integrity

Unauthorized access may


Implement authentication and
Security Risk compromise stored
secure storage mechanisms
information

27
CHAPTER – 3
SYSTEM ANALYSIS

28
CHAPTER – 3
SYSTEM ANALYSIS

System analysis is the process of studying and understanding the requirements, functionalities, and
operational behavior of a system before its implementation. It involves identifying the problems in
the existing system, determining user requirements, and proposing an effective solution to
overcome those limitations. System analysis helps developers understand how the system should
function and provides a foundation for system design and development.

The primary objective of system analysis is to gather information about the problem domain and
convert user requirements into a structured form that can be implemented effectively. It helps in
identifying system objectives, constraints, and necessary resources required for successful project
execution.

For the SafeDriveVision project, system analysis was performed to understand the major issues
associated with driver fatigue and distracted driving behavior. The analysis focused on studying
the causes of road accidents resulting from drowsiness, loss of attention, and mobile phone usage
while driving. Existing methods and systems were also studied to identify their limitations and
determine improvements that could be incorporated into the proposed solution.

The SafeDriveVision system is designed to monitor the driver's activities continuously and provide
real-time alerts whenever unsafe behavior is detected. Through proper system analysis, the project
requirements, functionalities, and expected outcomes were clearly identified before
implementation.

The system analysis process helps ensure that the developed solution satisfies project objectives
and provides an efficient, reliable, and user-friendly driver monitoring system.

3.1 PROBLEM ANALYSIS

Problem analysis is the process of identifying and understanding the issues that exist in a particular
system or environment. It helps in determining the root causes of a problem and finding suitable
29
solutions to overcome them. In software development, problem analysis is important because it
provides a clear understanding of system requirements and helps developers create effective
solutions.

In recent years, road accidents have become a major issue throughout the world. One of the primary
causes of these accidents is driver fatigue and distracted driving behavior. Drivers often become
tired during long journeys, lose concentration, or engage in activities such as mobile phone usage
while driving. These situations reduce the driver's attention level and increase the possibility of
accidents.

Driver drowsiness is a condition in which a driver experiences reduced alertness because of


tiredness or lack of sleep. It negatively affects reaction time, decision-making ability, and overall
driving performance. Similarly, distracted driving activities such as talking on mobile phones,
looking away from the road, and loss of concentration create dangerous situations that may result
in serious accidents.

Traditional safety systems mainly focus on vehicle performance and provide limited support for
monitoring driver behavior. Most systems are unable to continuously observe the driver's condition
and identify signs of fatigue or distraction in real time. Existing systems may also require expensive
hardware devices and specialized sensors, which increase implementation costs.

The SafeDriveVision project addresses these problems by developing an intelligent driver


monitoring system capable of analyzing driver behavior continuously. The system uses Artificial
Intelligence and Computer Vision techniques to detect eye closure, yawning, mobile phone usage,
and head movement in real time. It also generates immediate alerts to help drivers regain attention
and improve road safety.

Through proper problem analysis, the major causes and challenges associated with driver
monitoring were identified, enabling the development of an efficient and reliable solution for
reducing road accidents and improving driver safety.

30
3.2 EXISTING SYSTEM

The existing system refers to the currently available methods and technologies used for monitoring
driver behavior and preventing accidents caused by fatigue and distraction. Traditional driver
safety systems mainly focus on vehicle performance and basic warning mechanisms rather than
continuously monitoring the driver's condition.

Many existing systems use sensors and alarm-based mechanisms to identify unsafe situations.
Some systems rely on steering movement analysis, vehicle speed monitoring, lane departure
detection, and pressure sensors to determine whether a driver is losing attention. Certain advanced
vehicles include built-in driver assistance features that provide warnings when abnormal driving
patterns are detected.

Although these systems provide some level of safety support, they have several limitations. Most
existing systems are unable to directly analyze the driver's facial expressions and physical behavior.
They generally depend on vehicle-related parameters instead of continuously monitoring the
driver. As a result, these systems may fail to accurately detect fatigue, eye closure, yawning, or
distracted activities such as mobile phone usage.

Some modern driver monitoring systems use specialized sensors and infrared cameras for detection
purposes. However, these systems often require expensive hardware components and complex
installation procedures, increasing implementation cost. Such systems may also become less
effective under varying environmental conditions such as lighting changes and camera positioning
issues.

The existing systems provide only limited driver behavior analysis and may not offer complete
real-time monitoring. Therefore, there is a need for an intelligent and cost-effective system capable
of continuously analyzing driver activities and providing immediate alerts whenever risky behavior
is detected.

The SafeDriveVision project aims to overcome these limitations by using Artificial Intelligence
and Computer Vision techniques to provide accurate, real-time driver monitoring and improve
overall road safety.
31
3.3 PROBLEM WITH EXISTING SYSTEM

The existing driver monitoring systems have several limitations that reduce their effectiveness in
detecting driver fatigue and distracted behavior. Although traditional systems provide certain
safety features, they are often unable to continuously monitor the driver's condition and accurately
identify unsafe activities in real time. These limitations create challenges in maintaining driver
safety and preventing road accidents.

One of the major problems with existing systems is that they mainly focus on vehicle parameters
rather than monitoring the driver's behavior directly. Most systems analyze steering patterns, lane
movement, or vehicle speed instead of observing the driver's facial expressions and physical
activities. As a result, early signs of fatigue and distraction may not be detected effectively.

Another limitation is the inability to provide accurate real-time monitoring. Existing systems may
fail to continuously analyze activities such as eye closure, yawning, head movement, and mobile
phone usage. Incorrect detection or delayed response may reduce the effectiveness of the warning
system.

Many advanced driver monitoring systems require expensive hardware components such as
infrared cameras, specialized sensors, and dedicated processing units. The use of such equipment
increases implementation and maintenance costs, making the system less affordable.
Environmental conditions also affect the performance of existing systems. Factors such as poor
lighting conditions, camera positioning, shadows, and image quality variations may reduce
detection accuracy and generate false alerts.

Some existing systems also lack an interactive monitoring interface and detailed reporting features.
They may not provide proper visualization of driver status, alert history, or monitoring information
for future analysis.
The major problems of existing systems include limited driver behavior analysis, high
implementation cost, lower detection accuracy, hardware dependency, and reduced adaptability to
changing environmental conditions. These limitations create the need for a more intelligent,
accurate, and cost-effective solution capable of real-time driver monitoring and alert generation.

32
3.4 THE PROPOSED SYSTEM

The proposed system refers to the newly developed solution designed to overcome the limitations
of existing driver monitoring systems. The SafeDriveVision system is proposed as an intelligent
Driver Monitoring System that uses Artificial Intelligence and Computer Vision techniques to
continuously observe driver activities and provide real-time alerts whenever unsafe behavior is
detected.

The proposed system uses a camera to capture live video input from the driver and processes the
captured frames using image processing and machine learning techniques. The system analyzes
various facial features and driver movements to identify signs of fatigue and distraction. Facial
landmark detection methods are used to track important facial points such as eyes, mouth, and head
position for monitoring driver behavior.

The SafeDriveVision system is capable of detecting multiple activities such as eye closure, yawning,
mobile phone usage, and look-away situations. Eye closure detection helps identify driver
drowsiness, while yawn detection determines signs of fatigue. The mobile phone detection feature
identifies distracted driving behavior caused by phone usage. Head movement and look-away
detection monitor whether the driver is paying attention to the road.

The proposed system also calculates a dynamic focus score based on the driver's activities and
continuously updates the driver's safety status. Depending on the focus score, the system classifies
the driver's condition into categories such as SAFE, WARNING, and HIGH RISK. Whenever risky
behavior is detected, the system immediately generates voice alerts to regain the driver's attention.

The system includes a modern graphical dashboard that displays real-time monitoring information,
driver status, alert history, and performance indicators. Event records and captured images are stored
for future analysis and reporting purposes.

The proposed system provides several advantages over existing systems, including higher accuracy,
real-time monitoring, lower implementation cost, improved user interaction, and reduced
dependency on expensive hardware components.

33
CHAPTER – 4
SYSTEM DESIGN

34
CHAPTER - 4
SYSTEM DESIGN

System design is the process of defining the architecture, components, modules, interfaces, and
data flow of a software system before implementation. It provides a detailed representation of how
the system will function and how different components will interact with each other. System design
acts as a bridge between requirement analysis and coding by converting system requirements into
a structured and implementable model.

The primary objective of system design is to create an efficient framework that satisfies both
functional and non-functional requirements of the project. It helps in reducing complexity,
improving system organization, and ensuring smooth communication among different modules of
the application. Proper system design also improves maintainability, scalability, and performance
of the software system.

For the SafeDriveVision project, system design was developed to provide a clear understanding of
the workflow and interaction between various components of the system. The designed system
includes several modules such as image acquisition, face detection, eye closure detection, yawn
detection, mobile phone detection, look-away detection, alert generation, event logging, and
dashboard visualization.

The system captures real-time video frames through a webcam and processes them using image
processing techniques. The captured frames are analyzed using facial landmark detection and
object detection algorithms to identify driver behavior. Based on the detected activities, the system
calculates a focus score and updates the driver's status dynamically.

Whenever unsafe activities such as eye closure, yawning, mobile phone usage, or driver distraction
are identified, the system generates warning alerts and stores event information for future analysis.
The dashboard interface displays real-time information and monitoring results to improve user
interaction and system usability.

The following diagrams are used in system design to represent the structure and workflow of the
SafeDriveVision system:
4.1 Data Flow Diagram (DFD)
4.2 Entity Relationship Diagram (ER Diagram)
4.3 Use Case Diagram
4.4 Sequence Diagram
4.5 Class Diagram

These diagrams help in understanding system behavior and provide a visual representation of the
relationships and interactions among different components of the SafeDriveVision system.

35
4.1 DATA FLOW DIAGRAM

A Data Flow Diagram (DFD) is a graphical representation that shows the movement of data within
a system. It explains how data enters the system, how it is processed, and how the output is
generated. DFD helps in understanding the workflow and interaction among different modules.

In the SafeDriveVision system, the camera captures real-time video input from the driver. The
captured data is processed through face detection and activity detection modules. The system
identifies activities such as eye closure, yawning, phone usage, and look-away conditions. Based
on these detections, the system calculates the focus score, generates alerts, stores records in the
database, and displays results on the dashboard interface.

FIGURE – 1

36
4.2 ENTITY RELATIONSHIP DIAGRAM (ER DIAGRAM)

An Entity Relationship Diagram (ER Diagram) is a graphical representation used to show the
relationship between different entities within a system. It helps in understanding how data is
organized, stored, and connected in a database. ER diagrams simplify database design and improve
data management.

In the SafeDriveVision system, the ER diagram represents relationships between different entities
such as Driver, Detection Events, Alerts, Focus Score, and Database Records. The system stores
event information and monitoring details that are used for analysis and reporting purposes. The
relationships between these entities help in maintaining proper data organization and efficient
storage of monitoring records.

FIGURE - 2

37
4.3 USE CASE DIAGRAM

A Use Case Diagram is a graphical representation that describes the interaction between users and
the system. It identifies different functionalities of the system and shows how users interact with
those functionalities. The main purpose of a use case diagram is to provide a clear understanding
of system behavior and user activities.

In the SafeDriveVision system, the use case diagram represents the interaction between the driver
and the monitoring system. The system captures video input, detects driver activities such as eye
closure, yawning, phone usage, and look-away conditions, generates alerts, updates focus scores,
stores records, and displays information through the dashboard interface. The use case diagram
helps in understanding the relationship between the user and different system functionalities.

FIGURE - 3

38
4.4 SEQUENCE DIAGRAM

A Sequence Diagram is a graphical representation used to show the sequence of interactions between
different components of a system over time. It illustrates the flow of messages and operations performed
between system modules in a specific order. Sequence diagrams help in understanding how different
components communicate with each other during execution.

In the SafeDriveVision system, the sequence diagram represents the interaction between the camera,
image processing module, detection module, database, alert system, and dashboard interface. The camera
captures video input and sends it to the processing module. The processed data is analyzed for driver
activities such as eye closure, yawning, mobile phone usage, and look-away detection. Based on the
analysis, alerts are generated, event information is stored, and monitoring results are displayed on the
dashboard interface.

FIGURE - 4

39
4.5 CLASS DIAGRAM

A Class Diagram is a graphical representation used to describe the structure of a system by showing
classes, their attributes, methods, and relationships among them. It provides a detailed view of the object-
oriented design of a system and helps in understanding the interaction between different components.

In the SafeDriveVision system, the class diagram represents different classes involved in the project such
as Camera Module, Detection Module, Driver Class, Alert System, Database Module, and Dashboard
Interface. Each class performs specific operations and interacts with other classes for processing and
monitoring activities. The class diagram helps in organizing system components and improving
maintainability and scalability of the application

FIGURE -5

40
CHAPTER – 5
TECHNOLOGY

41
CHAPTER - 5
TECHNOLOGY

Technology refers to the collection of tools, programming languages, frameworks, libraries, and
software platforms used for developing and implementing a project. The selection of suitable
technologies is important because it directly affects system performance, efficiency, accuracy, and
usability. Different technologies provide specific functionalities required for developing various
modules of the application.

In the SafeDriveVision project, different technologies are used for image processing, machine
learning, object detection, graphical interface development, and database management. These
technologies work together to provide an intelligent driver monitoring system capable of detecting
driver fatigue and distracted behavior in real time.

The project primarily uses Python as the programming language due to its simplicity and extensive
support for Artificial Intelligence and Computer Vision applications. Image processing and
realtime video handling are performed using OpenCV, while Dlib is used for facial landmark
detection. The YOLO object detection algorithm is implemented for identifying mobile phone
usage. PySide6 is used for developing an interactive graphical user interface. SQLite is used for
data storage and maintaining event records generated by the monitoring system.

The use of these technologies helps improve system accuracy, reliability, and overall performance
while providing an efficient and user-friendly monitoring solution.

5.1 ABOUT PYTHON

Python is a high-level, interpreted, and general-purpose programming language widely used for
software development, Artificial Intelligence, Machine Learning, and Computer Vision
applications. It was developed by Guido van Rossum and is known for its simple syntax and easy
readability. Python supports object-oriented programming and provides a large collection of
libraries and frameworks that simplify application development.

42
Python has become one of the most popular programming languages because it allows developers
to write programs using fewer lines of code compared to many other programming languages. It
provides flexibility, portability, and extensive community support, making it suitable for both
small-scale and large-scale applications.

In the SafeDriveVision project, Python is used as the primary programming language for
implementing driver monitoring functionalities. It helps integrate different libraries such as
OpenCV, Dlib, PyTorch, PySide6, NumPy, and SQLite. Python also enables real-time video
processing, image analysis, object detection, and user interface development.

Python provides efficient support for machine learning and image processing operations, which
makes it highly suitable for developing intelligent systems like SafeDriveVision. The language
simplifies implementation and improves the overall performance and maintainability of the system.

5.1.1 USES OF PYTHON

Python is widely used in different areas of software development because of its simplicity,
flexibility, and extensive library support. It provides efficient solutions for developing applications
in various domains such as web development, data analysis, machine learning, and automation.
The availability of numerous frameworks and tools makes Python one of the most preferred
programming languages.

In the SafeDriveVision project, Python is used for implementing Artificial Intelligence and
Computer Vision functionalities. It helps in integrating different libraries and managing various
modules of the system efficiently.

The major uses of Python are as follows:


Python is used for Artificial Intelligence and Machine Learning applications.
It is used for image processing and computer vision systems.
It is used for web application development.
It is used for data analysis and scientific computing.
It is used for automation and scripting tasks.
It is used for developing desktop applications and graphical user interfaces.
43
It is used for database management and integration.
It is used for deep learning and neural network implementation.
It is used for real-time application development.
It is used for game development and multimedia applications.

Due to its powerful features and extensive library support, Python provides an efficient
environment for developing intelligent and real-time systems such as SafeDriveVision.

5.2 ABOUT SQLITE DATABASE

SQLite is a lightweight, serverless, and open-source relational database management system


used for storing and managing data efficiently. Unlike other database systems, SQLite does not
require a separate server for operation because the entire database is stored in a single file. It is
easy to install, simple to use, and suitable for small to medium-sized applications.

SQLite provides support for Structured Query Language (SQL), which is used to perform
operations such as data insertion, deletion, updating, and retrieval. It offers fast performance and
requires very little system configuration, making it highly suitable for desktop and embedded
applications.

In the SafeDriveVision project, SQLite is used for storing monitoring records and event
information generated by the system. The database maintains information such as detected
incidents, alert details, timestamps, and captured event records. It helps in organizing and managing
system data efficiently for future analysis and reporting.

SQLite provides several advantages such as simplicity, portability, low memory usage, and easy
integration with Python applications. Due to these features, it becomes an appropriate database
solution for implementing the SafeDriveVision system.

44
CHAPTER – 6
DATABASE

45
CHAPTER - 6
DATABASE

A database is an organized collection of data used to store, manage, and retrieve information
efficiently. Databases play an important role in software applications because they help maintain
records in a structured manner and enable quick access to stored information. Proper database
management improves system performance and ensures data consistency and reliability.

In the SafeDriveVision project, a database is used to store monitoring records generated during
system execution. The system continuously detects driver activities such as eye closure, yawning,
mobile phone usage, and look-away conditions. Information related to these events needs to be
stored for future analysis and reporting purposes.

SQLite database is used in this project because it is lightweight, serverless, and easy to integrate
with Python applications. The database stores different types of information such as event details,
alert information, timestamps, focus scores, and captured incident records. The stored data can be
used to analyze driver behavior and generate reports.

The database helps maintain proper organization of system information and supports efficient
retrieval of monitoring records. It also improves system reliability and allows future expansion of
functionalities such as cloud storage and analytics support.

6.1 TABLES

Tables are the basic components of a database used for storing information in an organized manner.
A table consists of rows and columns where rows represent records and columns represent
attributes or fields of the data. Tables help in maintaining structured information and allow efficient
storage, retrieval, and management of data.

In the SafeDriveVision project, database tables are used to store information generated during the
monitoring process. The system records different events such as eye closure detection, yawning,
mobile phone usage, look-away conditions, focus score details, and timestamps. These tables help
maintain historical records and support future analysis of driver behavior.

The main table used in the SafeDriveVision database is the Event Records table.

46
Table 6.1 Driver Information Table

Field Name Data Type Description

Driver_ID Integer Unique driver ID

Driver_Name Text Name of driver

Age Integer Driver age


Vehicle_No Text Vehicle number

Table 6.2 Event Record Table

Field Name Data Type Description


Event_ID Integer Unique event ID

Event_Type Text Type of event

Date Date Event date


Time Time Event time

Table 6.3 Focus Score Table

Field Name Data Type Description


Score_ID Integer Unique score ID

Focus_Score Integer Driver focus score

Status Text Driver status

Timestamp Text Recorded time

47
Table 6.4 Alert Table

Field Name Data Type Description

Alert_ID Integer Unique alert ID

Alert_Type Text Type of alert

Alert_Time Time Alert generation time

Alert_Status Text Alert condition

Table 6.5 Image Capture Table

Field Name Data Type Description

Image_ID Integer Unique image ID

Event_ID Integer Related event ID

Image_Path Text Image storage location

Capture_Time Time Time of image capture

The Event_Record table stores information related to all detected incidents and monitoring
activities. This information can be used later for report generation, system analysis, and future
enhancements. Proper table design improves database performance and ensures efficient handling
of monitoring data.

48
CHAPTER – 7
PROJECT DESIGNING AND CODING

49
CHAPTER - 7
PROJECT DESIGNING AND CODING

Project designing and coding is one of the most important phases in software development where
system requirements and design specifications are converted into an executable software
application. This phase focuses on implementing the planned modules, integrating different
technologies, and ensuring that all functionalities work together effectively. Proper project
designing simplifies implementation and improves the overall structure, maintainability, and
performance of the system.

For the SafeDriveVision project, the designing and coding phase involved developing different
modules responsible for real-time driver monitoring and integrating them into a complete system.
The project was designed in a modular manner so that each component performs a specific task
independently while interacting with other components.

The SafeDriveVision system was designed using a modular architecture approach where the
complete application is divided into multiple independent modules. Each module performs a
specific task and interacts with other modules to achieve the overall functionality of the system.
The modular design approach improves maintainability, flexibility, and scalability of the
application. It also simplifies debugging and future enhancement processes.

The overall workflow of the SafeDriveVision system begins with capturing real-time video input
from a webcam. The captured frames are then processed through image processing techniques to

50
identify and analyze driver behavior. Different detection algorithms work together to monitor
various activities and generate alerts whenever unsafe driving conditions are identified.

The system implementation consists of the following major modules:


1. Camera Input Module
2. Face Detection Module
3. Eye Closure Detection Module
4. Yawn Detection Module
5. Mobile Phone Detection Module
6. Look-Away Detection Module
7. Alert Generation Module
8. Database Management Module
9. Dashboard Interface Module

The interaction between these modules allows the system to continuously monitor driver activities
and provide real-time feedback. The camera module acquires input data, detection modules analyze
the driver's behavior, the alert module generates warnings, and the dashboard module displays
monitoring information to the user.

The coding implementation of the project was carried out using Python programming language
with the support of libraries such as OpenCV, Dlib, PyTorch, PySide6, NumPy, SciPy, and SQLite.
These technologies were integrated together to develop an intelligent and efficient Driver
Monitoring System.

Initial Setup and Library Import


The implementation of SafeDriveVision begins with importing required libraries and initializing
the resources needed for image processing, machine learning, and graphical interface operations.
These libraries provide support for real-time monitoring and driver behavior detection.
Code snippet:
import cv2
import dlib
import numpy as np
import torch

51
import sqlite3
import pygame
from [Link] import distance
from [Link] import QApplication

Description:
The above code imports libraries required for image processing, facial landmark detection, machine
learning operations, database management, audio generation, and graphical user interface
development.

System Initialization
The system initialization process loads the facial landmark predictor and activates the webcam for
monitoring.
Code snippet:

detector = dlib.get_frontal_face_detector()

predictor =
dlib.shape_predictor( "shape_predictor_81_face_landmarks.dat
"
)

cap = [Link](0)

Description:
The detector identifies faces within the video frame, while the facial landmark predictor extracts
facial points required for eye, mouth, and head movement analysis. The webcam is initialized to
continuously capture live video input.

Main Processing Flow


The main processing flow continuously captures image frames and sends them for analysis.
Code snippet:
while True:

52
if not ret:
break

gray =
[Link]( frame,
cv2.COLOR_BGR2GRAY
)
Description:
This code continuously captures frames from the webcam and converts them into grayscale format
for efficient processing and analysis.

Camera Input Module


The first module of the system is the camera input module, which captures live video frames
continuously from a webcam. This module acts as the primary source of data for the system because
all further processing depends on the captured video feed.

The camera continuously captures images of the driver and sends them for further processing.
Realtime frame acquisition is important because the system needs immediate analysis for
generating alerts.
The camera module performs the following tasks:
1. Capturing live video input.
2. Converting video streams into image frames.
3. Sending frames to image processing modules.
4. Maintaining continuous monitoring.

Figure 7.1 Camera Input Interface

53
Code snippet:

cap = [Link](0)

ret, frame = [Link]()


if not ret:
return

Description:
This code initializes the webcam and continuously captures frames for processing..

Face Detection Module


The face detection module identifies the driver's face within the captured frame. It ensures that
further processing is performed only when a face is detected.
Dlib facial landmark detection techniques are used to locate facial regions and extract important
facial points.
Functions performed by this module include:
1. Detecting the driver's face.
2. Tracking facial movement.
3. Extracting facial landmark points.
4. Providing facial coordinates for analysis.

Figure 7.2 Face Detection Result


Code snippet:

gray = [Link](frame, cv2.COLOR_BGR2GRAY)


faces = detector(gray, 0)

Eye Closure Detection Module


54
Description:
The captured frame is converted into grayscale and Dlib is used to detect the driver's face.

Eye Closure Detection Module


The eye closure detection module monitors eye movements to identify signs of driver fatigue and
drowsiness.
Eye Aspect Ratio (EAR) is calculated using facial landmark points around the eyes. If the eyes
remain closed for a certain duration, the system recognizes a drowsiness condition.
The module performs:
1. Eye landmark extraction.
2. Eye Aspect Ratio calculation.
3. Eye movement analysis.
4. Drowsiness detection.

Figure 7.3 Eye Closure Detection


Code snippet:
left_eye = pts[36:42]
right_eye = pts[42:48]

ear = (
eye_aspect_ratio(left_eye) +
eye_aspect_ratio(right_eye)
) / 2.0

Description:
Eye Aspect Ratio (EAR) is calculated to determine whether the driver's eyes are closed.

55
Yawn Detection Module
Yawning is one of the common symptoms of driver fatigue. The system analyzes mouth
movements to determine whether the driver is yawning.
The Mouth Aspect Ratio (MAR) technique is used to measure mouth opening conditions and
identify fatigue symptoms.
Functions of this module include:
1. Mouth landmark extraction.
2. Mouth Aspect Ratio calculation.
3. Yawn identification.
4. Fatigue analysis.

Figure 7.4 Yawn Detection


Code snippet:

mouth = pts[48:68]
mar = mouth_aspect_ratio(mouth)

if mar > 0.75:


self.yawn_count += 1

Description:
Mouth Aspect Ratio (MAR) is used to identify yawning behavior.

Mobile Phone Detection Module


The mobile phone detection module identifies distracted driving behavior caused by mobile phone
usage.

56
The YOLO object detection model is used to identify mobile phones present in video frames.

Figure 7.5 Mobile Phone Detection


Functions include:
1. Detecting mobile phone presence.
2. Identifying distracted behavior.
3. Generating warning alerts.
4. Updating monitoring records.

Code snippet:

results = [Link](img)
detections = [Link][0]

for detection in detections:


if int(detection[5]) == 67:
self.phone_count += 1

Description:
YOLO object detection identifies mobile phone usage during driving.

Look-Away Detection Module


This module monitors the driver's head movement and face orientation.
The system calculates the position of facial landmarks and determines whether the driver is looking
away from the road.
Functions include:
1. Head movement tracking.
57
2. Face orientation analysis.
3. Driver attention monitoring.
4. Alert generation.

Figure 7.6 Look-Away Detection


Code snippet:

eye_left = pts[36]
eye_right = pts[45]
nose_tip = pts[33]

head_angle =
calculate_head_angle( [Link](eye_l
eft), [Link](eye_right),
[Link](nose_tip)
)

if head_angle < 65 or head_angle > 115:


self.COUNTER_LOOK += 1

if self.COUNTER_LOOK >= 6:
self.lookaway_count += 1
sound_thread("regarder")
58
Description:
The system calculates head angle using facial landmark points and determines whether the driver
is looking away from the road. If the head orientation exceeds the threshold value for a specified
duration, the system identifies it as a distraction event and generates a voice alert.

Focus Score Calculation Module


The focus score module continuously calculates the driver's attention level based on detected
activities.
The score decreases when unsafe behaviors are detected and gradually increases when the driver
becomes attentive.
Functions include:
1. Monitoring driver behavior.
2. Calculating focus score.
3. Updating safety status.
4. Maintaining driver performance records.

Code snippet:

if self.focus_score < 80:


self.status_text = "WARNING"

if self.focus_score < 50:


self.status_text = "HIGH RISK"

Alert Generation Module


The alert module provides immediate notifications whenever dangerous conditions are detected.
Voice-based warning messages are generated to alert the driver and regain attention.
Functions include:
1. Audio alert generation.
2. Warning message display.
3. Notification management.
4. Event handling.

Code snippet:

if self.COUNTER1 >= 4:
sound_thread("eye")
save_event(img, "Eyes Closed")

if self.COUNTER_YAWN >= 5:
sound_thread("reposer")
save_event(img, "Yawning")

59
if self.COUNTER2 >= 3:
sound_thread("phone")
save_event(img, "Phone Detected")

if self.COUNTER_LOOK >= 6:
sound_thread("regarder")
save_event(img, "Look Away")

Database Management Module


The database module stores monitoring records and detected incidents.
SQLite database is used for maintaining information generated by the system.
Functions include:
1. Event storage.
2. Incident record management.
3. Timestamp generation.
4. Data retrieval.

Figure 7.7 Dashboard Interface


Code snippet:

conn = [Link]("driver_monitoring.db")
cursor = [Link]()

[Link]("""
60
CREATE TABLE IF NOT EXISTS Event_Record(
Event_ID INTEGER PRIMARY KEY AUTOINCREMENT,
Event_Type TEXT,
Date TEXT,
Time TEXT,
Focus_Score INTEGER,
Status TEXT
)
""")

[Link]()
[Link]()

Analytics Module

The analytics module is responsible for monitoring and analyzing driver activities and generating
statistical information based on detected events. It continuously tracks driver behavior such as eye
closure, yawning, mobile phone usage, and look-away conditions. Based on these activities, the
system calculates a focus score and determines the driver's current status. The analytics module
helps in identifying driving patterns and provides useful information for performance evaluation.
Functions performed by this module include:
1. Monitoring driver activities
2. Calculating focus score
3. Updating driver status
4. Maintaining alert statistics
5. Generating activity analysis

Figure 7.8 Analytics Dashboard


61
Code snippet:

self.focus_score = 100

if self.phone_count > 0:
self.focus_score -= 15

if self.lookaway_count > 0:
self.focus_score -= 8

if self.yawn_count > 0:
self.focus_score -= 5

if self.focus_score < 80:


self.status_text = "WARNING"

if self.focus_score < 50:


self.status_text = "HIGH RISK"

Description:
The above code continuously analyzes driver activities and updates the focus score according to
detected events. Based on the calculated score, the system categorizes the driver's condition into
SAFE, WARNING, and HIGH RISK states. The analytics module provides useful information
regarding driver attention level and improves monitoring efficiency.

Dashboard Interface Module


The graphical user interface module provides a modern dashboard for displaying monitoring
results.
PySide6 framework is used to create an interactive dashboard containing real-time information.
The dashboard displays:
1. Camera feed.
2. Focus score.
3. Driver status.
4. Alert history.
5. Detection counters.

62
Figure 7.9 Dashboard Interface
Code snippet:

self.status_card.setText(status)
[Link](str(self.focus_score))

Description:
The dashboard displays live camera feed, focus score, alerts, and driver status.

The coding and integration of these modules resulted in the development of a complete AI-based
Driver Monitoring System capable of performing real-time detection and providing enhanced
safety features for drivers.

63
CHAPTER – 8
SOFTWARE TESTING

64
CHAPTER - 8
SOFTWARE TESTING
Software testing is the process of evaluating a software system to identify errors, defects, and
inconsistencies before deployment. It is an important phase in software development because it
ensures that the developed application performs according to the specified requirements and
objectives. Software testing helps verify whether the system functions correctly under different
operating conditions and ensures reliability, accuracy, and quality of the software product.

The main objective of software testing is to identify and remove defects from the system and ensure
that all modules work efficiently. Testing helps developers determine whether the software satisfies
user requirements and performs the intended functions properly. It also helps in improving system
performance and reducing the chances of software failure during execution.

In the SafeDriveVision project, software testing was performed to verify the proper functioning of
various modules such as face detection, eye closure detection, yawn detection, mobile phone
detection, look-away detection, alert generation, database storage, and dashboard interface.
Different testing methods were applied to ensure that the system accurately detects driver activities
and generates appropriate responses.

Testing was also performed to evaluate system performance under different conditions such as
lighting variations, facial movements, camera positions, and multiple driver activities. The testing
process helped identify issues related to detection accuracy and system performance, allowing
necessary corrections and improvements to be implemented.
Proper software testing ensures that the SafeDriveVision system operates efficiently and provides
reliable real-time monitoring and alert functionality.

9.1 OBJECTIVES OF TESTING

Software testing is performed to verify whether the developed software system functions according
to the specified requirements and objectives. The primary objective of testing is to identify errors
and ensure that all modules of the system operate correctly under different conditions. Testing
helps improve the quality, reliability, and performance of the application and ensures that the final
product meets user expectations.
65
For the SafeDriveVision project, testing was performed to evaluate the functionality of different
modules and ensure that the system provides accurate and real-time driver monitoring. The testing
process focused on validating detection algorithms, graphical user interface behavior, alert
generation mechanisms, and database operations.

The major objectives of testing for the SafeDriveVision system are described below:

1. To Verify System Functionality


The main objective of testing is to verify that all features of the SafeDriveVision system work
according to the specified requirements. Functionalities such as face detection, eye closure
detection, yawn detection, phone detection, and look-away detection should operate correctly.

2. To Identify and Remove Errors


Testing helps in identifying bugs and errors present in the system. Detecting errors during
development reduces future issues and improves software quality.

3. To Validate Detection Accuracy


The system uses Artificial Intelligence and Computer Vision algorithms for driver monitoring.
Testing ensures that these algorithms provide accurate results and minimize false detections.

4. To Ensure Real-Time Performance


Since SafeDriveVision performs continuous video processing and monitoring, testing is required
to ensure that the system provides immediate responses without noticeable delays.

5. To Improve Reliability
Testing verifies that the system operates consistently under different operating conditions and
provides stable performance during long execution periods.

6. To Verify User Interface Functionality


The graphical dashboard and user interface should operate properly and display monitoring
information accurately. Testing ensures proper interaction between users and the application.

66
7. To Evaluate Database Operations
The system stores event records and monitoring information in the database. Testing verifies
correct insertion, retrieval, and storage of data.

8. To Improve System Quality


Testing improves the overall quality of the software by identifying weaknesses and ensuring proper
implementation of all functionalities.

9. To Ensure User Satisfaction


The final objective of testing is to ensure that the developed application satisfies user requirements
and provides an effective driver monitoring solution.

The testing objectives help ensure that the SafeDriveVision system performs efficiently and
reliably while providing accurate real-time monitoring and safety features.

9.2 TESTING TYPES

Software testing includes different testing methods used to verify the correctness, performance,
reliability, and functionality of a software system. Different testing types are applied during
software development to identify errors and ensure that the application operates according to
specified requirements. Each testing type focuses on a particular aspect of the system and helps
improve overall software quality.

For the SafeDriveVision project, different testing types were applied to evaluate system behavior
and ensure proper functioning of all modules such as face detection, eye closure detection, yawn
detection, mobile phone detection, look-away detection, alert generation, and database
management.

1. Unit Testing
Unit testing is performed to test individual modules or components of a system separately. In this
testing method, each module is tested independently to verify whether it performs its intended
function correctly.

67
In the SafeDriveVision project, unit testing was performed for different modules such as face
detection, eye detection, yawn detection, mobile phone detection, and alert generation modules.
Each module was tested individually before integrating it into the complete system.

2. Integration Testing
Integration testing is performed after unit testing to verify whether different modules work properly
when combined together. This testing ensures that communication between modules occurs
correctly and data is transferred without errors.

In the SafeDriveVision system, integration testing was performed to verify interaction among
camera input, image processing, object detection, database management, and dashboard modules.

3. System Testing
System testing is used to evaluate the complete software system as a whole. This testing ensures
that all integrated components function according to project requirements.

For SafeDriveVision, system testing was performed to verify complete driver monitoring
functionality including video capture, fatigue detection, alert generation, and event storage.

4. Functional Testing
Functional testing verifies whether all system functionalities operate according to specified
requirements. It focuses on validating outputs based on given inputs.

In the SafeDriveVision project, functional testing was used to verify activities such as eye closure
detection, yawn detection, phone usage detection, focus score generation, and voice alerts.

5. Performance Testing
Performance testing evaluates the speed, efficiency, and response time of the software system
under different operating conditions.

For SafeDriveVision, performance testing was performed to ensure that real-time video processing
and driver monitoring operations occur without significant delays.

68
6. User Interface Testing
User Interface testing verifies that graphical components and interactions function correctly and
provide a good user experience.

In the SafeDriveVision project, dashboard components such as camera feed display, focus score
indicators, alert history, and status panels were tested.

7. Database Testing
Database testing ensures that information is stored and retrieved correctly from the database.
For SafeDriveVision, database testing was performed to verify storage of event records,
timestamps, and monitoring information.

8. Validation Testing
Validation testing determines whether the developed software satisfies user requirements and
achieves project objectives.

In the SafeDriveVision project, validation testing ensured that the application successfully
monitored driver behavior and generated alerts for unsafe conditions.

Applying these testing methods improved the reliability and performance of the SafeDriveVision
system and ensured accurate operation under different conditions.

9.3 TEST CASES

Test cases are predefined conditions and input values used to verify whether the software system
performs according to the expected behavior. A test case contains information about the
functionality being tested, input conditions, expected output, and actual results obtained after
execution. Test cases help identify errors and ensure that all system functionalities operate
correctly.

For the SafeDriveVision project, different test cases were prepared to validate the functionality of
individual modules and verify overall system performance. Testing was performed on different
69
driver activities such as eye closure, yawning, mobile phone usage, look-away detection, and alert
generation.

The following test cases were used during project testing:

Test
Test Scenario Expected Result Status
Case ID
Camera Camera starts
TC01 Pass
Initialization successfully

TC02 Face Detection Driver face detected Pass

Eye Closure Alert generated for


TC03 Pass
Detection closed eyes

Yawning detected
TC04 Yawn Detection Pass
correctly

Phone usage
TC05 Phone Detection Pass
identified

Look-Away Driver distraction


TC06 Pass
Detection detected

Focus Score Focus score


TC07 Pass
Update changes correctly

Audio warning
TC08 Voice Alert Pass
generated

Data stored
TC09 Event Storage Pass
successfully

Dashboard Live data displayed


TC10 Pass
Update correctly

These test cases helped in verifying system functionality and ensuring that all modules of the
SafeDriveVision system performed according to the specified requirements. Testing results

70
confirmed that the system successfully monitored driver activities and generated appropriate
responses during execution

9.4 TEST APPLIED

Testing was applied to the SafeDriveVision system to ensure that all functionalities operated
correctly and produced accurate results under different conditions. Various testing methods were
used during development and implementation to verify system performance, identify errors, and
improve overall reliability. The testing process helped ensure that the developed system satisfied
all functional requirements and provided effective driver monitoring.

Different tests were applied to evaluate the behavior of the system during real-time execution. The
application was tested using different input conditions such as changes in facial expressions, eye
movement, head movement, mobile phone usage, and varying environmental conditions. These
tests helped determine whether the system generated correct outputs and appropriate alerts.

Functional Testing Applied


Functional testing was applied to verify that each feature of the system performed according to the
specified requirements. Functionalities such as face detection, eye closure detection, yawn
detection, phone detection, focus score calculation, and alert generation were tested individually
and as part of the integrated system.

Integration Testing Applied


Integration testing was performed after combining all modules into a complete system. This testing
ensured that communication between camera input, image processing modules, detection modules,
database management, and dashboard interface occurred correctly without any interruption.

Performance Testing Applied


Performance testing was applied to analyze the speed and efficiency of the system. Real-time video
processing and detection algorithms were evaluated to ensure that the application responded
quickly and generated alerts without significant delays.

71
User Interface Testing Applied
User interface testing was performed to verify the graphical dashboard functionality. The camera
feed, focus score display, alert notifications, and monitoring panels were tested to ensure proper
visualization and user interaction.

Database Testing Applied


Database testing was used to verify that monitoring records and event information were stored
correctly. Event logs, timestamps, and captured data were checked to ensure accurate storage and
retrieval.

Validation Testing Applied


Validation testing was applied to determine whether the SafeDriveVision system fulfilled user
requirements and project objectives. The complete system was executed under different conditions
to verify correct functionality and expected outcomes.

The application of these testing methods improved the quality and reliability of the
SafeDriveVision system. Testing confirmed that the system successfully performs real-time driver
monitoring and provides accurate detection and alert mechanisms.

72
CHAPTER – 8
LIMITATIONS AND FUTURE ENHANCEMENT

73
CHAPTER - 8
LIMITATIONS AND FUTURE ENHANCEMENT

The SafeDriveVision system provides an intelligent approach for monitoring driver activities and
reducing risks caused by fatigue and distraction. Although the developed system performs
realtime monitoring and detection efficiently, certain limitations still exist due to technical
constraints and environmental factors. Identifying these limitations is important because it helps
in understanding areas that can be improved in future versions of the system. Future
enhancements can improve accuracy, functionality, and overall system performance.

8.1 LIMITATION
Although the SafeDriveVision system provides an effective solution for detecting driver fatigue
and distracted driving behavior, the system still has certain limitations that may affect its
performance under different conditions. These limitations arise due to hardware constraints,
environmental conditions, and the use of image processing techniques. Understanding these
limitations is important because it helps identify areas for improvement and guides future system
enhancements.

1. Dependence on Lighting Conditions


The performance of the system depends significantly on lighting conditions. Since the system
captures real-time images through a camera, insufficient lighting or excessive brightness can affect
image quality and reduce detection accuracy. Poor lighting conditions may make it difficult for the
system to detect facial landmarks properly and can result in incorrect outputs.

2. Camera Position Sensitivity


The system requires proper camera placement for accurate monitoring of the driver's face. Incorrect
camera angles or improper positioning may reduce the visibility of facial features and affect system
performance. If the camera does not capture the driver's face correctly, the detection algorithms
may fail to identify driver activities.

3. Hardware Dependency
The SafeDriveVision system requires suitable hardware resources for smooth execution. Real-time
video processing and Artificial Intelligence operations consume considerable processing power

74
and memory. Systems with lower hardware specifications may experience performance issues such
as slower response time and reduced efficiency.

4. Possibility of False Alerts


The system may occasionally generate false alerts because of sudden facial movements, changes
in head position, or environmental disturbances. Incorrect detections can occur when the driver
changes posture rapidly or when external factors interfere with image processing.

5. Limited Environmental Adaptability


The system may face difficulties under different environmental conditions such as shadows,
background disturbances, reflections, or varying image quality. Such factors can reduce the
accuracy of facial feature detection and affect system reliability.

6. Dependence on Continuous Camera Input


The system completely relies on continuous camera operation for monitoring driver activities. Any
interruption in camera functionality or video capture failure can stop the monitoring process and
reduce system effectiveness.

7. Limited Physiological Analysis


The current implementation mainly focuses on facial behavior and object detection techniques. It
does not monitor physiological conditions such as heart rate, body temperature, stress level, or
brain activity that could provide additional information regarding driver health and alertness.

8. Computational Complexity
Real-time monitoring involves continuous image processing and execution of multiple algorithms
simultaneously. This requires significant computational resources and may increase system
complexity. Higher computational requirements may affect performance on low-end devices.

9. Dependency on Facial Visibility


The system requires clear visibility of the driver's face for accurate detection. Objects such as
masks, sunglasses, head coverings, or any obstruction covering facial features may reduce
detection accuracy and affect system operation.

75
10. Limited Real-Time Accuracy
Although the system provides real-time monitoring, slight delays may occur during processing
because of camera input, image analysis, and execution of multiple detection algorithms. These
delays may slightly affect immediate response generation.

Despite these limitations, the SafeDriveVision system successfully performs real-time driver
monitoring and provides an intelligent approach for reducing accidents caused by driver fatigue
and distracted driving behavior. Future improvements and technological advancements can further
reduce these limitations and improve overall system performance.

8.2 FUTURE ENHANCEMENT

The SafeDriveVision system has been designed to monitor driver behavior and improve road safety
through Artificial Intelligence and Computer Vision techniques. Although the developed system
provides real-time monitoring and detection functionalities, there are several opportunities for
future improvements that can enhance the capabilities, efficiency, and intelligence of the system.
Future enhancements focus on increasing detection accuracy, expanding system functionalities,
and integrating modern technologies for better performance.

1. GPS Integration for Location Tracking


One of the major future enhancements for the SafeDriveVision system is the integration of GPS
technology. GPS integration can help track the real-time location of the vehicle during monitoring.
If a critical situation is detected, such as continuous driver drowsiness or loss of attention, the
system can automatically provide location details for emergency support. This feature can improve
driver safety and provide immediate assistance during emergencies.

2. Emergency SMS and Notification System


The current system generates only voice alerts for warning the driver. In future versions, an SMS
and notification system can be integrated to send emergency messages to family members, nearby
hospitals, or emergency services. If the system detects severe risk conditions continuously, it can
automatically send notifications with location details and driver information.

76
3. Cloud Storage Integration
Currently, monitoring records and event information are stored locally in the database. Future
implementation can use cloud storage technology for storing data online. Cloud integration can
provide secure storage, remote access, and easier management of monitoring records. It can also
allow users to access monitoring information from different devices.

4. Mobile Application Development


A mobile application can be developed as an extension of the SafeDriveVision system. The mobile
application can provide real-time notifications, monitoring reports, and alert information directly
on smartphones. Users can monitor driver activities remotely and receive updates from any
location.

5. Advanced Artificial Intelligence Models


The current implementation uses facial landmark detection and object detection algorithms for
monitoring activities. Future versions can incorporate more advanced Artificial Intelligence and
Deep Learning models that provide higher accuracy and better performance. Advanced models can
reduce false detections and improve the efficiency of the monitoring system.

6. Integration of Additional Sensors


The present system mainly depends on camera input for monitoring driver activities. Additional
sensors can be integrated to collect more information regarding driver conditions. Sensors such as
heart rate sensors, temperature sensors, steering wheel sensors, and motion sensors can provide
additional health and behavioral information.

7. Emotion Recognition System


Future versions can include facial emotion recognition functionality. The system can analyze facial
expressions and determine emotional states such as stress, anger, fear, sadness, or frustration.
Monitoring emotional conditions can help identify unsafe driving situations and improve road
safety.

77
8. Internet of Things (IoT) Integration
Internet of Things technology can be integrated to establish communication between vehicles and
monitoring systems. IoT support can allow the system to share information with smart devices,
vehicle systems, and cloud servers for better monitoring and control.

9. Enhanced User Dashboard


The graphical user interface can be improved further by adding advanced visualization features
such as graphs, analytical reports, driver performance trends, and interactive monitoring panels.
This enhancement can improve user experience and simplify data analysis.

10. Deployment as a Standalone Application


Future implementation can convert the current project into a standalone desktop or mobile
application that can be installed and used directly without requiring manual software setup. This
would increase accessibility and simplify deployment.
The implementation of these future enhancements can transform SafeDriveVision into a more
intelligent, scalable, and advanced driver assistance system. Such improvements can increase
system efficiency, provide better safety mechanisms, and contribute significantly to reducing road
accidents caused by driver fatigue and distraction.

78
CONCLUSION

79
CONCLUSION

The SafeDriveVision project was developed to provide an intelligent and efficient solution for
monitoring driver behavior and improving road safety. The system successfully uses Artificial
Intelligence and Computer Vision techniques to detect unsafe driving conditions such as eye
closure, yawning, mobile phone usage, and look-away situations in real time. By continuously
monitoring the driver's activities, the system helps identify fatigue and distraction, which are
among the major causes of road accidents.

The implementation of facial landmark detection, object detection algorithms, and real-time image
processing techniques enabled the system to generate accurate results and immediate warning
alerts. The focus score mechanism and interactive dashboard further improved the effectiveness of
the system by providing a clear representation of the driver's condition and monitoring information.

The project successfully achieved its main objectives by detecting driver activities, generating
voice alerts, maintaining event records, and providing a user-friendly monitoring interface. The
developed system demonstrated that Artificial Intelligence can be effectively applied to
transportation systems for enhancing driver safety and reducing accident risks.

Although certain limitations exist, the proposed future enhancements such as cloud integration,
GPS support, mobile applications, and additional sensors can further improve the functionality and
intelligence of the system. Overall, the SafeDriveVision project provides a reliable, cost-effective,
and practical solution for real-time driver monitoring and contributes significantly toward
improving road safety and reducing accidents caused by driver fatigue and distracted behavior.

80
REFERENCES

81
REFERENCES

• OpenCV Official Documentation – Used for real-time image processing and video capture.
• dlib Official Documentation – Used for facial landmark detection and face recognition.
• PyTorch Official Website – Used for AI and deep learning model support.
• NumPy Official Documentation – Used for numerical and mathematical operations.
• SciPy Official Documentation – Used for scientific calculations such as EAR and MAR
distance measurement.
• pygame Official Website – Used for alarm sound generation.
• pywhatkit Documentation – Used for sending WhatsApp alert messages.
• SQLite Official Website – Used for database management and log storage.
• IP Webcam App Information – Used for converting mobile camera into a wireless webcam.
• Research papers and journal articles related to Driver Drowsiness Detection using Machine
Learning, Computer Vision, and Artificial Intelligence.

82
83
1

You might also like