A20 RTP

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

A Real Time Research Project Report on

HUMAN STRESS DETECTION IN AND THROUGH


SLEEP
Submitted to the
Guru Nanak Institute of Technology
(Autonomous)
In partial fulfilment of the requirements for the award of the degree of

Bachelor of Technology
in
Computer Science and Engineering
(CYBER SECURITY)
By
R.SAI PRANEETH (22831A6250)
K.AALOK (22831A6215)
K.HARSHINI (22831A6218)

Under the Esteemed Guidance of


Mr.B.PRANEETH REDDY SIR
Assistant Professor
Department of Emerging Technologies

Department of Emerging Technologies

Guru Nanak Institute of Technology


(Autonomous)
Ibrahimpatnam, R.R District- 501506

i
GURU NANAK INSTITUTE OF
TECHNOLOGY
(Autonomous)
Ranga Reddy District -501506

Department of Emerging Technologies


CERTIFICATE

This is to certify that Real Time Research Project report entitled “ HUMAN STRESS
DETECTION IN AND THROUGH SLEEP” by R.SAI PRANEETH (22831A6250),
K.AALOK (22831A6215), K.HARSHINI (22831A6218) was submitted in partial
fulfilment of the requirements for the degree of Bachelor of Technology in Computer
Science and Engineering (CYBER SECURITY) of Guru Nanak Institute of Technology
during the academic year 2023-2024 is a Bonafide record of work carried out under our
guidance and supervision.

Mr. B. PRANEETH REDDY Dr. M. SADISH SENDIL


INTERNAL GUIDE &PROJECT CO-ORDINATOR HOD-ET

ii
GURU NANAK INSTITUTE OF
TECHNOLOGY
(Autonomous)
Ranga Reddy District -501506

VISION AND MISSION

VISION OF GNIT

To be a world –class educational and research institution in the service of humanity by


promoting high quality Engineering and Management Education

MISSION OF GNIT

M1: Imbibe soft skills and technical skills.

M2: Develop the faculty to reach the international standards.

M3: Maintain high academic standards and teaching quality that promotes the analytical
thinking and independent judgment.

M4: Promote research, innovation, and product development by collaboration with


reputed foreign universities.

M5: Offer collaborative industry programs in emerging areas and spirit of


enterprise.

iii
GURU NANAK INSTITUTE OF
TECHNOLOGY
(Autonomous)
Ranga Reddy District -501506

DEPARTMENT OF EMERGING TECHNOLOGIES

VISION OF DEPARTMENT

To be a premier Department of Emerging Technologies, known globally for value


based education, Research & Innovation through academic excellence to serve the
needs of industry and society

MISSION OF DEPARTMENT

M1: Develop a strong foundation on fundamentals of Computer Science and


Engineering through outcome based Teaching Learning process.

M2: Establish state of art & Centre of Excellence facilities in Emerging technologies
for Design and development of Innovative Products.

M3: Involve the students in Group activities, including those of professional bodies to
develop leadership, entrepreneurship and good communication skills.

iv
GURU NANAK INSTITUTE OF
TECHNOLOGY
(Autonomous)
Ranga Reddy District -501506

DEPARTMENT OF EMERGING TECHNOLOGIES

Program Educational Objectives (PEO’s)

PEO-1: Have an ability to adapt to a rapidly changing environment by having learned


and applied cutting-edge skills in emerging technologies.

PEO-2: Build a strong foundation in the field of artificial intelligence, cyber security,
machine learning, and data science to contribute significantly in the area of innovations
and research.

PEO-3: Have strong work ethics, professional attitude, team spirit, leadership, and
enterprising skills to serve industry and society.

Program Outcomes (PO’s)

1. Engineering Knowledge: Apply the knowledge of mathematics, science, engineering


fundamentals, and an engineering specialization to the solution of complex
engineering problems.

2. Problem Analysis: Identify, formulate, review research literature, and analyze complex
engineering problems reaching substantiated conclusions using first principles of
mathematics, natural sciences, and engineering sciences.

