Pattern Recognition Application in ECG Arrhythmia Classification
Pattern Recognition Application in ECG Arrhythmia Classification
Keywords: Arrhythmia Classification, Pattern Recognition, Beat Segmentation, 1-D LBP, ELM Classification.
Abstract: In this paper, we propose a pattern recognition algorithm for arrhythmia recognition. Irregularity in the
electrical activity of the heart (arrhythmia) is one of the leading reasons for sudden cardiac death in the
world. Developing automatic computer aided techniques to diagnose this condition with high accuracy can
play an important role in aiding cardiologists with decisions. In this work, we apply an adaptive
segmentation approach, based on the median value of R-R intervals, on the de-noised ECG signals from the
publically available MIT-BIH arrhythmia database and split signal into beat segments. The combination of
wavelet transform and uniform one dimensional local binary pattern (1-D LBP) is applied to extract sudden
variances and distinctive hidden patterns from ECG beats. Uniform 1-D LBP is not sensitive to noise and is
computationally effective. ELM classification is adopted to classify beat segments into five types, based on
the ANSI/AAMI EC57:1998 standard recommendation. Our preliminary experimental results show the
effectiveness of the proposed algorithm in beat classification with 98.99% accuracy compared to the state of
the art approaches.
48
Nikan S., Gwadry-Sridhar F. and Bauer M.
Pattern Recognition Application in ECG Arrhythmia Classification.
DOI: 10.5220/0006116300480056
In Proceedings of the 10th International Joint Conference on Biomedical Engineering Systems and Technologies (BIOSTEC 2017), pages 48-56
ISBN: 978-989-758-213-4
Copyright
c 2017 by SCITEPRESS – Science and Technology Publications, Lda. All rights reserved
Pattern Recognition Application in ECG Arrhythmia Classification
network classifier leads to 98.78% classification cumulants and independent component analysis)
accuracy between normal and abnormal beats. In features were proposed for heart beat representation.
(Kadambe and Srinivasan, 2006), normal and An accuracy of 98.91% was achieved using the
abnormal time domain features, P, QRS and T fusion of SVM and radial basis function classifiers
waves from American Heart Association database to classify five types of arrhythmia. The
were classified with the accuracy of 96%, 90% and combination of fourth and fifth scale dual-tree
93.3%, respectively, by discretizing the wavelet complex wavelet transform (DTCWT) coefficients,
basis function using an adaptive sampling scheme. AC power, kurtosis, skewness and timing
Adaptive parameters of wavelet non-linear functions information were adopted in (Thomas et al., 2015)
and the relative weight of each basis function were as QRS characteristics. Multi-layer back propagation
estimated using a neural network. An accuracy of neural network was proposed to classify five types
99.65% for arrhythmia recognition was reported in of ECG beats of MIT-BIH Arrhythmia database with
(Yu and Chen, 2007) using wavelet transform and a the accuracy of 94.64%.
probabilistic neural network. However, a small As discussed, encouraging results on the
subset of MIT-BIH ECG database (only 23 records) arrhythmia classification have been obtained in
was employed for evaluation. In order to classify previous research. However, more applicable and
ECG beats, the authors in (Ebrahimzadeh and fully automatic techniques with high accuracy and
Khazaee, 2009) adopted statistical features from low complexity need to be developed. In particular,
Lyapunov exponents and wavelet coefficients power developing automatic computer aided segmentation
spectral density (PSD) values of eigenvectors and of ECG signal into heart beats is very important as
achieved a 94.64% accuracy for eight records from the first stage in beat classification. In previous
MIT-BIH arrhythmia database. Due to the effect of research (Thomas et al., 2015; Khalaf et al., 2015),
noise, and the nonstationary nature of ECG signal, R peaks were located using an annotated file which
nonlinear techniques appear to be more effective in makes the techniques semi-automatic. In contrast, in
extracting distinctive and hidden characteristics of the approach proposed in this paper, R peaks are
ECG signals. In (Martis et al., 2013b), higher order detected automatically based on a parabolic fitting
spectra (HOS) bi-spectrum cumulants and PCA algorithm. Moreover, a novel adaptive segmentation
dimensionality reduction approach were adopted to technique used in our work reduces the probability
represent ECG signals and feed-forward neural of beat misclassification and the risk of misdiagnosis
network and least square support vector machine due to the interference of adjacent beats which may
(SVM) were used for classifying different types of occur when a constant beat size was used as in
beats with an accuracy of 93.48%. In (Khalaf et al., previous works (Martis et al., 2013a; Elhaj et al.,
2015), a cyclostationary analysis was proposed as a 2016). As well, the chosen feature extraction
feature extraction approach to reduce the effect of technique has significant role in the accuracy of
noise and also to reveal hidden periodicities of ECG diagnosis. By discovering hidden patterns and
beats where spectral correlation coefficients were extracting distinctive features from the ECG signal,
utilised as statistical signal characteristics and which are less sensitive to noise, the accuracy of
passed through SVM for classification; this results in arrhythmia classification can be improved without
an accuracy of 98.6% for 30 records of the MIT-BIH requiring very complicated classifiers. Uniform 1-D
Arrhythmia database. Authors in (Oster et al., 2015) local binary pattern (LBP), used in our work, has the
proposed a switching Kalman filter technique for advantage of less sensitivity to noise and
arrhythmia classification, and automatic selection of effectiveness in extracting hidden and salient
beat type. This method also includes a beat type for information from non-stationary ECG signals and
unknown morphologies “X-factor” which due to low computational complexity, it can be
incorporates a form of uncertainty in classification employed in real-time applications (Kaya et al.,
for the case of indecision on the beat type. The 2014).
classification F1 score of the algorithm on MIT-BIH The proposed arrhythmia recognition approach
arrhythmia database was 98.3%. Employing the in this paper is based on beat classification by
fusion of linear and nonlinear features has benefits adopting the fusion of wavelet transform and
the advantages of handling noise and a more uniform 1-D LBP feature extraction of ECG signal
effective description of the signal. In (Elhaj et al., and extreme learning machine (ELM) classification.
2016), a combination of linear (PCA of DWT The ECG signal is pre-processed to remove the
coefficients) and nonlinear (high order statistics, unwanted effect of noise. Then, the de-noised signal
49
HEALTHINF 2017 - 10th International Conference on Health Informatics
Figure 1: Block diagram of the proposed arrhythmia recognition and classification algorithm.
50
Pattern Recognition Application in ECG Arrhythmia Classification
Tompkins, 1985).
. (3)
4 BEAT SEGMENTATION
Figure 2: Five categories of ECG beat classes based on the In order to recognize arrhythmia, we had to compute
ANSI/AAMI EC57-1998 standard. a beat classification by dividing each ECG signal
into beat segments and classify different types of
beats. The segmentation process consists of R peak
3 PREPROCESSING detection and isolation of beats based on the
duration of R-R intervals.
The effect of noise on the ECG signal reduces the
accuracy of recognition of arrhythmia in the ECG 4.1 R Peak Detection
records and therefore, the precision of diagnosis of
cardiovascular disease will be decreased. Various R peaks are the largest deviation of ECG signals
categories of noise are associated with the ECG from the baseline. The proposed algorithm for R
signal, such as powerline interference, device noise, peak detection in this work is based on the parabolic
muscle noise, motion noise, contact noise and fitting algorithm (Jokic et al., 2011). By adopting
quantization noise (Elhaj et al., 2016). In order to two polynomial functions (PFs) of degree 3, we
increase the accuracy of disease detection, pre- modelled the R peak. A signal of length is
processing is required to be applied on the ECG defined as follows.
signal to reduce the effect of noise and improve the : 1 , 2 ,…, (5)
signal to noise ratio. In this paper, we applied a
digital elliptic band-pass filter with passband of 5-15 where is the sample of the signal. The
Hz (maximizes the QRS energy), which is approximation of signal using the polynomial
constructed by cascading a low-pass and high-pass function of order is denoted by the following
filters, to remove muscle noise and baseline wander equation.
(Pan and Tompkins, 1985) as follows. ⋯ ,
3.1 Low-pass Filter 1, 2, … , . (6)
By minimizing the least square error (the square of
The adopted low-pass filter has the following norm of the residual), we can calculate the
transfer function and amplitude response, coefficients as follows.
respectively (Pan and Tompkins, 1985).
, (1) ‖ ‖ , (7)
3 0. (8)
| | where T is sampling period (2)
2
In order to find R peak, a differentiator is first used
3.2 High-pass Filter to highlight the high inclines of the ECG signal.
Then, the PFs are fitted from the Q peak to the R
The transfer function of the high-pass filter is based peak (through the ascending R leg) and from R peak
on the subtraction of the output of a first-order low- to the S peak (through the descending R leg) (Jokic
pass filter from an all-pass filter as follows (Pan and et al., 2011).
51
HEALTHINF 2017 - 10th International Conference on Health Informatics
5.1 Wavelet
Figure 3: Three-level wavelet decomposition.
Discrete wavelet transform is a viable and powerful
feature extraction technique to analyse ECG signals
locally in multi-resolution manner in time and
frequency domain simultaneously and separate the
signal frequency sub-bands. A signal can be
displayed with different scaling and wavelet basis
functions (Emadi et al., 2012). DWT extracts the
approximation (low frequency components) and
detailed coefficients (high frequency components) as Figure 4: 2-D LBP for a sample point of a 2-D signal: a)
shown in Fig 3 ( and are approximation and choosing P neighbours on the neighbourhood of radius R
detail coefficients and 1, 2 3). A continuous around a centre sample point, b) comparing signal values
for centre and neighbour points and c) creating the binary
wavelet transform is generated by a series of
pattern and associated decimal value for the centre sample.
translations and dilations of mother wavelet . as
follows (Ródenas et al., 2015).
52
Pattern Recognition Application in ECG Arrhythmia Classification
histograms as the feature sets, the image-size Furthermore, all feature vectors regardless of the
dimension of the feature space can be reduced to the beat size, have equal length of feature sets.
number of histogram bins (Ahonen et al., 2004). is
the radius of the neighbourhood and is the number
of neighbour samples which are compared with the
centre pixel as shown in Fig 4. If the value of the
neighbour sample is greater than or equal to the
centre sample, a 1 is assigned to that neighbour and
if it is less than the centre pixel a 0 is assigned to
that sample. Therefore, we have a -bit binary
pattern for each pixel at , location and the
decimal value (DV) associated with the binary
pattern is calculated as follows. Figure 5: Neighbouring around one sample point of ECG
signal for 1-D LBP feature extraction.
, .2 , (12)
1 0 6 CLASSIFICATION
. (13)
0 0
In this section, we describe our approach for training
Decimal values are used to make the histogram for a classifier to learn the set of arrhythmia classes
the 2-D signal. Therefore, the size of feature vector from a set of the extracted features from ECG beat
which is extracted from the 2-D image is equal to segments. We then use the remaining features for
the number of histogram bins (2 ). In order to testing the classifier to predict the class labels of
reduce the size of features and remove redundant beat segments; we apply 10-fold cross validation (to
information, we ignore non-uniform patterns due to keep consistency with reference works). The feature
the fact that considerable amount of discriminating set of all ECG beat segments is divided into two
information (important local textures such as spots, randomly selected subsets for training and
line ends, edges and corners) is preserved by taking validation, for 10 times, and the classification
only uniform patterns into consideration (Ahonen et approach is applied every time to predict the
al., 2004). The binary pattern is uniform if there are arrhythmia class labels for the test set. Each time,
at most two bitwise transitions from 0 to 1 or 1 to 0. 90% of the dataset is devoted to the training subset
Each histogram has 1 2 bins for uniform and the rest forms the testing subset. The final
and 1 bin for all non-uniform patterns, in total there accuracy is the average of 10 folds. We employ an
are 1 3 bins. Therefore, the computational extreme learning machine as the proposed
complexity is also reduced (Nikan and Ahmadi, classification approach. Feed-forward neural
2015). networks are used extensively as classification
The one-dimensional version of LBP can be adopted strategies in medical pattern recognition applications
to extract distinctive characteristics from ECG due to their capability in approximating the
signals. The same procedure is applied on each nonlinear mappings in the data. In order to tune the
sample point of the signal by comparing P/2 weights and biases of the network, traditional
neighbours from right and left side of centre sample learning mechanisms such as gradient decent
to create the P-bit pattern as shown in Fig 5 (Kaya et method are employed. However, due to very slow
al., 2014). In this paper, the uniform 1-D LBP with iterative tuning by a gradient decent technique and
neighbourhood size of 8 points is applied on wavelet its convergence into local minima, feed-forward
coefficients from the previous section. Therefore, a neural networks suffer from slow learning and poor
histogram of 59 bins (based on the above scalability. Extreme learning machine (ELM), as a
formulations 1 3 8 8 1 3 59 learning algorithm for single hidden layer feed-
bins) is created as the feature vector for each beat forward neural network (FF-NN), is a faster
segment. This technique not only discovers local technique. An ELM classifier is generalized single
sudden variances and hidden patterns from ECG hidden layer neural network with random hidden
signal but also has the advantage of having less nodes and determined hidden layer weights without
sensitivity to noise, extracting sparser iterative weight tuning (Huang et al., 2006). For N
characteristics, and is computationally effective. distinct training samples, the single hidden layer FF-
53
HEALTHINF 2017 - 10th International Conference on Health Informatics
% 100. (19)
̅ ̅ . ̅ ̅,
Table 2 shows the total accuracy of the proposed
1, 2, … , (14) arrhythmia classification approach compared to the
where, ̅ , ,…, and previous works in the literature, using the following
equation.
, ,…, are input and output nodes, . is
the activation function of network, is threshold of
% 100 (20)
hidden node and , ,…, and
̅ , ,…, denote the weight vectors where, is the true negative value of the
between the hidden node and the input and classification. As shown in Table 2, our proposed
output nodes, respectively. samples can be method outperforms other reference techniques in
approximated to have zero error means such that, the accuracy of beat classification. In the presented
work, we adopted the same dataset as what was
employed in the studies that are used for
. ̅ (15) comparison, except for the work in (Khalaf et al.,
2015), were only 30 ECG recordings were adopted
where, (15) can be denoted as follows. which is much smaller than the 48 recordings in our
study.
Λ (16) Our proposed algorithm is fully automatic,
compared to the semi-automatic techniques in
where, Λ ̅ , ̅ ,…, ̅ and Y (Thomas et al., 2015; Khalaf et al., 2015). Based on
, ,…, and is the hidden layer matrix,
Table 1: Sensitivity and Precision of the proposed
the column of which is the output of hidden algorithm for classifying each beat type.
node. It is proven in (Huang et al., 2006) that if .
is infinitely differentiable, then we can assign Beat Class Sensitivity % Precision %
random values to the weights and biases and the
N 97.86 98.50
required hidden layer nodes is . Therefore, in
the ELM technique, rather than tuning the weights V 96.20 98.63
and biases iteratively in gradient descent method,
F 92.73 96.35
they are randomly assigned in the beginning of
learning. Then, is calculated and output weights S 90.50 94.06
are obtained through the following minimum norm
U 78.66 82.36
least squares solution of (16),
Λ (17) Table 2: Comparison of the accuracy of different
where, is the Moore-Penrose generalized inverse algorithms for arrhythmia classification.
of (Huang et al., 2006).
Method Total Accuracy %
DTCWT+Morphological-ANN
94.64
(Thomas et al., 2015)
7 EXPERIMENTAL RESULTS
PDHI-SVM/RBF (Elhaj et al.,
98.91
In order to evaluate the performance of the proposed 2016)
algorithm for arrhythmia recognition and
classification, cross validation is applied on the SC-SVM (Khalaf et al., 2015) 98.60
entire MIT-BIH arrhythmia database (110094 beat
segments). Sensitivity and precision of classification DWT+PCA-NN (Martis et al.,
98.78
of each beat type are calculated using true positive 2013a)
( ), false positive ( ) and false negative ( ) as
follows and shown in Table 1. Proposed algorithm 98.99
54
Pattern Recognition Application in ECG Arrhythmia Classification
the results in Table 2, the classification accuracies in Emadi, M., Khalid, M., Yusof, R., & Navabifar, F. (2012).
(Martis et al., 2013a) and (Elhaj et al., 2016) are Illumination normalization using 2D wavelet.
very close to the result of our proposed approach. Procedia Engineering, 41, 854-859.
However, the proposed adaptive segmentation Goldberger, A. L., Amaral, L. A., Glass, L., Hausdorff, J.
M., Ivanov, P. C., Mark, R. G., …, Stanley, H. E.
method in this paper reduces the interference of (2000). PhysioBank, PhysioToolkit and PhysioNet:
adjacent beats, which is caused by using fixed beat components of a new research resource for complex
size as in (Martis et al., 2013a) and (Elhaj et al., physiologic signals. Circulation, 101(23), E215-E220.
2016). Our proposed technique outperforms those Huang, G. B., Zhu, Q. Y., & Siew, C. K. (2006). Extreme
approaches by 232 and 89 less misclassifications, learning machine: theory and applications.
respectively. Neurocomputing, 70(1-3), 489-501.
Inan, O. T., Giovangrandi, L., & Kovacs, G. T. (2006).
Robust neural network based classification of
premature ventricular contraction using wavelet
8 CONCLUSIONS transform and timing interval feature. IEEE
Transactions on Biomedical Engineering, 53(12),
The proposed arrhythmia classification approach 2507-2515.
introduces a novel adaptive beat segmentation Jokic, S., Delic, V., Peric, Z., Krco, S., & Sakac, D.
method based on the median value of the R-R (2011). Efficient ECG modeling using polynomial
functions. Electronics and Electrical Engineering,
intervals which reduces the misclassification due to
4(110), 121-124.
the inclusion of adjacent beats in each segment. Kadambe, S., & Srinivasan, P. (2006). Adaptive wavelets
Moreover, applying uniform 1-D LBP on the for signal classification and compression.
wavelet coefficients not only reduces the International Journal of Electronics and
dimensionality of feature space to 59 bins, which Communications, 60(1), 45-55.
makes the proposed algorithm computationally Kaya, Y., Uyar, M., Tekin, R., & Yıldırım, S. (2014). 1D-
effective, but also extracts local sudden variances local binary pattern based feature extraction for
and sparser hidden patterns from the ECG signal and classification of epileptic EEG signals. Applied
has the advantage of having less sensitivity to noise. Mathematics and Computation, 243, 209-219.
Khalaf, A. F., Owis, M. I., & Yassine, I. A. (2015). A
ELM classification leads to 98.99% accuracy of beat
novel technique for cardiac arrhythmia classification
classification of ECG records in the MIT-BIH using spectral correlation and support vector
arrhythmia database, based on the ANSI/AAMI machines. Expert Systems with Applications, 42(21),
EC57:1998 standard recommendation, which 8361-8368.
outperforms the performance of the state of the art Khoshnoud, S., & Ebrahimnezhad, H. (2013).
arrhythmia recognition algorithms in the literature. Classification of arrhythmias using linear predictive
These types of algorithms create opportunities for coefficients and probabilistic neural network. Applied
automatic methods that can be applied to ECG Medical Informatics, 33(3), 55-62.
readings to help cardiologists assess the risk of Korurek, M., & Dogan, B. (2010). ECG beat classification
using particle swarm optimization and radial basis
arrhythmias that may result in sudden cardiac death.
function neural network. Expert Systems with
This, given the shortage of cardiologists, can Applications, 37(12), 7563-7569.
enhance our ability to screen people at risk. Martis, R. J., Acharya, U. R., & Min, L. C. (2013a). ECG
beat classification using PCA, LDA, ICA and discrete
wavelet transform. Biomedical Signal Processing and
REFERENCES Control, 8(5), 437-448.
Martis, R. J., Acharya, U. R., Mandana, K. M., Raya, A.
K., & Chakraborty, C. (2013b). Cardiac decision
Ahonen, T., Hadid, A., & Pietikainen, M. (2004, May). making using higher order spectra. Biomedical Signal
Face recognition with local binary patterns. in Processing and Control, 8(2), 193-203.
Proceedings of 8th European Conference on Moody, G. B., & Mark, R. G. (2001). The impact of the
Computer Vision (ECCV), Prague, 469-481. MIT-BIH arrhythmia database. IEEE Engineering in
Ebrahimzadeh, A., & Khazaee, A. (2009). An efficient Medicine and Biology Magazine, 20(3), 45-50.
technique for classification of electro-cardiogram Nikan, S., & Ahmadi, M. (2015). Local gradient-based
signals. Advances in Electrical and Computer illumination invariant face recognition using LPQ and
Engineering, 9(3), 89-93. multi-resolution LBP fusion. IET Image Processing,
Elhaj, F. A., Salim, N., Harris, A. R., Swee. T. T., & 9(1), 12-21.
Ahmed, T. (2016). Arrhythmia recognition and Oster, J., Behar, J., Sayadi, O., Nemati, S., Johnson, A. E.,
classification using combined linear and nonlinear & Clifford, G. D. (2015). Semisupervised ECG
features of ECG signals. Computer Methods and ventricular beat classification with novelty detection
Programs in Biomedicine, 127, 52-63.
55
HEALTHINF 2017 - 10th International Conference on Health Informatics
56