Noise-tolerant Modular Neural Network System for Classifying ECG Signal

,


Introduction
The electrocardiogram (ECG) is a non-invasive clinical test that measures and records electrical changes that take place in the heart when it beats [1].ECG is vastly used for screening, diagnosis, and monitoring of several heart conditions.Most ECGs are recorded and interpreted by health professionals, few of which have received formal training and proper assessment of competency in recording and interpreting ECGs [2,3], and many selfreported their ECG reading skills as inadequate [4].Therefore, several automated approaches have been developed to increase efficiency and enhance accuracy in interpreting ECG waveforms [5].This is the case of classification systems based on artificial neural networks (NN), which have become very popular and most widely employed for successful classification of ECG signals [5] because of their natural ability to deal with incomplete or ambiguous input in pattern recognition tasks [6].
An ECG signal consists mainly of five continuous electromagnetic waves namely, P, Q, R, S, and T (Fig. 1).The amplitude, direction, and duration of the waves, and their morphological aspects are analyzed for specific abnormalities.Other important information includes the peak area, called the QRS complex, the duration of the PR and QT intervals, and the deviation of the PR and ST segments.These characteristics can be contaminated by the physical parameters of electronic and mechanical devices, electrical activity of muscles, degradation of the electrode-skin contact, and other causes [7][8][9].Noise corruption can generate similar morphologies to the ECG waveform, reducing the discriminating power of heartbeat patterns, and increasing the rate of false alarms for cardiac monitors [9].Therefore, a large number of NN approaches for ECG classification have included signal preprocessing for noise reduction, using a wavelet transformer (WT) [6,[11][12][13], nonlinear cubic spline interpolation (CSI) [14], fast Fourier transformation (FFT) [15] or band-pass filters [16][17][18][19].
Nevertheless, current strategies for this critical step, the preprocessing for noise removal, are still unsatisfactory because clinical interpretation often requires even higher signal quality to detect cardiac disorders [20,21].For that reason, NN systems for ECG classification that are robust and efficient, and have greater noise tolerance, are needed.In this paper, we develop and test a noise-tolerant ECG signal classifier based on an NN approach.The method uses a modular NN architecture to perform initial training and testing on a simulated dataset.Ultimately we discriminated normal and abnormal heartbeat patterns for single lead of real ECG signals.

Literature review
Most NN systems were tested using ECG data from the MIT-BIH arrhythmia database [5], which contains 48 ECG recordings with signals that were band-pass filtered in the frequency range of 0.1 to 100 Hz and sampled at 360 Hz [22].In this sense, Rohan and Patil also used a low pass filter with a cut-off frequency of 30-100 Hz to pre-process 16 records from the MIT-BIH database [16].They then employed an NN approach composed by two hidden layers with eight neurons and classified four types of cardiac arrhythmias with an overall accuracy of 99.9%.Asl et al. used a 5-15 Hz band-pass filter to remove contamination from 2009 ECG segments, each with 32 RR intervals [17].The authors developed a three-layered NN with one hidden layer of 20 neurons that classified RR interval signals into four arrhythmia categories with an average accuracy of 99.3%.Das and Ari employed an NN approach with a pre-processing band-pass filter (3-20Hz) to reduce noise in 44 records of the database [18].They classified five types of ECG beats with an S-transform NN approach and achieved 97.9% of average classification accuracy.In contrast, Tang and Shu eliminated noise from an ECG waveform using high-pass filter with 0.7Hz and low-pass filter with 100Hz [19].Their quantum NN model recognized ECG signals with an overall accuracy of 91.7%.
In two studies the authors used WT technique to remove noise from MIT-BIH records.Javadi et al. proposed a modular NN based on a mixture of experts and negatively correlated learning using stationary WT as a tool for noise reduction [6].The NN ensemble produced a recognition rate of 96% for classifying normal heartbeats, premature ventricular contraction arrhythmias and other cardiac abnormalities.Vijayavanan et al. preprocessed ECG signal to remove different kinds of artifacts using discrete WT [12].They proposed a probabilistic NN approach to discriminate the difference between a normal ECG signal and an arrhythmia affected signal with an accuracy of 96.5% classification rate.Similarly, Naima and Timemy used discrete WT denoising procedure on ECG data collected from two hospitals in Bagdad [13].Their discrete WT-NN classifier with six neurons in the hidden layer detected acute MI with 95% accuracy.On the other hand, Güler and Übeyli decomposed ECG signals from the Physiobank database [23] into time-frequency representations also using discrete WT.They classified four types of ECG beats with a total accuracy of 96.9% through a combined NN model composed by 30 hidden neurons [11] In its place, Setizwan et al. employed the nonlinear CSI method to estimate and eliminate noise from the baseline ECG of MIT-BIH registers.The implemented fuzzy-neuro learning vector quantization algorithm produced 95.5% of the overall accuracy rate to classify normal beat and 11 types of arrhythmias [14].Meanwhile, Vishwa et al. applied direct FFT to remove low frequencies and restore an ECG signal from the MIT-BIH arrhythmia database with the help of inverse FFT [15].The NN model composed by three and five neurons in first and second hidden layer respectively obtained a detection accuracy of 96.7%.
In contrast, Garg and Sharma used an NN model with two hidden layers to analyze ECG records from the MIT-BIH database with no additional filter and correctly detected normal vs. arrhythmic ECGs with a general accuracy of 96.6% [24].Finally, Jadhav et al. used records from the Cardiac Arrhythmia Database of the UCI Machine Learning Repository [25] with no prior filtering for classification of normal and abnormal ECG signals.Their NN approach with two hidden layers resulted in 82.4% correct classifications [26].

Materials and methods
The NN classification comprises five stages: (i) simulation of ECG signal, (ii) extraction of features that indicate cardiac abnormalities, (iii) computer generation of normal and abnormal heartbeat patterns, (iv) artificial noise injection, and (v) cardiac rhythm classification on simulated and real ECG signals.

ECG signal simulation
We used a standard electrocardiographic 12 lead representation of the heart electrical activity [27] divided in the P, PQ, QRS, ST, T and TP sections (Fig. 1), to simulate an ECG signal with specific parameters (Table 1).The resulting signal was composed of different waveforms and frequencies.The P and T sections of the simulated ECG signal were similar to waveforms generated by the movement of a piston, which allowed generation of a mathematical model of their behavior [28].The piston describes an oscillatory motion that can be approximated by a simple harmonic.The position equation of the piston is a function of the angular velocity: x(t)=r•cos(ωt), where x(t) is the piston position versus time, r is the radius of the crank and ωt is the angular velocity of rotation in radians.
The P wave modeled by the piston motion equation had maximum amplitude of 0.125 mV.The T wave was split into two sections: the first section had maximum amplitude of 0.16 mV, a positive slope, and a period of T1; the second section had the same maximum amplitude, a negative slope, and a period, T2, which was less than T1.The QRS segment used corresponding voltages at the Q, R, and S points and intermediate voltages for the PQ-Q, Q-R, R-S, and S-ST sections.A positive off-set voltage was then added to each value.Each section was further characterized by amplitude and corresponding slope (Table 1).The final output ECG signal, simulated using MATLAB software [29,30], had a duration of 700 ms for each cycle and was mounted on a signal base of 512 mV amplitude (Fig. 2).

Cardiac abnormalities
Feature extraction is a key issue in recognition and classification tasks.We used a combination of morphological and timing features to distinguish between a normal heartbeat (NH) and disorders of heart rate and cardiac rhythm.The shape, position, and time duration of P, Q, T waves and the ST segment, were used to identify specific abnormalities (Fig. 3).The P wave is the first positive deflection on ECG signal, with a normal duration <120 ms and amplitude rarely exceeding 0.25 mV.Greater amplitude suggests right atrial enlargement (RAE) [31], and an inverted P wave can indicate junctional rhythm (JR) [32].The Q wave is the first downward deflection on ECG signal.Pathological Q waves, with a duration >40 ms or depth >0.1 mV, can be a sign of current or previous myocardial infarction (MI) [33].Greater than 0.2 mV depression of the ST segment, which connects the QRS complex and the T wave, is attributable to cardiac ischemia (CI) [34].Widespread inversion of the T wave, the first deflection following the QRS complex, is also associated with CI [35].

Dataset
After extracting the morphological and timing characteristics of the simulated ECG signal, we generated 10000 heartbeat feature vectors (normal and abnormal) for each ECG segment.The dimensions of the feature vectors for the P, Q, ST and T waves were 102, 115, 120, and 200-dimensional respectively.We then built matrices , , and ) from randomly selected pattern vectors, using 900 for each matrix.These were organized as interspersed normal ( ) and abnormal patterns ( ).In the case of a P wave with two associated pathologies ( ), both abnormal patterns were inserted after each NH pattern: (1) Later, we randomly combined the pattern vectors to generate a total training dataset, composed of 5400 samples from five classes.The first class was a NH; the other four classes were specific cardiac pathologies for each ECG wave.This takes into account that CI could be attributable to depression of the ST segment or widespread inversion of the T wave [34].The total training data was partitioned into two datasets: training and testing set.The testing set was not seen by NN classifier during the training phase.It is only used for testing the generalization of NN approach after it was trained.We randomly selected the 80% examples for training, and the rest 20% examples as testing data.
To assess the robustness of the learned patterns within noisy conditions, and to improve the generalization capability of the resulting NN system, we created artificial corruption in all ECG segments of testing set (Fig. 4) using a Gaussian white-noise model [40].We injected 1 to 12% of randomly generated Gaussian white noise [41,42].We defined quality categories to describe the noise level: minor (1-2%), moderate (4-6%), severe (8-10%), and extreme (12%).The corrupted testing set was used during the training phase to improve the behavior of NN ensembles while they were trained within noise conditions.
Later we build a corrupted dataset for testing of trained NN with a total of 21600 contaminated ECG segments (17100 NH, 1800 CI, 900 RAE, 900 JR, and 900 MI segments).In addition, the NN approach was tested on real ECG records of the Physikalisch-Technische Bundesanstalt (PTB) Diagnostic ECG Database [36].The PTB database contains digitized ECG signals provided by the National Metrology Institute of Germany.This ECG collection included 15 simultaneously measured signals: the conventional 12 leads together with the 3 Frank lead ECGs.Each signal is digitized at 1000 samples per second, with 16 bit resolution over a range of ± 16 mV and sampling frequency equal to 1 KHz [36].We selected data from 221 subjects with a clinical summary available, which included ECG records classified as NH (n=52) or cardiac abnormalities (148 MI, 14 dysrhythmia and 7 myocardial hypertrophy).For the testing purpose, we considered an unbalanced dataset in favor of arrhythmia data (76.5%) to improve the testing generalization capabilities of the NN classifier to recognizing cardiac abnormalities.Lead V1 was chosen for the whole analysis; because it has the largest ratio of atrial to ventricular signal amplitude and therefore can offer more representative characteristics for identifying the common heart diseases [37,38].The final test set consisted of 884 ECG traces built from 4 heartbeats per individual.