3. Design/development of solutions: Design solutions for complex engineering problems


and design system components or processes that meet the specified needs with
appropriate consideration for the public health and safety, and the cultural, societal,
and environmental considerations.

v
4. Conduct investigations of complex problems: Use research-based knowledge and
research methods including design of experiments, analysis and interpretation of data,
and synthesis of the information to provide valid conclusions.

5. Modern tool usage: Create, select, and apply appropriate techniques, resources,
and
modern engineering and IT tools including prediction and modelling to complex
engineering activities with an understanding of the limitations.

6. The engineer and society: Apply reasoning informed by the contextual knowledge to
assess societal, health, safety, legal and cultural issues and the consequent
responsibilities relevant to the professional engineering practice.

7. Environment and sustainability: Understand the impact of the professional engineering


solutions in societal and environmental contexts, and demonstrate the knowledge of,
and need for sustainable development.

8. Ethics: Apply ethical principles and commit to professional ethics and responsibilities
and norms of the engineering practice.

9. Individual and teamwork: Function effectively as an individual, and as a member or


leader in diverse teams, and in multidisciplinary settings.

10. Communication: Communicate effectively on complex engineering activities with the


engineering community and with society at large, such as, being able to comprehend
and write effective reports and design documentation, make effective presentations
and give and receive clear instructions.

11. Project management and finance: Demonstrate knowledge and understanding of the
engineering and management principles and apply these to one’s own work, as a

vi
member and leader in a team, to manage projects and in multidisciplinary
environments.

12. Life-long learning: Recognize the need for and have the preparation and ability
to engage in independent and life-long learning in the broadest context of
technological change.

vii
GURU NANAK INSTITUTE OF
TECHNOLOGY
(Autonomous)
Ranga Reddy District -501506

MAPPING WITH PO’S AND PEO’S

Sl.
No. Content PO’s PEO’s

1 Introduction PO1, PO2 PEO1

2 Abstract PO1, PO2 PEO1

3 System Specifications PO3, PO5 PE01

4 Architecture Design PO3, PO4 PEO1, PEO2

P09, PO10, PEO2, PEO3


5 Implementation
PO11
PO4, PO11, PEO2, PEO3
6 Results
PO12

viii
GURU NANAK INSTITUTE OF
TECHNOLOGY
(Autonomous)
Ranga Reddy District -501506

DECLARATION

We hereby declare that the Real time research project report entitled “HUMAN
STRESS DETECTION IN AND THROUGH SLEEP” is the work done by
RIKKAMALLE SAI PRANEETH (22831A6250),KARNALA AALOK
(23831A6215), KOTTAPALLI HARSHINI(22831A6218) towards the fulfilment of the
requirement for the award of the Degree of Bachelor of Technology in Computer
Science and Engineering (Cyber security), Guru Nanak Institute of Technology, is the
result of the work carried out under the guidance Mr..PRANEETH REDDY SIR,
Assistant Professor , Guru Nanak Institute of Technology, Hyderabad.

We further declare that this mini project report has not been previously submitted
before either in part or full for the award of any degree or any diploma by any
organization or any universities.

RIKKAMALLE SAI PRANEETH(22831A6250)


KARNALA AALOK (22831A6215)
KOTTAPALLI HARSHINI (22831A6218)

ix
ACKNOWLEDGEMENT

“Task Successful” makes everyone happy. But the happiness will be gold without glitter if
we didn’t state the persons who have supported us to make it happen.

We would like to express our sincere thanks and gratitude to our principal Dr. S.
SREENATHA REDDY and Head of the Department Dr. M. SADISH SENDIL, Department
of Emerging Technologies, Guru Nanak Institute of Technology for guided us in developing
the requisite capabilities for taking up this mini project.

We would like to say our sincere thanks to Mr. B.PRANEETH REDDY Assistant Professor
and Project Coordinator, Department of CSE (CYBER SECURITY), GNIT for providing
seamless support and right suggestions are given in the development of the project.

