UCS503- Software Engineering Lab
(A typical Specimen of Cover Page & Title Page)
Driver Drowsiness Detection System
UCS503 Software Engineering Project Report
Mid-Semester Evaluation
Submitted by:
101903769 Jashdeep Singh Offline
101903599 Gaurav Aggarwal Online
101903746 Himanshu Singh Online
BE Third Year, CoE/CoE MBA
Group No: F
Submitted to: Harkiran Kaur
Name of the Faculty
Computer Science and Engineering Department
TIET, Patiala
October 2021
UCS503- Software Engineering Lab
TABLE OF CONTENTS
S.No. Assignment Page No.
1. Project Selection Phase
1.1 Software Bid
1.2 Project Overview
2. Analysis Phase
2.1 Use Cases
2.1.1 Use-Case Diagrams
2.1.2 Use Case Templates
2.2 Activity diagram and Swimlane Diagrams
2.3 Data Flow Diagrams (DFDs)
2.3.1 DFD Level 0
2.3.2 DFD Level 1
2.3.2 DFD Level 2
2.4 Software Requirement Specification in IEEE Format
3. Design Phase
3.1 Class Diagram
3.2 Sequence Diagram
3.3 Collaboration Diagram
3.4 Database Design : ER Diagram
4. Prototyping-GUIs
4.1 Screen Shots
Software Bid/ Project Teams
UCS 503- Software Engineering Lab
Group :2CO29 Dated:27/08/2021
Team Name: F
Team ID (will be assigned by Instructor):
Please enter the names of your Preferred Team Members.
• You are required to form a three to four person teams
• Choose your team members wisely. You will not be allowed to change teams.
Name Roll No Project Experience Programming Language used
Jashdeep Singh 101903769 App dev, web Apps HTML,CSS,JAVASCRIPT
Yanish Bansal 101903626 Website HTML,CSS,MongoDB,Node.js
Himanshu 101903746 None C++,Python,CSS
Singh
101903599 Contributed on Github C,Python,HTML
Gaurav
Agarwal
Programming Language / Environment Experience
List the languages you are most comfortable developing in, as a team, in your order of
preference. Many of the projects involve Java or C/C++ programming.
1. HTML
2. CSS
3. Javascript
Choices of Projects:
Please select 4 projects your team would like to work on, by order of preference: [Write at-least one
paragraph for each choice (motivation, reason for choice, feasibility analysis, etc.)]
First Choice
College Portal – A common portal for all college going students. It will have todo
list system which will remind students about task to complete within deadlines. It
will keep a record of their day to day expenses, Enable students to have equal say
in mess,etc. It will be build using HTML,CSS,Javascript, MongoDB.
Second Choice Store Management System for Store Owners to manage their store items,
sales and purchase details, and all employees' details. Owner and the
allowed
employees can register and login to their accounts. Expired Products,
Reordering items, etc can be managed via interactive GUI.
Third Choice Driver Drowsiness Detection System - The majority of accidents happen
due to
the drowsiness of the driver. So, to prevent these accidents we will build a
system using Python, OpenCV, and Keras which will alert the driver
when he feels sleepy.
Fourth Choice Color Detection - Color detection is necessary to recognize objects, it is
also used as a tool in various image editing and drawing apps
Additional Remarks/ Inputs
Please tell us about any other factors that we should take into consideration (e.g., if you really would
like to work on a project for some particularly convincing reason).
As all Team members know programming languages related to web development so choice 1
would be most preferrable for us as it includes building a website from
scratch.…………………………………………………………………………………………
……
………………………………………………………………………………………………
………………………………………………………………………………………………
UCS503- Software Engineering Lab
Project Overview
A non-intrusive machine vision-based approach has been used to build a Driver Drowsiness
Detection System. To identify weariness, the device employs a tiny monochrome security
camera that is pointed directly at the driver's face and watches the driver's eyes. When tiredness
is identified, a warning signal is sent to the driver to inform him. This report explains how to
locate the eyes and identify whether they are open or closed. The method created is unlike any
other currently published article, which was one of the project's main goals. The method works
by finding the borders of the face using information from the binary version of the picture,
narrowing the region where the eyes may be. After locating the facial region, the eyes are
located by computing the area's horizontal averages. The eyes are found by locating large
intensity changes in the face, taking into consideration the fact that eye areas in the face exhibit
great intensity fluctuations. Once the eyes have been identified, the intervals between intensity
changes in the eye region are measured to identify whether the eyes are open or closed. Eye
closure correlates to a vast distance
Use Case Scenerios:
Use case name Video Input
Use case ID UC-01
Description It takes video as input.
Actor Camera
Pre-condition Proper and Continuous power supply for camera.
1. Electric power supply should be available for camera.
Normal Flow of
2. Video gets separated into frames.
Events
3. Video will be processed by the software.
Post- condition Video is processed into frames and passed to the model.
Alternative course
(AA) Video can be processed by an additional webcam.
of action
Exception flow of
(SR) Users can either attach an external webcam or either use its
Events
mobile for or any video input device.
Table 2.1 use case description for video input
Use case name Video Processing
Use case ID UC-02
Description Model will decide on basis of images scores.
Actor Camera
Pre-condition Proper and Continuous power supply for camera.
1. Electric power supply should be available for camera.
Normal Flow of
2. Video gets separated into frames.
Events:
3. Images gets scored or classified.
4. Scores decide the action alert or still.
Post- condition User vehicle speed will be decreased and notification will be send.
Alternative course
(AA) Model can be uploaded to cloud as well in case of future
ofaction
alerts.
Exception flow of
(SR) If user may feel an uneven braking then he or she can
Events
manually disable it to reduce errors or anamolies.
(SR) Server can degrade or hang in few conditions like
excessive use.
Table 2.2 use case description for video processing and decision making
Use case name Output Logs
Use case ID UC-03
Description It shows an output of Drowsiness Score.
Actor Model
Pre-condition Internet Facility available for updating data.
1. User has a drive.
Normal Flow of
2. User parks vehicle and gets a drowsiness score of his facial
Events:
expression on due course of track.
3. If any drowsiness is detected or any uneven activity is
detected then this gives an alert system.
Post- condition The alert and log files are generated.
Alternative flow of
(AA) Live feed or alert will be activated if user sleeps.
Events
Exception course
(SR)Server may fail to upload logs or no file is uploaded on
of action
the server.
(SR) Data Storage on cloud may exceed the required
available space.
Table 2.3 Use Case Scenario for Output Logs
Driver Drowsiness Detection System
DFD 0
Group Name: F
Date: 12-10-2021
Video
Frame Processing
Finding Yawning
closures
1.0
Driver Drowsiness
Detection System
Alert System Extract Eye
Landmarks
Consciousness
Detection
Software Requirements Specification Document
Version 1.0
Driver Drowsiness Detection System
Prepared by:
Jashdeep Singh - 101903769
Himanshu Singh - 101903746
Gaurav Agarwal - 101903599
1
TABLE OF CONTENTS
Chapter No. Topic Page No.
1. Introduction 3
1.1 Purposes of the Document 3
1.2 Scope of the Development Project 3
1.3 Definitions, abbreviations and acronyms 4
1.4 References 5
1.5 Overview 5
2. Overall Description 6
2.1 Product Perspective 6
2.2 Product functions 9
2.3 User Characteristics 9
2.4 General Constraints, Assumptions and Dependencies 10
2.5 Apportioning of the requirements 11
3. Specific Requirements 11
3.1 External Interface Requirements 11
3.2 Detailed Description of Functional Requirements 12
3.2.1 Functional Requirements for calculating Real 12
Time Video
3.2.2 Functional Requirements for Processing the frames 12
3.2.3 Functional Requirements for Generating Results & Output Alarms 12
3.3 Performance requirements 14
3.4 Logical database requirements 14
3.5 Quality attributes 15
3.6 Other requirements 15
4. Change History 15
5. Document Approvers 15
2
1. Introduction
1.1 Purpose of this Document
A thorough explanation of the requirements for the Driver Drowsiness Detection System will
be provided in the Software Requirements Specification (SRS). This SRS will provide a
thorough knowledge of what may be expected from the system that will be built. The right
software will be produced for the end user and will be utilised for the development of the
project's future phases due to a clear knowledge of the system and its functioning. It will
serve as the project's basis. The Driver Drowsiness Detection System may be developed,
built, and tested using the specified requirements.
1.2 Scope of the Development Project
A non-intrusive machine vision-based approach has been used to build a Driver Drowsiness
Detection System. To identify weariness, the device employs a tiny monochrome security
camera that is pointed directly at the driver's face and watches the driver's eyes. When
tiredness is identified, a warning signal is sent to the driver to inform him. This report
explains how to locate the eyes and identify whether they are open or closed. The method
created is unlike any other currently published article, which was one of the project's main
goals.
The method works by finding the borders of the face using information from the binary
version of the picture, narrowing the region where the eyes may be. After locating the facial
region, the eyes are located by computing the area's horizontal averages. The eyes are found
by locating large intensity changes in the face, taking into consideration the fact that eye
areas in the face exhibit great intensity fluctuations. Once the eyes have been identified, the
intervals between intensity changes in the eye region are measured to identify whether the
eyes are open or closed. Eye closure correlates to a vast distance.
1.3 Definitions, abbreviations and acronyms
SRS – Software Requirements Specification
UML – Unified Modeling Language
1.4 Overview
The system will capture video, that is, it will record picture frames from the camera in real
time. After the frames are captured, they are pre-processed before the algorithms are used.
The driver's face and eyes were identified after pre-processing. There is already a template in
the database, and if the system detects the driver's sleepiness for longer than the set amount
of time, the driver will be notified by a firing alarm.
1.5 References
[1] Jihong Liu, Zhongfan Li ,Li Yang, Zhan Mei,” Study of the Eye-tracking Methods Based
on Video”, 2011 Third International Conference on Computational Intelligence,
Communication Systems and Networks.
[2] Lu Yufeng, Wang Zengcai ,”Detecting Driver Yawning in Successive Images”
IEEE 2009.
[3] Shabnam Abtahi, Behnoosh Hariri, Shervin Shirmohammadi,”Driver Drowsiness
Monitoring Based on Yawning Detection” IEEE 2011.
[4] Xianghua Fan, Fuyou Zhang, Haixia Wang, Xiao Lu, “The System of Face Detection
Based on OpenCV” , IEEE 2012.
[5] Weirwille, W.W. (2006), “Overview of Research on Driver Drowsiness Definition and
Driver Drowsiness Detection,” 14th International Technical Conference on Image Processing.
[6] Jihong Liu, Zhongfan Li ,Li Yang, Zhan Mei,” Study of the Eye-tracking Methods Based
on Video”, 2011 Third International Conference on Computational Intelligence,
Communication Systems and Networks.
2. Overall Description
2.1 Product Perspective
There are two primary components to the SRS. The overall description comes first, followed
by the specific requirements. The Overall Description will provide a high-level overview of
the Driver Drowsiness Detection System's needs. The system's needs will be detailed in the
Specific Requirements section.
The goal of this project is to create a sleepiness detecting system prototype. The emphasis
will be on developing a system that can track the open or closed condition of the driver's eyes
in real time. It is hoped that by monitoring the eyes, the signs of driver tiredness might be
recognised early enough to prevent an automobile collision. A series of pictures of a face, as
well as the monitoring of eye movements and blink patterns, are used to detect weariness.
Face image analysis is a major academic topic with applications such as face recognition,
virtual tools, and security systems for human identification. This research focuses on eye
localization, which entails looking at the whole picture of the face and using a self-developed
image-processing algorithm to determine the position of the eyes. The technology is meant to
detect weariness and identify whether the eyes are open or closed after the location of the
eyes has been determined.
2.2 Product Functions
● The system will perform the following functions:
● System will capture the video i.e. the system will continuously capture image frames
from the webcam.
● After capturing the frames, the captured frames are pre-processed before the application
of the algorithms.
● After pre-processing, the face and eyes of the user are detected.
● There is already a template in the database which is compared with the face and eyes of
the driver and if the system detects drowsiness for more than specified period of time
then the firing alarm will alert the user.
Components User Input(Camera) System Output
Requirements
Face Detection Yes Yes X X
Face Detection with Left Yes Yes X X
Motion
Face Detection with Right Yes Yes X X
Motion
Eye Detection within the Yes Yes X X
face
Alarm X X X Yes
2.3 User Characteristics
Entire project team is responsible for the successful delivery of the product. Team member
assignments per deliverable according to expertise
1. Preliminary Project Plan
2. Presentation
3. Software Project Management Plan
4. Software Requirement Specification
5. Face Detection Module
6. Eye Detection Module
7. System Test Document
8. Software Design Document
9. Algorithm Module
10. Demo
11. Synopsis
2.4 General Constraints, Assumptions and Dependencies
The most important aspect of implementing a machine vision system is the image acquisition.
Any deficiencies in the acquired images can cause problems with image analysis and
interpretation. Ambient light is required for detection. Examples of such problems are a lack
of detail due to insufficient contrast or poor positioning of the camera: this can cause the objects
to be unrecognizable, so the purpose of vision cannot be fulfilled.
2.5 Apportioning of requirements
The work was divided amongst the team members as follows:
1. Design and Architecture: Harshit, X
2. Machine Learning Development: Harshit, Z
3. Testing: Y, Z
4. Deployment: X, Y
3. Specific Requirements
3.1 External Interface Requirements
The system has two main modules, one for the detection of the face of the driver and other
for the detection of the eyes of the driver. In general, the system should work in any
operating environment.
1. Minimum Specifications
• RAM: 1 gigabyte (GB) for 32-bit or 2 GB for 64-bit
• Processor: 1 gigahertz (GHz) or faster processor.
2. Computer with a webcam OR a laptop
Software Interface Requirements:
1. Visual Studio
2. Open CV
3.2 Detailed Description of Functional Requirements
3.2.1 Calculating Real Time Video
The system should capture frames at 10 frames per second.
Purpose It takes video as input.
Inputs Camera should be available..
Processing 1.Electric power supply should be available for camera.
2.Video gets separated into frames.
3.Video will be processed by the software.
Outputs Video is processed into frames and passed to the model.
3.2.2 Processing the frames
a. Captured frames will be pre-processed i.e. converted into grayscale.
b. This system will be responsible for finding facial and eye regions.
Purpose Video is divided into frames.
Inputs It generates all the images.
Processing The camera should have access to an electrical
power supply.
The video is divided into frames.
The images are graded or categorized.
The action alert or still is determined by the
scores.
Outputs User vehicle speed will be decreased and
notification will be send.
3.2.3 Generating Results/Output (Alarm)
Based on output, the system will decide whether the driver is drowsy and generate an alarm.
Purpose It shows an output of Drowsiness Score.
Inputs Internet Facility available for updating data.
Processing The user has a hard disc. User parks car and
receives a sleepiness score based on his facial
expression as the track progresses. If any sleepiness
or unbalanced activity is identified, a warning
system is activated.
Outputs The alert and log files are generated.
3.3 Performance Requirements
The system will perform the following functions:
● System will capture the video i.e. the system will continuously capture image frames from
the webcam.
● After capturing the frames, the captured frames are pre-processed before the application of
the algorithms.
● After pre-processing, face and eyes of the user are detected.
● There is already a template in the database which is compared with the face and eyes of
the driver and if the system detects drowsiness for more than specified period of time then
the firing alarm will alert the user.
3.4 Logical Database Requirements
Figure below shows the E-R diagram for the entire system.
3.5 Quality Attributes
The focus will be placed on designing a system that will accurately monitor the open or closed
state of the driver’s eyes in real-time. By monitoring the eyes, it is believed that the symptoms
of driver fatigue can be detected early enough to avoid a car accident. Detection of fatigue
involves a sequence of images of a face, 7and the observation of eye movements and blink
patterns. The analysis of face images is a popular research area with applications such as face
recognition, virtual tools, and human identification security systems. This project is focused
on the localization of the eyes, which involves looking at the entire image of the face, and
determining the position of the eyes by a self-developed image-processing algorithm. Once the
position of the eyes is located, the system is designed to determine whether the eyes are opened
or closed, and detect fatigue.
3.6 Other Requirements
None at this point of time.
4. Change History
Version 1.0 Initial Release
5. Document Approvers
SRS for Driver Drowsiness Detection System approved by:
Harkiran
Kaur Ast.
Proff.
9/2/21
Class Diagrams
Group F October 14, 2021
Driver Vehicle
+DrivingLicenselD : String +VehiclelD :String
1..* 1..* +VehicleType : String
+DrivingVehicle() +Start()
+Yawning() +Drive()
+BlinkingEyes() +Stop()
«use»
Detection System Analysis System
+WebCam : float +ImageProcessor : float
0..3 1
+FaceDetection() +ExtractingFeatures0
+MouthDetection() +OpenAndClosedEyeAnalysis()
+CapturingImage() +Yawn Detection()
Decision System Alarm
+SoundSystem : int
+YesIfDrowsy() : +StartRinging()
+NolfNotDrowsy() +StopRinging()
:Driver
:Camera :Processor Drowsiness :Alarm
Detection Model
Driver
Captures Video
Sends Video Sends Processed Video
Frames Alerts Alarm
Alarm Beeps