Neural network classifier
The modular NN classifier consisted of four, threelayered, feedforward micro NNs built through Matlab NN toolbox, one for each ECG interval analyzed.A back-propagation algorithm in batch gradient descent with momentum mode [39] and random weights/bias initialization were used for training.Transfer function group was of the hyperbolic tangent-logarithmic sigmoid-linear type for input-hidden-output layers.The learning rate and momentum coefficient were selected as 0.05 and 0.9 respectively.Performance was tested using the mean squared error parameter, computed for differences between the actual outputs and the outputs obtained in each trained micro NN.The training ended, if the total sum of the squared errors was <0.001, or when 3000 epochs were reached.The target outputs for NH, RAE, JR, MI, and CI were given by (0,0,0,0), (0,0,0,1), (0,0,1,0), (0,1,0,0), and (1,0,0,0), respectively.

Simulated ECG dataset
When the NN system was trained using pattern vectors of clean and noised simulated ECG signals, the MSE convergence goal (0.00096) was reached in 109 epochs.The best performance was obtained using 10 (P and T) or 5 (Q and ST) neurons in the hidden layer of the micro NNs.In the first scenario of testing with an artificial corrupted dataset, correct classifications over 10 runs averaged 99.2%, 95.1%, 91.4%, and 85.2% for minor, moderate, severe, and extreme noise (Table 2) respectively.Total confusion matrix of each micro NN model for all the levels of noise is shown in Table 3

