100% found this document useful (1 vote)
58 views8 pages

ECG-based Heartbeat Classification in

This document describes a system for classifying heartbeats using electrocardiogram (ECG) signals processed with a spiking neural network implemented in neuromorphic hardware. The system encodes ECG signals as spike trains, classifies patterns with a recurrent spiking neural network, and achieves 95% accuracy on a standard dataset. It demonstrates an energy-efficient approach for always-on heart monitoring in wearable devices.

Uploaded by

Phuong an
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
58 views8 pages

ECG-based Heartbeat Classification in

This document describes a system for classifying heartbeats using electrocardiogram (ECG) signals processed with a spiking neural network implemented in neuromorphic hardware. The system encodes ECG signals as spike trains, classifies patterns with a recurrent spiking neural network, and achieves 95% accuracy on a standard dataset. It demonstrates an energy-efficient approach for always-on heart monitoring in wearable devices.

Uploaded by

Phuong an
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

IJCNN 2019. International Joint Conference on Neural Networks. Budapest, Hungary.

14-19 July 2019

ECG-based Heartbeat Classification in


Neuromorphic Hardware

Federico Corradi1 , Sandeep Pande1 , Jan Stuijt1 , Ning Qiao2 , Siebren Schaafsma1 ,
Giacomo Indiveri2 , and Francky Catthoor3,4
1 Stichting IMEC Nederland, High Tech Campus 31, Eindhoven 5656 AE, The Netherland
2 Institute of Neuroinformatics, University of Zurich and ETH Zurich, Switzerland 3
IMEC Leuven, Kapeldreef 75, 3001 Heverlee, Belgium
4 KU Leuven, ESAT Department, B-3001 Leuven, Belgium

Email: [email protected]

Abstract—Heart activity can be monitored by means of Specifically, we demonstrate heartbeat classification using
ElectroCardioGram (ECG) measure which is widely used to Spiking Neural Network (SNN) in a neuromorphic hardware
detect heart diseases due to its non-invasive nature. Trained implementation.
cardiologists can detect anomalies by visual inspecting recordings
of the ECG signals. However, arrhythmias occur intermittently The key contributions of this work are:
especially in early stages and therefore they can be missed in
routine check recordings. We propose a hardware setup that • We introduce a method for encoding and compressing
enables the always-on monitoring of ECG signals into wearables. the ElectroCardioGram (ECG) signals into a stream of
The system exploits a fully event-driven approach for carrying asynchronous digital events (i.e. spike trains).
arrhythmia detection and classification employing a bio-inspired
spiking neural network. The two staged Spiking Neural Network • We demonstrate that the compressed ECG signals can
(SNN) topology comprises a recurrent network of spiking neurons be correctly classified after a dimensionality expansion
whose output is classified by a cluster of Leaky integrate- performed by a recurrent SNN.
and-fire (LIF) neurons that have been supervisely trained to
distinguish 17 types of cardiac patterns. We introduce a method • We demonstrate high accuracy of classification after
for compressing ECG signals into a stream of asynchronous training Leaky integrate-and-fire (LIF) neurons to dis-
digital events that are used to stimulate the recurrent SNN. Using criminate one out of 18 classes (see table II) in a
ablative analysis, we demonstrate the impact of the recurrent SNN supervised manner, from a large number of spatio
and we show an overall classification accuracy of 95% on the temporal spike patterns produced by the recurrent
PhysioNet Arrhythmia Database provided by the Massachusetts SNN.
Institute of Technology and Beth Israel Hospital (MIT/BIH).
The proposed system has been implemented on an event-driven • We validate our system exploiting a state-of-the-art
mixed-signal analog/digital neuromorphic processor. This work custom mixed-signal analog/digital Very Large Scale
contributes to the realization of an energy-efficient, wearable, Integration (VLSI) neuromorphic processor that im-
and accurate multi-class ECG classification system. plements the recurrent SNN.

I. Introduction • We explore, using software simulation, a simplified


version of the recurrent SNN that is compatible with
Neuromorphic computing is a promising alternative com- a digital embedded implementation. We demonstrate
putational approach to standard von Neumann machines for that our computational approach achieves high classi-
dedicates sensory-processing or classification tasks. Neuro- fication accuracy also with this simplified SNN model.
morphic systems emulate the biophysics of neuro-biological
architectures by emulating the massively parallel information In the next Section we discuss related works. Related
processing abilities of the brain. Computation and communica- works are discussed in Section II. The overall design flow is
tion in this novel type of devices are co-localized [1] and they introduced in Section III. Results are presented in Section IV
are based on the hypothesis that neuronal spiking activity is a and conclusions in Section VI.
key element of information processing within neuro-biological
systems [2]. Todays bio-inspired neuromorphic computing sys- II. Related Work
tems are gaining a considerable level of attention due to their
massively parallel information processing abilities, low latency, Traditional automated arrhythmia classification systems
and their low-power performance [3]–[5]. that exploit signals measured from a ECG device are usually
based on the following computational steps: a) recording
Within this context, we propose a realization of a spike- and storing of the ECG signal, b) ECG signal filtering and
based solution for detecting cardiac anomalies that is compat- preprocessing, c) heartbeat segmentation, d) feature extraction,
ible with the principle of information processing of spiking e) learning and classification. The first step follows the standard
neural network, that is scalable, real-time, and offers state-of- von Neumann approach, to store and retrieve data on/from an
the-art performance in terms of accuracy. external memory block (and consuming power in doing so).
978-1-7281-2009-6/$31.00 ©2019 IEEE paper N-19235.pdf
Personal use is permitted, but republication/distribution requires IEEE permission.
See http://www.ieee.org/publications standards/publications/rights/index.html for more information.
IJCNN 2019. International Joint Conference on Neural Networks. Budapest, Hungary. 14-19 July 2019

