Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 29

Automated Driver Drowsiness Detection System

Minor project report


Submitted By
Naren Karthikeyan R
(20BCA031)

Under the Guidance of


Dr. C. Arun Priya
Associate Professor
Department of Computer Applications\

In partial fulfilment of the requirements for the Award of the Degree of


BACHELOR OF COMPUTER APPLICATIONS of Bharathiar University,
Coimbatore

DEPARTMENT OF COMPUTER APPLICATIONS


PSG COLLEGE OF ARTS & SCIENCE
An Autonomous College – Affiliated to Bharathiar University
Accredited with A Grade by NAAC (3rd Cycle)
College with Potential for Excellence
(Status awarded by the UGC)
Star College Status Awarded by DBT-MST
An ISO 9001:2015 Certified Institution.
Civil Aerodrome POST
Coimbatore-641014

November 2022
DEPARTMENT OF COMPUTER APPLICATIONS
PSG COLLEGE OF ARTS & SCIENCE
An Autonomous College – Affiliated to Bharathiar University
Accredited with A Grade by NAAC (4th Cycle)
College with Potential for Excellence
(Status awarded by the UGC)
Star College Status Awarded by DBT-MST
An ISO 9001:2015 Certified Institution.
Civil Aerodrome POST
Coimbatore-641014

CERTIFICATE

This is to certify that this project work entitled “Automated Driver Drowsiness
Detection System” is a Bonafide record of work done by Naren Karthikeyan R
(20BCA031) in partial Fulfillment of the requirement for the award of Degree of
Bachelor of Computer Applications of Bharathiar University.

Faculty Guide Head of the


Department

Submitted for Viva - voce Examination held on


Internal Examiner External Examiner
DECLARATION

I, Naren Karthikeyan R (20BCA031), hereby declare that this minor project work
entitled " Automated Driver Drowsiness Detection System", is submitted to
PSG College of Arts & Science (Autonomous), Coimbatore in partial Fulfillment
for the award of BACHELOR OF COMPUTER APPLICATIONS, is a record
of original work done by me under the supervision and guidance of Dr. ARUN
PRIYA C. Assistant Professor in Department of Applications PSG College of arts
& science, Coimbatore.

This project work has not yet been submitted by me for the award of any other
Degree / Diploma / Associative ship / Fellowship or any other similar degree to
any other University.

PLACE: COIMBATORE Naren Karthikeyan R


DATE : 29-11-2022 (20BCA031)
ACKNOWLEDGEMENT

With great gratitude I would like to acknowledge the help of those who
contributed their valuable suggestions and timely assistance to complete this work.

First and foremost, I would like to extend my heartfelt gratitude and place
my sincere thanks to THIRU. L. GOPALAKRISHNAN managing Trustee, PSG
& SONS Charities,
Coimbatore for providing all sorts of support and necessary facilities throughout
the course.

I express my deep sense of gratitude to Secretary, Dr. T. KANNAIAN


M.Sc., MTech., Ph.D., for permitting me to undertake this work.

I thank our Principal, Dr. D. BRINDHA M.Sc., MPhil., Ph.D.,


M.A(Yoga)., for her support and constant source of inspiration through the course
of project.

Also, I would like to thank our Vice Principal, Dr. A. ANGURAJ M.Sc.,
M.Phil., PhD., for his support.
I own my deepest gratitude to Dr. R. SUDHA MCA., M.Phil., Ph.D., Head of
the Department of Computer Applications, PSG College of Arts & Science,
Coimbatore, for her consultancy, encouraging me to pursue new goals and ideas.
My sincere thanks to Dr. C. ARUN PRIYA ., Assistant professor, PSG College
of Arts & Science, Coimbatore for her valuable suggestions, support and guidance
as my internal guide, without which my work would not have reached the present
form.
Last but not the least, I am greatly indebted to my parents and friends for
their kind cooperation in each and every step I took in this project.

ABSTRACT
Abstract

The project Automated Drowsiness Detection System deals with a countless


number of people driving on the highway day and night. Taxi drivers, bus drivers, truck drivers
and people traveling long-distance suffer from lack of sleep. Due to which it becomes very
dangerous to drive when feeling sleepy.

The majority of accidents happen due to the drowsiness of the driver. So, to prevent these
accidents we will build a system using Java, xml and google vision API which will alert the
driver when he feels sleepy.

Drowsiness detection is a safety technology that can prevent accidents that are caused by drivers
who fell asleep while driving .If the drivers eyes remain closed for more than a certain period of
time, the driver is said to be drowsy and an alarm is sounded.
AI techniques and Google Vision API for Android are utilized to analyze data for monitoring,
detecting, predicting and controlling driver drowsiness. Finally, the android application is
prepared end-to-end for the user and applied for data collection in the future research
experiment. The objective of this intermediate Java project is to build an automated
drowsiness detection system that will detect that a person’s eyes are closed for a few
seconds. This system will alert the driver when drowsiness is detected. detection This is a
safety technology that can prevent accidents that are caused by drivers who fell asleep while
driving. The system so designed is a non-intrusive real-time monitoring system. The priority is

on improving the safety of the driver without being obtrusive. In this project the eye blink of the
driver is detected. This project was developed inorder to improve the security senses in
roadways and also to prevent the loss of life due to reasons like fatigue or carelessness .This
provides the solution for transport companies to have a higher probability of preventing
accidents , which eventually result the company in loss . The system yet has many future
enhancements that could even result in a greater usage in other sectors as well.

TABLE OF CONTENTs

CONTENTS PAGE NO

1. INTRODUCTION 1

2. SYSTEM SPECIFICATION
1. Hardware Specification 3
2. Software Specification 4
3. Software description 5

3. SYSTEM ANALYSIS 8
1. Existing system 8
2. Proposed system 9

4. SYSTEM DESIGN 10
1.Introduction 10
2.Input Design 10
3.Flowchart Diagram 11

5. SYSTEM TESTING 12
1.Testing 12
2.Types of Testing 15

6.SCOPE FOR FUTURE ENHANCEMENT 16

7.CONCLUSION 17

8.BIBLOGRAPHY 17

9.APPENDICES 18
1.Form Design 18
2.Sample Coding 20

1. INTRODUCTION

Automated Driver Drowsiness Control Technology Using Artificial Intelligence


based Decision Support System

The objective of this intermediate Java project is to build an


automated drowsiness detection system that will detect that a person’s eyes are closed
for a few seconds. This system will alert the driver when drowsiness is detected.

The main purpose of this project is to develop the methodology to detect and predict driver
drowsiness at the early stages using physical and physiological variables. A feasibility test is
conducted to evaluate the accuracy and performance of the proposed methodology. AI
techniques and Google Vision API for Android are utilized to analyze data for monitoring,
detecting, predicting and controlling driver drowsiness. Finally, the android application is
prepared end-to-end for the user and applied for data collection in the future research
experiment.Drowsiness detection is a safety technology that can prevent accidents that are caused
by drivers who fell asleep while driving. The system so designed is a non-intrusive real-time
monitoring system. The priority is on improving the safety of the driver without being obtrusive.

In this project the eye blink of the driver is detected.


The modules of the system developed are as follows

1) Home Module

The home module presents the user to select the time variants for the closing of eyes and
the user can start by clicking on the start button

2) Initiation Module:

In this module the user can start the application as per the user’s start time , it will be
non active and idle during times before the start of the journey .

3) Detection Module:

In this module the face is recognized and identified by the application ,and displays the
status of the recognition of the user’s face in the application

4) Analysis Module :

The user face is analyzed by the extension of google API used for face detection and it
alerts the user in the event of any drowsiness

5) Report Module:

The final module where the report of the analysis is displayed at after the end of the
session .The start time and end time are displayed. .
2. SYSTEM SPECIFICATION

2.1 HARDWARE SPECIFICATION

A good hardware selection plays a vital part for the development of an


application. The first step in contracting equipment is to identify each component and
spell out the performance criteria that the processor must meet under normal
operating conditions. Identifying the hardware requirements of the system needs
detailed analysis of the system that has to be developed. This decides the type of
processor that the system requires for the development and other hardware
equipment involving the input/output devices.

The minimum hardware requirements for implementing the project are

Processor : Intel Core i3 2330M

Speed : 2.33 G Hz

Ram : 4 GB

Hard Disk Drive : 500 GB

Camera : 5 mp
2.2 SOFTWARE SPECIFICATION

