Electrocardiogram (ECG) Signal Modeling and Noise Reduction Using Hopfield Neural Networks

The Electrocardiogram (ECG) signal is one of the diagnosing approaches to detect heart disease. In this study the Hopfield !eural !etwork (H!!) is applied and proposed for ECG signal modeling and noise reduction. The Hopfield !eural !etwork (H!!) is a recurrent neural network that stores the information in a dynamic stable pattern. This algorithm retrieves a pattern stored in memory in response to the presentation of an incomplete or noisy version of that pattern. Computer simulation results show that this method can successfully model the ECG signal and remove high-frequency noise. KeywordsHopfield eural etworks; ECG signal modeling; noise reduction


INTRODUCTION
The electrocardiogram (ECG) signal is one of the diagnosing approaches to detect heart disease.ECG signals provide significance information about heart functional conditions and circulation system.By placing the electrodes on body surface the electrical activity of the heart muscles can be measured [1].A typical ECG cycle waveform is shown in Figure 1.The ECG signal is very weak, ranging from 10 µV to 5 mV, with a frequency from 0.05 Hz to 100 Hz.In addition, the ECG signal is often corrupted with noise.Therefore, a correct diagnosis can be very difficult.The noise is generally generated from the equipment used and also from the body's bioelectric activity [2].Since ECG signal is vital for an accurate diagnosis, ECG modeling and noise reduction is rather essential for clinical applications [3][4][5][6].
Several methods have been applied for modeling and denoising of ECG signals, such as band pass filters [7], adaptive filters [8], the ensemble averaging technique [9] and extended Kalman filters [10].The ADLPSO algorithm [11] and Wavelet Neural Networks (WNN) [12], denoising methods based on the Wavelet transform, have also been used for ECG denoising.Although these methods demonstrated good performance, they can be sensitive to varying parameters.Neural Networks have been recently used in all kind of modeling and their success and wide application encourage the consideration of Neural Networks as a method to model ECG signals with low Signal to Noise Ratio (SNR).
In this study we used the Hopfield Neural Network (HNN) for ECG signal modeling and noise reduction.The HNN is a recurrent neural network that stores the information in a dynamic stable pattern.The applied algorithm retrieves a pattern stored in memory in response to the presentation of an incomplete or noisy version of that pattern.The HNN consists of a set of N interconnected neurons which update their activation values asynchronously and independently of other neurons.All neurons are both input and output neurons [13].Figure 2 portrays a typical HNN that consists of a set of 4 interconnected neurons.All neurons are connected to each other and act as both inputs and outputs.II.THEORETICAL BACKGROUND Modeling using an HNN follows four basic stages [13]:

A. Storage (Learning).
If x 1 , x 2 ,…, x p indicated a known set of M-dimensional memories, the synaptic weights of the network can be computed as: where h ij is the synaptic weight from neuron i to neuron j and x θ,i is ith element of vector x θ .

www.etasr.com Bagheri et al: Electrocardiogram (ECG) Signal Modeling and oise Reduction Using Hopfield…
where t j (0) is the state of neuron j at time n = 0, and u j is the jth element of the vector u.

C. Iteration until Convergence
Update the elements of state vector t(n) randomly in accordance with the rule: Repeat the iteration until the state vector u stays unchanged.

D. Outputting
If u stable indicates the stable point computed at the end of stage C, the resulting output vector y of the network will be: and the mean-squared error is defined as follows: where E is the statistical expectation operator.

III. APPLICATION OF THE HNN
Both training and testing data were taken from [14].The steps described below were followed in order to obtain data suitable for the HNN input: • Data consists of 2 ECG signals with 30000 samples each.
• A low pass filter used to calculate the baseline wander.
With a sampling frequency of f s = 20000 we have: • To remove baseline wander the following equation was used: data ew data baseline = − (10) • Noise was added to data with respect to the definition of SNR.

SignalPower S R oisePower
The original data were noisy to begin with (Figure 3) but in order to test the algorithm, high magnitude noise was needed and so an SNR equal to zero was applied.
• Initialization: output data of step 3 (noisy signal) were given to the network as an initialization vector to compute (4).
• Iteration until Convergence: the algorithm was updated by (5).
• Outputting: the unchanged output of ( 5) is the output of algorithm.
For the considered application M=30000, P=2, number of iterations=100 and number of neurons=30000.Each neuron stands for storing of one sample of the signal.Matlab was used for all calculations.The clean signal is shown in Figure 3 and the noisy signal is shown in Figure 4.

IV. RESULTS
The results of applying the HNN algorithm to the considered data are shown in Figures 5 and 6.It can be seen that the method successfully modeled the ECG signal and removed high-frequency noise.Figure 7 shows the meansquared error versus the number of iterations.As it can be seen, the algorithm converges and the mean-square value of the error signal decreased as the number of iterations increased.The ECG signal is one of the diagnosing approaches to detect heart diseases but it is usually corrupted with unwanted interference.To reduce noise, methods employing filters and wavelet transform have been applied.Although they demonstrated good performance, they tend to be sensitive to varying parameters.Neural Networks have widely been used for modeling, showing significant success and being less sensitive to varying parameters.In this study a Hopfield Neural Network is applied for ECG signal modeling and denoising.The algorithm was applied to two different ECG signals.
Results showed that the method can successfully model ECG signals with low SNR.More tests will be conducted to further investigate the performance of HNN in the future.Other kinds of ECG signals will also be used to examine the clinical application of the method.

Fig. 1 .
Fig. 1.A typical ECG signal If o indicates the target output for the algorithm then the error signal is defined as: