Artificial Neural Network based Sleep-Wake Classification for Detecting Onset of Heart Disease

foulchilianΤεχνίτη Νοημοσύνη και Ρομποτική

20 Οκτ 2013 (πριν από 3 χρόνια και 7 μήνες)

67 εμφανίσεις

Artificial Neural Network
based
Sleep
-
Wake Classification for
Detecting
Onse
t of Heart Disease

Chau Nguyen

Yale University

Abstract

In this paper, w
e propose
a novel
sleep
-
wake
cycle
classification

approach

based on
a wearable heart
monitoring system
,
for the purpose of detecting

the onset of coronary heart disease. Compared with
other existing sleep
-
wake classification meth
ods that make

use of difficult
-
to
-
obtain EEG and ECG
spectrum, our approach makes use of only the heart rate and acceleration data

classified by a simple
-
to
-
implement artificial neural network
, making it a suitable candidate for deployment

in system limited by
computing power or sensing accuracy.

1.
Introduction

Sleep
-
wake classification is a well
-
researched topic.
The importance of s
leep
-
wake cycle lies in its ability
to predict onset of disease. Patients at high risk of heart attack have been known to have worsening
sleep
-
wake cycles in the period leading to the attack.
The most standard approaches
for sleep
-
wake
classification
often

make use of the three basic physiological signal measurements: brain waves called
electroencephalography (EEG), eye movements called electrooculography (EOG) and electrical muscle
activity called electromyography (EMG). This approach is widely known as po
lysomnography (PSG).
Although highly accurate, PSG
is intrusive and
often requires complicated sensing equipments
that are
only available in a clinic or laboratory environment, making it unsuitable for use in a wearable system
. A
simpler method for sleep
-
w
ake classification makes use of Actigraph which employs accelerometer
s

to
access the muscle activity of the limbs. Actig
raph, however, is limited by accuracy and by its inability to
distinguish between sleep and a normal resting state. Other researchers su
ch as …makes use of the
power spectrum of the ECG

(e
lectrocardiogr
aphy or
the electrical activity of the heart
) as well as the
spectrum of HRV (heart rate variability). These approaches yiel
d better results than Actigraph;

however,
their limitation lies in the intensive data rate and computing power required as well as the
required
accuracy of the ECG signal

obtained
. We propose the use of
just the heart rate in conjunction with
acceleration data. Heart rate has been known
to drop around 20% during sleep and can be accurately
obtained from either a poor ECG signal or a LED
-
based oximeter attached to the finger. Acceleration
data can be obtained from
miniature

MEMS
-
based accelerometers, available in a variety of platforms,
ma
king
it an ideal candidate or inclusion
in a

wearable system.
We use an artificial n
eural network to do
the clas
sification

of data into sleep
-
wake. The artificial neural network is chosen due to their
capability
for nonlinear class separation and the possi
bility to efficiently implement them on a microcontroller
.


2.
Sensing Infrastructure

We propose the use of a wearable sensing system for sleep
-
wake classification as
data
resulted from
constant monitoring will provide a more accurate picture of the patie
nt’s condition than periodic data at
long interval in a clinic setting.
Many systems have been developed for remote heart monitoring such as
the LiveNet system developed by the MIT Wearable Computing Group or the CodeBlue project at
Harvard. Many of these
systems often rely on intricate sensors developed in
-
house or specialized PDAs
running

Linux. Our system is

instead
based on off
-
the
-
shelf commercially available
components such as
the
Alive Heart Monitor and the popular Blackberry handheld device, which

a
llow
s

for quick adoption
and scalability. Moreover, most of the heart monitoring applications so far have focused on the analysis
of ECG signals such as looking for signs of various
arrhythmia

conditions. Our research demonstrates
that more capabilities ca
n attained if we make use of both the ECG and acceleration data on such a
system
, in this case to identify sleep
-
wake cycle
.

We have

integrated this sensing
infra
structure with the
BScope, a Django
-
based web portal developed by our lab which allows authori
zed medical specialists to
manage and view the patient’s data securely over the internet in real
-
time.

The work flow t
o get the data

from the hea
rt monitor to the BScope Portal

is as follow. The heart
monitor
worn by the patient
automatically
records the
sensors

data

for ECG and acceleration

to a file on
an SD, which will be read by a PC. Alternately, the PC
or Blackberry
can record th
e
sensor
data directly to
a file through the Bluetooth connection with the monitor. In both cases, the file is recorded in the Alive
Technologies proprietary ATS format, which can be converted to the more popular European Data
Format (.edf) using ATSConver
t, a program pr
ovided with the heart monitor. We

have developed

a

Python program