Hardware has all of the components that make your particular device work, and
without it, the software would not be accessible. The better the hardware, the more
appealing (in theory) the experience. On other hand, we have software. It might not
be tangible, but it's what you interact with most. You need intelligent software to
achieve that. Good hardware just won't do. Software is set to change the world.
This could be because it's more malleable and faster to change than hardware The
cost of change is much higher for hardware than for software. Software products
evolve through multiple releases by adding new features and re-writing existing
logic to support the new features.

The software used here to develop the system are

Programming language

 XML

 JAVA.

Operating System

 Windows 10 (Eclipse)/Android
2.3 SOFTWARE DESCRIPTION

Java
Java is a high-level, class-based, object-oriented programming language that is
designed to have as few implementation dependencies as possible. It is a general-
purpose programming language intended to let programmers write once, run
anywhere (WORA), meaning that compiled Java code can run on all platforms that
support Java without the need to recompile. Java applications are typically compiled
to bytecode that can run on any Java virtual machine (JVM) regardless of the
underlying computer architecture. The syntax of Java is similar to C and C++, but
has fewer low-level facilities than either of them. The Java runtime provides dynamic
capabilities (such as reflection and runtime code modification) that are typically not
available in traditional compiled languages. As of 2019, Java was one of the
most popular programming languages in use according to GitHub, particularly
for client–server web applications, with a reported 9 million developers.

Java was originally developed by James Gosling at Sun Microsystems. It was


released in May 1995 as a core component of Sun Microsystems' Java platform. The
original and reference implementation Java compilers, virtual machines, and class
libraries were originally released by Sun under proprietary licenses. As of May 2007,
in compliance with the specifications of the Java Community Process, Sun
had relicensed most of its Java technologies under the GPL-2.0-
only license. Oracle offers its own HotSpot Java Virtual Machine, however the
official reference implementation is the OpenJDK JVM which is free open-source
software and used by most developers and is the default JVM for almost all Linux
distributions.

Java uses an automatic garbage collector to manage memory in the object lifecycle. The
programmer determines when objects are created, and the Java runtime is responsible for
recovering the memory once objects are no longer in use. Once no references to an object
remain, the unreachable memory becomes eligible to be freed automatically by the garbage
collector. Something similar to a memory leak may still occur if a programmer's code holds a
reference to an object that is no longer needed, typically when objects that are no longer needed
are stored in containers that are still in use. If methods for a non-existent object are called, a null
pointer exception is thrown.

One of the ideas behind Java's automatic memory management model is that programmers can
be spared the burden of having to perform manual memory management. In some languages,
memory for the creation of objects is implicitly allocated on the stack or explicitly allocated and
deallocated from the heap. In the latter case, the responsibility of managing memory resides with
the programmer. If the program does not deallocate an object, a memory leak occurs. If the
program attempts to access or deallocate memory that has already been deallocated, the result is
undefined and difficult to predict, and the program is likely to become unstable or crash. This
can be partially remedied by the use of smart pointers, but these add overhead and complexity.
Note that garbage collection does not prevent logical memory leaks, i.e. those where the memory
is still referenced but never used.

Garbage collection may happen at any time. Ideally, it will occur when a program is idle. It is
guaranteed to be triggered if there is insufficient free memory on the heap to allocate a new
object; this can cause a program to stall momentarily. Explicit memory management is not
possible in Java.

Java does not support C/C++ style pointer arithmetic, where object addresses can be
arithmetically manipulated (e.g. by adding or subtracting an offset). This allows the garbage
collector to relocate referenced objects and ensures type safety and security.

As in C++ and some other object-oriented languages, variables of Java's primitive data types are
either stored directly in fields (for objects) or on the stack (for methods) rather than on the heap,
as is commonly true for non-primitive data types (but see escape analysis). This was a conscious
decision by Java's designers for performance reasons.

Java contains multiple types of garbage collectors. Since Java 9, HotSpot uses the Garbage First
Garbage Collector (G1GC) as the default. However, there are also several other garbage
collectors that can be used to manage the heap. For most applications in Java, G1GC is
sufficient. Previously, the Parallel Garbage Collector was used in Java 8.

Having solved the memory management problem does not relieve the programmer of the burden
of handling properly other kinds of resources, like network or database connections, file handles,
etc., especially in the presence of exceptions.

XML.

Extensible Markup Language (XML) is a markup language and file format for storing,


