Short communication
Hybrid
fi
re
fl
y and Particle Swarm Optimization algorithm for the
detection of Bundle Branch Block
Padmavathi Kora
a,⁎
, K. Sri Rama Krishna
b aGokaraju Rangaraju Institute of Engineering and Technology, Hyderabad 500090, India
bVR Siddardha Engineering College, Vijayawada 520007, India
a b s t r a c t
a r t i c l e i n f o
Article history:
Received 11 September 2015 Accepted 6 December 2015 Available online 17 December 2015
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 hybrid Firefly and Particle Swarm Optimization (FFPSO) technique in combination with Levenberg Marquardt Neural Network (LMNN) classifier. BBB is devel-oped when there is a block along the electrical impulses travel to make heart to beat. ECG feature extraction is a key process in detecting heart ailments. Our present study comes up with a hybrid method combining the two meta-heuristic optimization methods, Firefly algorithm (FFA) and Particle Swarm Optimization (PSO), for feature optimization of ECG (BBB and normal) patterns. One of the major controlling forces is the light intensity attraction of FFA algorithm that models the optimum solution. The light intensity attraction process of the FFA algorithm depends on random directions for search, this may delay in achieving the global optimization solution. The hybrid technique FFPSO, integrates the concepts from FF algorithm and PSO and creates new individuals. In the FFPSO method the local search is performed through the modified light intensity attraction step with PSO op-erator. The FFPSO features are compared with the classical FF, PSO features. The FFPSO feature values are given as the input to the Levenberg Marquardt Neural Network (LM NN) classifier. It has been observed that the perfor-mance of the classifier is improved with the help of the optimized features.
© 2015 The Society of Cardiovascular Academy. Production and hosting by Elsevier B.V. All rights reserved. This is an open access article under the CC BY-NC-ND license (http://creativecommons.org/licenses/by-nc-nd/4.0/).
Keywords:
Bundle Branch Block FFA
PSO FFPSO LM NN classifier
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 auto-mate 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 theflow 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. The changes in the morphology can be observed through the changes in the ECG. Good performance depends on the accurate detection of ECG features. ECG changes in Left Bundle Branch Block (LBBB) are:
• Increased QRS complex duration (≥0.12 s)
• Increased Q wave amplitude
• Abnormal T wave
ECG changes in Right Bundle Branch Block (RBBB) are:
• Increased QRS complex duration (≥0.12 s)
• RSR' format
• T wave inversion
Detection of BBB using ECG involves three main steps: preprocess-ing, feature extraction and classification. Thefirst step in preprocessing mainly concentrates in removing the noise from the signal usingfilters. The next step in the preprocessing is the‘R’peak detection then these‘R’
peaks are used to segment the ECGfile into beats. The samples that are extracted from each beat contain non-uniform samples. The non-uni-form samples in each beat are converted into uninon-uni-form samples of size 200 by using a technique called resampling. The resampled ECG beat.
In the feature extraction procedure, a fraction of signal around the R peak is extracted as the time-domain features since the R peak of ECG signals is an important index for cardiac diseases. To ensure the impor-tant 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.
P, Q, R, S and T waves provides information regarding amplitudes and relative time intervals of ECG. These changes in the ECG are called morphological transitions. The morphological changes (P, QRS complex, T, U waves) of ECG are due to the abnormalities in the heart. BBB is one
⁎ Corresponding author.
Peer review under responsibility of The Society of Cardiovascular Academy. http://dx.doi.org/10.1016/j.ijcac.2015.12.001
2405-8181/© 2015 The Society of Cardiovascular Academy. Production and hosting by Elsevier B.V. All rights reserved. This is an open access article under the CC BY-NC-ND license (http://creativecommons.org/licenses/by-nc-nd/4.0/).
Contents lists available atScienceDirect
International Journal of the Cardiovascular Academy
j o u r n a l h o m e p a g e :w w w . e l s e v i e r . c o m / l o c a t e / i j c a csuch morphological abnormality seen in the heart diseases. In the previ-ous studies morphological features are extracted for clinical observation of heart diseases. The feature extraction using traditional techniques generally yield a large number of features, and many of these might be insignificant. Therefore, the common practice is to extract key fea-tures useful in the classification.
This paper presents meta-heuristic FFPSO, is used as a feature extrac-tion method instead of using tradiextrac-tional feature extracextrac-tion/optimizaextrac-tion techniques. A large number of meta-heuristic techniques have been de-signed to solve feature optimization problem. Some of the methods among all these are Genetic Algorithm (GA),7Particle Swarm
Optimiza-tion (PSO),6Bacterial Foraging Optimization(BFO),4,5,3Firefly Algorithm (FFA)13etc.
Meta-heuristic algorithms are proven to outperform the gradient based algorithms for real world optimization problems. Firefly algorithm1is one such newly designed algorithm mimicking
flashing mechanism offireflies. A detailed explanation and formulation of the firefly algorithm is given in Section 4.
Traditional Firefly Algorithm (FFA)2has one disadvantage of getting
trapped into the local optimum. Sometimes it is unable to come out of that state. The parameters in thefirefly algorithm arefixed and do not have any mechanism to remember the previous best situation of each firefly and this makes them move regardless of its previous better solution.
In this paper, a novel hybrid optimization method concurrently combines the FFA with the PSO. Now a days the PSO10is a swarm
based optimization algorithm and it takes inspiration from a group of birds or a group offish etc. The proposed hybrid algorithm fulfills local search by using the light intensity operation mechanism of FFA whereas the global search is accomplished by a PSO operator. Using this combi-nation it maintains a balance between‘exploration’and‘exploitation’
and enjoying the best of both the algorithms (FFA and PSO).12The
proposed method, referred to as Firefly Particle Swarm Optimization (FFPSO) has been compared with the normal PSO and FFA. The follow-ing comparative measures were used to study the (i) accuracy of the final solution, and (ii) convergence speed. Such comparison shows the superiority of the proposed algorithm. This algorithm outperformed both PSO and FFA over a few ECG benchmarks sets for the classification problem.
The ECG classificationflow diagram is shown in theFig. 1. Preprocessing
To prove the performance of proposed technique, the usual MIT BIH arrhythmia database9is 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. Total number of ECG beats used for classification are 19,039. De-noising of ECG data is a pre-processing step that removes noise and makes ECGfile useful for subse-quent steps in the algorithm. The Sgolay FIR smoothingfilter is used for removing the noise in ECG signals. The next step in the preprocessing is the R peak detection, then segmentation of ECGfile into beats (P, QRS Complex), by taking R peaks as the reference points.
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 impor-tant 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 contain nonuniform samples. The nonuniform samples in each beat are
converted into uniform samples of size 200 by using a technique called resampling. The resampled ECG beat samples/features.
Feature optimization
Particle Swarm Optimization (PSO)
PSO11is a kind of swarm based optimization method developed by
Eberhart and Kennedy inspired from the behavior of aflock of birds. Each particle in the groupflies in the search domain with a velocity and it tries to attain the best velocity according to its own previous best (pbest) and its companions' best (gbest)flying experience.
The advantage of using PSO over other optimization techniques is its simplicity. And very few parameters need to be adjusted. Due to this, PSO has been widely used in a variety of applications. In an n-dimensional search space,Xi= (x1, x2, x3,…,xn), let the particles
be initialized with positionsXiand velocitiesViand thefitness is
calcu-lated based on particle positional coordinates as the input values. Then the particles are moved into new positions using the equations below: Viðiþ1Þ ¼ω:Við Þ þi C1:ϕ1:ðPbest−Xið ÞiÞ þC2:ϕ2:ðgbest−Xið ÞiÞ ð1Þ
Xiðiþ1Þ ¼Xið Þ þi Viðiþ1Þ ð2Þ
Firefly algorithm (FFA)
This algorithm was designed by a mathematician X.S. Yang in the year 2007. FFA was formulated by mimicking theflashing (mating) activity offireflies. Even though this algorithm is similar to the PSO,6 Artificial Bee Colony (ABC) Optimization14and Ant Colony Optimization
(ACO),15proved to be much simpler in algorithm implementation.
Fireflies are small insects, which are capable of producing light to at-tract a prey (mate). They release small rhythmic lightflashes. The light intensity attraction‘I’offireflies decreases with the distance‘r’. Hence, mostfireflies are visible only up to several hundreds of meters. To exe-cute this algorithm thefitness function is articulated based on thefl uo-rescence light behavior offireflies. For simplicity, it is imagined that light intensity attractiveness offirefly is determined by its brightness
‘I’which is in turn connected with thefitness function. Attractiveness and light intensity
At a particular position‘r’, the brightness‘I’of afirefly can be chosen as I (r), proportional to thefitness, for a maximization problem. So the I (r) varies according to the well known inverse square law.
I rð Þ ¼rIs2 ð3Þ
Fireflies attractiveness β is proportional to the I (r) seen by surroundingfireflies can be defined as
β¼β0e−γr
2
ð4Þ whereγis the light absorption coefficient.
Distance
The distance between any 2fireflies is estimated using the distance formula. ri;j¼ ffiffiffiffiffiffiffi Xd k¼1 v u u t xi;k−xj;k 2 ð5Þ
Firefly‘i’is moved towards brighterfirefly‘j’and its movement is calculated by Movement xi¼xiþβ0e−γ r2 i;j x i−xj þαϵi ð6Þ
Thefirst term in Eq.(6)denotes the current location of afirefly, the second term is used for determining the attractiveness (β) of afirefly (attractivefirefly), towards the attractive neighboringfireflies and the third term indicates the random walk of afirefly (random part). xi¼xiþαðrand−1=2Þ ð7Þ whenfirefly‘i’lacks the brighterfirefly‘j’then it will go for a random walk as in Eq.(7), in search of the best candidate, where the coefficient
αis a randomization variable, and‘rand’is a random number consis-tently spread over the space (0, 1).
The pseudo code forfirefly algorithm is given below Pseudo code:firefly algorithm
1. Generate the initial population randomly.
2. Calculate thefitness of initial population based on light intensity of fireflies.
3. While (tbtermination criteria is satisfied) 4. For i = 1:p (pfireflies)
5. For j = 1:p
6. Calculate light intensity (I) using Eq.(3).
7. Distance between twofireflies is calculated using Eq.(5). 8. If (I(i)bI (j))
9. Firefly i is moved towardsfirefly j using Eq.(6). 10. Determine new solutions.
11. Else
12. Firefly i is moved randomly towards j using Eq.(7). 13. End If
14. End for j. 15. End for i. 16. End while
17. Sort thefireflies according to light intensity values of the new solution.
Proposed approach: hybrid FF and PSO (FFPSO) algorithm
In this section, a part of PSO is used in the FFA to increase conver-gence and also to enhance its capability for not falling into the local minimum. The FFPSO has exactly the same steps as the FFA with the exception that the position vector of FFA is modified as follows: In the FFPSO, the distance between xi andpbesti, is the Cartesian distance
rpx¼ ffiffiffiffiffiffiffi Xd k¼1 v u u t pbesti;j−xi;j 2 ð8Þ The distance between xi andgbesti, is the Cartesian distance
rgx¼ ffiffiffiffiffiffiffi Xd k¼1 v u u t gbesti;j−xi;j2 ð9Þ The position vectors xi of the FFPSO is randomly mutated by using Eq.(8) xiðtþ1Þ ¼wxið Þ þt c1e−r 2 px pbest i−xið Þt ð Þ þc2e−r 2 gx gbest i−xið Þt ð Þ þα γð −1=2Þ ð10Þ
Pseudo code: FFPSO
1. Generate the initial population randomly. 2. Initialize pbest and gbest.
3. Calculate thefitness of initial population based on light intensity of fireflies.
4. While (stopping criteria is satisfied) 5. For i = 1:p (pfireflies)
6. For j = 1:p
7. Light intensity I is determined using Eq.(3).
8. Distance between pbest-xi and gbest-xi is calculated using Eqs.(8) and (9).
9. If (I(i)bI(j))
10. Firefly i is moved towardsfirefly j using Eq.(10) 11. Else
12. Firefly i is moved randomly towardsfirefly j using Eq.(7). 13. End If
14. Calculate the new solutions and update the light intensity value 15. Update pbest and gbest.
16. End for j 17. End for i 18. End while
19. Sort thefireflies in descending order based on their light intensity In the suggested approach, the light intensity attraction step of each particle gets mutated by a PSO operator. At this step, each particle is ran-domly attracted towards the gbest position in the entire population. Local search in different regions is carried by the modified attractiveness step of the FFPSO algorithm. The main objective of FFPSO feature selec-tion stage is to reduce the features of the problem before the supervised neural network classification. Among all the wrapper algorithms used, FFPSO, which solves optimization problems using the methods offl ash-ing behavior offireflies, has emerged as a promising one.
Classification of ECG withfirefly features
The extracted features from FFPSO algorithm (20 features) are clas-sified using different types of classification techniques such as K-Nearest Neighbor (KNN), Support Vector Machine (SVM), LM Neural Network classifiers.
Levenberg-Marquardt Neural Network (LM NN)
In this work for the detection of BBB, back propagation Levenberg-Marquardt Neural Network (LMNN)19was used. This NN provides
rapid execution of the network to be trained, which is the main advan-tage in the neural signal processing applications,8citeKP. 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 was compared with Scalar Conjugate Gradient (SCG) NN. The LMNN algorithm is a robust and a very simple method for ap-proximating a function. SCG NN method provides conjugate directions of search instead of performing a linear search. The network is trained with 11,039 ECG beats, and tested with 8000 ECG beats. The total num-ber of iterations is 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.
Results
ECG features before optimization = [1 2 3 ...200];
The optimized features are = [41, 14, 198, 17, 189, 139, 22, 81, 177, 1, 171, 82, 134, 40, 49, 38, 80, 86, 129, 138];
These reduced features are given as input for the Neural Network so that its convergence speed andfinal 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 FFPSO
is used as the feature extraction technique. Using FFPSO ECG beat fea-tures are optimized to 20 feafea-tures. The FFPSO gives optimized feafea-tures (best features) for the classification. The performance of FFPSO is com-pared with classical FFA and PSO techniques. The FFA, PSO and FFPSO features are classified using SVM, KNN, SCG NN and LM NN as inTable 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.
• 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 NegativeTrue NegativeþFalse PositiveX100 ð11Þ
Sensitivity¼True PositiveTrue PositiveþFalse NegativeX100 ð12Þ
Accuracy¼TPþTNTPþþTNFPþFNX100 ð13Þ
• TP (True_Positive) = count of all the correctly classified normal beats.
• TN (True_Negative) = count of all beats the correctly classified abnor-mal beats.
• FP (False_Positive) = count of normal beats which are classified as ab-normal.
• 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. Discussion
The proposed FFPSO is compared against other three BBB detection algorithms such as Wavelet Transform (WT), Continuous wavelet Transform (CWT), Wavelet transform and Probabilistic Neural Network (PNN) in terms of related features selected from the original database and classification accuracy obtained from different classifiers using Matlab software.
The work in,18explores an experimental study of using WT for extracting relevant features and KNN based classifier for the detection of BBB. The work presented in,17uses morphological features for
classi-fication using SVM. The work proposed in,16uses Arrhythmia dataset
Table 1
Classification with LM NN classifier.
Classifier Sensi Speci Accuracy
FFA + SVM 76.2% 75.47% 72.13% PSO + SVM 71.0% 73.13% 70.12% FFPSO + SVM 95.5% 96.9% 96.74% FFA + SCG NN 88.2% 87.2% 87.9% PSO + SCG NN 86.1% 85.3% 86.0% FFPSO + SCG NN 97.42% 92.28% 97.13% FFA + KNN 53.5% 52.2% 53.22% PSO + KNN 52.5% 53.2% 65.1% FFPSO + KNN 92.35% 93.9% 92.17% FFA + LM NN 93.34.2% 92.2% 93.9% PSO + LM NN 91.2% 89.2% 80.9% FFPSO + LM NN 99.97% 98.7% 99.1%
taken from MIT/BIH repository and 20 morphological and wavelet features are extracted then PNN is used for supervised learning and clas-sification. From the experiments, it is concluded that the proposed FFPSO with LMNN classifier outperformed other three algorithms with selection of minimal number of relevant features. This increases the classification accuracy as shown inTable 2. The FFPSO employed to intelligently select the most relevant features that could increase the classification accuracy while ignoring noisy and redundant features. Conclusion
It is evident from the results that hybrid FFPSO approach out per-forms the other two optimization methods in terms of accuracy and convergence rates. In the present study, we developed a simple compu-tational model for the detection of ECG BBB using the FFPSO algorithm. The FFPSO algorithm was compared with the FFA and PSO . In our study the following were observed: 1) accuracy 2) convergence speed. The FFPSO method was shown to provide better results than original FFA and PSO for all the tested data.
References
1.Mishra Anurag, et al. Optimized gray-scale image watermarking using DWT—SVD andfirefly algorithm.Expert Syst Appl2014;41(17):7858–7867.
2. Sahu Rabindra Kumar, Panda Sidhartha, Padhan Saroj, et al. A hybridfirefly algorithm and pattern search technique for automatic generation control of multi area power systems.Int J Electr Power Energy Syst2015;64:9–23.
3.Nasir Ahmad NK, Tokhi MO, Ghani N, et al. Novel adaptive bacteria foraging algo-rithms for global optimization. Applied Computational Intelligence and Soft Comput-ing; 2014.
4.Passino Kevin M. Biomimicry of bacterial foraging for distributed optimization and control.Control Syst2002;22(3):52–67.
5. Liu Y, Passino KM, et al. Biomimicry of social foraging bacteria for distributed optimi-zation models, principles, and emergent behaviors.J Optim Theory Appl2002;115(3): 603–628.
6. Kennedy J, Eberhart R, et al. Particle swarm optimization. Proc. IEEE Int. Conf. Neural Netw; 1995. p. 1942–1948.
7. Back T. Evolutionary algorithms in theory and practice: evolution strategies, evol. programming. Proc. Genetic Algorithms. London, U.K.: Oxford Univ. Press; 1996 8. Sapna S, Tamilarasi A, Kumar MP, et al. Backpropagation learning algorithm based on
levenberg marquardt algorithm. CS and IT-CSCP; 2012;393–398.
9. Goldberger AL, Amaral LA, Glass L, Hausdorff JM, Ivanov PC, Mark RG, Stanley HE, et al. Physiobank, physiotoolkit, and physionet components of a new research re-source for complex physiologic signals.Circulation2000;101(23):e215–e220. 10. Eberhart RC, Kennedy J, et al. A new optimizer using particle swarm theory. Proc.
ISMMH S; 1995. p. 39–43.
11.Melgani F, Bazi Y, et al. Classification of electrocardiogram signals with support vector machines and particle swarm optimization.IEEE Trans Inf Technol Biomed2008;12(5). 12.Abd-Elazim SM, Ali ES, et al. A hybrid particle swarm optimization and bacterial for-aging for optimal power system stabilizers design.Int J Electr Power Energy Syst
2013;46:334–341.
13.Horng Ming-Huwi, et al. Firefly meta-heuristic algorithm for training the radial basis function network for data classification and disease diagnosis. INTECH Open Access Publisher; 2012.
14. Pal SK, Rai CS, Singh AP, et al. Comparative study offirefly algorithm and particle swarm optimization for noisy non-linear optimization problems.Int J Intell Syst Appl2002;4(10):50.
15. Dorigo Marco, Stutzle Thomas. The ant colony optimization metaheuristic: algo-rithms, applications, and advances. Handbook of metaheuristics. US: Springer; 2003;250–285.
16.Yu Wei, et al. Application of multi-objective genetic algorithm to optimize energy
ef-ficiency and thermal comfort in building design.Energy Build2015;88:135–143. 17.Ceylan Rahime, ozbay Yksel, et al. Wavelet neural network for classification of bundle
branch blocks.Proc World Congr Eng2011;4(2).
18.Kutlu Yakup, Kuntalp Damla, Kuntalp Mehmet, et al. Arrhythmia classification using higher order statistics. Signal Processing, Communication and Applications Confer-ence; 2008.
19.Kora Padmavathi, Sri Rama Krishna K. Improved Bat algorithm for the detection of myocardial infarction.SpringerPlus2015;4(1):666.
Table 2
Comparative study for detection of BBB.
Studies Approach Accuracy
R Ceylan et al. (2011)17
Wavelet Transform (WT) 98.1% Kutlu et al. (2008)18
Continuous Wavelet Transform (CWT) 97.3% Yu et al. (2007)16
WT and Probabilistic Neural Network 98.39% Proposed approach FFPSO and Neural Network 99.1%