Biomedical Signal Processing and Control
Biomedical Signal Processing and Control
a r t i c l e i n f o a b s t r a c t
Article history: Ventricular Fibrillation (VF), one of the most dangerous arrhythmias, is responsible for sudden cardiac
Received 27 July 2018 arrests. Thus, various algorithms have been developed to predict VF from electrocardiogram (ECG), which
Received in revised form is a binary classification problem. In the literature, we find a number of algorithms based on signal
28 November 2018
processing, where, after some robust mathematical operations the decision is given based on a predefined
Accepted 11 December 2018
threshold over a single value. On the other hand, some machine learning based algorithms are also
reported in the literature; however, these algorithms merely combine some parameters and make a
Keywords:
prediction using those as features. Both the approaches have their perks and pitfalls; thus our motivation
Electrocardiogram (ECG)
Empirical Mode Decomposition
was to coalesce them to get the best out of the both worlds. Hence we have developed, VFPred that, in
Heart arrhythmia addition to employing a signal processing pipeline, namely, Empirical Mode Decomposition and Discrete
Support vector machine Fourier Transform for useful feature extraction, uses a Support Vector Machine for efficient classification.
Ventricular Fibrillation (VF) VFPred turns out to be a robust algorithm as it is able to successfully segregate the two classes with
equal confidence (sensitivity = 99.99%, specificity = 98.40%) even from a short signal of 5 s long, whereas
existing works though requires longer signals, flourishes in one but fails in the other.
© 2018 Elsevier Ltd. All rights reserved.
https://doi.org/10.1016/j.bspc.2018.12.016
1746-8094/© 2018 Elsevier Ltd. All rights reserved.
350 N. Ibtehaz et al. / Biomedical Signal Processing and Control 49 (2019) 349–359
1 The MIT-BIH Malignant Ventricular Arrhythmia Database (VFDB) 1 The mean value is subtracted from all the samples, thus making
[22]: This database includes 22, 30 minutes long ECG recordings the mean zero.
of subjects who experienced episodes of sustained Ventricular 2 Next, a moving average filter of order 5 is applied. For an ECG
Tachycardia, Ventricular Flutter, and Ventricular Fibrillation. The signal, this should remove most of the interspersions and muscle
ECG signals of this database were sampled with a sampling fre- noise.
quency of 250 Hz. 3 Then, the signal is filtered using a high pass filter of cut-off fre-
2 Creighton University Ventricular Tachyarrhythmia Database quency, fc = 1 Hz. This imposes drift suppression on the signal.
(CUDB) [23]: This database includes 35, 8 minutes long ECG 4 Finally, a low pass butterworth filter of order 12 and cut-off fre-
recordings of human subjects who experienced episodes of quency, fc = 20 Hz is applied to attenuate the unnecessary high
sustained Ventricular Tachycardia, Ventricular Flutter, and Ven- frequency information.
N. Ibtehaz et al. / Biomedical Signal Processing and Control 49 (2019) 349–359 351
Fig. 1 illustrates the outcome of preprocessing and filtering on • Empirical Mode Decomposition is performed on the filtered sig-
the signal. As can be observed this step removes a great deal of nal and the first two IMF components along with the Residue are
noises from the ECG signal. computed as follows:
1 The number of extrema and the number of zero crossings must Vn = ˛(max(x(n))) (4)
either be equal or differ (with each other) at most by one. where, ˛ is a constant that should be chosen wisely. We took
2 At any point, the mean value of the envelopes of the local maxima ˛ = 0.05.
and minima is zero. • The samples nL of IMF1 (n) that falls within −Vn to Vn are identified,
i.e.,
Please refer to the supplementary materials for the complete
description of the EMD algorithm. By applying the EMD algorithm nL = {t : t ∈ n, |IMF 1 (t)| ≤ Vn } (5)
we decompose a signal x(t) into a set of IMF functions in decreasing
• The noise level crossing ratio (NLCR) is calculated using the fol-
order of oscillatory behavior, and possibly a Residue, as shown in
lowing formula,
Fig. 2.
x(t) = IMF 1 (t) + IMF 2 (t) + · · · + IMF n (t) + R(t) (1) n∈n
IMF 21 (n)
NLCR = L (6)
2 x (n)
n ∈ nL
2.2.2.2. Observing IMF components to distinguish VF from Not VF.
IMF components describe the oscillatory characteristics of a signal. • Finally, the appropriate IMF is selected as follows:
From the studies of ECG signal, it has been found that except for ‘VF’
IMF 1 (n) + IMF 2 (n), if NLCR ≤ ˇ
signals all other classes of ECG signals contain a QRS complex [21]. IMF = (7)
Thus, we have a property that apparently separates the ‘VF’ from IMF 1 (n), otherwise
the ‘Not VF’. An attempt can be made to find a proper formulation
to distinguish ‘VF’ signals exploiting this characteristic. Here, ˇ is a properly chosen constant. We considered ˇ = 0.02.
The presence of a QRS complex distorts the upper and lower
envelopes as they introduce additional local maxima and local min- Thus, the appropriate IMF component and the Residue is taken
ima points. On the contrary, due to the absence of any QRS complex, for further analysis.
‘VF’ class ECG signals have envelopes that are symmetric in nature.
The small interval QRS complexes in the ‘Not VF’ class ECG signals 2.2.2.4. Observing oscillatory characteristics on dataset. Based on
result in higher frequency oscillations. Thus, their 1st IMF com- our analysis above, the expected value of IMFsimiliarity for ‘VF’ is
ponent captures those oscillations missing the actual ECG signal greater than 0.5 whereas it is less than 0.5 for ‘Not VF’. On the con-
itself. On the other hand, for the lack of QRS complex, the ‘VF’ class trary, the expected value of Rsimilarity is just the opposite, i.e., less
ECG signals are not supposed to have major high frequency oscilla- than 0.5 for ‘VF’ and greater than 0.5 for ‘Not VF’. However, it was
tions compared to ‘Not VF’ class ECG signals. Therefore, the 1st IMF found that these theoretical observations are not always found to
component of ‘VF’ class is likely to follow the original ECG signal. be true in practice, especially, when checked against a large amount
Thus, it should be possible to distinguish the two classes by of diverse data. In particular, a lot of overlaps are observed between
observing how much the 1st IMF component correlates with the the two classes (please refer to Fig. 1 of the supplementary material
ECG signal itself. Moreover, the remaining signal can also be ana- where we illustrate such cases of overlapping using a scatter plot).
lyzed to increase the robustness, which will be referred as the In Fig. 4, we have presented a 2D histogram that shows the dis-
Residue component [10]. Since the IMF and Residue components tribution of IMFsimilarity and Rsimilarity of the two classes. For both
are disjoint in nature it is expected that the Residue of ‘Not VF’ sig- the classes, according to our theoretical analyses, the data points
nal will match the original ECG signal more than that of ‘VF’ class should have been within the bounding boxes. However, this is not
ECG signal. The cosine similarity metric can be taken as a mea- the case as we can observe a great amount of overlapping.
sure of similarity between the two signals [10]. Thus IMFsimilarity
and Rsimilarity can be defined as follows: 2.2.2.5. Hypothesis. From further experimentation with data we
came up with the following hypothesis:
Signal · IMF 1
IMF similarity = (2a)(2b)
| Signal || IMF 1 | Even after filtering and preprocessing, there may still remain
some undesired frequency components in our data, preventing
These facts are illustrated in Fig. 3,
us from separating the two classes.
2.2.2.3. Extracting oscillatory characteristics from ECG signals. Even In other words, there may be certain frequency components of
after preprocessing and filtering, some high frequency noises may the IMF and certain (not necessarily the same) frequency compo-
still prevail in the signal. In such cases, the 1st IMF component nents of the Residue which may allow us to distinguish the two
would actually represent those noises. To determine whether the classes accurately. Hence, we need to prioritize these frequency
1st IMF component contains useful information or noise we fol- components while making a decision. So instead of taking the
low the scheme proposed in [10]. In order to extract the oscillatory straightforward cosine similarity of the Signal with IMF and R as
features from the ECG signals we perform the following steps: features, as is done in [10], we focus on the frequency information.
352 N. Ibtehaz et al. / Biomedical Signal Processing and Control 49 (2019) 349–359
Fig. 2. Empirical Mode Decomposition of an ECG signal. Here we can observe that the top IMF components are more oscillatory in nature and gradually their oscillation
diminishes. IMF1 and IMF2 captures most of the oscillations from the original signal and it progressively fades in IMF3 , IMF4 and IMF5 .
Fig. 3. Relation of the 1st IMF and R components with the original signal, the cosine similarities are presented inside the parentheses. In (a) for a ‘VF’ class signal, we observe
that the 1st IMF and the original signal are very similar (cosine similarity = 0.995) while R deviates quite a bit (cosine similarity = 0.017). (b) on the other hand, shows an
example from ‘Not VF’ class. Here, we can observe distinct QRS peaks, and they prevent the 1st IMF from capturing any useful information (cosine similarity of 0.002 with
the original signal). Rather they are quite oscillatory accounting for the non-uniform upper and lower envelops. This compels the Residue to closely follow the original signal
(cosine similarity = 0.918).
2.2.3. Extracting frequency information from oscillations 2.2.3.2. Observing the frequency components. Our theoretical anal-
2.2.3.1. Discrete Fourier transform (DFT). The Fourier series, pro- yses indicate that for a ‘VF’ class ECG signal, the IMF component
posed by Joseph Fourier in the 19th century, was originally should be similar to the original signal, and the Residue compo-
developed to represent a periodic signal as an infinite sum of sim- nent is likely to deviate from it. The opposite is expected for a ‘Not
ple harmonic oscillations of different frequencies [26]. This allows VF’ class ECG signals. But while studying real world dataset, a lot
us to analyze the impact of individual frequency bands over a sig- of fluctuations are observed. Thus, according to our hypothesis we
nal. Later it was extended to aperiodic signals through Fourier resolve the signal, IMF and Residue (R) to frequency components
Transform. For finite and discrete signals we sample the Fourier using DFT, and then analyze their relations.
Transform coefficients as a finite sequence, that corresponds to a In our data analysis it was found that the frequency compo-
complete period of the original signal [26]. Thus, Discrete Fourier nents lying between 1-5 Hz were more prominent while separating
Transform (DFT) for a discreate signal x of length N is defined as: the two classes. Also, if we plot the frequency components of the
two classes and observe them, we get a somewhat intuitive idea of
N−1
2i classifying the signals (Fig. 5).
X[k] = x[n] exp(− kn), for 0≤k ≤N−1 (8)
N
n=0
N. Ibtehaz et al. / Biomedical Signal Processing and Control 49 (2019) 349–359 353
Fig. 4. 2D histograms representing the distribution of IMFsimilarity and Rsimilarity of ‘VF’ and ‘Not VF’. From our theoretical analyses, the IMF component should be similar to the
original signal for a ‘VF’ class signal and it is likely to be different for a ‘Not VF’ class signal. On the contrary, the Residue component should diverge from the original signal
for a ‘VF’ class signal, but should closely follow the original signal for ‘Not VF’. Hence, bounding boxes have been drawn where the points are expected to reside. Here, the
two classes should have been confined within the black bounding boxes, but a lot of overlapping is clearly visible.
In Fig. 5a, we observe the example of a ‘Not VF’ class. Here, it is Random Forest [27,28] is an ensemble learning algorithm that
evident from the DFT coefficients that the original signal is a wide- employs a collection of decision tree classifiers. However, along
band signal, due to the presence of QRS complex. For the case of with solving the classification problem, a Random Forest can also be
IMF, the DFT coefficients merely capture the distributed wideband used to determine the importance of the features and thereby rank
components caused by QRS complex. On the other hand, the DFT them accordingly. [29,30]. Thus using the Random Forest algorithm,
coefficients of the R signal seem to represent a quite narrow-band we identify the most promising subset of the features and use them
signal and it captures the pattern of the signal. This satisfies our for the final classification.
expectation.
On the other hand, in Fig. 5b, i.e., for the example of ‘VF’ class, we
2.2.4.3. SVM classifier. Support vector machines (SVM), proposed
can observe that the IMF frequency components, as we expected,
by Vapnik [31,32] compute a hyperplane between the data points
almost completely match with that of the original signal. Addition-
that separates them into two classes. Using a quadratic optimiza-
ally, very tiny frequency components of R can be observed, which
tion, the hyperplane, wT x + b = 0, is constructed to maximize the
is in line with our analysis.
distance or margin between the hyperplane and the nearest points.
In both the examples we can observe that there are some addi-
SVM is inherently a linear classifier but with nonlinear mappings of
tional rather unexpected, unusual frequency components. This fact
the input space using an appropriate kernel, SVM can be employed
becomes more apparent as we study more data. These frequency
for nonlinear classification purposes as well. After selecting the use-
components disturb our expected waveshape, thus affecting the
ful features, we use a SVM classifier to classify the ECG episodes to
validation of our assumptions. So we need to determine which
be either ‘VF’ or ‘Not VF’. We use a Gaussian Radial Basis Function
frequency components should be considered. A machine learning
(RBF) as our kernel because it reliably finds the optimal classifi-
algorithm can be used to interpret the significance of the individual
cation solutions in most practical situations [33]. The value of a
frequency components and set weights accordingly to distinguish
Radial Basis Function (RBF) is a function of distance from the origin
the two classes.
((x) = (||x||)), or some other predefined point ((x, c) = (||x − c||)).
In particular, we used the Gaussian variant of RBF, which for two
2.2.4. Machine learning classifier vectors x and x is defined as follows:
2.2.4.1. Feature Extraction. Instead of taking the DFT coefficients as
features, we are actually interested in how much the individual DFT K(x, x ) = exp(− || x − x | |2 ) (11)
coefficients of the signal match with the corresponding DFT coeffi-
cients of IMF or R. Thus, similar to cosine similarity we multiply the where, is the inverse of the standard deviation of the Gaussian
two terms and normalize the product with an appropriate value, as distribution.
described in Eqs. (9) and (10) The entire workflow of VFPred prediction system is presented
in Fig. 6.
SignalDFT [i] · IMF DFT [i]
IMF similarity [i] = , 1≤i≤N (9)
|| SignalDFT || || IMF DFT ||
2.3. Implementation
SignalDFT [i] · RDFT [i]
Rsimilarity [i] = , 1≤i≤N (10) We have implemented the VFPred algorithmic in Python pro-
|| SignalDFT || || RDFT ||
gramming language [34]. We used NumPy [35] for efficient
Here, || SignalDFT ||, || IMFDFT ||, and || RDFT || are the magnitudes of numerical computation, SciPy [36] and PyEMD [37] for signal pro-
SignalDFT , IMFDFT , and RDFT vectors respectively. cessing. We used the SVM and Random Forest implementation
from scikit-learn [38] library and used imbalanced-learn [39] for
2.2.4.2. Feature selection using Random Forest. By far, we have con- SMOTE. Moreover, we used matplotlib and seaborn [40] for visual-
sidered all the frequency components as features. However, not ization purposes. We also used the WFDB package [41] to fetch data
all features may be equally useful for our prediction and some may from Physionet. All the codes are available in the following github
even hamper our prediction. This motivates us to perform a feature repository:
ranking, i.e., analyzing the importance of an individual feature. https://github.com/nibtehaz/VFPred
354 N. Ibtehaz et al. / Biomedical Signal Processing and Control 49 (2019) 349–359
Fig. 5. Frequency domain observation of the two classes. In (a) for ‘Not VF’ the DFT coefficients represent the wide band nature of the signal due to the presence of QRS
complex. Here, we can observe that the IMF component accounts for the fluctuations, instead of following the signal, also the DFT coefficients appear to be representing the
wide band characteristics of the signal as well. On the contrary, the R component seems to follow the pattern of the signal. On the other hand, in (b) we can observe that for
‘VF’ class the DFT coefficients of the IMF component almost completely match with that of the signal whereas DFT coefficients of R are pretty tiny, thus they cover almost no
information at all. In both the figures it can be seen that the DFT components between 1-5 Hz offer the most useful insights (here, the plots are cropped to 1-15 Hz range for
visualization purposes).
The experiments were performed on a Dell-Inspiron 5548 Note- We use the following commonly used evaluation metrics:
book (with a 5th generation Intel core-i5 CPU @2.2 GHz having 8 TP TN
GB DDR3 RAM). Sensitivity = , Specificity = ,
TP + FN TN + FP
TP + TN
2.4. Evaluation metrics Accuracy = (12)
TP + FP + TN + FN
Fig. 6. Flow diagram of VFPred algorithm. The algorithm takes an ECG signal of length Te (s), then performs some pre-processing and filtering in order to remove noise and
artifacts from the signal. Next, the IMF and R component of the signal is analyzed using Empirical Mode Decomposition (EMD). After that, the signal, IMF, and R are resolved
into frequency components using Discrete Fourier Transform (DFT), and features are computed. The most prominent features are selected using Random Forest and finally,
a SVM classifier makes the classification.
fails to detect ‘VF’, the Accuracy would still be high. This trend is mance on the validation set is illustrated in Fig. 7. Here we have
disturbingly observed in many of the works in the literature, as shown the values of G-Mean Accuracy for different combinations of
most of the works prioritize the ‘Not VF’ class [10–12,14,18,19,42]. and C, as it nicely balances both sensitivity and specificity. Please
Thus we need an evaluation metric that accounts for the imbal- refer to the supplementary material where the other metrics have
ance in the dataset. Geometric Mean Accuracy (G-Mean Accuracy) also been reported.
is one such metric [43]. G-Mean Accuracy is defined as follows: From the experiments we observe that as we increase the
episode length, the performance improves. G-Mean Accuracy
G − Mean Accuracy = Sensitivity × Specificity (13) improves from 88.244% for Te = 2 s to 91.966% for Te = 5 s and to
95.101% for Te = 8 s. Thus, an increase of Te by 3 s roughly improves
This metric will become high only when both the sensitivity and
G-Mean accuracy by 4%. From a practical consideration, we should
specificity are high. Therefore, giving priority to the majority class
set the episode length, Te such that the detection is both fast and
as seen in some previous works will result in poor performance.
accurate. However, there is a trade-off here: as we increase the
episode length Te the detection accuracy improves but the compu-
3. Results tation becomes slower. So as a middle point we consider an episode
length, Te = 5 s, for our further experiments.
3.1. SVM parameter tuning Also, it can be observed that for Te = 2 s, C = 1 yields the best
results, but for Te = 5 s and Te = 8 s the most promising results are
Performance of any machine learning algorithm depends highly obtained for C ∈ [10, 100]. On the other hand, the best performing
on the proper selection of parameters. For our algorithm, we have values of are between 45 and 60. By performing some additional
used a SVM classifier with ‘RBF’ kernel. This SVM classifier has two random experiments, it was seen that for Te = 5 s, the set of param-
parameters: eter values C = 100 and = 45 consistently outperformed all other
combinations. Thus, we selected them as the parameters of our SVM
1 Regularization constant, C: C is the parameter that defines model.
whether the SVM classifier margin is a soft margin or a hard
margin [31].
2 Kernel hyperparameter, : is the parameter of Gaussian Radial
Basis Function [31]. 3.2. Feature ranking by Random Forest Classifier
For tuning the parameters, initially, we took a small portion of We used a Random Forest comprising 750 decision trees to rank
the data as the training data and the rest as the validation data. our features. After computing the feature importance using the
Since the dataset is highly imbalanced, it was quite tricky to train Random Forest algorithm, we normalized the values and plotted
our classifier. We randomly shuffled the entire dataset, and then them in Fig. 8(a). Here the first half consists of the IMF features
took 3000 samples from ‘VF’ class and 5000 samples from ‘Not VF’ (colored in blue) and the last half corresponds to the R features
class as the training set. More samples were taken from the ‘Not (colored in red).
VF’ class because it contains more variations as compared to the Now, from the plot, we can observe that most of the features do
‘VF’ class. The rest of the dataset was kept as the validation set not contribute at all in making an accurate prediction. These fea-
(VF = 2320, Not VF = 46087). tures originate from the DFT coefficients and since DFT coefficients
To tune the parameters we performed an exhaustive grid search. for a real signal is symmetric, so are their significances. Moreover,
We tried out three different episode lengths, Te = 2 s, 5 s, and 8 s, as the importance of the leftmost and the rightmost features of both
seen in literature. We trained the classifier using the training data IMF and R are negligible, they actually correspond to the high fre-
and observed the performance on the validation data. The perfor- quency components. The most impactful features are the features
356 N. Ibtehaz et al. / Biomedical Signal Processing and Control 49 (2019) 349–359
Table 1
Experimental results. Here we have shown both the results of the 10-fold cross
validation and stratified 10-fold cross validation tests.
Fig. 8. Feature ranking using a random forest. In (a) we have plotted the relative importance of the features. The features coming from IMF and R are colored in blue and
red respectively (please see the online version). From the figure, it is evident that a great deal of features is actually quite trifling, thus omission of them should make the
classification more efficient. Thus, in Fig. (b) we have shown the outcome of taking only a percentage of the top features, in terms of Specificity, Sensitivity, and G-Mean
Accuracy. The performance gradually improves as we increase the number of features, but after taking the top 16% features, it reaches a plateau. However, it was seen that
taking the top 24% features yields a slight improvement of 0.002%. (For interpretation of the references to color in this figure legend, the reader is referred to the web version
of this article.)
1 Some researchers made a pre-selection of ECG signals by hand ber of ECG signal parameters and used them as features to train a
[4–8,48,49,9,10]. This resulted in better performance of their SVM model (Se = 74.1, Sp = 94.7). In a later work [15], they consid-
algorithms, but the accuracy drastically falls when tested on the ered ECG segments of 8 s long to compute temporal and spectral
entire dataset [13]. parameters as features and then they developed a classifier using
2 All the datasets we have are imbalanced. It was observed in some SVM. This obtained an accuracy of 91.1% while detecting VF. Qiao
research works that priority was given to the majority class (‘Not et al. [16] presented quite a similar pipeline; some parameters
VF’) resulting in a higher specificity and lower sensitivity, albeit were computed as features and a genetic algorithm was used to
with a high accuracy [10–12,14,18,19,42]. rank the features. Then, weights were set to classes to consider
3 Surprisingly, a few authors tested their algorithms on the training the imbalance in the dataset and finally, a SVM model was trained
set, resulting in a higher but clearly misleading accuracy [18]. (Se = 96.2%, Sp = 96.2%, Ac = 96.3%). However, a drawback of the
algorithm is that it considered Ventricular Fibrillation, Ventric-
Amann et al. [13] presented a comparison of ten algorithms ular Tachycardia, and Ventricular Flutter all as the VF class. As
for the detection of VF. It was shown that none of the algorithms, these three classes are quite similar in appearance, an algorithm
namely, TCI [4], ACF [5], VF Filter Method [6], Spectral Algorithm should be robust enough to distinguish among these three. Verma
[7], Complexity Measure Algorithm [8], Li Algorithm [48], Tomp- et al. [17] used similar approaches to extract features and sub-
kins Algorithm [49] etc., performed well over the entire dataset. sequently used a Random Forest classifier to detect VF signals.
The actual accuracy measures were very low compared to what was This algorithm obtained Ac = 94.79, Se = 95.04, Sp = 94.78 for 5 s
specified in the original papers since a pre-selection of the signals long episodes and better results for 8 s long episodes (Ac = 97.20,
was done. Other algorithms in the literature that use only signal Se = 95.05, Sp = 97.02). Mi et al. [18] experimented with differ-
processing techniques also show a selectively high but overall poor ent dimensionality reduction and machine learning algorithms.
performance. Arafat et al. [9] presented a method based on EMD and Strangely, their models were tested on the training set, still, it
Bayes Decision Theory, which shows a sensitivity (Se) of 99.00%, obtained poor sensitivity (Se = 92.396, Sp = 99.121, Ac = 99.350). Asl
specificity (Sp) of 99.88% and accuracy (Ac) of 99.78%, with only et al. [19] did some preprocessing on the ECG signals before extract-
‘VF’ and ‘NSR’ (Normal Sinus Rhythm) signals in the dataset. But ing the features and performing a dimensionality reduction using
the performance falls drastically when other beats and rhythms are Gaussian Discriminant Analysis (GDA); finally, a SVM model was
considered. Anas et al. [10] presented another algorithm based on trained. This algorithm is by far the best performing one (Se = 95.77,
the EMD which obtains a sensitivity of 82.89%, specificity of 99.02% Sp = 99.40, Ac = 99.16), but the drawback is that it works on the win-
and accuracy of 98.62%, on the test set. The authors not only made dow length of 32 R–R interval, which is roughly 30 s. This makes the
a pre-selection of the signals but also gave priority to the Not VF algorithm extremely slow and delays the prediction. Clayton et al.
class while selecting the threshold which results in a high accu- [20] used a (shallow) neural network to classify ‘VF’, which unfortu-
racy but low sensitivity. Two other algorithms, Hilbert transform nately obtained poor performance (Se = 86, Sp = 58). Acharya et al.
(HILB) [11] and Phase Space Reconstruction (PSR) [12] algorithms [42] very recently used a Convolutional Neural Network (CNN)
use the phase space of the ECG signal for VF detection. But they do to detect VF along with some other arrhythmias. Their algorithm
not consider the shape of this signal. Thus, they fail to differenti- obtained a high specificity (98.19) but very low sensitivity (56.44).
ate VT (Ventricular Tachycardia) from VF when other arrhythmias In Table 2 we present a comparison among a number of meth-
are present (HILB: Se = 79.73, Sp = 98.83, Ac = 98.40; PSR: Se = 78.07, ods. Here we are only showing the algorithms based on machine
Sp = 99.01, Ac = 98.53). learning techniques as they outperform traditional signal process-
Machine learning approaches show great promises as they ing based algorithms. Note that the results reported in Table 2
improve the detection accuracy. Almost all the machine learning should be interpreted carefully as different works have reported
algorithms in the literature extract features from other existing their results using different validation techniques. As has already
VF detection algorithms based on signal processing, and then use been mentioned, in our work, we employed 10-fold cross valida-
them as features to detect VF. Atienza et al. [14] studied a num- tion, and avoided independent testing as the idea of the latter has
358 N. Ibtehaz et al. / Biomedical Signal Processing and Control 49 (2019) 349–359
Table 2
Comparison among different methods. Results are taken from the respective papers. ‘–’ indicates that the score was not available/reported in the respective paper. Here, we
have only included the machine learning based works, as they outperforms the traditional approaches based solely on signal processing (as shown in Section 3.5.)
been doubted by some researchers (e.g., [50]). More specifically, class ECG signals and proposed a novel feature engineering scheme.
as argued by Chou in [50], the way of independent test instance Next, we trained machine learning classifiers on the extracted fea-
selection to test the predictor could be quite arbitrary resulting in tures. As the dataset is highly imbalanced we adopted appropriate
arbitrary conclusions. A predictor achieving a higher success rate techniques to overcome the imbalance. Also, we have computed
than the other predictor for a given independent testing dataset feature importance and experimentally found that similar perfor-
might fail to keep so when tested by another independent testing mance can be obtained by using a much smaller subset of the
dataset. Accordingly, independent testing is not a fairly objective computed features, which can be very helpful for constructing a
test method although it has often been used to demonstrate the real time system as it will make our algorithm much faster. We
practical application of a predictor in different domains. Unfor- have compared our algorithm with the state of the art and found
tunately most of the works we are comparing with, employed out that our algorithm outperforms them. The only algorithm that
independent testing but without any specific information about the comes close to our algorithm is presented by Asl et al. [19]. How-
test dataset; also they have not published the code of their imple- ever, the downside of their algorithm is that it works on windows
mentation making it impossible to reproduce the test results and of 32 R–R intervals (roughly 30 s), obtaining a sensitivity of 95.77%,
ensure a level playing field. specificity of 99.40%, accuracy of 99.16% and G-Mean Accuracy of
97.57%. On the other hand, our algorithm obtains a sensitivity of
4. Conclusion 99.99%, specificity of 98.40%, accuracy of 99.20% and G-mean accu-
racy of 99.19%, on a small 5 s long window. Moreover, It has been
Ventricular Fibrillation is a dangerous life threatening arrhyth- seen experimentally that our performance improves as we increase
mia that can cause sudden cardiac arrest resulting in a sudden the window length.
death. The inability of a doctor to continuously monitor the heart In conclusion, this work has shown that the combination of
conditions of all the patients motivates us to design and develop signal processing based feature engineering and machine learn-
efficient and accurate automated systems to perform the task. ing based decision making can greatly improve the performance of
Immediately after Ventricular Fibrillation is detected a shock treat- algorithms in biomedical signal processing domain. While existing
ment can be given to the patient. A lot of research works have algorithms emphasize either on signal processing or on machine
been done to detect Ventricular Fibrillation using either signal pro- learning, leaving the other one neglected, our objective has been
cessing or machine learning techniques separately. In some works, to make a fusion of these two approaches to take the best of both
the authors have even proposed automated systems to give shock techniques. Thus, we have developed a robust algorithm, VFPred,
treatment to the patients. They have argued that the system should for the detection of Ventricular Fibrillation that is both fast and
have higher specificity, i.e., the accuracy of detecting patients not accurate. One of the most noteworthy features of VFPred is that it
affected by Ventricular Fibrillation should be higher. This imposes can classify both the classes equally accurately, even when using
priority on detecting ‘Not VF’ class correctly and in most cases the a short ECG signal. This is a significant improvement as existing
accuracy of detecting ‘VF’ becomes low. We find this contradic- works, while can identify the majority class (‘Not VF’) very well,
tory, as the objective is to detect VF, not the other class. Moreover, fall much shorter in identifying the minority class (‘VF’). Also, the
such a system will be vulnerable if it fails to detect VF consistently success of VFPred with short ECG signals opens up the possibili-
which may result in deaths of patients. We do not deny the impor- ties for developing more responsive, real time cardiac monitoring
tance of high specificity but at the same time, we believe that the systems.
sensitivity should be high as well. Note that, our goal is to aid the The future direction of this research is to delve into detecting
doctors and in no way to replace them. Hence, instead of develop- other life threatening heart arrhythmias using a coalescence of
ing automated shocking systems that fail in detecting ‘VF’ properly machine learning and signal processing. Furthermore, it would be
with the excuse of preventing the shock treatment of unaffected interesting to investigate to what extent the patterns can be learnt
patients, we propose an automated monitoring system which will from the time domain signal alone without complex preprocess-
continuously monitor the patients and when the possibility of ‘VF’ ing. Ultimately, the objective would be to develop wearable cardiac
arises, it will activate an alarm, prompting an experienced doctor to monitoring devices, that can infer arrhythmias in real-time.
examine the case and decide whether a shock treatment is indeed
required. Thus the sensitivity of the detection/prediction system
should be high to avoid unfortunate deaths. We also gave impor-
tance to specificity, as our algorithm can classify both the classes
with near equal performance. Conflict of interests
In this work, we combined the strengths of both signal pro-
cessing and machine learning. We analyzed the pattern of the ‘VF’ The authors declare that there is no conflict of interests.
N. Ibtehaz et al. / Biomedical Signal Processing and Control 49 (2019) 349–359 359
Acknowledgments [21] S.A. Jones, ECG Notes: Interpretation and Management Guide, FA Davis, 2009.
[22] S.D. Greenwald, The development and analysis of a ventricular fibrillation
detector. PhD thesis, Massachusetts Institute of Technology, 1986.
Nabil Ibtehaz is supported by an ICT Fellowship (adminis- [23] F.M. Nolle, F.K. Badura, J.M. Catlett, R.W. Bowser, M.H. Sketch, Crei-gard, a
trated by ICT Division-Government of the People’s Republic of new concept in computerized arrhythmia monitoring systems, Comput.
Bangladesh). Cardiol. 13 (1986) 515–518.
[24] A.L. Goldberger, L.A.N. Amaral, L. Glass, J.M. Hausdorff, P.Ch. Ivanov, R.G. Mark,
J.E. Mietus, G.B. Moody, C.-K. Peng, H.E. Stanley, Physiobank, physiotoolkit,
Appendix A. Supplementary data and physionet, Circulation 101 (23) (2000) e215–e220.
[25] N.E. Huang, Z. Shen, S.R. Long, M.C. Wu, H.H. Shih, Q. Zheng, N.-C. Yen, C.C.
Tung, H.H. Liu, The empirical mode decomposition and the Hilbert spectrum
Supplementary data associated with this article can be found, in for nonlinear and non-stationary time series analysis., in: Proceedings of the
the online version, at https://doi.org/10.1016/j.bspc.2018.12.016. Royal Society of London A: Mathematical, Physical and Engineering Sciences,
vol. 454, The Royal Society, 1998, pp. 903–995.
[26] A.V. Oppenheim, Discrete-time Signal Processing, Pearson Education India,
References 1999.
[27] T.K. Ho, Random decision forests, in: Proceedings of the Third International
[1] S.G. Priori, C. Napolitano, M. Memmi, B. Colombi, F. Drago, M. Gasparini, L. Conference on Document Analysis and Recognition, vol.e 1, IEEE, 1995, pp.
DeSimone, F. Coltorti, R. Bloise, R. Keegan, et al., Clinical and molecular 278–282.
characterization of patients with catecholaminergic polymorphic ventricular [28] L. Breiman, Random forests, Mach. Learn. 45 (1) (2001) 5–32.
tachycardia, Circulation 106 (1) (2002) 69–74. [29] R. Díaz-Uriarte, S.A. De Andres, Gene selection and classification of microarray
[2] A. Baldzizhar, E. Manuylova, R. Marchenko, Y. Kryvalap, M.G. Carey, data using random forest, BMC Bioimform. 7 (1) (2006) 3.
Ventricular tachycardias: characteristics and management, Crit. Care Nurs. [30] H. Bjoern, B. Menze, M. Kelm, R. Masuch, U. Himmelreich, P. Bachert, W.
Clin. 28 (3) (2016) 317–329. Petrich, F.A. Hamprecht, A comparison of random forest and its Gini
[3] Y. Li, J. Bisera, M.H. Weil, W. Tang, An algorithm used for ventricular importance with standard chemometric methods for the feature selection
fibrillation detection without interrupting chest compression, IEEE Trans. and classification of spectral data, BMC Bioimform. 10 (1) (2009) 213.
Biomed. Eng. 59 (1) (2012) 78–86. [31] C. Cortes, V. Vapnik, Support-vector networks, Mach. Learn. 20 (3) (1995)
[4] N.V. Thakor, Y.-S. Zhu, K.-Y. Pan, Ventricular tachycardia and fibrillation 273–297.
detection by a sequential hypothesis testing algorithm, IEEE Trans. Biomed. [32] B.E. Boser, I.M. Guyon, V.N. Vapnik, A training algorithm for optimal margin
Eng. 37 (9) (1990) 837–843. classifiers, in: Proceedings of the Fifth Annual Workshop on Computational
[5] S. Chen, N.V. Thakor, M.M. Mower, Ventricular fibrillation detection by a Learning Theory, ACM, 1992, pp. 144–152.
regression test on the autocorrelation function, Med. Biol. Eng. Comput. 25 (3) [33] S. Sathiya Keerthi, C.-J. Lin, Asymptotic behaviors of support vector machines
(1987) 241–249. with Gaussian kernel, Neural Comput. 15 (7) (2003) 1667–1689.
[6] S. Kuo, Computer detection of ventricular fibrillation, in: Proc. of Computers [34] G. Van Rossum, et al., Python programming language, USENIX Annual
in Cardiology, IEEE Comupter Society, 1978, pp. 347–349. Technical Conference, vol. 41 (2007) 36.
[7] S. Barro, R. Ruiz, D. Cabello, J. Mira, Algorithmic sequential decision-making in [35] S. van der Walt, S. Colbert Chris, G. Varoquaux, The Numpy array: a structure
the frequency domain for life threatening ventricular arrhythmias and for efficient numerical computation, Comput. Sci. Eng. 13 (2) (2011) 22–30.
imitative artefacts: a diagnostic system, J. Biomed. Eng. 11 (4) (1989) 320–328. [36] E. Jones, T. Oliphant, P. Peterson, {SciPy}: Open Source Scientific Tools for
[8] X.-S. Zhang, Y.-S. Zhu, N.V. Thakor, Z.-Z. Wang, Detecting ventricular {Python} (2014).
tachycardia and fibrillation by complexity measure, IEEE Trans. Biomed. Eng. [37] D. Laszuk, Python Implementation of Empirical Mode Decomposition
46 (5) (1999) 548–555. Algorithm, 2017.
[9] M.A. Arafat, J. Sieed, M.K. Hasan, Detection of ventricular fibrillation using [38] F. Pedregosa, G. Varoquaux, A. Gramfort, V. Michel, B. Thirion, O. Grisel, M.
empirical mode decomposition and Bayes decision theory, Comput. Biol. Med. Blondel, P. Prettenhofer, R. Weiss, V. Dubourg, et al., Scikit-learn: machine
39 (11) (2009) 1051–1057. learning in python, J. Mach. Learn. Res. 12 (Oct) (2011) 2825–2830.
[10] E.M. Abu Anas, S.Y. Lee, M.K. Hasan, Exploiting correlation of ECG with certain [39] G. Lemaître, F. Nogueira, C.K. Aridas, Imbalanced-learn: A python toolbox to
emd functions for discrimination of ventricular fibrillation, Comput. Biol. tackle the curse of imbalanced datasets in machine learning, J. Mach. Learn.
Med. 41 (2) (2011) 110–114. Res. 18 (17) (2017) 1–5.
[11] A. Amann, R. Tratnig, K. Unterkofler, A new ventricular fibrillation detection [40] J.D. Hunter, Matplotlib: a 2D graphics environment, Comput. Sci. Eng. 9 (3)
algorithm for automated external defibrillators, in: Computers in Cardiology, (2007) 90–95.
IEEE, 2005, pp. 559–562. [41] I. Silva, G.B. Moody, An open-source toolbox for analysing and processing
[12] A. Amann, R. Tratnig, K. Unterkofler, Detecting ventricular fibrillation by Physionet databases in Matlab and octave, J. Open Res. Softw. 2 (1) (2014).
time-delay methods, IEEE Trans. Biomed. Eng. 54 (1) (2007) 174–177. [42] U. Rajendra Acharya, H. Fujita, O.S. Lih, Y. Hagiwara, J.H. Tan, M. Adam,
[13] A. Amann, R. Tratnig, K. Unterkofler, Reliability of old and new ventricular Automated detection of arrhythmias using different intervals of tachycardia
fibrillation detection algorithms for automated external defibrillators, ECG segments with convolutional neural network, Inform. Sci. 405 (2017)
Biomed. Eng. Online 4 (1) (2005) 60. 81–90.
[14] F. Alonso-Atienza, J.L. Rojo-Álvarez, A. Rosado-Muñoz, J.J. Vinagre, A. [43] R. Barandela, J.S. Sánchez, V. Garcıa, E. Rangel, Strategies for learning in class
García-Alberola, G. Camps-Valls, Feature selection using support vector imbalance problems, Pattern Recogn. 36 (3) (2003) 849–851.
machines and bootstrap methods for ventricular fibrillation detection, Expert [44] H. He, E.A. Garcia, Learning from imbalanced data, IEEE Trans. Knowled. Data
Syst. Appl. 39 (2) (2012) 1956–1967. Eng. 21 (9) (2009) 1263–1284.
[15] F. Alonso-Atienza, E. Morgado, L. Fernandez-Martinez, A. García-Alberola, J.L. [45] D. Mease, A.J. Wyner, A. Buja, Boosted classification trees and class
Rojo-Alvarez, Detection of life-threatening arrhythmias using feature probability/quantile estimation, J. Mach. Learn. Res. 8 (Mar) (2007) 409–439.
selection and support vector machines, IEEE Trans. Biomed. Eng. 61 (3) (2014) [46] N.V. Chawla, K.W. Bowyer, O.H. Lawrence, W.P. Kegelmeyer, Smote: synthetic
832–840. minority over-sampling technique, J. Artif. Intell. Res. 16 (2002) 321–357.
[16] Q. Li, C. Rajagopalan, G.D. Clifford, Ventricular fibrillation and tachycardia [47] R. Kohavi, et al., A study of cross-validation and bootstrap for accuracy
classification using a machine learning approach, IEEE Trans. Biomed. Eng. 61 estimation and model selection, in: IJCAI, vol. 14, Montreal, Canada, 1995, pp.
(6) (2014) 1607–1613. 1137–1145.
[17] A. Verma, X. Dong, Detection of ventricular fibrillation using random forest [48] C. Li, C. Zheng, C. Tai, Detection of ECG characteristic points using wavelet
classifier, J. Biomed. Sci. Eng. 9 (05) (2016) 259. transforms, IEEE Trans. Biomed. Eng. 42 (1) (1995) 21–28.
[18] M.H. Song, J. Lee, S. Pil Cho, K. Joung Lee, S.K. Yoo, Support vector machine [49] J. Pan, W.J. Tompkins, A real-time QRS detection algorithm, IEEE Trans.
based arrhythmia classification using reduced features, Int. J. Control Autom. Biomed. Eng. (3) (1985) 230–236.
Syst. 3 (4) (2005) 571. [50] K.-C. Chou, Some remarks on protein attribute prediction and pseudo amino
[19] B.M. Asl, S.K. Setarehdan, M. Mohebbi, Support vector machine-based acid composition, J. Theor. Biol. 273 (1) (2011) 236–247.
arrhythmia classification using reduced features of heart rate variability
signal, Artif. Intell. Med. 44 (1) (2008) 51–64.
[20] R.H. Clayton, A. Murray, R.W.F. Campbell, Recognition of ventricular
fibrillation using neural networks, Med. Biol. Eng. Comput. 32 (2) (1994)
217–220.