transmitting, and reconstructing arbitrary data. It defines a set of rules for encoding documents in
a format that is both human-readable and machine-readable. The World Wide Web Consortium's
XML 1.0 Specification of 1998 and several other related specifications all of them free open
standards define XML.

The design goals of XML emphasize simplicity, generality, and usability across the Internet. It is
a textual data format with strong support via Unicode for different human languages. Although
the design of XML focuses on documents, the language is widely used for the representation of
arbitrary data structures such as those used in web services.
3 SYSTEM ANALYSIS
3.1 EXISTING SYSTEM
The pre-existing application of driver drowsiness system was developed because the
majority of accidents happen due to the drowsiness of the driver. So, to prevent these accidents a
system using Python, OpenCV, and Keras which will alert the driver when he feels sleepy is
built and exists already.

This existing system analyses the driver’s heart rate, eye movement and other inputs such as
before and while driving photo to analyse the face detection for drowsiness detection of the
driver.

Disadvantages

 The driver has to wear heart rate monitoring device at all times during driving.
 The user has to input more data on the system.
 Any slight malfunction in the hardware may lead to false report.
 Does not provide a final report.
 Time limit cannot be set for closing of the eyes.
3.2 PROPOSED SYSTEM

This project “ Automated Driver Drowsiness Detection system “ , was developed to minimalize
the hardware used in the pre existing system. In this new proposed automated drowsiness
detection system the driver needn’t wear any special monitoring devices , the driver just have to
start the application in the device and place it such a way it captures the face at all times and
stays active , this project goes inactive or displays the face as missing in case the driver seems to
have moved. It alarms and alerts the driver if any drowsiness is detected by the system.

Advantages

 It is an Automated system.Requires minimal interaction with the user.


 The user doesn’t have to input more amount of data or even give his personal
information.
 No login is required, direct use of the application is proposed.
 It can be put into any small scaled devices and developed into a product for future needs.
4 SYSTEM DESIGN

4.1 Introduction

System design is the process or art of defining the architecture, components,


modules, interfaces, and data for a system to satisfy specified requirements. One
could see it as the application of systems theory to product development. Design is
the first phase in development phase for any engineer’s product system. Design is the
creative process. It deals with the creating ability of the programmer. A good design
is the key to effective system. The term “Design” is defined as “The process of
applying various techniques and principles for the purpose of defining a process or a
system in sufficient details to permit its physical realization”.

4.2 Input design

The user interface design is very important for any application. The interface
design describes how the software communicated within itself, to system that
interpreted with it and with humans who use it. The interface is a packing for
computer software if the interface is easy to learn, simple to use. If the interface
design is very good, the user will fall into an interactive software application.

***SINCE THIS SYSTEM IS AUTOMATED THERE IS NOT MUCH OF INPUT DATA


THROUGH WHICH THE RESULT CHANGES, THE ONLY INPUT RECEIVED IS THE
TIME LIMIT SET **
Flow Chart Diagram
5. SYSTEM TESTING

5.1 TESTING

The Automated Driver Drowsiness Detection System was tested along the following
guidelines to prove its validity. It was tested using the following technologies of the
software testing. Testing is the process of exercising software with the intent of finding
errors. The Web-app testing is a collection of related activities with a single goal: to
uncover errors in web application content, function, usability, navigability, performance,
capacity and security.

Testing is a process of executing a program with the intent of finding an


error. A good test has a high probability of finding an as yet undiscovered error. A
successful test is one that uncovers an as yet undiscovered error. The objective is to
design tests that systematically uncover different classes of errors and do so with a
minimum amount of time and effort. Testing cannot show the absence of defects, it
can only show that software defects are present.

System testing of software or hardware is testing conducted on a complete,


integrated system to evaluate the system's compliance with its specified
requirements. System testing falls within the scope of black box testing, and as such,
should require no knowledge of the inner design of the code or logic.
Test Plan

The test-case designer not only has to consider the white and black box test
cases, but also the timing of the data and the parallelism of the tasks that handle the
data. In many situations, test data provided when a real system is in one state will
result in proper processing, while the same data provided when the system is in a
different state may lead to error. The intimate relationship that exists between real-
time software and its hardware environment can cause testing problems. Software
tests must consider the impact of hardware faults of software processing. Step
strategy for real-time systems is proposed. The first step in the testing of real-time
software is to test each task independently (i.e.) the white and black box tests are
designed and executed for each task. Each task is executed independently during
these tests. The task testing uncovers errors in logic and functions, but will not
uncover timing or behavioural errors.

