Cardiovascular disease, including heart disease and stroke, remains the leading cause of death around the world. Yet, most heart attacks and strokes could be prevented if some method of pre-monitoring and pre-diagnostic can be provided. In particular, early detection of abnormalities in the function of the heart, called arrhythmias, can be valuable for clinicians. The electrocardiogram (ECG) plays an important role in the process of monitoring and preventing heart attacks. The typical ECG, shown in Fig. (1), consists of three basic waves: P, QRS, and T. These waves correspond to the far field induced by specific electrical phenomena on the cardiac surface, namely, the atrial depolarization, P, the ventricular depolarization, QRS complex, and the ventricular repolarization, T. It should be noted, however, that the ECG signal does not look the same in all the leads of the standard 12-lead system used in clinical practice.
There is increasing recognition that computer- based analysis and classification of diseases can be very helpful in diagnostics and several algorithms have been developed in the literature for detection and classification of ECG beats using neural networks.
The techniques, developed for automated detection of changes in electrocardiographic signals, work by transforming the mostly qualitative diagnostic criteria into a more objective quantitative signal feature classification problem. In order to address this problem, the analysis of ECG signals has been carried out using techniques such as autocorrelation function, time frequency analysis, and wavelet transform (WT)
SA schematic of the designed algorithm in this study is shown in Fig. (2). This algorithm consists of three stages: pre-processing, main Process and finally, classification of the ECG beats.
Pre-processing This stage includes four levels of data processing: signal filtering, sample selection, feature extraction, and dimensionality reduction.
Fig. (3) shows raw ECG signal which clearly exhibits baseline wandering and the same ECG signals after applying the filtering method. It is obvious that the baseline wandering has been removed, leading to a better performance of the neural classifier.
The data of ECG signals used in this study are taken from the MITBIH ECG signal database, including normal beats and five types of different arrhythmia beats. For this research, the selected types of arrhythmias are atrial pre-mature beats (A), right bundle branch block beats (R), left bundle branch block beats (L), paced beats (P), and pre-mature ventricular contraction beats (PVC or V).
The suitable range of samples from the raw ECG signal was found experimentally to be 150 samples after the R wave for all types of signals, which are called a segment. These segments are found to be an appropriate range of ECG signals which represent morphological differences between different types of ECG beats and include sufficient amount of data needed for classification of heart arrhythmias. Fig. (4) shows a normal beat and selected sub-sample.
The selection of the analysing function in WT, which is called the mother wavelet, has a significant effect on the result of analysis and should be selected carefully based on the nature of the signal. Several mother wavelets, such as Morlet and Mexican-hat, have been used in ECG signal analysis for component detection and disease diagnosis. Because of the harmonic nature of Morlet and Mexican-hat, they are often used for analysis of harmonic signals and the usage of these mother wavelets are not likely to be suitable options in the case of ECG signal classification. In fact, the simplicity of the computed CWT coefficients can be used as a convenient criterion to help in the selection of the mother wavelet as shown below.
Fig. (5) shows a normal signal and its CWT with different mother wavelets in the scale a=10. Figure 5(a) shows a normal signal beat, which has three picks. Figure 5(b) shows CWT of the same signal beat with Haar mother wavelet. This figure is very simple and the effects of the raw signal picks are obvious and observable. These effects can be analysed easily and the extracted features would be suitable and appropriate for the data classification. Also, these computed coefficients can represent morphological differences very well.
To compute the CWT of signals, it is not necessary to use scales in the range of 1 through 100. In view of the fact that computing CWT of signals in this range of scales will lead to a huge volume of data as extracted features, it is not advisable to use it. Instead, a specific range of scales, which is suitable and appropriate for feature extraction, is needed. The following is an analysis to determine the appropriate range of scales for the current study.
A huge amount of data would not be efficient to perform a pattern recognition process. In our algorithm and in the final level of pre-processing, PCA is applied on the computed matrices of wavelet coefficients, where each of them is a 10 150 matrix, resulting in 10 PC vectors. In this study, the first three PC vectors have been selected and arranged as the neural network classifier input vector. This number of PC vectors was chosen according to the results which are presented in Tab. (1)
In Tab. (1) the accuracy of the neural network classifier with respect to the selected number of PC vectors is shown. According to Table 1, the accuracy of the neural network classifier increases as the number of selected PC vectors increases from 1 to 5, since by increasing the size of data in this level and this range, the classifier will have a more appropriate set of data for classification. The accuracy of the neural network classifier decreases as the number of selected PC vectors increases from 5 to 10, since in this level, the size of the data is too much for the classifier to have a good performance. Since the difference between classification accuracy in the case of 3 PC vectors and 5 PC vectors is not that impressive, we chose 3 PC vectors in order to have a reasonable accuracy, while having less computational effort in comparison with selecting 5 PC vectors. As a result, by selecting only three PC vectors, dimensionality reduction without significant loss of data information is achieved, leading to a better performance of the neural classifier.
After finishing the pre-processing stages, data is ready as the input vector for the neural network classifier. In this study, a classical MLPNN structure is used as the neural network classifier structure. This MLPNN is trained with the back propagation method of error. Selection of the neural network inputs is the most important component of designing the neural network based pattern classification since even the best classifier will perform poorly if the inputs are not selected well. The inputs of neural network in this study are constructed in the way which was described in previous section. In our algorithm, we used a classical MLPNN structure with two hidden layers and with 60 nodes in the first hidden layer and 15 nodes in the second hidden layer for 160 iterations. The structure of this MLPNN classifier with input, hidden, and output layers is shown in Figure 9.
The MIT-BIH arrhythmia database is used to evaluate the proposed algorithm. To assess the accuracy of the classifier, sensitivity, positive predictive accuracy and total accuracy have been calculated. Tab. (2) shows the result of classification by the neural network. It can be seen from this table that from the whole testing database, the classification fails only in five cases.