The second step is commonly carried with wavelet transform, and convert the high-fidelity ECG trace in a four channel
Kalman filtering or other standard signal processing algorithms spiking outputs. Every ECG channel is encoded in two outputs
[6]–[8]. The heartbeat segmentation is based on the detection (ON/OFF channels), digital events from each channel mark the
of the QRS complex of the ECG signals [9], [10]. Feature time at which the input signal has changed more (ON) or less
extraction is carried with different methods that include fil- (OFF) than a fixed threshold. The encoding of the input signal
tering, embeddings and wrapper methods. Filter methods rely is executed for each ECG input channel with the following
on the statistical properties of the signal and are based on algorithm 1.
correlations matrix or linear decomposition with independent
component analysis [11]. Embeddings and wrapper methods Data: ECG single-lead trace
are more computationally expensive than filtering techniques Result: UP; DN (two vectors of spikes)
as they require a trained classifier and their role is to optimize dc = 0;
the output with a variety of feature sets. The classification while input trace do
of ECG signals have been performed using Support Vector read_trace_current ;
Machine (SVM) [12], [13], neural network approaches [14], current_time ;
[15], and feature based clustering methods [16], [17]. if read_trace_current > dc + δ then
In this work, we propose an alternative approach that dc = read_trace_current;
is compatible with state-of-the-art spike based neuromorphic UP.append(current_time);
processors of the kind recently realized as research prototypes end
by different companies and research institutions [3]–[5]. In fact, if read_trace_current < dc − δ then
our method exploits a spiking neural network that operates on dc = read_trace_current;
streaming data, without the need to use memory buffers for ex- DN.append(current_time);
tra signal filtering steps, without segmenting the heartbeat and end
without a clever feature extraction method. In our approach, end
Algorithm 1: Delta modulator algorithm. Given a high-
we directly convert ECG signals into digital pulses (i.e. spike
fidelity ECG trace, this algorithm outputs two vectors of
trains); we cast the problem of ECG signals classification into
spikes (UP,DN).
a temporal spike patterns classification problem. This problem
is still a major challenge in computational neuroscience, and
machine learning. It can have great influence in the design of The threshold δ represents the incremental or decremental
embedded electronic systems [18], [19]. Many key mechanisms change of the input signal that causes a single spike. Given
are already available thanks to recent efforts devoted to the an ECG input trace in the normalized range [0, 1], we set the
understanding of the role of spike-timing in neural information threshold δ = 0.003. The lower threshold results in dense spike
processing system [20], [21]. We base our work on these efforts patterns and vice versa. With this parameterization an ECG
and we propose a fully spike-based system for ECG arrythmia complex is encoded in about 250 spikes in total. The temporal
detection and classification. precision has been fixed to one microsecond.

III. Methods C. Recurrent Spiking Neural Network


A. System overview The recurrent SNN is composed of 320 spiking neurons
The proposed system is illustrated in Figure 1. The archi- organized in two dense clusters. One cluster contains 256
tecture is fully event-driven and consists of three main blocks. excitatory neurons while the second cluster contains 64 in-
hibitory neurons. The SNN has been simulated in software
1) The ECG input signals are converted into digital with a simplified Integrate-and-Fire (I&F) neuron model. In
pulses (i.e. spikes) by two delta modulators. These addition, the SNN have been implemented in an hardware
delta modulators convert ECG signals into temporal neuromorphic processor, and real-time performance have been
spike patterns as if they were produced by four obtained. In this case, the hardware analog neurons behave
spiking neurons (plus and minus circles in fig: 1). accordingly to a bio-realistic adaptive exponential LIF neuron
2) A recurrent SNN receives inputs from the delta model. Description the these two models is given in details in
modulators and performs a dimensionality expansion sections III-E,IV-B respectively. More information about the
of the inputs. hardware analog neurons and the neuromorphic processor is
3) A pool of LIF neurons are supervisely trained to clas- presented in [5].
sify the different temporal spike patterns produced by The input layer of the network is represented by the ON
the recurrent SNN. The spikes from the LIF neurons (+) and OFF (−) output channels of the delta modulators.
are counted and the most active class is selected. These channels can be seen as four input neurons that emit
In the next subsections we explain in details all these blocks spike patterns. These input neurons make fixed random con-
and we describe the supervised training algorithm. nections to 20% of the synapses of the excitatory cluster
of neurons. The weights of the input connections are drawn
B. ECG Signal Compression and Encoding in Spikes from a Gaussian distribution centred around zero (μ = 0)
with a standard deviation of σ = 0.08. Connectivity levels
The role of the delta modulator is to compress the two- among the excitatory and inhibitory pools of neurons in the
lead ECG signal and to convert this signal in spike patterns. SNN are the followings: Exc − Exc = 30%, Exc − Inh = 20%,
These delta modulators have been implemented in software Inh − Exc = 10%, Inh − Inh = 20%. Connectivity levels refer