Verification

The process of determining whether or not the products of a


given phase of the software development cycle meet the implementation steps and
can be traced to the incoming objectives established during the previous phase.
Verification process helps in detecting defects early, and preventing their leakage e
downstream. Thus, the higher cost of later detection and rework is eliminated

The goal of software testing is to assess the requirements of a


project; then the tester will determine if these requirements are met. There are many
times when low memory usage and speed are more important than making the program
pretty or capable of handling errors. While programming skills are useful when testing
software, they are not necessarily required; however, it can be useful in determining
the cause of errors found in a project.
5.2 TYPES OF TESTING
There are different types of testing in the development process. They are:

 Unit Testing

 Integration Testing

 Validation Testing

UNIT TESTING
All the modules are tested individually using this test. Developers write unit tests to
check their own code. Unit testing differs from integration testing, which confirms that
components work well together, and acceptance testing, which confirms that an
application does what the customer expects it to do. Unit tests are so named because they
test a single unit of code. Unit testing focuses verification effort on the smallest unit of
software design. Each of the modules in this project was verified individually for errors.

INTGRATION TESTING

Embedding and inverse process are jointly tested. Integration testing is a


systematic testing for constructing the program structure while at the same time
conducting tests to uncover errors associated within the interface. This testing was
done with sample data. The need for integrated test is to find the overall system
performances.

VALIDATION TESTING

Software validation is achieved through a series of black box test that


demonstrate conformity with requirements. A test plan outlines the classes of tests to
be conducted and a test procedure defines specific test cases that will be used to
demonstrate conformity with requirements. In my project the modules are tested its
validation by giving various inputs and their results are verified.

6 FUTURE ENHANCEMENTS
This project has a wide scope for future development, as the user’s
requirement is always going to be changed which is not static and these needs are
dynamic. The technology which is famous today becomes out-dated in very next day.
To keep abstract of technical improvements, the system may be further refined. And
so such type of system is improved in further future development. This enhancement
is done in an efficient and effective manner. We can thus update the same with
further modification establishment and can be integrated with minimal modification.
Hence the project is extendable and can be developed in anytime with more advanced
features.
7 Conclusion

Thus Automated Driver Drowsiness Control Technology Using Artificial Intelligence


based Decision Support System is used to prevent these accidents we will build a system
using Java, xml and google vision API which will alert the driver when he feels sleepy.
This is a highly useful system which provides the user with high beneficial abilities while
having minimal user interface and only user input of time limit on which the system
must notify the driver in case when drowsiness is detected, when the system is duly
active. it provides a report of the time from which the system was activated and the time
of termination of the application. This is highly portable and can be converted into a
smallscale use or the application can also be used for multi-purposed extensive uses too.

BIBLIOGRAPHY

 https://www.java.com/en/download/help/sysreq.html

 https://www.w3schools.com/xml/xml_whatis.asp

 http://ethesis.nitrkl.ac.in/3373/1/thesis-

 Prototype thesis by NIT- Rourkela

 https://github.com/DeltaTheWolf/app-update-tracker/blob/master/Kik%20X/
unknown/androidsupportmultidexversion.txt

 Github
APPENDICS
SAMPLE CODES:

<?xml
version="1.0"e
ncoding="UTF
-8"?>
<projectDescriptio

<name>Automate
>
<comment>Projec
AutomatedDriverD
Buildship.</comm
<projects>
</projects>
<buildSpec>
<buildComm
<name>org.eclipse.buildship.core.gradleprojectbuil
der</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>

<nature>org.eclipse.buildship.core.gradleprojectnat
ure</nature>
</natures>
<filteredResources>
<filter>
<id>1635143105820</id>
<name></name>
<type>30</type>
<matcher>

<id>org.eclipse.core.resources.regexFilterMatcher</
id>
<arguments>node_modules|.git|
__CREATED_BY_JAVA_LANGUAGE_SERVER
__</arguments>
</matcher>
</filter>
</filteredResources>
</projectDescription>

<?xml
version="1.0"
encoding="UTF-
8"?>
<project version="4">
<component
name="VcsDirectoryMappings">
<mapping
directory="$PROJECT_DIR$" vcs="Git"
/>
</component>
</project>
.

You might also like