We would like to say our sincere thanks to MR.PRANEETH REDDY, Assistant Professor
and Project Guide, Department of CSE (CYBER SECURITY), GNIT, for providing seamless
support and right suggestions are given in the development of the project.

Finally, we would like to thank our family members for their moral support and
encouragement to achieve their goals.

RIKKAMALLE SAI PRANEETH(22831A6250)


KARNALA AALOK (22831A6215)
KOTTAPALLI HARSHINI
(22831A6218)

x
HUMAN STRESS DETECTION
IN &THROUGH SLEEP

xi
ABSTRACT

 Considering today’s lifestyle, people are just forgetting the


benefits sleep provides to the human body. Stress is a
psychological condition that reduces the quality of sleep and
affects every facet of life.

 Stress is a normal phenomenon in today's world, and it causes


people to respond to a variety of factors, resulting in physiological
and behavioural changes. If we keep stress in our minds for too
long, it will influence our bodies. Many health conditions
associated with stress can be avoided if stress is detected sooner.

 When a person is stressed, a pattern can be detected using various


bio-signals such as thermal, electrical, impedance, acoustic,
optical, and so on, and stress levels can be identified using these
bio-signals.

xii
TABLE OF CONTENTS

CHAPTER TITLE PAGE


NO. NO.
ABSTRACT xi
LIST OF FIGURES xv
xvi
LIST OF SYMBOLS

CHAPTER 1: INTRODUCTION 1
1.1 GENERAL 1
1.2 SCOPE OF THE PROJECT 3
1 1.3 OBJECTIVE 4
1.4 EXISTING SYSTEM 4
1.4.1 EXISTINGSYSTEM DISADVANTAGES 5
1.5 LITERATURE SURVEY 6
1.6 PROPOSED SYSTEM 11
1.6.1 PROPOSED SYSTEM ADVANTAGES 11
CHAPTER 2: PROJECT DESCRIPTION 12
2.1 GENERAL 12

2 2.2 METHODOLOGIES 12
2.2.1 MODULES NAME 12
2.2.2 MODULES EXPLANATION 13
2.3 TECHNIQUE OR ALGORITHM 14
CHAPTER 3: REQUIREMENTS 15
3.1 GENERAL 15

3 3.2 HARDWARE REQUIREMENTS 16


3.3 SOFTWARE REQUIREMENTS 16

xiii
CHAPTER 4: SYSTEM DESIGN 17
4.1 GENERAL 17
4
4.2 UML DIAGRAMS 18

4.2.1 USE CASE DIAGRAM 18


4.2.2 CLASS DIAGRAM 19
4.2.3 OBJECT DIAGRAM 20
4.2.4 STATE DIAGRAM 21
4.2.5 ACTIVITY DIAGRAM 22
4.2.6 SEQUENCE DIAGRAM 23
4.2.7 COLLABORATION DIAGRAM 24
4.2.8 COMPONENT DIAGRAM 25
4.2.9 DATA FLOW DIAGRAM 26
4.2.10 DEPLOYMENT DIAGRAM 27
4.2.11 SYSTEM ARCHITECTURE 28
CHAPTER 5: DEVELOPMENT TOOLS 30
5.1 GENERAL 30
5.2 HISTORY OF PYTHON 31
5 5.3 IMPORTANCE OF PYTHON 31
5.4 FEATURES OF PYTHON 32
5.5 LIBRARIES USED IN PYTHON 32

CHAPTER 6: IMPLEMENTATION 33
6 6.1 GENERAL 33
6.2 IMPLEMENTATION 34
CHAPTER 7: SNAPSHOTS 41
7 7.1 GENERAL 41
7.2 VARIOUS SNAPSHOTS 42
CHAPTER 8: SOFTWARE TESTING 44
8.1 GENERAL 44
8
8.2 DEVELOPING METHODOLOGIES 45
8.3 TYPES OF TESTING 46
CHAPTER 9: 47
FUTURE ENHANCEMENT 47
9