to read the
content of
f

the
edf file and automatically
import the sensor data

into
MySQL

server
. This involves several steps. First the EDF file is converted to CSV files. The

starting time
and date for the data is extracted and a UNIX timestamp is then calcul
ated for every data point. The
data is

then upload
ed to the appropriate table in MySQL

server
, which can be accessed by the BScope

portal
.










Alive Heart Monitor

PC/Blackberry records
sensors data in .ATS

.EDF
-
> text
-
>
MySQL

server

BScope
Portal


3. Experiment

The
subject

wore the Alive Heart Rate monitor
on the chest
for 18 hours

between 11:08:49pm on Oct 7
and 5:13:41pm on Oct 8.
During that period, the subject engaged in a number of different activities:
sleep
ing, walking to class, sitting for lecture,

and exercising at the gym.
The following
graphs display
the
instantaneous
heart rate
and acceleration
over that period
.

The data
obtain
ed

confirms the results in
the literature that

heart rate is 20
-
30%
lower during sleep.
Also as expected,
the accelerati
on is
lower during sleep.


















4. Sleep
-
wake classification usin
g the artificial neural network

We build a standard back
-
propagation
feed
-
forward
fully
-
connected
artificial neural network with
1
hidden layer,
12 input neurons and 1 output neuro
n to classify the data

into sleep and wake
.
The 12
inputs are prepared as follow. The data for the past one minute is divided into 6 periods of 10 seconds.
The instantaneous heart rate and the magnitude of the acceleration are averaged out for each of thes
e
10 second intervals, giving 12 inputs

to be

fed to the neural network. We feed the data from the past
one minute to the neural net instead of just feeding the current data because variation in heart rate
(HRV) and acceleration can potentially be one of t
he nonlinear rules for classifying sleep
-
wake that we
want the neural network to learn. We train the neural net with one hour of sleep data
(the
5
th

hour

after
the start of the experiment
)
and one hour of wake data

(
13
th

hour)
.
The desired output is 0 for
sleep and
1 for wake. The method used to

train the neural net
work is back
-
propagation in which the error in
learning is fedback to adjust the weight of the neurons.
After 10000
0 iteration
s
, the network
successfully learns the

training set within an
error

o
f
0.0
113
.
We then test the network on
two
other
one
-
hour chunks of data
(testing set): the sleep data during
8
th

hour and the wake data during the
17
th

hour
to access its performance.

For the sleep data
at the 8
th

hour, the test

give
s a mean square

error
of
0.022 with 3 failed test
-
points out
of 354 test
-
points.

F
or the wake data at the 17
th

hour, the test

gives
a
mean square

error of 0.001519
with 0 bit failed
.
A test
-
point is considered failed if the output differs by
more than 0.35 from the desire outpu
t.
Both errors are small indicating that the neural net correctly
classifies
most

of
the data points in these testing sets.


We then proceed to test
the neural net on
the entire sleep
-
wake data for the 18 hours and observe the
output of the neural net


Using the criteria output <0.5 for sleep and >0.5 for wake, it seems that the neural net work has
managed to classify the sleep
-
wake pattern accurately for more than 90% of the time.
This is remarkable
because the neural net has only been trained using the

data
from
5
th

and 13
th

hours.
There are however,
periods that the neural network has classifie
d incorrectl
y. This happens for short periods
at around

2, 7
and 17 h
ours

after the start of the experiment. It is expected that if the neural network is trained

using
the data from a longer

period

such as the entire sleep
-
wake data for 24 hours
, the accuracy rate will
improve.


To test this hypothesis
, we obtain
ed

a
nother
set of experiment
al

data.

The subject wore the heart
monitor for 24 hours between 7:30pm Nov
ember 11, 2009 and 7:30pm November 12, 2009. This

entire
set of data wa
s
then
used to train the neural network as before.

After 10
6

iterations, the network successfully learns the training set with a mean square error of 0.05.
The network obtained is then

tested on the first set of data (18hours) and the results are plot
t
ed.


Again if we use the criteria output <0.5 for sleep and >0.5 for wake, it seems that the neural net work
has managed to classify the sleep
-
wake pattern accurately for more than 90% of

the time. However, the

neural network seems to classify the wake periods better than sleep periods
, because the sleep data
seems to be noisier. To correct for this we repeat the experiment with a slightly different procedure in
preparing the 12 inputs to
the neural network.

The data for the past six minutes is divided into 6 periods
of 60 seconds instead of 10 seconds. The instantaneous heart rate and the magnitude of the
acceleration are averaged out for each of these 60 second intervals. This procedure s
eems to improve
the prediction accuracy, as depicted in the graph below.