Real ECG dataset
For the last stage of the study the trained NN approach was tested directly on raw ECG traces from PTB database, exclusively for discriminating between NH and cardiac abnormality.Overall classification accuracy was 95.7%.The results are shown by a confusion matrix, where each cell contains the number of ECG traces classified for the corresponding combination of estimated and true outputs (Table 4).

Estimated output
True In Table 6 the overall performance of our proposed NN classifier is compared with the recognition rate of previous NN approaches for EGC classification found in the literature.

Discussion
Overall, results of the previous studies make it clear that suppression of noise corruption embedded in analysed signals improves the accuracy of NN classifiers.However, filtering parameters, particularly cut-off frequencies and phase response characteristics, should be chosen such that clinical information in ECG signals remains undistorted, while as much noise as possible is removed [43].This is difficult because the signal and noise often share the same frequencies.Furthermore, adaptive filters do not normally have a sharp delineation between the pass-bands and cut-bands, but rather a slow transition in the filter response.If the clinical signals and noise are close, it may not be possible to remove the noise without removing some of the clinical signal [44].
Converse to previous NN approaches for classification of ECG signals, the system proposed trains with clean and noisy data [55].By using inputs corrupted with randomly sampled noises and various signal-tonoise ratios, we were able to build a robust classifier without an adaptive filter, because the injected noise improves the generalization capability of the NN model [56].The rationale of this approach is that the perturbation introduced in training by the injected noise can be learned by the NN structure and recognized in the test phase.More exactly, noise injection during the training favors an optimal solution at which the objective function is less sensitive to the change of the input [57].On the other hand, this approach is based on the premise that an NN method, which can provide accurate classification with noise, is preferable to methods that modify the original signal.Furthermore the modular design based in micro NNs provides a more specific classification for each considered kind of cardiac abnormality.In this sense, the analysis and experiments suggest that by injecting a minor to extreme level of noise in training of NN, the noise patterns can be effectively learned, and the generalization capability of the micro NNs can be improved.Both of these advantages result in substantial performance improvement of NN for ECG classification in noise conditions, without the inclusion of adaptive filters.
However, although the average classification accuracy and precision of our NN system is competitive,