-2- paper N-19235.pdf


ECG-based Heartbeat Classification in Neuromorphic Hardware

input signals full spike-based processing output

+
-

num spikes
+
- class id

ECG DELTA MODULATORS RECURRENT SPIKING NEURAL NETWORK LIF READOUTS


Fig. 1: System architecture. ECG input signals are loaded from the MIT/BIH dataset. Two delta modulators convert signals into spike patterns, every ECG lead
is encoded in two channels ON (+) and OFF (−). The recurrent SNN architecture is composed of two dense clusters of neurons interconnected with excitatory
and inhibitory connections among themselves. Output spikes from the SNN are sent to a LIF neurons layer. These LIF neurons perform classification of the
spike pattern by selectively firing when specific spike patterns are present.

section we show the limited impact of this restriction on the


overall performance of the system.

D. Software SNN and I&F Neuron model


The recurrent SNN is simulated with a simplified I&F
neuron model with no leak. The neuron integrates pre-synaptic
input spikes which are transmitted in form of digital pulses.
These pulses cause the neuron’s membrane potential (Vmem )
to immediately increase, when Vmem reaches a threshold value
a spike is emitted and the membrane potential is reset to a
constant value (Vrst ). The evolution of the membrane potential
(Vmem ) for the neurons in the recurrent SNN behaves accord-
ingly to:

i
Vmem = Vrst + ∑ wi ∑(t − ti j )
j j

Fig. 2: top) Die picture of the multi-core neuromorphic processor used to


implement the recurrent SNN, the die is a prototype chip designed by UZH Here, t represents time, and wi is a set of synaptic weights.
and ETH Zürich, see [5] for more details. The multi-neuron chip is organized ti j is the time of spike of the jth spike of the ith presynaptic
in 4 cores, each of which containing 256 neuron and synapse units. bottom) neuron. We used Vrst = 0 and the threshold φ = 1.
Dynamic Asynchronous Neuromorphic Processors DYNAP-SE-1. This system
hosts 4 neuromorphic processors and enable the use of them via a USB The synaptic weights for all the excitatory connections has
communication with a standard desktop computer (see [22]). been drawn from a Gaussian distribution with μ = 0.04 and
σ = 0.04. While the inhibitory connections have also been
drawn from a Gaussian distribution in the opposite direction
(μ = −0.04,σ = −0.04).
to the probability that one neuron has to make a connection to
any other neuron in the destination cluster. All neurons in the recurrent SNN have been connected in
an all-to-all fashion to a pool of LIF neurons (fig:1 whose
Network implementation in the analog neuromorphic pro- membrane potential (VLIF ) is described by the following equa-
cessor does not allow to store predefined high-resolution tion:
synaptic weights. For this reason, in the analog neuromor-
phic processor, the weights of the network have not been
precisely mapped from the software simulation, but only the
i
VLIF = Vrst + ∑ wi ∑ k(t − ti j )
distributions and the average connectivity levels have been j j
maintained. This has been necessary because of the inability
of the current version of the neuromorphic analog processor to in which we have introduced the term k(t). This term
store predefined high-resolution synaptic weights. In the results represents an exponential kernel function that is defined as:

-3- paper N-19235.pdf


IJCNN 2019. International Joint Conference on Neural Networks. Budapest, Hungary. 14-19 July 2019

1.0 1.0

amplitude [au]

amplitude [au]
0.5 0.5

0.0 0.0

0.5 reconstructed form spikes 0.5 reconstructed form spikes


ECG MIT/BIH ECG MIT/BIH
1.0 1.0
0.00 0.05 0.10 0.15 0.20 0.25 0.30 0.00 0.05 0.10 0.15 0.20 0.25 0.30
40 40
+ ON
ONch
ch + ON ch

- OFF ch 30
- OFF ch 30

num. spikes

num. spikes
20 20
ON ch ON ch
OFF ch 10 OFF ch 10

0 0
0.00 0.05 0.10 0.15 0.20 0.25 0.30 0.00 0.05 0.10 0.15 0.20 0.25 0.30
time [sec] time [sec]

Fig. 3: Delta modulator and ECG input signal. top) ECG trace from the MIT/BIH dataset superposed to its reconstruction after compression carried by delta
modulator. bottom) Delta modulator output. Spikes are shown as vertical bars (ON/OFF). The average number of spikes is shown as continuous and dotted
lines, the time bin used to calculate the number of spikes has a size of 170ms.

