Detection of Bundle Branch Block Using Bat Algorithm and Levenberg Marquardt Neural Network Padmavathi Kora and K. Sri Rama Krishna
Abstract Abnormal Cardiac beat identification is a key process in the detection of heart ailments. This work proposes a technique for the detection of Bundle Branch Block (BBB) using Bat Algorithm (BA) technique in combination with Levenberg Marquardt Neural Network (LMNN) classifier. BBB is developed when there is a block along the electrical impulses travel to make heart to beat. The Bat algorithm can be effectively used to find changes in the ECG by identifying best features (optimized features). For the detection of normal and Bundle block beats, these Bat feature values are given as the input for the LMNN classifier. Keywords Bundle block Arrhythmia database
Bat algorithm
LMNN classifier
MIT-BIH
1 Introduction Electro-Cardiogram is used to access the electrical activity of a human heart. The diagnosis of the heart ailments by the doctors is done by following a standard changes. In this project our aim is to automate the above procedure so that it leads to correct diagnosis. Early diagnosis and treatment is of great importance because immediate treatment can save the life of the patient. BBB is a type of heart block in which disruption to the flow of impulses through the right or left bundle of His, delays activations of the appropriate ventricle that widens QRS complex and makes changes in QRS morphology. BBB is developed when there is a block along the path that electrical pulses travel to make the heart to beat. Since the electrical impulses cannot travel through the preferred pathway across the BBB, it may travels through muscles that slows P. Kora (&) GRIET, Hyderabad, India e-mail:
[email protected] K. Sri Rama Krishna VRSEC, Vijayawada, India © Springer International Publishing Switzerland 2016 S.C. Satapathy and S. Das (eds.), Proceedings of First International Conference on Information and Communication Technology for Intelligent Systems: Volume 1, Smart Innovation, Systems and Technologies 50, DOI 10.1007/978-3-319-30933-0_55
553
554
P. Kora and K. Sri Rama Krishna
down the electrical movement and changes the directional path of the pulses. A condition in which there is a delay in the in the hearts lower chambers may be observed through changes in the ECG. ECG is a cost effective tool for analyzing cardiac abnormalities. The diagnosis of heart ailments by doctors is done by standard changes. In this project, our aim is to automate the above procedure so that it leads to correct diagnosis. Early diagnosis and treatment is of great importance because immediate treatment can save the life of the patient. Good performance depends on the accurate detection of ECG features. Detection of BBB using ECG involves three main steps: preprocessing, feature optimization and classification as shown in Fig. 1. The first step in preprocessing mainly concentrates in removing noise from the signal using filters. Next step in the preprocessing is the ‘R’ peak detection and then segmentation of ECG file into beats. The samples that are extracted from each beat contains non uniform samples. The non uniform samples of each beat are converted into uniform samples of size 200 by using a technique called re-sampling. Fig. 1 ECG classification using BA
Detection of Bundle Branch Block Using Bat Algorithm …
555
Feature extraction in the present paper is based on the extracting key features using nature inspired algorithm [1, 2] called BA. In recent years many models are developed based on the behaviors of living beings and have been applied for solving the sensible real world issues. Among them, BA may be a population based optimization technique. BA is used extensively as a model to solve many engineering applications. In Recent years, BA has been applied with success to some engineering concepts like harmonic estimation, optimum management, reduction machine learning and transmission loss and so on. The proposed BA [3] scheme has been compared to Particle Swarm Optimization (PSO) [4, 5] which is a popular algorithm for optimization of ECG features with respect to the following performance measures like convergence speed, and the accuracy in the final output.
2 Pre Processing 2.1
Data Collection and Noise Removal
To prove the performance of BA, the usual MIT BIH arrhythmia database [6] is considered. The data used in this algorithm confines to 11 recordings that consists of 5 normal, 3 LBBB and 3 RBBB for a duration of 60 min at 360 Hz sampling rate. Denoising of ECG data is a preprocessing step that removes noise and makes ECG file useful for subsequent steps in the algorithm. The Sgolay FIR smoothing filter is used for filtering.
3 Feature Extraction In the feature extraction procedure, a fraction of signal around the R peak is extracted as the time-domain features since the R peaks of ECG signal are an important index for cardiac diseases. To ensure the important characteristic points of ECG like P, Q, R, S and T are included, a total of 200 sampling points before and after the R peak are collected as one ECG beat sample. The samples that are extracted from each beat contains non uniform samples. The non uniform samples in each beat are converted into uniform samples of size 200 by using a technique called resampling. The resampled ECG beat samples/features is shown in Fig. 2.
556
P. Kora and K. Sri Rama Krishna
Fig. 2 ECG beat segmentation
4 Feature Optimization The customary feature extraction methods generally yields a large number of features, and many of these might be insignificant. Therefore, the effective technique in this study is to extract the key features useful in the classification of ECG beats. In this sub-section, 20 key features from 200 samples are extracted using BA algorithm.
4.1
Bat Algorithm(BA)
BA [7] was developed by Yang. Bats use eco-location technique to find their food/prey. Echolocation capability of Bats: Generally bats have the ability to identify many bugs, recognize distance of the quarry and move gently and can circumvent the obstacle in the whole duskiness and for communication, they use a special type of sonar known as echo-location. All creatures including bats issue out some pulses that have the capability of using echo-location. These pulses ranges from frequency of high pitch (>200 kHz) to low pitch (10 kHz). When these pulses strike the obstacles, they reach the bats again in the form of echoes. The echo-location features are conceptualized by following rules. Most of the bats use a sophisticated sense of hearing. They release sounds that bounce (echoes) back from the insects or objects in their path. From these echoes, the bats can identify how far the insects or objects are from their current position and the also estimate the size of insects or objects within a fraction of second.
Detection of Bundle Branch Block Using Bat Algorithm …
557
Though they can vary the loudness in many forms, we assume that the loudness varies from a large (positive) A0 to a minimum constant value Amin. Bat algorithm structure (a) Initialization: The fitness of the initial bat population is evaluated using the Eq. (1) and the values of pulse rate ri, loudness Ai and frequency fmin, fmax are initialized. f ðxÞ ¼
j1 h i X 100ðxi þ 1 x2i Þ2 þ ðxi 1Þ2
ð1Þ
i¼1
where j is the dimension and x(i) is the ith bat. (b) Movement of Virtual Bats: The new bat population is generated by adjusting the position xi and the velocity vi for each bat in the population as given in Eqs. (2) and (3) respectively. ft ¼ fmin þ ðfmax fminÞ rand vi ðt þ 1Þ ¼ vi ðtÞ þ ðxi ðtÞ xGbest Þft
ð2Þ
xi ðt þ 1Þ ¼ xi ðtÞ þ vi ðtÞ
ð3Þ
The velocity and position updates of the ith bat are calculated using Eqs. (2) and (3). The wavelength λ and loudness A are varied according to the location and size of the food. The vi and xi are initialized with some initial random values and a fitness function f is calculated, using the particles positional coordinates as input values. (c) Local search capability of the algorithm: xnew ¼ xGbest þ At
ð4Þ
In order to enhance the local search capability of the algorithm, Yang [8] has created the best solution using the Eq. (4) where xGbest is a high quality solution chosen by some mechanism. A−t is the average loudness value of all the bats at tth time step and the ϵ is generated by some random mechanism ranging between −1 and 1. (d) Loudness(A): Loudness Ai has been updated using Eq. (5) as the iterations proceed. As bats approach their food, the loudness usually decreases. Generally, the loudness value will decrease when the bat starts approaching the best solution as shows in the following equation: Ai ðt þ 1Þ ¼ aAi ðtÞ The amount of decrease is determined by α where 0 < α < 1.
ð5Þ
558
P. Kora and K. Sri Rama Krishna
(e) Pulse emission rate(r): The pulse emission rate ri has been updated using the Eq. (6) as the bats approach their food. r increases. Pulse rate r yields a better solution near XGbest, higher pulse rate doesn’t yield best solution in local search space. ri ðt þ 1Þ ¼ ri0 ½1 ect
ð6Þ
where γ > 0 The r and A are updated only when the new solution is made better than the previous solution where γ is constant. The original BA has been demonstrated in the following algorithm. In this algorithm, the bat behavior has been analyzed based on the its fitness function. It consists of the following points:
5 Classification of BBB with Optimized BA Features The extracted features from BA algorithm (20 features) are classified using different types of classification techniques such as KNN, SVM, Neural Network classifiers.
Detection of Bundle Branch Block Using Bat Algorithm …
5.1
559
Levenberg-Marquardt Neural Network (LM NN)
In this work for the detection of BBB, back propagation Levenberg-Marquardt Neural Network (LMNN) was used. This NN provides rapid execution of the network to be trained, which is the main advantage in the neural signal processing applications [9]. The NN was designed to work well if it was built with 20 input neurons, 10 neurons in the hidden layer and 3 neurons in the output layer. The performance of this algorithm is compared with Scalar Conjugate Gradient (SCG) NN. The LMNN algorithm is a robust and a very simple method for approximating a function. SCG NN method provides conjugate directions of search instead of performing a linear search. The network is trained with 1800 ECG beats, and tested with 1006 ECG beats. The total number of iterations are set to 1000 and mean square error less than 0.001. The main advantage of this algorithm is that the time required to train the network is less.
6 Results ECG features before optimization = [1 2 3………200]; The optimized ECG features (20 features) after BA algorithm are given below Optimized features (column numbers) using BA = [41, 14, 198, 17, 189, 139, 22, 81, 177, 1, 171, 82, 134, 40, 49, 38, 80, 86, 129, 138]; These reduced feature are given as input for the Neural Network so that its convergence speed and final accuracy can be increased. The ECG beats after segmentation are re-sampled to 200 samples/beat. Instead of using morphological feature extraction techniques, in this paper BA is used as the feature optimization technique using BA ECG beat features are optimized to 20 features. The BA gives optimized features (best features) for the classification. The performance of BA is compared with classical PSO technique. The BA, PSO features are classified using SVM, KNN, SCG NN, LM NN as in the Table 1. – Count of Normal beats used for classification-9193. – Count of RBBB beats user for classification-3778. – Count of LBBB beats user for classification-6068. Table 1 Classification with LM NN classifier
Classifier
Sensi (%)
Speci (%)
Accuracy (%)
PSO + SCG NN BA + SCG NN PSO + LM NN BA + LM NN
86.1
85.3
86.0
97.42 91.2 99.97
92.28 89.2 98.7
97.13 80.9 98.9
560
P. Kora and K. Sri Rama Krishna
– Total number of beats used for classification-19,039. – Count of correctly classified beats-18,800. – Total misclassified beats-239. For measuring accuracy two parameters sensitivity and specificity are calculated using the following equations. Specificity ¼
True Negative 100 True Negative þ False Positive
ð7Þ
Sensitivity ¼
True Positive 100 True Positive þ False Negative
ð8Þ
TP þ TN 100 TP þ TN þ FP þ FN
ð9Þ
Accuracy ¼
– TP(True_Positive) = Count of all the correctly classified Normal beats. – TN(True_Negative) = Count of all beats the correctly classified Abnormal beats. – FP(False_Positive) = Count of Normal beats which are classified as Abnormal. – FN(False_Negative) = Count of Abnormal beats which are classified as Normal. In the training mode we applied multilayer NN and checked the network performance and decided if any changes were required to the training process or the data set or the network architecture. First, check the training record, `trainlm’ Matlab function.
7 Conclusion The results showed that the proposed BA method extracts more relevant features for ECG analysis. These extracted features are fed into a three layer LM NN to classify the beats into normal or LBBB or RBBB. The LM NN clearly distinguishes the Left and Right bundle blocks by taking features from the BA. The BA is compared to PSO algorithm. If this procedure helps us automate a certain section or part of the diagnosis then it will help the doctors and the medical community to focus on other crucial sections. This has also increased the accuracy of diagnosis.
References 1. Yang, X.S.: Bat algorithm for multi-objective optimisation. Int. J. Bio-Inspired Comput. 3(5), 267–274 (2011) 2. Yang, X.S., Gonzalez, J.: A new metaheuristic bat-inspired algorithm. In: Nature Inspired Cooperative Strategies for Optimization (NICSO 2010), pp. 65–74. Springer, Berlin (2010)
Detection of Bundle Branch Block Using Bat Algorithm …
561
3. Baziar, A., Rostami, M.A., Akbari-Zadeh, M.R.: An intelligent approach based on bat algorithm for solving economic dispatch with practical constraints. J. Intell. Fuzzy Syst. 27(3) (2014) 4. Melgani, F., Bazi, Y.: Classification of electrocardiogram signals with support vector machines and particle swarm optimization. IEEE Trans. Inf. Technol. Biomed., 12(5), (2008) 5. Kora, P., Rama Krishna, K.S.: Hybrid bacterial foraging and particle swarm optimization for detecting bundle branch block. Springerplus, 4(9), (2015) 6. Mark, R., Moody, G.: MIT-BIH Arrhythmia Database, May. 1997. Available http://ecg.mit.edu/ dbinfo.html 7. Yang, X.S.: A new metaheuristic bat-inspired algorithm. In: Nature inspired cooperative strategies for optimization (NICSO 2010), pp. 65–74. Springer, Berlin (2010) 8. Yang, X.S., He, X.: Bat algorithm: literature review and applications. Int. J. Bio-Inspired Comput. 5(3), 141–149 (2013) 9. Sapna, S., Tamilarasi, A., Kumar, M.P.: Backpropagation learning algorithm based on Levenberg Marquardt Algorithm. Comput. Sci. Inf. Technol. (CS and IT) 2, 393–398 (2012)