Telecommun Syst (2011) 46: 209–215 DOI 10.1007/s11235-010-9286-2
Genetic algorithm and wavelet hybrid scheme for ECG signal denoising El-Sayed A. El-Dahshan
Published online: 18 February 2010 © Springer Science+Business Media, LLC 2010
Abstract This paper introduces an effective hybrid scheme for the denoising of electrocardiogram (ECG) signals corrupted by non-stationary noises using genetic algorithm (GA) and wavelet transform (WT). We first applied a wavelet denoising in noise reduction of multi-channel high resolution ECG signals. In particular, the influence of the selection of wavelet function and the choice of decomposition level on efficiency of denoising process was considered. Selection of a suitable wavelet denoising parameters is critical for the success of ECG signal filtration in wavelet domain. Therefore, in our noise elimination method the genetic algorithm has been used to select the optimal wavelet denoising parameters which lead to maximize the filtration performance. The efficiency performance of our scheme is evaluated using percentage root mean square difference (PRD) and signal to noise ratio (SNR). The experimental results show that the introduced hybrid scheme using GA has obtain better performance than the other reported wavelet thresholding algorithms as well as the quality of the denoising ECG signal is more suitable for the clinical diagnosis. Keywords Wavelet denoising · Thresholding · ECG · Genetic algorithm · Hybrid intelligent technique
1 Introduction ECG signal is considered as a non-stationary signal. One of the most efficient techniques for signal noise elimination for such a non-stationary signal processing is the wavelet E.-S.A. El-Dahshan () Faculty of Science, Ain Shams University, Abbassia, Cairo 11566, Egypt e-mail:
[email protected] transform [1–4], especially for signals with low signal-tonoise ratio (SNR). Thresholding is used in wavelet domain to smooth out or to remove some coefficients of wavelet transform subsignals of the measured signal. The denoising method that applies thresholding in wavelet domain has been proposed by Donoho [5, 6]. The Donoho’s method for noise reduction works well for a wide class of one dimensional and two-dimensional signal. Recently, researches from biomedical signal processing community have applied wavelet transform in ECG signal filtration [1, 4, 7]. Methods based on shrinkage of wavelet coefficients are very popular for estimation of biological signals. Most ECG signal wavelet denoising algorithms are based on Donoho’s Universal theory [1, 4, 7–9]. Sayadi et al. [1] proposed a technique to remove noise from the ECG using adaptive wavelet transform, named bionic wavelet transform. Novak et al. [10] reported a noise reduction technique based on adaptive wavelet method using a detection algorithm for different noise level as pre-processing. Singh et al. [11] proposed a selection procedure of mother wavelet basis functions applied for noise suppression of the ECG signal in wavelet domain. Efficient selection of wavelet denoising parameters, such as wavelet function, decomposition levels, threshold function (method), and threshold selection rules is critical to the success of signal denoising. Usually, these parameters are selected empirically; which leads to low noise elimination performance. So the contribution of this paper is to introduce an evolutionary optimization method based on the Genetic Algorithm (GA) to search the wavelet denoising parameters in order to obtain the optimal ECG signal filtration efficiency. A brief review of wavelet transform (WT) and wavelet denoising using Donoho’s method are provided in Sect. 2. Section 3 introduces the GA approach. The proposed hybrid
210
E.-S.A. El-Dahshan
Fig. 1 The wavelet denoising procedure
denoising technique is described in Sect. 4. In Sect. 5, the experimental results of the proposed work are discussed. Finally conclusion is given in Sect. 6.
2 ECG wavelet-based denoising Recently, the wavelet theory denoising [4] have been widely exploited in noisy ECG filtering. Several wavelet denoising ECG signal algorithms were developed, exploring each a particular parameter; the wavelet function, threshold calculus, and level decomposition [12, 13]. In this context, we develop in this present work a denoising wavelet algorithm based on the corrupted white Gaussian noise (WGN) estimation. 2.1 Wavelet denoising principle The WT is a time-scale representation technique, which describes a signal by using the correlation with translation and dilation of a function called mother wavelet [10]. WT (in its continuous or discrete version) represents a signal as a sum of wavelets with different locations and scales [14]. In this paper, Donoho’s method is applied to the discrete wavelet transform (DWT). The definition of a discrete wavelet transform is given by [11]. x(n)gj,k (n) (1) C(a, b) = n∈Z
where x(n) is the input signal, C(a, b) are dyadic wavelet coefficients, a = 2−j , b = k2−j , j ∈ N, k ∈ Z, a is dilation (scale), b is translation and gj,k (n) = 2j/2 g(2j n − k) is discrete wavelet. When the signal is decomposed to a certain level using DWT, a set of wavelet coefficients is correlated to the high frequency subbands while the other wavelet coefficients are correlated to low frequency subbands [15]. Our proposed technique is designed using Matlab Wavelet Toolbox. The toolbox provides built in routines for using the
DWT to decompose the signal into wavelet coefficients and then to reconstruct the signal using inverse discrete wavelet transform (IDWT). The basic idea of wavelet-based denoising procedure is illustrated in Fig. 1. The application of wavelet noise suppression requires the selection of different parameters: a wavelet basis function, the thresholding type, thresholding selection rule, decomposition level, and a noise scaling option. The first step in producing a wavelet denoising is to choose a wavelet basis function to be used in signal decomposition. Different types of wavelet (orthogonal and biorthogonal) are available in Matlab toolbox. Each type has different subtypes. The selection of a suitable level depends on the signal and the experience. Often the chosen level is based on a desired low-pass cutoff frequency. The high frequency subbands contain the details in the data set. If these details are small enough, they might be omitted without substantially affecting the main features of the data set. Therefore, by setting the wavelet coefficients that corresponding to these small details to zero, the noise vanishes. This becomes the basic concept behind thresholding: applying the IDWT on the results may lead to reconstruction with essential signal characteristics and less noise [7, 8]. Two types of thresholding functions are often used: Hard thresholding and Soft thresholding [5, 6]. The thresholding is based on a value namely called δ which used to compare with all the detailed coefficients. Generally, the threshold value δ to be applied in the wavelet domain is the product of the standard deviation of the noise amplitude σ and the factor δ0 that depends on the length N of the data sample, where δ = σ δ0 . There are mainly four threshold selection rules that are summarized in Table 1. The choice of thresholding functions and threshold values plays an important role in the global performance of a wavelet processor for noise reduction. Threshold selection rules are based on the underlying model. Given a measured signal s(n) with a Gaussian white noise N (0, 1), then: s(n) = x(n) + σ e(n)
(2)
Genetic algorithm and wavelet hybrid scheme for ECG signal denoising Table 1 Four threshold selection rules
211
Thresholding rule
Description
Rule 1: Rigrsure
Threshold is selected using the principle of Stein’s Unbiased Risk Estimate (SURE)
Rule 2: Sqtwolog
Fixed form threshold yielding minimax performance multiplied by a small factor proportional to log(length(s)). It is usually equal to sqrt(2 ∗ log(length(s)))
Rule 3: Heursure
Threshold is selected using a mixture of first two methods
Rule 4: Minimaxi
Selected using the minimax principle. It uses a fixed threshold chosen to yield minimax performance for mean square error against an ideal procedure
where x(n) is the original signal and e is the noise, σ is the strength of the noise, and time n is equally spaced. There are three threshold rescaling methods available in Matlab toolbox: ‘one’ for no rescaling, ‘sln’ for rescaling using a single estimation of level noise based on first level coefficients and ‘mln’ for rescaling using level dependent estimation of level noise. 2.2 Wavelet denoising parameters The wavelet noise reduction performance of the ECG signal is conditioned by five processing parameters named “wavelet denoising parameters”, including: (1) the type of wavelet basis function , (2) the decomposition level L, (3) thresholding function β, (4) threshold selection rules λ, and (5) threshold rescaling methods ρ. Selection of a suitable wavelet denoising parameters is critical for the success of ECG signal filtration in wavelet domain, because there is currently no known method to calculate which combination of the above wavelet denoising parameters that give the best denoise signal. Therefore, in our noise elimination method the genetic algorithm has been used to select the optimal wavelet denoising parameters which lead to maximize the filtration performance.
3 Genetic algorithm approach GA is a global search method which utilizes the principle of natural selection and genetics. The method starts from a randomly generated population (potential solutions) whose performance is evaluated by a fitness function [16]. GA uses three fundamental operators termed; (1) selection (Reproduction.), (2) crossover and (3) mutation to evolve global optimized network parameters [16, 17]. GA works with a set of candidate solutions called a population. Based on the principle of ‘survival for the fittest’, the GA obtains the optimal solution after a series of iterative computations on its operators: the reproduction, the crossover, and the mutation. The size of the population and the probability rates for crossover and mutation are called the control parameters of the genetic algorithm. GA generates successive populations of alternate solutions that are represented by a chromosome, i.e.
a solution to the problem, until acceptable results are obtained based on the fitness function. The fundamentals of traditional Gas are well covered in [18–20]. The fitness function has to provide some measures of the GA’s performance in a particular environment, and assesses the quality of a solution in the evaluation step. The objectives of denoising are to suppress effectively the noise and restore the original ECG signal. A common goal of optimization in ECG noise suppression is to minimize the mean square error (MSE) between the original ECG signal and the denoisy version of this ECG signal, so the MSE has been chosen as the fitness function. Given an original signal x(n), consisting of N samples, and a reconstructed approximation to this signal, x(n), ˆ the MSE is given by [4]: N 1 2 [x(n) − x(n)] ˆ MSE = N
(3)
n=1
4 The proposed hybrid denoising technique Consider ECG signal is corrupted by standard white Gaussian noise. The GA was used to search for the optimum wavelet denoising parameters for ECG signal noise elimination problems. As shown in Fig. 2, the proposed GA-wavelet hybrid denoising scheme can be summarized as follows: 1. Input: • Noisy ECG signal, Wavelet denoising parameters (, L, β, λ, ρ) 2. Processing: a. Set the proper wavelet thresholding denoising parameter ranges for ECG signal, and construct the objective functions, including the mean square error (MSE), b. Optimize the wavelet denoising parameters using GA. When a satisfied termination criteria is reached (according to the noise suppression performance) select the optimal denoising parameters, c. Perform a 1-D discrete wavelet transform for the noisy ECG signal to get all the wavelet coefficients, d. Threshold the noisy coefficients in ECG signal with the optimal thresholds, and get the modified new ECG components. 3. Output: Reconstruct the denoising ECG signal.
212
E.-S.A. El-Dahshan
Fig. 2 GA-wavelet hybrid denoising technique Table 2 The ranges of the wavelet denoising parameters to be optimized
Wavelet denoising parameters
Range
The type of wavelet basis function φ
Meye (meyr), Mexican_hat (mexh), Morlet (morl), Gaussian (gaus1-gaus8), Symlet (sym1-sym45), Coiflet (coif1-coif5), Daubechies (db1-db45), and Biorthogonal (bior1.1-bior1.5 & bior2.2-bior2.8 & bior3.1-bior3.9).
Thresholding function β
Soft (s), Hard (h).
Decomposition level L
1–10
Thresholding selection rule λ
Heursure, Rigsure, Sqtwolog, and Minimax.
Rescaling approach ρ
No scaling (one), Single level (sln), Multiple level (mln).
5 Results and discussion To evaluate the filtration efficiency of the proposed technique, several real world datasets were downloaded from the MIT-BIH database [21]. Each of the ECG records has the following specifications: signal length is 650,000 samples, sampling rate is 360 Hz, resolution is 11 bits over a 10 mV range, and bit rate is 3960 bps. These data sets have been frequently used as benchmarks to compare the performance of different noise reduction methods in the literature.
The ECG datasets were contaminated with additive white Gaussian noise of different values of standard deviation (σ ). The noise is randomly generated and added to the original ECG signal. In practical application the parameters listed above (Sect. 2.2) are usually selected empirically. To guide the selection of these parameters, besides experience, GA is proposed in this work to optimize the entire set of denoising parameters. Table 2 lists the ranges of the parameters to be optimized.
Genetic algorithm and wavelet hybrid scheme for ECG signal denoising Table 3 The optimal wavelet denoising parameters obtained by the GA for the tested signal
Wavelet denoising parameters
Value when
when
when
SNRin < 10 dB
10 dB < SNRin < 20 dB
SNRin < 20 dB
Wavelet function φ
Sym6, sym7
Coifl5
Db7
Decomposition level L
7, 8
5, 6
3, 4
Thresholding function β
soft
soft
soft
Threshold selection rule λ
rigsure
rigsure
rigsure, heursure
Rescaling approach ρ
sln
sln
sln
In this work, the optimization of the wavelet denoising parameters has been carried out using the FlexGA toolbox for Matlab version 1.0 [22]. The GA parameters which have been used are: a steady-state GA with a single population of 700 individuals evolved for 50 generations using a crossover rate of 90% and a mutation rate of 1%. The stop criteria were the convergence tolerance on fitness. The optimal wavelet denoising parameters obtained by the GA are given in Table 3. Although there was no evidence that a single wavelet was the best suited for denoising ECG, there were some wavelets which were slightly better than others for this purpose. The orthogonal (Daubechies, Coiflets, and Symlets) wavelet transform has certain benefits. It is very concise and allows perfect and simple reconstruction of the original signal [4, 5]. The Symlet family (sym6 and sym7) is more symmetrical than the Daubechies. The Coiflet family (coif5) is more symmetrical than the Daubechies wavelets. For this reason the symlet is more suitable for the ECG contaminated with high noise level and the Daubechies (db7 and db8) wavelet is more suitable for low noise level. Since the level decomposition is related to the noise level, so for high noise level the suitable noise level is 7–8 while for low noise level the suitable level is 3–4. In spite of hard thresholding is the simplest method, soft thresholding can produce better results than hard thresholding. This is because hard thresholding may cause discontinuities in the signals. The option ‘sln’ corresponds to the basic noise model with unscaled noise and performing threshold rescaling using only a single estimation of the level noise. The ‘sln’ method performed the best of three available threshold rescaling methods. It was believed that the ‘rigrsure’ method would be more effective. Both the percent root mean-square difference (PRD) and the signal-to-noise ratio SNR are used as measures of noise reduction performance. The PRD and SNR (in dB) are calculated from (4) and (5) respectively; where: N N 2 2 [x(n) − x(n)] ˆ / [x(n)] , PRD = 100 n=1
213
n=1
(4)
Table 4 The performance of denoising the ECG signals for different input SNR Input SNR (dB) Output SNR (dB) Improvement SNR(dB) PRD % 0
13.5
13.5
21.2
5
15.6
10.6
16.6
10
18.3
8.2
12.2
15
22.1
7.1
7.8
20
26.6
6.4
4.8
25
31.3
5.3
2.7
30
34.2
4.2
1.9
35
37.5
2.5
1.3
40
41.5
1.5
1.0
SNR = 10 log10
N N 2 2 [x(n)] / [x(n) − x(n)] ˆ n=1
(5)
n=1
For the wavelet denoising parameters obtained by the GA based on the fitness function, the experiment is conducted on 50 numbers of ECG signals (MIT-BIH database). The average values of PRD and SNR are calculated for the signal before and after the filtration. Table 4 shows the denoising results of ECG signal obtained using the GA-wavelet hybrid denoising technique for Input SNR: 0–40 dB. The original, the noisy, and the denoised signals obtained using the proposed techniques (for one sample as an example) are shown in Fig. 3. PRD of 7.8 and output SNR of 22.1 are obtained for denoising using the proposed technique. For a noisy signal of input SNR = 15 dB. The higher the SNR, the less noise is. Figure 4(a) shows the relation between the signalto-noise ratio before (input SNR, from 0 dB to 40 dB as mentioned in Table 4) and after filtration (output SNR). The relation between the out SNR and the input is merely linear. The PRD between the original signal and the denoised signal are shown in Fig. 4(b). PRD plot confirms that the hybrid denoising technique smoothes too much when the noise level is low. Less PRD indicates efficient denoising of the original signal. For noise suppression performance evaluation, the SNR improvement achieved by our hybrid denoising technique is
214
E.-S.A. El-Dahshan
Fig. 3 (a) Original signal (one sample as an example). (b) The corrupted ECG with noise at input SNR 15 dB. (c) The denoised ECG signal resulting from the proposed technique (φ = sym7, β = soft, λ = rigrsure, L = 6, and ρ = sln) with output SNR = 22.1 dB
Fig. 4 (a) The dependence of the output SNR of the input SNR (b) The PRD with the input SNR (c) The SNR improvement with SNR
defined as the value of the system output SNR (in dB) minus the input SNR (in dB). Figure 4(c) shows the relation between the SNR improvement and the input SNR. It can be seen that less SNR improvement is achieved for high SNR. Therefore, when SNR increases, the ECG signal becomes less noisy, and there is less noise to be reduced. If SNR approaches infinity, the posteriori (output) SNR would be the same as the priori (input) SNR. In all conditions, the output SNR is greater than the corresponding input SNR. The SNR improvements obtained from our hybrid denoising technique are compared to other reported noise elimination techniques (for the same datasets); wavelet based techniques [1, 7, 8], nonlinear Bayesian Filter [23], low-pass filter and adaptive filtering approach [10]. These techniques are applied to the same database. The results of SNR improvements for ECG signals are extremely sensitive to the noise level. Figure 5 shows the SNR improvement for the previous techniques (which are applied to our dataset) compared with the SNR improvement obtained by the proposed hybrid denoising technique. So it can be seen from the results that the hybridization of GA and wavelet trans-
Fig. 5 The improvement SNR for several common denoising techniques applied to our dataset compared with the SNR improvement obtained by the proposed hybrid denoising technique: (A) Wavelet based denoising [7, 8]. (B) Low-pass filter [10]. (C) Adaptive wavelets denoising [10]. (D) Wavelet based denoising [1]. (E) Bionic wavelet denoising [1]. (F) Nonlinear Bayesian Filter [23]. (G) Our proposed hybrid denoising technique
form optimizes the wavelet denoising parameters of ECG signals.
Genetic algorithm and wavelet hybrid scheme for ECG signal denoising
6 Conclusions A hybrid denoising technique for ECG signals is proposed based on genetic algorithm and wavelet transform. The technique is used as pre-processing technique for the analysis and classification of the ECG signal. Selection of wavelet denoising parameters is critical to the success of noise elimination process for the ECG signal. For efficient selection of wavelet denoising parameters, besides experience, GA is proposed to optimize the entire range set of wavelet denoising parameters leading to an efficient ECG signal filtration. It could be concluded that, the noise reduction of a signal depends on the optimum value of the level of decomposition, the suitable forms of wavelet family and the thresholding techniques. Taken into consideration that GA is a powerful tool for parameters selection and optimization, therefore the hybridization between the GA and wavelet transform makes the hybrid denoising technique more powerful than the available systems.
References 1. Sayadi, O., & Shamsollahi, M. B. (2006). ECG denoising with adaptive bionic wavelet transform. In Proc. IEEE EMBS (pp. 6597–6600). 2. Manikandan, M. S., & Dandapat, S. (2007). Wavelet energy based diagnostic distortion measure for ECG. Biomedical Signal Processing and Control, 2, 80–96. 3. Scott, H. H., & John, V. A. (2008). Automated wavelet denoising of photoacustic signals for circulating melanoma cell detection and burn image. Physics in Medicine and Biology, 53, 227–236. 4. Prasad, V. V. K. D. V., Siddaiah, P., & Rao, B. P. (2008). A new wavelet based method for denoising of biological signals. IJCSNS International Journal of Computer Science and Network Security, 8, 238–244. 5. Donoho, D. L. (1995). De-noising by soft thresholding. IEEE Transactions on Information Theory, 41, 613–627. 6. Donoho, D. L., & Johnstone, I. M. (1994). Ideal spatial adaptation via wavelet shrinkage. Biometrica, 81, 425–455. 7. Poornachandra, S. (2008). Wavelet-based denoising using subband dependent threshold for ECG signals. Digital Signal Processing, 18, 49–55. 8. Poornachandra, S., & Kumaravel, N. (2005). Hyper-trim shrinkage for denoising of ECG signal. Digital Signal Processing, 15, 317–327. 9. Alfaouri, M., & Daqrouq, K. (2008). ECG signal denoising by wavelet transform thresholding. American Journal of Applied Sciences, 5, 276–281. 10. Novak, D., Frau, D. C., Eck, V., Pérez-Cortés, J. C., & AndreuGarcía, G. (2000). Denoising electrocardiogram signal using adaptive wavelets. In BIOSIGNAL 2000, Brno, Czech (pp. 18– 20).
215 11. Singh, B. N., & Tiwari, A. K. (2006). Optimal selection of wavelet basis function applied to ECG signal denoising. Digital Signal Processing, 16, 275–287. 12. Erçelebi, E. (2004). Electrocardiogram signals de-noising using lifting-based discrete wavelet transform. Computers in Biology and Medicine, 34, 479–493. 13. Kania, M., Fereniec, M., & Maniewski, R. (2007). Wavelet denoising for multi-lead high resolution ECG signals. Measurement Science Review, 7, 30–33. 14. Zhang, Y., Wang, L., Gao, Y., Chen, J., & Shi, X. (2007). Noise reduction in Doppler ultrasound signals using an adaptive decomposition algorithm. Medical Engineering & Physics, 29, 699–707. 15. Magosso, E., Ursino, M., Zaniboni, A., & Gardella, E. (2009). A wavelet-based energetic approach for the analysis of biomedical signals: application to the electroencephalogram and electrooculogram. Applied Mathematics and Computation, 207, 42–62. 16. Ferreira da Silva, A. R. (2005). Wavelet denoising with evolutionary algorithms. Digital Signal Processing, 15, 382–399. 17. Huang, C. L., & Wang, C. J. (2006). A GA-based feature selection and parameters optimization for support vector machines. Expert Systems with Applications, 31, 231–240. 18. Goldberg, D. E., & Holland, J. H. (1988). Genetic algorithms and machine learning. Machine Learning, 3, 95–99. 19. Sharkand, L.-K., & Chunyang, Y. (2003). Design of optimal shiftinvariant orthonormal wavelet filterter banks via genetic algorithm. Signal Processing, 83, 2579–2591. 20. Ferreira da Silva, A. R. (2001). Evolutionary-based methods for adaptive signal representation. Signal Processing, 81, 927–944. 21. MIT-BIH database (2010). http://www.physionet.org/physiobank/ database/mitdb. 22. Flexible Intelligence Group (1998). User’s Guide, FlexCI Version 1.0, LLC. http://www.cynapsys.com. 23. Sameni, R., Shamsollahi, M. B., Jutten, C., & Clifford, G. D. (2007). A nonlinear Bayesian filtering framework for ECG denoising. IEEE Transactions on Biomedical Engineering, 54, 2172– 2185. El-Sayed A. El-Dahshan received his B.Sc. in Physics and Computer Science from Ain Shams University Cairo, Egypt in 1986. He received a post graduate diploma in electronics from Ain Shams University, Cairo Egypt 1988. In 1990 he received his M.Sc. in the microwaves area from Ain Shams University Cairo, Egypt. He received his Ph.D. degree in thin films technology 1998 (cooperation system-Scientific Channel) between Claustahl-Zeller Field Teschneche Universtate—Germany and Ain Shams University—Egypt). He is currently an assistant professor of industry electronics at Faculty of Science-Ain Shams University. His research interests include wavelet theory and its applications in the fields of signal and image processing, as well as optimization techniques based on machine learning and soft computing