1) SVM for multi-class classification: we have used the


−(t−ti )2 solver provided by the open-source C library libsvm [24]
k(t) = e τe
that implements a one-against-one approach for multi-class
classification [23]. We have constructed k(k − 1)/2 classifiers
ti represents the time of arrival of a spike, and the fixed (k = 18 classes) and each one is trained with data from two
decay constant has been set to τe = 0.0003. In section IV-C classes. During the classification phase, we have exploited a
we motivate the specific choice of the parameter τe . voting strategy: each binary classification is considered to be
a voting where votes are cast for all data points. In the end,
a point is designated to be in the class with the maximum
E. Training LIF classifiers number of votes.
The output of the recurrent network has been used to 2) LIF readouts for multi-class classification: training
supervisely train (using software simulations) a pool of LIF a LIF neuron readout means finding the optimal synaptic
neurons that would selectively fire when a spike pattern of the weights. In our approach we convert every SVM into a single
corresponding class is presented at the inputs. LIF neuron which solves a binary classification problem, we
In order to achieve such classification exploiting LIF neu- have constructed a pool of k(k − 1)/2 = 153 neurons. The
rons, we first trained in standard SVM and then we converted synaptic weights for a neuron can be obtained by transforming
the numerical results into weights vectors for a pool of LIF the hyperplane coefficients W of the respective SVM. To
neurons. The method that we have followed was first introduced achieve that, one only need to multiply the coefficients W
in [21]; here we report some of the mathematical steps and the with φ /ρ, where φ is the LIF firing threshold. The membrane
details of our design. potential of the LIF neurons is therefore described by the
following dot product:
Let us consider the pattern classes P p , p = 1, .., 18. Each
spike pattern is composed of incoming spikes that are produced
VLIF (t) = (φ /ρ)W · f (ti )
by the recurrent pool of 320 neurons over a presentation time
T . Let ti j be the time of the jth spikes of the ith neuron. We
can consider the impact of a spike train at the postsynaptic The result can be intuitively described as constraining the
site after the application of the constant kernel function k(t). synaptic weights such that the membrane potential of a LIF
In other words, at each time t, we evaluate a vector f (t) = neuron is below the firing threshold for patterns that are outside
( f1 (t), f2 (t), .., fn (t)) where fi (t) = ∑ j k(t − ti j ). This means the desired class, and above (at leat for one time t) for the
that the spike pattern is transformed into a set of points f p = desired target class (see LIF neurons in fig: 4).
{ f (tl )} that is sampled at fixed intervals tl = Δl (see f (tl ) in A winner-take-all strategy on all LIF neurons can then be
fig: 4). The intent of the classification is to find a hyperplane applied as a voting scheme. This process ensures a complete
X(W, b) defined as match between classification carried by SVMs and a pool of
LIF neurons.
W1 f1 +W2 f2 + ... +WN fN − ρ = 0 IV. Experimental Results
A. ECG encoding and data compression
that separates at least one point from a pattern that is part
of class Pq to all patterns in another class Ph . SVM can be The ECG recordings from the MIT/BIH dataset are in a
used to solve this task. In our multi-class problem, we used the high-fidelity format. These signals are digitized at 360 samples
approach of one-against-one as originally proposed in [23]. per second per channel with a resolution of 11-bit over a

-4- paper N-19235.pdf


ECG-based Heartbeat Classification in Neuromorphic Hardware

ON
B. VLSI implementation of the Recurrent Spiking Neural Net-
DELTA MOD OFF
ON work
OFF
The recurrent SNN has been implemented in a custom
f(tl) VLSI neuromorphic processor, the "CX-Quad" [5]. The neuro-
morphic processor is an asynchronous multi-neuron chip that

(t)
includes analog neuron and synapse circuits, as well as an

FILTER k
asynchronous digital logic. The "CX-Quad" is optimized for
maximizing re-configurability, scalability while at the same
RECURRENT
time minimizing power consumption as well as latency. The

SYNAPTIC
NEURON ID

SNN
"CX-Quad" device contains 1024 neurons organized in 4 cores
of 256 units. Each unit contains one neuron and one synapse
block. The synapse block is constituted by an analog linear
integrator circuit which integrates input events from 64 12-
bit programmable Content Addressable Memory (CAM) cells.
The proposed recurrent SNN requires only 2 cores. One core
for hosting 256 excitatory neurons, and a second one for
instantiating 64 neurons of the inhibitory population. The neu-
LIF ral dynamics is emulated using subthreshold analog circuits,
READOUTS THRESHOLD
and the neuron model is a bio-realistic adaptive-exponential
I&F neuron circuit. The on-chip analog synaptic dynamics
num spikes

is achieved thanks to log-domain Differential Pair Integrator