xiv
47
9.1 FUTURE ENHANCEMENTS

CHAPTER 10: 48
10.1 CONCLUSION 48
10
10.2 REFERENCES 49

xv
LIST OF FIGURES

FIGURE NO NAME OF THE FIGURE PAGE NO.

4.1 Use case Diagram 18

4.2 Class diagram 19

4.3 Object diagram 20

4.4 State Diagram 21

4.5 Activity Diagram 22


4.6 Sequence diagram 23
4.7 Collaboration diagram 24

4.8 Component Diagram 25

4.9 Data flow diagram 26

4.10 Deployment Diagram 27

4.11 Architecture Diagram 28

xvi
LIST OF SYMBOLS

NOTATI
S.N ON NOTATION DESCRIPTION
O NAME

Class
1 Class Name Represent
sa
collection
-
+ of similar
attribu
public entities
te
grouped
-
- together.
attribu
private
te

+oper
a on

NA Associations
Cla ME Cla represents static
2 Association ss A ss relationships
B between
Class Class classes. Roles
A B represents the
way the two
classes see each
other.

It aggregates
3 Actor several classes
into a single
class.

Clas Class
sA A

xvii
Interaction
4 Aggregatio Class Clas between
n B sB
the system
and
external
environme
nt

Relation uses Used for


5 additional
(uses)
process
communicatio
n.
Extends
Relation relationship is
6 used when one
(extends) extends use case is
similar to
another use
case but does a
bit more.

Communicatio Communicatio
7 n n between
various use
cases.

8 State State of the


State
processes.

Initial
9 State Initial state of
the object

Final state Final state of

xviii
1 the object
0

Control flow Represents


1 various control
1 flow between
the states.

Decision box Represents


1 decision
2 making
process from a
constraint
Interact ion between
Uses case the system and
Use case
1 external
3 environment.

Represents physical
modules which are a
Component
collection of
14
components.

Represents physical
modules which are a
Node
collection of
15
components.

Data A circle in DFD


16 Process/State represents a state or
process which has
been triggered due
to some event or
action.

xix
Represents external
External entities such as
17 entity keyboard, sensors,
etc.

Transition Represents
18 communication that
occurs between
processes.

Object Represents the


19 Lifeline vertical dimensions
that the object
communications.

Message Message Represents the


20 message
exchanged.

xx
CHAPTER-1

INTRODUCTION

1.1 GENERAL

• Psychological data is required as input data to predict the stress level (on a
scale of 5) of a person in sleep.

• Psychological data usually include heart rate, blood glucose, blood


pressure, respiration rate, body temperature, blood volume, eye tracking,
sound pressure, electrocardiogram, blood oxygen saturation, and skin
conductance. This data can be collected by wearable devices of different
types.

• This data when given to the web application, performs the prediction
through the ML model and gives the predicted output.

1
1.2 SCOPE OF THE PROJECT

 In recent times, significant research is carried out in the fields of


psychology and computer science regarding the detection and
modeling of stress.

 The foremost step in identifying early signs of stress - related issues


involves assessing and monitoring sleep quality, understanding the
impact of stress on physical health. Accurately detecting stress during
sleep can provide valuable insights into an individual’s mental and
physical health.

 Machine learning techniques are used in analyzing the sleep patterns


and early diagnosis of stress.

 The goal of this study is to develop an AI model for predicting the


detection of stress and to potentially substitute the supervised
machine learning classification models.

 The performance of various supervised algorithms like Decision Tree,


Adaboost, SVM and MLP are compared and the results are evaluated
in terms of accuracy.

2
 1.3 OBJECTIVE

 Six machine learning techniques, including Multilayer Perception


(MLP), Random Forest, Support Vector Machine (SVM), Decision
Trees, Naïve Bayes and Logistic Regression were utilized in the
classification level after the data had been preprocessed in order to
compare and obtain the most accurate results.

 Based on the experiment results, it can be concluded that the Naïve


