Sunteți pe pagina 1din 4

32nd Annual International Conference of the IEEE EMBS

Buenos Aires, Argentina, August 31 - September 4, 2010

Distinguishing Between Ventricular Tachycardia and


Ventricular Fibrillation From Compressed ECG
Signal in wireless Body Sensor Networks
Ayman Ibaida and Ibrahim Khalil
School of Computer Science and IT - RMIT University-Melbourne, VIC 3000, Australia
ayman.ibaida@student.rmit.edu.au, ibrahimk@cs.rmit.edu.au

Abstract—Since ECG is huge in size sending large volume data stored in compressed format, cardiovascular diagnosis is pos-
over resource constrained wireless networks is power consuming sible, without performing decompression, saving processing
and will reduce the energy of nodes in Body Sensor Networks power, resource and time.
(BSN). Therefore, compression of ECGs and diagnosis of diseases
from compressed ECGs will play key roles in enhancing the life- Unfortunately, very few algorithms are capable of diagnos-
time of body sensor networks. Moreover, discrimination between ing cardiovascular diseases from compressed ECGs. The first
ventricular Tachycardia and Ventricular Fibrillation is of crucial attempt was made in [9] where the authors diagnosed multiple
importance to save human life. Existing algorithms work only on diseases from compressed MIT BIH ECG for the very first
plain text ECGs to distinguish between the two, and therefore, not time directly from their compressed ECG. Later, the authors
suitable in BSN. VT and VF are often similar in patterns and in
filtration of noise and improper attribute selection in compressed in [11], [5] showed that VT can be diagnosed from compressed
ECGs will make it even harder to classify them properly. In ECGs using various data mining [2] techniques. However, the
this paper, a supervised attribute selection algorithm called problem of distinguishing VT and VF from compressed ECGs
Correlation Based Feature Selection (CFS) [4] is used to filter the in BSN is still unresolved. What makes it difficult is the fact
unwanted attributes and select the most relevant attributes. We that they are often similar in patterns as seen in Fig. 1, and
then use the selected attributes to train and classify VT and VF
using Radial Basis Function (RBF) Neural Network and k-nearest any noise in the signal will make it even more difficult to
neighbour techniques. We experimented with 103 ECG samples distinguish them properly.
taken from MIT-BIH Malignant Ventricular Ectopy Database. Therefore, in this paper, we propose a new method to
Results showed that accuracy can be as high as 93.3% when first compress the ECG data using a character substitution
attribute selection is used and large number of training samples technique [10], and then analyse the compressed ECGs to
are provided.
obtain frequency distributions of various attributes (i.e. char-
acters used in compression). As the number of attributes
could be large we enforce attribute selection method to extract
I. I NTRODUCTION
meaningful feature subset which is then applied for training
Sudden death accounts for almost half of all cardiovascular and testing the system a Radial Basis Function based Neural
disease related deaths, and is generally caused by ventricular network and k nearest neighbour techniques.
Tachycardia (VT) and Ventricular Fibrillation (VF). VT usu-
ally occurs few weeks after a heart attack, and is common II. T HE METHODOLOGY
among elderly people. Because of the severity they need
In this paper, the compression algorithm proposed in [10]
to be diagnosed and treated quickly. For example, sustained
has been adopted to distinguish between VT and VF. Because
ventricular tachycardia (episodes lasting more than 30 sec-
compressed ECG data gives us large number of attributes, we
onds) requires emergency treatment. However, treatments for
used data mining tools such as attribute selection algorithms
them using defibrillators are different: VF requires high-energy
for dimensionality reduction. Neural Network and k nearest
defibrillations and VT needs low-energy cardioversion.
neighbour approaches have been used to classify the resulting
Therefore, it is important that we distinguish them properly.
data set to distinguish between Ventricular Tachycardia and
However, existing algorithms [1], [13], [12], [8] work on plain
Ventricular Fibrillation. In Fig. 1(a) we can see a Ventricular
text ECG data, and may not be suitable for Body Sensor
Tachycardia ECG sample from the MIT-BIH Malignant Ven-
Network (BSN) [7]. This is because sensor nodes in BSN
tricular Ectopy Database and Fig. 1(b) shows a Ventricular
would prefer to send and receive ECG data in compressed
Fibrillation sample from the same database for a different
format to save battery power by sending fewer bytes. However,
patient.
this would require the sensor nodes to diagnose diseases
directly from the compressed data.
The benefit of diagnosis from compressed ECG is immense. A. Compression of ECGs
As compressed ECG contains less characters, diagnosis from The ECG encoding algorithm [10] adopted in this paper
compressed ECG can be possible (using the techniques shown is a symbol substitution based technique that also performs
in [9] with fewer reading operations (I/O). Most importantly, some mathematical transformations before applying substitu-
for telecardiology applications, where ECG is transmitted and tions on pre-processed data. According to the literature, this
978-1-4244-4124-2/10/$25.00 ©2010 IEEE 2013
1 1.5 TABLE I
0.5
1 S ELECTED ATTRIBUTES
0.5
0
0 Rank Attribute number
−0.5
−0.5 1 5
−1
−1
2 21
3 40
−1.5 −1.5
0 500 1000 1500 2000 2500 0 500 1000 1500 2000 2500 4 41
5 44
(a) (b) 6
7
50
64
8 80
Fig. 1. (a) VT ECG sample (b) VF ECG sample 9 83
10 99
11 103
12 114
13 115
was highest possible lossless compression ratio achieved for 14 118
15 120
compressing publicly available ECG of MIT BIT Arrhythmia 16 144
17 169
Database. The character set that is used for substitutions is 18 193
19 232
shown in Fig. 2. The compression algorithm consists of several 20 239
sequential stages. In summary, ECG signal is normalized 21
22
241
246
by converting the samples into the smallest integer values, 23 256

and after some more manipulations of these numbers ASCII


characters are used to substitute the values [10].
Correlation Based Feature selection (CFS) [4] is used to filter
the unwanted attributes and select the most relevant attributes.
To select the correct subset we need to select the best eval-
uation method for the subset, and the best search method to
search the feature space. In CFS the selection criteria will
select the attribute subset which is highly correlated within
Fig. 2. Character Set for the compressed ECG signal the class, but uncorrelated when compared to the other class.
The CFS feature subset evaluation function is shown in Eq. 1

kTcf
B. Analysis of Compressed ECG signal Ms = q (1)
Since the Compressed ECG file consists of the character k + k(k − 1)Tf f
set shown in Fig. 2 it may appear as containing meaning-
less information. Analysis of such information is done by Where M s is the heuristic merit of a feature subset S
generating character frequency distributions. As a result, we containing k features, Tcf is the mean feature-class correlation
have the frequency count for each character. Since we used (f ∈ S) and Tf f is the average feature-feature inter correla-
extended ASCII characters in this version of compression, we tion. To find the correlation between two features A and B
have 256 characters. These 256 characters can be regarded we used the symmetric uncertainty as shown in Eq. 2
as 256 attributes. Taking all the attributes into consideration
H(A) + H(B) − H(A, B)
without any kind of filtering will lead to infiltration of noise U (A, B) = 2 (2)
into original signal. In this case the classification accuracy will H(A) + H(B)
be low, since the difference between the two diseases is very where U (A, B) is the uncertainty between A (a ∈ A) and
small. B (b ∈ B), H(A) is the entropy of attribute A which can be
calculated as in Eq. 3
C. Attribute Subset Selection X
H(A) = − p(a) log(p(a)) (3)
Since the ECG of VF and VT has much similarity, any noise
a∈A
with the original signal will affect the classification process.
In this paper, a supervised attribute selection algorithm called and H(A, B) is the entropy of A after observing B which
can be calculated as in Eq. 4
X X
150 80
H(A, B) = − p(b) p(a|b) log(p(a|b)) (4)
60 b∈B a∈A
100
Character Frequency

40 After evaluating the subsets we adopted the Best First


50 Search method to search the features space to generate the
20
new subsets. The results for Attribute selection is shown in
0 0 table I and its frequency distribution is shown in Fig. 3.
0 10 20 0 10Attributes 20

(a) (b)
D. Classification using Radial basis Function (RBF)
Fig. 3. Frequency Distributions of Selected Attributes in Compressed Data
(a) 14 Ventricular Tachycardia Samples of Patient p420, (b) 13 Ventricular Radial basis function neural networks differs from percep-
Fibrillation Samples of Patient p422 tron feed forward neural network in how it deals with training
2014
TABLE II
S ELECTED ATTRIBUTES F OR VARIOUS ECG S AMPLES OF PATIENT P 420

Sample No Attributes
5 21 40 41 44 50 64 80 83 99 103 114 115 118 120 144 169 193 232 239 241 246 256
1 7 17 3 9 12 1 107 9 13 6 4 34 33 31 41 0 0 0 1 1 0 0 0
2 10 9 3 7 8 2 116 8 7 7 2 15 22 31 64 0 0 0 1 0 0 0 0
3 12 4 5 5 11 1 134 8 6 3 2 26 20 47 45 0 3 0 0 1 0 0 0
4 21 15 5 11 24 0 82 6 12 5 5 16 10 13 10 0 0 0 2 1 0 0 0
5 16 12 7 14 11 1 105 4 10 10 4 21 22 32 30 0 0 0 0 0 0 0 0
6 18 12 3 7 15 0 83 7 7 6 6 23 25 22 14 0 0 0 0 2 0 0 0
7 19 14 2 10 15 0 92 12 11 7 4 9 19 20 26 0 1 0 0 0 0 0 0
8 20 20 7 9 20 1 105 4 12 3 5 19 24 13 15 0 1 0 1 0 0 0 0
9 14 14 2 12 13 0 106 6 9 7 6 17 22 24 27 0 0 0 0 1 0 0 0
10 9 6 9 3 9 1 106 3 8 4 7 22 24 35 40 0 0 0 0 0 0 0 0
11 12 4 3 7 15 0 124 5 4 5 2 23 27 47 49 0 0 0 0 0 0 0 0
12 13 5 6 4 10 2 131 9 5 8 0 19 26 36 51 0 0 0 0 1 0 0 0
13 9 6 6 12 9 0 143 2 6 7 5 19 26 42 53 0 0 0 0 0 0 0 0
14 11 5 7 5 17 0 127 5 8 6 5 20 26 46 38 0 0 0 0 0 0 0 0

TABLE III
S ELECTED ATTRIBUTES F OR VARIOUS ECG S AMPLES OF PATIENT P 422

Sample No Attributes
5 21 40 41 44 50 64 80 83 99 103 114 115 118 120 144 169 193 232 239 241 246 256
1 9 5 1 2 9 1 15 4 6 6 5 14 22 25 43 14 1 5 0 0 4 1 66
2 5 2 1 4 7 0 12 5 7 5 0 21 16 36 56 8 0 5 0 0 5 0 74
3 9 7 4 9 10 0 11 4 4 6 3 19 18 44 61 4 0 5 0 0 4 2 48
4 5 10 0 1 7 0 11 2 7 7 3 21 23 40 49 16 1 2 0 0 3 0 75
5 8 8 4 5 12 0 12 3 6 6 3 22 20 34 52 5 0 6 0 0 11 0 48
6 4 5 3 1 8 0 13 5 10 4 8 25 22 31 53 1 0 5 0 0 10 1 60
7 5 7 3 8 8 0 8 8 7 7 1 20 21 34 53 5 0 6 2 1 6 1 64
8 9 6 6 7 7 0 16 5 8 3 0 23 28 42 48 10 1 4 0 0 4 1 63
9 6 4 3 2 5 0 12 5 11 4 1 15 21 34 51 8 0 7 0 0 3 0 61
10 5 6 4 4 7 1 10 6 4 3 2 25 21 42 41 25 0 6 0 0 8 1 66
11 6 8 3 8 10 0 9 5 6 6 1 21 22 35 47 13 0 10 2 1 6 1 67
12 7 5 6 7 7 0 16 7 8 2 0 19 29 43 51 8 1 5 0 0 5 0 63
13 8 5 4 5 10 0 10 4 2 5 5 22 21 28 49 11 0 5 0 0 4 2 66

Radial Basis Function Layer Linear Layer


is the number of data points in j -th cluster, n is number of
Yr Yo
clusters and l number of centroids.
X + || .. || X X + The third parameter for learning is the linear weights which
can be learned by normal back-propagation algorithm after
Wi Bi Wo Bo
making the first and second parameters constants [3].

Fig. 4. Radial Basis Function neural Network block Diagram


E. Classification using k-Nearest Neighbour (KNN)
KNN is the simplest instance based classifier. It is based
and testing samples. The neurons in the hidden layer calculate on selecting the training sample nearest to the testing point.
the Euclidean distance between the input and the weights In KNN, the distance metric function used in this paper is
vector to produce the output. The output is large as the distance Euclidean distance which can be calculated as in Eq. 6, where
is small and vice versa. The training parameters are the weights D is the distance between X (1) and X (2) and N is the number
(centers), the learning layer weights and biases. The activation of components in each vector.
function used in the RBF neuron is the Symmetric multivariate v
uN
Gaussian function. The RBF layer output is fed to a normal uX (1) (2)
linear perceptron with sigmoid function. Therefore, the Radial D(X (1) , X (2) ) = t (xi − xi )2 (6)
Basis Neural Network consists of two layers, RBF layer and i=1

linear output layer as shown in Fig 4. KNN algorithms consists of two phases, training phase and
Attribute selection in the earlier stage gives us 23 attributes. classification phase. In training phase it stores the training
Therefore, the number of inputs in the first layer is 23. The samples with their corresponding classification labels. In the
number of RBF neurons in the first layer is less than or equal classification phase, we select k as a constant value to enable
to the number of training samples. RBF neural network uses k- the algorithm select the class of the k nearest training points.
mean algorithm for training and finding the centres parameter. The KNN performance will be affected dramatically with
The second parameter to be trained in the RBF network is the irrelevant attributes. The disadvantage of KNN is that, any
width of the Gaussian function for each RBF neuron. There are noise in the dataset will affect its performance, as will be
many methods for choosing these parameters, but the common observed in the results later.
method is to make them equal to the average distance between
the data and the cluster centers as shown in equation 5 III. R ESULTS AND D ISCUSSIONS
We experimented with 103 ECG samples taken from 9
1 X patients where each ECG sample is of 10 seconds length. The
σij = (xkj − cij )2 , 1 ≤ i ≤ l; 1 ≤ j ≤ n (5)
mj sample distribution is selected to have approximately equal
k∈Cj
portions of ventricular tachycardia and fibrillation - 58 samples
where xkj is the j-th component of the input vector xk , mj for Ventricular tachycardia and 45 samples for ventricular
2015
TABLE IV
R ESULTS FOR KNN AND RBF

DATAset type Classification Algorithm cross validation 2 folds cross validation 4 folds
Sensitivity Specificity Accuracy Sensitivity Specificity Accuracy
256 Attributes RBF 90.6 80 85.4 85.2 85.7 85.4
KNN k=7 81.54 86.84 83.49 85 83.7 84.4
23 Attributes RBF 87.27 79.17 83.5 91.53 90.91 91.26
KNN k=7 89.47 84.78 87.37 98.1 88 93.2

fibrillation. Using the procedure discussed earlier we can now stop filter with centre frequency of the mean signal frequency
derive Table II and Table III showing the 23 attributes dataset achieved a sensitivity of 94 % and specificity of 91 %.
for patient p420 and p422 respectively of MIT-BIH Malignant
Ventricular Ectopy Database. Similarly, datasets with attribute V. CONCLUSION AND FUTURE WORK
selection can be derived for other patients in the database. Because ECG signal is enormous in size,compression algo-
To test the performance of RBF and KNN classification rithms must be used to make the whole tele-cardiology faster
algorithms, cross validation has been applied with two cases, and efficient. A faster solution is of crucial importance for
2 folds and 4 folds to examine the impact of increasing and diagnoses and treatment of cardiovascular diseases. To make
decreasing the number of training samples on both algorithms. body sensor network energy efficient, we performed ECG
Also specificity and sensitivity have been calculated for each analysis and data mining on the compressed ECG signal using
case. Moreover, to show how attribute selection improves Correlation based feature extraction and k-nearest neighbours
the performance, the experiments are carried out for dataset and Radial bases function as a classification technique. Com-
with 256 attributes and after the reduction of the attributes. pressed ECG signal can be fast in transmission, and we have
This will further validate our earlier observations. Table IV clearly shown that we can analyse and classify the compressed
shows the results for all experiments as it is applied to ECG signal to detect cardiac Ventricular abnormalities such as
original data and the reduced data. From the results it is clear VT and VF.
that KNN algorithm offers the best accuracy, better than the
RBF network. Also, the accuracy increases after performing R EFERENCES
attribute selection as shown in the results obtained. [1] R. Abbas, W. Aziz, and M. Arif. Prediction of ventricular tachyarrhyth-
In all experiments better results have been achieved in a mia in electrocardiograph signals using neural network and modified
nearest neighbour method. In Engineering, Sciences and Technology,
4 folds cross validation, which means whenever we increase Student Conference On, pages 1–6, Dec. 2004.
number of training samples the accuracy will be increased. [2] M. Dunham. Data mining introductory and advanced topics. Prentice
Moreover, for the original dataset, it can be noticed that, RBF Hall/Pearson Education, 2003.
[3] M. Gupta, L. Jin, and N. Homma. Static and dynamic neural networks:
performs better than KNN, which confirms that noise in the from fundamentals to advanced theory. IEEE, 2003.
dataset affects KNN, but RBF is hardly affected by noisy [4] M. A. Hall. Correlation-based Feature Subset Selection for Machine
data and irrelevant attributes. For the filtered data set of 23 Learning. PhD thesis, University of Waikato, Hamilton, New Zealand,
1998.
attributes, it is obvious how KNN algorithm performs well, [5] A. Ibaida, I. Khalil, and F. Sufi. Cardiac abnormalities detection from
especially when large number of training samples are provided compressed ecg in wireless telemonitoring using principal components
the accuracy will reach to 93%. analysis (pca). In Intelligent Sensors, Sensor Networks and Information
Processing (ISSNIP), 2009 5th International Conference on, pages 207
–212, dec. 2009.
IV. R ELATED W ORKS [6] I. Jekova. Comparison of five algorithms for the detection of ventricular
fibrillation from the surface ecg. Physiological Measurement, 21(4):429,
Distinguishing Ventricular Tachycardia from Ventricular 2000.
Fibrillation is a big challenge because of the similarities [7] B. Lo, S. Thiemjarus, R. King, and G. Yang. Body sensor network–a
between the two. All the existing approaches to distinguish wireless sensor platform for pervasive healthcare monitoring. In The
3rd International Conference on Pervasive Computing. Citeseer, 2005.
them use raw ECG data without any compression. Nithish [8] K. Minami, H. Nakajima, and T. Toyoshima. Real-time discrimination of
V Thakor et. al [12] generated a binary sequence to derive ventricular tachyarrhythmia withFourier-transform neural network. IEEE
the probability distribution, and applied sequential hypothesis Transactions on Biomedical Engineering, 46(2):179–185, 1999.
[9] F. Sufi, Q. Fang, I. Khalil, and S. S. Mahmoud. Novel methods of
testing until the algorithm can reach to the required decision. faster cardiovascular diagnosis in wireless telecardiology. IEEE Journal
They used the same dataset for testing and for generating on Selected Areas in Communications, 27(4), MAY 2009.
probability distributions. Their algorithm required at least 7 [10] F. Sufi and I. Khalil. Enforcing secured ECG transmission for real time
telemonitoring: A joint encoding, compression, encryption mechanism.
seconds to generate the correct decision. Almost similarly, Xu- Security and Communication Networks, 1(5), 2008.
Sheng [13] converted ECGs into a binary string by means of [11] F. Sufi, A. Mahmood, and I. Khalil. Diagnosis of cardiovascular
comparing it with a threshold. Statistical analysis has been abnormalities from compressed ecg: A data mining based approach. In
Information Technology and Applications in Biomedicine, 2009. ITAB
done to find the thresholds for distinguishing VT and VF. 2009. 9th International Conference on, pages 1 –4, nov. 2009.
They achieved 100 % accuracy with window size of 7 seconds. [12] N. Thakor, Y. Zhu, and K. Pan. Ventricular tachycardia and fibrillation
However, the limitation of this method is that, they used the detection by a sequential hypothesis testing algorithm. IEEE Transac-
tions on Biomedical Engineering, 37(9):837–843, 1990.
same dataset for producing the statistical thresholds. When [13] X. Zhang, Y. Zhu, N. Thakor, and Z. Wang. Detecting ventricular
other researchers tested this algorithm they achieved lower tachycardia and fibrillation by complexity measure. IEEE Transactions
accuracy [6]. Another Approach [6] that uses a narrow band on Biomedical Engineering, 46(5):548–555, 1999.

2016