(DPI) filters that emulate a bio-realistic temporal synaptic
dynamics, with time contants in the range of tens of ms. All the
class id recurrent connections of the SNN are routed directly on-chip
TIME [0.3 s]
thanks to the on-chip routing system. In our experiment, we
have used a USB communication port to connect the device to
Fig. 4: Full spike-based processing pipeline. Processing flow is from top to a host computer that has been used to convert ECG signals into
bottom. top - Delta Mod) ECG input signals are converted in spikes by two spike trains by implementing in software the delta modulators
delta modulators. middle - Recurrent SNN) Raster plot for the first 180 (as described in section III-B). We have used the open-source
neurons in the recurrent SNN. Every dot represents one spike emitted by a
neuron. Horizontal lines define the first 31 neurons. The blue traces on the library libcaer for communicating spike events to and from
right, represent the effect of the spikes of the first 31 neurons to LIF readout the "CX-Quad". Our application has been fully written in C++
neuron after the application of the synaptic kernel k(t) with time constant equal and performs in real-time.
to τe = 3x10−5 . bottom - LIF readouts) Raster plot for the 153 LIF neurons.
Colors encode LIF neuron’s id. The histogram groups spikes obtained for each
class, collected as a vote. On the right, it is shown the membrane potential C. Parameters Optimization
for all LIF readout neurons. The threshold has been determined exploiting
equivalent SVMs. The recurrent SNN expresses a wide range of network dy-
namics. This dynamics strongly depends upon the connectivity
levels, the interaction among excitatory and inhibitory recur-
rent connections, as well as from the amount and distribution
of input connections. By varying the connectivity levels, it
has been possible to observe full synchronicity, cluster states,
attractor states, and asynchronous dynamics [26].
10mV range. In our experiment, we have compressed such In this work, we analyze the dynamics of the recurrent
data with the delta modulator algorithm 1. Fig: 3 shows a SNN from the point of view of the readout neurons whose
sample of an ECG trace that has been converted in spikes task is the classification of the ongoing spatio temporal spike
using the proposed lossy delta modulator scheme. The benefits patterns produced by the recurrent SNN. The goal of our
of this type of encoding are the sparsity of the spikes, the experimental setting is to use the recurrent neural network
low-bandwidth requirements and the on-demand nature of the as a high dimensional projection of the input patterns. In
encoding (when input signal is not changing, no output spikes our settings, network dynamics needs to be tuned to produce
are produced). The bottom plot in fig: 3 shows a trace of transient states that relates to the input patterns in a non-linear
spikes; when there is no change in the input signal, both manner.
output channels (ON/OFF) are active at very low rate. The
encoding of the two ECG complexes, over the full period of 1) Parameters Optimization in the VLSI neuromorphic pro-
[0.0 − 1.4] sec, results in a total of 717 spikes. The top plot cessors: configurations that exhibit stable states and ongoing
in fig: 3 shows the reconstruction of the original ECG trace activations even in the absence of inputs have been avoided
carried using the spikes produced by the delta modulator. The by reducing the connectivity levels of the recurrent connection
reconstruction achieve an average of 12dB Signal to Noise in the excitatory population, and by increasing the level of
Error Ratio (SNER) between the original and the reconstructed inhibitory connections from the inhibitory clusters of neurons.
ECG signals. Previous work has demontrated that these delta This can be experimentally done in the "CX-Quad" device
modulator are feaseable to be implemented in VLSI hardware thanks to the use of the effective transfer function of the
and are compatible with neuromorphic systems [25]. system as in [27]. This measure enable us to tune the analog

-5- paper N-19235.pdf


IJCNN 2019. International Joint Conference on Neural Networks. Budapest, Hungary. 14-19 July 2019

96
hardware parameters (biases) of the "CX-Quad" as synaptic 16 bits
8 bits
time constants, mean synaptic efficacy, neuron’s refractory 95 4 bits
period, and neuron’s firing threshold such that network dy-
namics does not fall in stable states. If the network dynamics 94

would exhibits stable states, upon the presentation of an input


93
stimulus network dynamics would relax into a prototypical

Accuracy
pattern of activity performing a dimensionality reduction of
92
the input stimulus [28]. On the other hand, if the network
dynamics would be completely driven by the input, there would 91
not be transient activity and reverberation, which is essential
in discriminating temporal spike patterns. Therefore we have 90
selected to work in a state in which there is some balance
among excitatory and inhibitory contributions [29]. 89
0.0000 0.0005 0.0010 0.0015 0.0020 0.0025 0.0030
2) Software SNN parameters : we have explored the im- e