Bayes algorithm, when used to classify the data, can do so with
91.27% accuracy, high precision, recall, and f measure values, as well
as the lowest mean absolute error (MAE) and root mean squared error
rates (RMSE).

 We can estimate human stress levels using the study’s findings, and
we can address pertinent problems as soon as possible.

3
1.4 EXISTING SYSTEM:

• Psychological stress is injurious to health. In existing system, stress is identified in


face-to-face interview, communication or any other activities, where two or more
people are analysed by another.

• Other systems were designed to detect stress by taking tweets as input from the
Twitter or Facebook data set and machine learning algorithms are applied to detect
stress from tweets.

• Most of the existing system works either on person interaction or on social


networking stress data and not on body-based sensor data.

1.4.1 EXISTINGSYSTEM DISADVANTAGES:


Complexity: Analyzing sleep patterns to detect stress accurately requires
sophisticated algorithms and technology, which may be complex to develop and
implement.

Privacy Concerns: Continuous monitoring of sleep raises privacy concerns, as it


involves gathering personal data about an individual's sleep habits.

False Positives/Negatives: There's a risk of false positives (detecting stress when


it's not present) or false negatives (failing to detect stress when it is present), which
could lead to incorrect conclusions or unnecessary anxiety.

Cost and Accessibility: Developing and implementing sleep monitoring


technology can be expensive, limiting its accessibility to certain populations or
healthcare systems.

4
1.5 LITERATURE SURVEY

TITLE: The Meaning of Sleep Quality: A Survey of Available


Technologies

YEAR:2017

DESCRIPTION:

Sleep is an important part of the human daily routine. Restoring sleep is strongly
related to a better physical, cognitive, and psychological well-being. By contrast, poor or
disordered sleep leads to possible impairments of cognitive and psychological functioning and to
a worsened general physical health. In this context, understanding changes in sleep quality
becomes a research imperative that leads to the need for the definition of what restoring or
quality sleep means. This understanding of what ‘‘sleep quality’’ means requires a cross-domain
investigation. It arises the need for a comprehensive study that offers a complete taxonomy of
sleep monitoring systems, with a focus on sleep quality, and that gives useful insights about
which combination of metrics, signals, and sleep variables is the best in relation to different
categories of users. The proposed study is focused on systematically categorizing the methods
and approaches for sleep quality understanding, with an emphasis on technological approaches,
including wearable, on-bed, and actigraphy devices. It offers a systematic review for researchers
who are interested in sleep quality identification tasks, and highlights strengths and weaknesses
of state-of-the-art metrics and solutions in order to suggest the best choice for new potential
research challenges in the field. Another important outcome of the proposed work is the study of
the impact on the identified signal metrics and solutions of the different target user populations
with their specific user requirements.

5
Improving Stress Management and Sleep Hygiene in Intelligent
Homes
YEAR:2020

DESCRIPTION:
High stress levels and sleep deprivation may cause several mental or
physical health issues, such as depression, impaired memory, decreased motivation, obesity, etc.
The COVID-19 pandemic has produced unprecedented changes in our lives, generating
significant stress, and worries about health, social isolation, employment, and finances. To this
end, nowadays more than ever, it is crucial to deliver solutions that can help people to manage
and control their stress, as well as to reduce sleep disturbances, so as to improve their health and
overall quality of life. Technology, and in particular Ambient Intelligence Environments, can
help towards that direction, when considering that they are able to understand the needs of their
users, identify their behavior, learn their preferences, and act and react in their interest.

This work presents two systems that have been designed and developed in the context of an Intelligent
Home, namely CaLmi and HypnOS, which aim to assist users that struggle with stress and poor sleep
quality, respectively. Both of the systems rely on real-time data collected by wearable devices, as well as
contextual information retrieved from the ambient facilities of the Intelligent Home, so as to offer
appropriate pervasive relaxation programs (CaLmi) or provide personalized insights regarding sleep
hygiene (HypnOS) to the residents. This article will describe the design process that was followed, the
functionality of both systems, the results of the user studies that were conducted for the evaluation of their
end-user applications, and a discussion about future plans.

