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

AUTOMATED DRIVER DROWSINESS

DETECTION SYSTEM
MINOR PROJECT REPORT

Submitted By
Naren Karthikeyan R
(20BCA031)
Under the Guidance of
Mrs. Arun Priya Maam
Assistant Professor
Bachelor of Computer Applications Department
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
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.

TABLE OF CONTENT
CONTENTS PAGE NO

1. INTRODUCTION 1

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

3. SYSTEM ANALYSIS 10
1. Existing system 10
2. Proposed system 11

4. SYSTEM DESIGN 12
1.Introduction 12
2.Input Design 13
3.Modules 15
4.DataFlow Diagram 16

5. SYSTEM TESTING 17
1.Testing 17
2.Types of Testing 20

6.SCOPE FOR FUTURE ENHANCEMENT 22

7.CONCLUSION 23

8.BIBLOGRAPHY 24

9.APPENDICES 25
1.Form Design 0
2.Sample Coding 0

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.

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. 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. 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.
First we input the facial image using a webcam.
Preprocessing was first performed by binarizing the
image. The top and sides of the face were detected to
narrow down the area where the eyes exist. Using the
sides of the face, the center of the face was found which
will be used as a reference when computing the left and
right eyes. Moving down from the top of the face,
horizontal averages of the face area were calculated.
Large changes in the averages were used to define the eye
area.
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.
2.1 HARDWARE SPECIFICATION
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
Compact Disk
700 MB
Drive :

2.2 SOFTWARE SPECIFICATION


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.

The input design is the process of converting


the user-oriented inputs into the computer-based
format. Errors entered by data entry operations can
be controlled by input design. The data is fed into
the system using simple interactive forms. The
forms have been supplied with messages so that
user can enter data without facing any difficulty.
The data is validated wherever it requires in the
project. This ensures that only the correct data
have been incorporated into the system. The goal
for designing input data is to make data entry as
easy, logical and free from errors.
The objectives of input design are:
• To produce a cost effective method of input
• To make the input forms understandable to the
user
• To ensure the validation of data input

• To achieve the highest position level of


accuracy
The various activities to be performed for the over
all input processors are:
• Data recording at its source.
• Data transfer to input form.

• Data conversation to computer acceptable


mode.
• Data validation.

• Data flow control.

***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 ***
Module:

1.
Data flow diagram:
5. SYSTEM TESTING

5.1 TESTING

The “AUTOMATED DRIVER DROWSINESS 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.
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