pact of different SNN parameters on the overall classification Fig. 5: Synaptic decay constant exploration: a peak of accuracy is evident for
accuracy. When building a computationally efficient neural τe = 3x10−5 for all experiments.
network hardware it is necessary to explore the precision of
the representations for synaptic values, this will delineate the
memory requirements and the complexity of the neural and
synaptic hardware units. In our exploration, we kept constant depends on the number of support vectors. For example the
the number of synaptic connections and the number of neurons LIF neuron whose role is the decision among classes %N vs
in the recurrent SNN as described for the VLSI implementation %J has a synaptic dendritic tree (input connections) composed
in the neuromorphic processor. However, we have gradually of 1219 + 6 = 1225 input weight vectors.
varied the precision of the representation for the synaptic
weights. We have explored configurations in which synaptic
weights are represented in fixed-point with different number of D. Classification Accuracy
bits (4,8,16) for both integer and fractional part. Given these Classification accuracy is reported in table I as the cross
representations we have trained the full system and measured validated performance on the full dataset that has been ran-
the classification accuracy. Note that this exploration has been domly split as in table II. The number under training and
carried only for the recurrent SNN, while the LIF neurons and testing refer to the number of single ECG complexes selected.
their synapses has been maintained to full precision (32-bit During the split we kept constant the distribution of examples
floating point). In fig: 5 we show the classification accuracy in each class as in the MIT/BIH dataset. The variation in
for a variety of parameters settings, including the exponential table I refers to the variation over a 5-fold cross-validation.
decay time constant τe . From this results it is clear that the Every line in the table refers to a different experiment. These
choice of τe = 3x10−5 is well motivated, as reported already results demonstrate the effect of the recurrent SNN on the
in section III-E. performance of the system (i.e. classification accuracy).
3) Software LIF parameters: the learned support vectors
are encoded as synaptic weights of the connections between The classification carried with SVMs on the full resolution
each SNN neuron with all LIF readout neurons (153 in total). (320Hz sampling rate) ECG signals is able to obtain a classi-
The support vectors are the points in the dataset that are the fication accuracy of 94.2%, this result is obtained without the
closest to the decision boundaries, some of them represent use of any spiking neuron, only with the use of the dataset
examples that are wrongly classified (i.e. at the wrong side of with a standard machine learning approach (implemented with
the decision boundary) and for which a penalty is assigned libsvm as in section III-E1). This requires about 6 hours of
during the learning process. This representation allows to training time in a 8 core i7 standard desktop computer.
retrieve the decision boundaries by simply calculating the dot If the signals are encoded into spikes and used to excite the
product between input test patterns and weight connections. recurrent SNN the accuracy of the classification carried by a
In our spiking implementation, this dot product is computed linear SVM increases up to 95.6%. This performance can then
between the output spikes of the recurrent SNN, after the be mapped one-to-one to a pool of LIF neurons. This requires
application of the synaptic filter k(t), weighted by the synap- only 20 minutes of training time in a 8 core i7 standard desktop
tic input connections for all LIF readout neurons. Decision computer. Is addition, if the output of the two delta moulators
boundaries are the threshold values of the membrane potential (ECG ENC in table I) is used without the recurrent SNN but is
of the LIF neurons; if a LIF neuron receives enough positive applied directly to the synaptic kernel and then classified with
contributions it will reach the threshold, and it will emit a a SVM the performance drop significantly (only 84%). This is
spike. The spike will signal a vote for the selected class among a confirmation of the fact that the recurrent SNN is performing
the two of its own competence. Since the MIT/BIH dataset is interesting dimensionality expansion of the compressed ECG
highly unbalanced, the number of support vectors varies for signals.
each class, therefore every LIF has a different number of input
synapses. Our training process results in a total of 3745 support The three last rows in table I, show the performance of
vectors. The number of support vector per class varies from a the system when a fixed-point representation is used for the
maximum of 1219 (%N) to a minimum of 6 (%J). Each LIF synaptic weights in the SNN. By reducing the number of bits
neuron receives inputs via a number of synaptic contacts that from 32 to 8 accuracy only drops with about 2.5%.

-6- paper N-19235.pdf


ECG-based Heartbeat Classification in Neuromorphic Hardware

weights for robust spike pattern classification. This makes our


CLASIFICATION TYPE ACCURACY
results easily interpreteable in terms of neural networks and
1) ECG FULL RESOLUTION 94.2 ± 0.3 still are based on well known machine learning techniques.
2) ECG ENC 84.5 ± 0.6
3) ECG ENC + rSNN neuromorphic VLSI 93.8 ± 1.2 VI. Conclusions
4a) ECG ENC + rSNN digital 32 bit floating 95.6 ± 0.5
4b) ECG ENC + rSNN digital 16 fixed 95.2 ± 0.7 In this work we propose a heartbeat classification system
4c) ECG ENC + rSNN digital 8 fixed 93.2 ± 0.9 that exploits a two lead-ECG signals and then process the
information in a fully event-driven manner. We firstly compress
TABLE I: Classification Results and ablative study. 1) using high resolution and convert the ECG signals into temporal spike patterns. We
ECG signals classified by a SVM. 2) using ECG signals encoded by two delta
modulators and classified by a SVM. 3) fully spiking solution exploiting the then exploit a recurrent SNN in hardware and in software. We
multi-neuron neuromorphic processor. 4a/b/c) fully spiking solution simulated demonstrate by means of an ablation study the effectiveness
in software. of the recurrent SNN that enables the training of simple linear
classifiers. We conclude that our approach of heartbeat classifi-
cation is accurate as we achieve more than 95% accuracy on the
Classification by expert (label) Training Testing 18 classes of arrhythmia provided by the MIT/BIH dataset. In
%N Normal beat 10882 2714 addition, our system is compatible with spiking neuromorphic
%L Left bundle branch block beat 1050 266
%R Right bundle branch block beat 860 250 processors and could be easily mapped into an energy-efficient,
%B Bundle branch block beat (unspecified) 8 2 and accurate wearable device.
%A Atrial premature beat 948 206
%a Aberrated atrial premature beat 70 8
%J Nodal (junctional) premature beat 28 4 Acknowledgments
%S Supraventricular premature or ectopic beat (atr. or nod.) 1128 300
%V Premature ventricular contraction 10 2
%r R-on-T premature ventricular contraction 78 12 This work is supported in parts by EU-H2020 grant Neu-
%F Fusion of ventricular and normal beat 34 6 RAM3 Cube (NEUral computing aRchitectures in Advanced
%e Atrial escape beat 34 6 Monolithic 3D-VLSI nano-technologies) and ITEA3 PART-
% j Nodal (junctional) escape beat 11 11
%n Supraventricular escape beat (atr. or nod.) 244 68 NER project (Patient-care Advance-ment with Responsive
%E Ventricular escape beat 154 22 Technologies aNd Engagement togetheR).
%/ Paced beat 64 24
% f Fusion of paced and normal beat 106 44
%Q Unclassifiable beat 64 10
References
TABLE II: Number of single ECG complexes per class. The distribution of
[1] G. Indiveri and S. Liu, “Memory and information processing in neuro-
the dataset is highly unbalanced.
morphic systems,” Proceedings of the IEEE, vol. 103, no. 8, pp. 1379–
1397, Aug 2015.
[2] J. Von Neumann, The computer and the brain. Yale University Press,
2012.
Interestingly, the performance of a fully digital implemen-
[3] M. Davies, N. Srinivasa, T.-H. Lin, G. Chinya, Y. Cao, S. H. Choday,
tation of a recurrent SNN with a fixed-point resolution of G. Dimou, P. Joshi, N. Imam, S. Jain, et al., “Loihi: A neuromorphic
8 bits for the synaptic weights is similar to the one of the manycore processor with on-chip learning,” IEEE Micro, vol. 38, no. 1,
mixed-signal analog/digital neuromorphic VLSI processor. The pp. 82–99, 2018.
hardware processor is also the one that shows greater variation. [4] F. Akopyan, J. Sawada, A. Cassidy, R. Alvarez-Icaza, J. Arthur,
This is not surprising given the analog nature of computation P. Merolla, N. Imam, Y. Nakamura, P. Datta, G.-J. Nam, et al.,
“Truenorth: Design and tool flow of a 65 mw 1 million neuron
and the susceptibility to electrical noise, temperature and other programmable neurosynaptic chip,” IEEE Transactions on Computer-
factors that influence the subthreshold dynamic of the ultra Aided Design of Integrated Circuits and Systems, vol. 34, no. 10, pp.
low-power neurons and components in the device. Overall this 1537–1557, 2015.
variability remains very well contained however, showing that [5] S. Moradi, N. Qiao, F. Stefanini, and G. Indiveri, “A scalable multi-
the analog implementation is quite suitable. core architecture with heterogeneous memory structures for dynamic
neuromorphic asynchronous processors (dynaps),” IEEE Transactions
on Biomedical Circuits and Systems, vol. 12, no. 1, pp. 106–122, Feb
V. Discussions 2018.
Many design choices have been made to simplify the [6] C. Li, C. Zheng, and C. Tai, “Detection of ecg characteristic points using
wavelet transforms,” IEEE Transactions on biomedical Engineering,
neuron model of the recurrent SNN. These simplifications vol. 42, no. 1, pp. 21–28, 1995.
include the fact that the neuron model has no leak and it is [7] M. Bahoura, M. Hassani, and M. Hubin, “Dsp implementation of
devoid from a bio-realistic mechanism of membrane integra- wavelet transform for real time ecg wave forms detection and heart rate
tion. Despite these remarkable simplifications, the role of the analysis,” Computer methods and programs in biomedicine, vol. 52,
recurrent SNN is still proved to be useful in providing a high- no. 1, pp. 35–44, 1997.
dimensional expansion of the spiking input signals. After this [8] E. J. d. S. Luz, W. R. Schwartz, G. Cámara-Chávez, and D. Menotti,
expansions, the spike pattern can be classified by linear models “Ecg-based heartbeat classification for arrhythmia detection: A survey,”
Computer methods and programs in biomedicine, vol. 127, pp. 144–164,
with less parameters optimization [30]. These simplifications 2016.
have been made to enable the design of a compact digital
[9] J. Pan and W. J. Tompkins, “A real-time qrs detection algorithm,” IEEE
neuron circuit that is functional but at the same time has the Trans. Biomed. Eng, vol. 32, no. 3, pp. 230–236, 1985.
less number of components. In this work we have exploited [10] W. Zong, G. Moody, and D. Jiang, “A robust open-source algorithm
standard machine learning techniques to train SVMs, and to detect onset and duration of qrs complexes,” in Computers in
then we have translated these results into optimized synaptic Cardiology, 2003. IEEE, 2003, pp. 737–740.