Keywords:

ambient intelligence; smart home; stress management; sleep hygiene; sleep


monitoring; contextual awareness
6
Objective measures, sensors and computational techniques for
stress recognition and classification: A survey
YEAR:2021

Stress is a major growing concern in our day and age adversely impacting both individuals and
society. Stress research has a wide range of benefits from improving personal operations,
learning, and increasing work productivity to benefiting society – making it an interesting and
socially beneficial area of research. This survey reviews sensors that have been used to measure
stress and investigates techniques for modelling stress. It discusses non-invasive and unobtrusive
sensors for measuring computed stress, a term we coin in the paper. Sensors that do not impede
everyday activities that could be used by those who would like to monitor stress levels on a
regular basis (e.g. vehicle drivers, patients with illnesses linked to stress) is the focus of the
discussion.

Computational techniques have the capacity to determine optimal sensor fusion and automate
data analysis for stress recognition and classification. Several computational techniques have
been developed to model stress based on techniques such as Bayesian networks, artificial neural
networks, and support vector machines, which this survey investigates. The survey concludes
with a summary and provides possible directions for further computational stress research.

7
A clinical and technical methodological review on stress
detection and sleep quality prediction in an academic
environment
YEAR:2022

DESCRIPTION
In recent times there is an increased awareness in understanding the impact of Mental health on
the overall wellbeing of an individual. Mental health along with physical health is very much
required for one’s wellbeing and must be guarded more meticulously before it’s too late to
restore to its original form. Though mental health is a much talked about topic both in academics
and scientific research for a few decades now, there is an upsurge of mental illness as people are
challenged with different stressful events in various multitude of life scenarios which has added
to the existing pool of various mental issues post-outbreak of Covid-19 pandemic. According to
the World Health Organization(WHO), depression is one of the leading causes of disability in
achieving global developmental goals. About 20% of the world’s children and adolescents have a
mental health condition and suicide is the second leading cause of death among 15-29-year-olds
[1]. WHO also states that the mental health professionals in India are not on par with the
standard measures as there are just psychiatrists (0.3), and psychologists (0.07) per 100,000
population while the desirable number is anything above and beyond three psychiatrists and
psychologists per 100,000 population.Therefore this issue of imbalance in monitoring the
students mental health needs to be taken up with high priority failing to which has other
repercussions over students overall wellbeing.People suffering from stress, anxiety, and
depression are said to have multiplied post the outbreak of deadly Covid-19 [2]. However,
university students are mostly affected by sleep patterns which have resulted in an imbalance in
mental health and daytime dysfunction [3] Though students are vulnerable to psychological
disabilities, high academic pressure has also added to the lack of quality sleep post-Covid-19 [4].
This study is therefore conducted in the interest of the psychological health conditions and the
associated sleep health of the students post Covid -19.

8
1.6 PROPOSED SYSTEM
• In the proposed system, a framework is developed for detecting stress in sleep through the
parameters - snoring range of the user, respiration rate, body temperature, limb movement
rate, blood oxygen levels, eye movement, number of hours of sleep, heart rate from a dataset
by using Decision Tree algorithm.

• Based on the changes during sleep, stress prediction for the following day is proposed.

• Stress Levels are shown as 0 – low/normal, 1 – medium low, 2 – medium, 3 – medium high,
4 – high, that has been generated from Literature Review.

1.6.1 PROPOSED SYSTEM ADVANTAGES


 Early Detection: Identifying stress through sleep patterns can help catch problems early,
allowing for timely intervention and prevention of potential health issues.

 Non-Invasive: Monitoring sleep is non-intrusive and doesn't require direct interaction,


making it a comfortable and convenient method for stress detection.

 Continuous Monitoring: Sleep patterns can be monitored continuously, providing a


comprehensive picture of an individual's stress levels over time.

 Objective Data: Sleep data provides objective insights into stress levels, minimizing
subjective biases that may occur with self-reported stress assessments

You might also like