Project REPORT
Project REPORT
Project REPORT
Learning Techniques
ABSTRACT
Stress may be defined as the reaction of the body to regulate itself to
changes within the environment through mental, physical, or emotional
responses. Recurrent episodes of acute stress can disturb the physical and mental
stability of a person. This subsequently can have a negative effect on work
performance and in the long term can increase the risk of physiological disorders
like hypertension and psychological illness such as anxiety disorder.
Psychological stress is a growing concern for the worldwide population across
all age groups. A reliable, cost efficient, acute stress detection system could
enable its users to better monitor and manage their stress to mitigate its long-
term negative effects. In this article, we will review and discuss the literature
that has used machine learning based approaches for stress detection. We will
also review the existing solutions in the literature that have leveraged the
concept of edge computing in providing a potential solution in real-time
monitoring of stress.
INTRODUCTION
Stress is one of the main factors that are affecting millions of lives. Mental
stress needs to be in control as it results in different dangerous suffering. Timely
mental stress detection can help to prevent stress related health problems. It is
important to inform the person about his/her unhealthy life style and even alarm
him/her before any acute condition occurs. Stress detection technology could
help people better understand and relieve stress by increasing their awareness of
heightened level of stress that would otherwise go undetected. For this objective,
we design a smart device that has the capability of monitoring stress level
continuously in everyday activities. It not only sends alert to users via
smartphone but allows them to manage stress and share health data with doctors
and family. Remote patient monitoring using this device may increase access to
efficient caring and decrease health care delivery cost.
LITERATURE SURVEY
METHODOLOGY
In this project, the data is collected using IOT sensors such as temperature
sensor, skin conductance sensor and accelerometer. Skin conductance sensor is
used as physical activities stimulate sweat glands which can bring variation in
skin conductance. There is a data collection phase to collect the training
examples needed for the Logical regression algorithm. The collected data is
then fed into the appropriate Logical regression algorithm, which classifies
these set of parameters along with the user, into one of the stress levels. If any
abnormality in the stress level is detected, the user is notified on his smart phone
text message and is asked to take the necessary precautions. If there are major
changes in the stress level that can cause harm to the user’s health, or if any
chance of heart attack is predicted, the user, his emergency contacts and his
doctor are notified.
EXISTING SYSTEM
PROPOSED SYSTEM
The proposed system will attempt to create a device that monitors stress in
a continuous manner where the heart beat rate (using pulse sensor) and
skin conductance are used to determine the stress level.
The accelerometer sensor is a device that is used to measure acceleration
forces. Such forces maybe static or dynamic to sense movements or
vibrations.
These sensor information are collectively stored in the cloud.
Now, using an appropriate ML algorithms (like Logistic Regression), we
do the prediction on the data that is stored and the predicted results falls
into various classes such as undertrained, over trained etc.
BLOCK DIAGRAM
LCD
MICROCONTROLLER
Smoke sensor Buzzer
PYTHON Temperature
LAPTOP
(LM35)
HARDWARE REQUIREMENTS:
Computer – Processor, high speed is preferred. 64 - bit
Hard disk – Free space of 5GB
Laptop built-in Camera
Renesas Microcontroller
LCD display for Microcontroller
Temperature sensor(LM35)
Accelerometer
Smoke Sensor
Skin Conductance Sensor
Buzzer
SOFTWARE’S USED:
1. Python 3.7
2. Open CV tool
3. OS – Windows 8 / 10, 64 – bit.
4. Embedded C
5. Cube Suite+ Compiler
6. Renesas Flash Programmer V2.0
STRESS DATASET:
Renesas Microcontroller:
Features
General-purpose register: 8 bits × 32 registers (8 bits × 8 registers × 4
banks)
Control registers
The control registers control the program sequence, statuses and stack memory.
The control registers consist of a
program counter (PC), a program status word (PSW) and a stack pointer (SP).
The program counter is a 20-bit register that holds the address information of the
next program to be executed.
When a branch instruction is executed, immediate data and register contents are
set.
Reset signal generation sets the reset vector table values at addresses 0000H and
0001H to the program counter.
The program status word is an 8-bit register consisting of various flags set/reset
by instruction execution.
Program status word contents are stored in the stack area upon vectored interrupt
request is acknowledged or PUSH
PSW instruction execution and are restored upon execution of the RETB, RETI
and POP PSW instructions. Reset
This flag controls the interrupt request acknowledge operations of the CPU.
When 0, the IE flag is set to the interrupt disabled (DI) state, and all maskable
interrupt requests are disabled.
When 1, the IE flag is set to the interrupt enabled (EI) state and interrupt request
acknowledgment is controlled with an in-service priority flag (ISP1, ISP0), an
interrupt mask flag for various interrupt sources, and a priority specification flag.
instruction execution.
When the operation result is zero, this flag is set (1). It is reset (0) in all other
cases.
These are 2-bit flags to select one of the four register banks.
In these flags, the 2-bit information that indicates the register bank selected by
SEL RBn instruction execution is stored.
If the operation result has a carry from bit 3 or a borrow at bit 3, this flag is set
(1). It is reset (0) in all other cases.
This flag stores overflow and underflow upon add/subtract instruction execution.
It stores the shift-out value upon rotate instruction execution and functions as a
bit accumulator during bit operation instruction execution.
BUZZER
A "piezo buzzer" is basically a tiny speaker that you can connect directly to
an Arduino.
"Piezoelectricity" is an effect where certain crystals will change shape when
you apply electricity to them. By applying an electric signal at the right
frequency, the crystal can make sound.
5V Supply.
Figure: Buzzer
SMOKE SENSOR
Smoke alarms detect fires by sensing small particles in the air using a couple of
different kinds of technologies. Once they detect those particles above a certain
threshold, they signal the alarm to sound so that you and your family can get to
safety.Smoke alarms save lives
TEMPRETURE SENSOR – LM35:
A liquid crystal display consists of an array of tiny segments (called pixels) that
can be manipulated to present an information. Liquid crystals do not emit light
directly instead they use light modulating techniques.
LCDs are preferred to cathode ray tube (CRT) displays in most applications
because
3. Safer disposal
4. Energy Efficient
4. Glass substrate with common electrode film (ITO) with horizontal ridges
to line up with the horizontal filter.
6. Reflective surface to send light back to viewer. (In a backlit LCD, this
layer is replaced with a light source.)
It has a Panel with 2 rows and 16 column and with blocks as shown below with
5x7 pixel-selection pattern.
Operating Voltage
Pin Details
Timing Diagram
Write Mode
Read Mode
10K VR 1
3 1 +5 V
U1
2
VSS
VD D
V0
A LC D _R S RS
ALC D _R /W R /W
A LC D _E E
D B0 D B0
D B1 D B1
D B2 D B2
D B3 D B3
D B4 D B4
D B5 D B5
D B6 D B6
D B7 D B7
LED A
LED K
16x 2 ALP H A LC D
Make sure that 5V and GND lines are properly connected otherwise you may
end up in damaging parallel port.
If you want backlight than connect pin 15 of LCD to 5V and pin 16 of LCD
to GND. By adjusting 10k resistor make pin 3 of LCD at 0V. If connections are
proper you will see this after power on.
INCLUDEPICTURE "http://lcdinterfacing.googlepages.com/lcdok.bmp/lcdok-
medium;init:.jpg" \* MERGEFORMATINET INCLUDEPICTURE
"http://lcdinterfacing.googlepages.com/lcdok.bmp/lcdok-medium;init:.jpg" \*
MERGEFORMATINET INCLUDEPICTURE
"http://lcdinterfacing.googlepages.com/lcdok.bmp/lcdok-medium;init:.jpg" \*
MERGEFORMATINET
Flow Chart
LCD initialization
ALCD_Comm( 0x0E ); This command will make
the display
void on, cursor
ALCD_Init( void ) blinking
0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x
80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x
C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF
2. SOFTWARE IMPLEMENTAION
Cubesuite
CLICK NEXT
Select voltage reference “5V”
Figure : Python
NUMPY
NumPy is an open source library available in Python that aids in mathematical,
scientific, engineering, and data science programming. It works perfectly well
for multi-dimensional arrays and matrices multiplication. NumPy is a
programming language that deals with multi-dimensional arrays and matrices.
On top of the arrays and matrices, NumPy supports a large number of
mathematical operations.
NumPy is memory efficiency, meaning it can handle the vast amount of data
more accessible than any other library. Besides, NumPy is very convenient to
work with, especially for matrix multiplication and reshaping. On top of that,
NumPy is fast. In fact, TensorFlow and Scikit learn to use NumPy array to
compute the matrix multiplication in the back end.
During the Google I/O Conference in June 2016, Jeff Dean stated that 1,500
repositories on GitHub mentioned TensorFlow, of which only 5 were from
Google. Unlike other numerical libraries intended for use in Deep Learning like
Theano, TensorFlow was designed for use both in research and development and
in production systems, not least RankBrain in Google search and the fun
DeepDream project.It can run on single CPU systems, GPUs as well as mobile
devices and large scale distributed systems of hundreds of machines.
OpenCV
OpenCV (Open Source Computer Vision Library) is an open source computer
vision and machine learning software library. OpenCV was built to provide a
common infrastructure for computer vision applications and to accelerate the use
of machine perception in the commercial products. Being a BSD-licensed
product, OpenCV makes it easy for businesses to utilize and modify the code.
The library has more than 2500 optimized algorithms, which includes a
comprehensive set of both classic and state-of-the-art computer vision and
machine learning algorithms. These algorithms can be used to detect and
recognize faces, identify objects, classify human actions in videos, track camera
movements, track moving objects, extract 3D models of objects, produce 3D
point clouds from stereo cameras, stitch images together to produce a high
resolution image of an entire scene, find similar images from an image database,
remove red eyes from images taken using flash, follow eye movements,
recognize scenery and establish markers to overlay it with augmented reality,
etc. OpenCV has more than 47 thousand people of user community and
estimated number of downloads exceeding 18 million. The library is used
extensively in companies, research groups and by governmental bodies .Along
with well-established companies like Google, Yahoo, Microsoft, Intel, IBM,
Sony, Honda, Toyota that employ the library, there are many startups such as
Applied Minds, Video Surf, and Zeitera, that make extensive use of OpenCV.
OpenCV’s deployed uses span the range from stitching street view images
together, detecting intrusions in surveillance video in Israel, monitoring mine
equipment in China, helping robots navigate and pick up objects at Willow
Garage, detection of swimming pool drowning accidents in Europe, running
interactive art in Spain and New York, checking runways for debris in Turkey,
inspecting labels on products in factories around the world on to rapid face
detection in Japan.
It has C++, Python, Java and MATLAB interfaces and supports Windows,
Linux, Android and Mac OS. OpenCV leans mostly towards real-time vision
applications and takes advantage of MMX and SSE instructions when available.
A full-featured CUDA and OpenCL interfaces are being actively developed right
now. There are over 500 algorithms and about 10 times as many functions that
compose or support those algorithms. OpenCV is written natively in C++ and
has a template interface that works seamlessly with STL containers. The figure
shows the symbol of opencv library.
Figure : OpenCV
FUTURE WORK
Most of the works on stress detection are oriented towards psychological
stress detection. Although there have been few works on physiological stress
detection, there is further need for research towards detecting physiological
stress. Research should be conducted to design robust classification models that
can generalize classifications irrespective of the signal acquisition device and
configuration. This will ensure the applicability of a framework in any setting
irrespective of the type of edge devices and the configuration in which the data is
collected.
Another interesting research direction that could be explored is the use of
an edge-cloud framework which will distribute the process of pre-processing,
feature extraction and classification across different layers of edge and cloud.
This might be useful when integrating multiple end users to a single platform. In
this context, there are other research scopes such as dealing with the massive
amount of data that might be generated at the edge with time. Works are being
done in this field to enhance the quality of data storing and retrieval mechanisms
in an edge cloud settings. Ensuring privacy, security, and confidentiality of the
data streams generated is also another exciting research direction. Another
direction that would be interesting to explore is to study the effectiveness of
different intervention mechanisms in mediating acute stress responses. This will
be a critical step towards developing a ubiquitous stress detection and
management system which has the potential to further develop into a smart
health monitoring system. Finally, real-time monitoring of stress can be
integrated in a smart home environment to assist older adults and persons with
dementia or cognitive impairment.
RESULTS AND CONCLUSIONS
1. A dataset containing the stress classifications for a set of parameters.
2. Predicting the stress levels using ML algorithms with good accuracy.
3. A system that monitors changes in stress levels of a user in their everyday
activities and notifying them on these changes.
REFERENCES
[1] S. Cohen, R. C. Kessler, and L. U. Gordon, Strategies for measuring stress in
studies of psychiatric and physical disorders. Oxford University Press, 1995.
[2] B. Mcewen, “Protective and damaging effects of stress mediators: Central
role of the brain,” Dialogues in clinical neuroscience, vol. 8, no. 02, pp. 367–81,
2006.
[3] P. Adams, M. Rabbi, T. Rahman, M. Matthews, A. Voida, G. Gay, T.
Choudhury, and S. Voida, “Towards personal stress informatics: Comparing
minimally invasive techniques for measuring daily stress in the wild,” in
Proceedings of the 8th International Conference on Pervasive Computing
Technologies for Healthcare, 2014, pp. 72– 79.
[4] S. Greene, H. Thapliyal, and A. Caban-Holt, “A survey of affective
computing for stress detection: Evaluating technologies in stress detection for
better health,” IEEE Consumer Electronics Magazine, vol. 5, no. 4, pp. 44–56,
Oct 2016.
[5] H. Thapliyal, V. Khalus, and C. Labrado, “Stress detection and management:
A survey of wearable smart health devices,” IEEE Consumer Electronics
Magazine, vol. 6, no. 4, pp. 64–69, Oct 2017.
[6] J. Bakker, M. Pechenizkiy, and N. Sidorova, “What’s Your Current Stress
Level? Detection of Stress Patterns from GSR Sensor Data,” in Proceedings
IEEE 11th International Conference on Data Mining Workshops, 2011, pp. 573–
580.
[7] A. de Santos Sierra, C. Sanchez Avila, J. Casanova, and G. Bailador, “A
Stress-Detection System Based on Physiological Signals and Fuzzy Logic,”
IEEE Transactions on Industrial Electronics, vol. 58, pp. 4857–4865, November
2011.
[8] C. Setz, B. Arnrich, J. Schumm, R. La Marca, G. Trà ˝uster, and U. Ehlert,
“Discriminating Stress From Cognitive Load Using a Wearable EDA Device,”
IEEE Transactions on Information Technology in Biomedicine, vol. 14, no. 2,
pp. 410–417, 2010.
[9] S. Yoon, J. Kyoung Sim, and Y.-H. Cho, “A flexible and wearable human
stress monitoring patch,” Scientific Reports, vol. 6, p. 23468, 03 2016.