NN approach
Filtering technique Accuracy (%) *Rohan et al. [16] 30-100 Hz 99.9 the system was tested for the detection of only four types of cardiac pathologies.On the other hand, the first results of the trained NN approach were achieved with artificially generated random Gaussian white noise, without any specific assumption on the origin of the noise.Moreover, the additive noise model can differ to some extent from real ECG records that are corrupted by physiological noise and exhibiting spatial correlation across the individual ECG signals [16].These limitations require additional research for situations where the nature of the contaminating noises are better known, and the additive artificial noise may be selected according to the particular situation.Therefore, our system requires further verification including information about the noise sources using actual ECG data and classifying other specific types of cardiac disorders.

Conclusion
We developed a robust and fairly accurate, noise-tolerant NN approach for detecting and diagnosing specific cardiac abnormalities.

Figure 3 :
Figure 3: Morphological and timing features of (a) the P wave; (b) the Q wave; (c) the ST segment; and (d) the T wave, used to detect specific cardiac abnormalities

Table 1 :
Parameters of typical ECG lead. .

Table 2 :
Classification performance for contaminated ECG segments.

Table 3 :
Confusion matrix for classification of artificially corrupted ECG segments.Overall classification accuracy was 93.9%.The best performance was achieved for the micro NNs, Q and ST, correctly classifying 98.8% of NH and 100% of abnormal segments.

Table 4 :
Confusion matrix for classification of real ECG signals.

Table 5 :
Total test performance of the NN classifier.

Table 6 :
* ECG signals that were previously band-pass filtered in the frequency range of 0.1 to 100 Hz and sampled at 360 Hz.Comparison of the overall classification accuracy of the proposed method and previous NN approaches in literature.
The modular NN system discriminates between simulated normal and abnormal cardiac rhythms with high accuracy for ECG signals with minor to moderate noise and good accuracy for signals with severe to extreme noise.The previous artificial noise injection stage enables the trained NN classifier to handle noise and recognize cardiac abnormalities on raw ECG signals with high Precision.With further verification, this system could facilitate the use of NN approaches to support clinical decisions.