-7- paper N-19235.pdf


IJCNN 2019. International Joint Conference on Neural Networks. Budapest, Hungary. 14-19 July 2019

[11] J.-J. Wei, C.-J. Chang, N.-K. Chou, and G.-J. Jan, “Ecg data compres-
sion using truncated singular value decomposition,” IEEE Transactions
on Information Technology in Biomedicine, vol. 5, no. 4, pp. 290–299,
2001.
[12] E. D. Übeyli, “Ecg beats classification using multiclass support vector
machines with error correcting output codes,” Digital Signal Processing,
vol. 17, no. 3, pp. 675–684, 2007.
[13] F. Melgani and Y. Bazi, “Classification of electrocardiogram signals
with support vector machines and particle swarm optimization,” IEEE
transactions on information technology in biomedicine, vol. 12, no. 5,
pp. 667–677, 2008.
[14] S. Osowski and T. H. Linh, “Ecg beat recognition using fuzzy hy-
brid neural network,” IEEE Transactions on Biomedical Engineering,
vol. 48, no. 11, pp. 1265–1271, 2001.
[15] Z. Dokur and T. Ölmez, “Ecg beat classification by a novel hybrid neural
network,” Computer methods and programs in biomedicine, vol. 66, no.
2-3, pp. 167–181, 2001.
[16] P. De Chazal, M. O’Dwyer, and R. B. Reilly, “Automatic classification
of heartbeats using ecg morphology and heartbeat interval features,”
IEEE transactions on biomedical engineering, vol. 51, no. 7, pp. 1196–
1206, 2004.
[17] M. Lagerholm, C. Peterson, G. Braccini, L. Edenbrandt, and L. Sornmo,
“Clustering ecg complexes using hermite functions and self-organizing
maps,” IEEE Transactions on Biomedical Engineering, vol. 47, no. 7,
pp. 838–848, 2000.
[18] S. Mitra, S. Fusi, and G. Indiveri, “Real-time classification of complex
patterns using spike-based learning in neuromorphic vlsi,” IEEE Trans-
actions on Biomedical Circuits and Systems, vol. 3, no. 1, pp. 32–42,
2009.
[19] A. Mohemmed, S. Schliebs, S. Matsuda, and N. Kasabov, “Training
spiking neural networks to associate spatio-temporal input–output spike
patterns,” Neurocomputing, vol. 107, pp. 3–10, 2013.
[20] R. Gütig and H. Sompolinsky, “The tempotron: a neuron that learns
spike timing–based decisions,” Nature neuroscience, vol. 9, no. 3, p.
420, 2006.
[21] M. Ambard and S. Rotter, “Support vector machines for spike pattern
classification with a leaky integrate-and-fire neuron,” Frontiers in com-
putational neuroscience, vol. 6, p. 78, 2012.
[22] aiCTX AG, https://ai-ctx.com.
[23] C.-W. Hsu and C.-J. Lin., “A comparison of methods for multi-class
support vector machines,” IEEE Transactions on Neural Networks,
vol. 13, pp. 415–425, 2002.
[24] C.-C. Chang and C.-J. Lin, “LIBSVM: A library for support vector
machines,” ACM Transactions on Intelligent Systems and Technology,
vol. 2, pp. 27:1–27:27, 2011, software available at http://www.csie.ntu.
edu.tw/~cjlin/libsvm.
[25] F. Corradi and G. Indiveri, “A neuromorphic event-based neural record-
ing system for smart brain-machine-interfaces,” IEEE transactions on
biomedical circuits and systems, vol. 9, no. 5, pp. 699–709, 2015.
[26] W. Maass, T. Natschläger, and H. Markram, “Real-time computing
without stable states: A new framework for neural computation based
on perturbations,” Neural computation, vol. 14, no. 11, pp. 2531–2560,
2002.
[27] M. Giulioni, P. Camilleri, M. Mattia, V. Dante, J. Braun, and P. Del Giu-
dice, “Robust working memory in an asynchronously spiking neural
network realized with neuromorphic vlsi,” Frontiers in neuroscience,
vol. 5, p. 149, 2012.
[28] M. Giulioni, F. Corradi, V. Dante, and P. Del Giudice, “Real time
unsupervised learning of visual stimuli in neuromorphic vlsi systems,”
Scientific reports, vol. 5, p. 14730, 2015.
[29] N. Bertschinger and T. Natschläger, “Real-time computation at the edge
of chaos in recurrent neural networks,” Neural computation, vol. 16,
no. 7, pp. 1413–1436, 2004.
[30] O. Barak, M. Rigotti, and S. Fusi, “The sparseness of mixed selectivity
neurons controls the generalization–discrimination trade-off,” Journal
of Neuroscience, vol. 33, no. 9, pp. 3844–3856, 2013.

-8- paper N-19235.pdf

You might also like