Detection of ECG waveforms by neural networks

Detection of ECG waveforms by neural networks

PII: S1350-4533(97)00029-5 Med. Eng. Phys. Vol. 19, No. 8, pp. 738–741, 1997  1997 IPEM Published by Elsevier Science Ltd Printed in Great Britain 1...

190KB Sizes 0 Downloads 85 Views

PII: S1350-4533(97)00029-5

Med. Eng. Phys. Vol. 19, No. 8, pp. 738–741, 1997  1997 IPEM Published by Elsevier Science Ltd Printed in Great Britain 1350–4533/97 $17.00 + 0.00

Detection of ECG waveforms by neural networks ¨ lmez*, Ertugrul Yazgan* and Okan K. Ersoy† Zu¨mray Dokur*, Tamer O *Istanbul Technical University, Electrical & Electronics Engineering Department, 80626 Maslak, Istanbul, Turkey; †Purdue University, School of Electrical and Computer Engineering, West Lafayette, IN 47907, U.S.A. Received 14 August 1996, accepted 28 May 1997

ABSTRACT In this study, ECG waveform detection was performed by using artificial neural networks (ANNs). Initially, the R peak of the QRS complex is detected, and then feature vectors are formed by using the amplitudes of the significant frequency components of the DFT spectrum. Grow and Learn (GAL) and Kohonen networks are comparatively investigated to detect four different ECG waveforms. The comparative performance results of GAL and Kohonen networks are reported.  1997 IPEM Published by Elsevier Science Ltd Keywords: Neural networks, ECG waveforms, detection Med. Eng. Phys., 1997, Vol. 19, 738–741, December

1. INTRODUCTION Two major types of neural networks for classification are those based on supervised learning, such as backpropagation network, and those based on competitive learning, such as the GAL1 and the Kohonen network2. In our work, we compare the Kohonen network with the GAL in terms of their classification performances, learning time and the number of nodes used in both networks in detection of four different types of ECG waveforms. A major advantage of the Kohonen network over those based on supervised learning is its fast learning speed. The major disadvantages are the following: it is not an incremental network. The network generates feature vectors (FVs) throughout the inside of a class homogeneously rather then concentrating them on the boundaries between classes. This causes the generation of an excessive number of FVs. Another disadvantage is that a method for adapting the gain constant and the neighborhood parameter optimally during learning has not been developed. In the GAL network, the problems discussed above are minimized by generating an incremental number of FVs near the boundaries of the classes. The paper consists of three sections. In section 2, we discuss the methods used. Section 3 presents the results of the computer simulations and the conclusions.

MIT/BIH Arrhythmia Database3. The database consists of 48 half-hour recordings for a total of 24 h of ECG data. The waveforms are sampled at 360 Hz with 11-bit resolution over a 10 mV range. QRS detection is the first stage of signal processing prior to pattern recognition4. In our work, in order to enhance the QRS complexes and to suppress noise artifacts, baseline wander and nonQRS portions of the ECG, digital filters are used. First, in order to restore the baseline, the signal is filtered by a digital high-pass filter (HPF) with a cut-off frequency of 2 Hz. The difference equation for the recursive high-pass filter designed is given by x(k) = 1.951x(k ⫺ 1) ⫺ 0.952x(k ⫺ 2) + 0.976u(k) ⫺ 1.952u(k ⫺ 1) + 0.976u(k ⫺ 2)

(1)

where u(k) and x(k) are the input and output sequences, respectively. The output of the HPF is processed in two different branches, and the outputs of these branches are fed into a multiplier. On one of these branches, the output of the HPF is fed into a band-pass filter (BPF) with a center frequency of 17 Hz, which is the main frequency of the QRS complex. The BPF reduces the influence of muscle noise, 50 Hz interference, and Twave interference. The difference equation of the recursive BPF designed is given by:

2. METHODS

y(k) = 1.849y(k ⫺ 1) ⫺ 0.933y(k ⫺ 2) + 0.0337x(k) ⫺ 0.0337x(k ⫺ 2).

The waveforms used to train and to test the GAL and Kohonen networks were obtained from the

Next is an amplitude squaring process that maximizes the QRS energy of the signal in this branch.

(2)

Detection of ECG waveforms: Z. Dokur et al.

The resulting signal is denoted by r. After this process, the signal r is passed through a moving-window integrator for smoothing. This is given by: 1 [r(k ⫺ (N ⫺ 1)) N ⫺ 2)) + …… + r(k)] w(k) =

+ r(k ⫺ (N

(3)

where N is the number of samples in the integration window. The width of the window is determined empirically. For our sample rate of 360 samples/s, the window is 30 samples wide. On the other branch, the output of the HPF passes through a low-pass filter (LPF) with a cutoff frequency of 36 Hz to reduce the high-frequency noise present in the ECG signal. The difference equation of the low-pass filter designed is given by: v(k) = 2v(k ⫺ 1) ⫺ v(k ⫺ 2) ⫺ 2x(k ⫺ 10) + x(k ⫺ 20).

+ x(k)

(4)

The output of the LPF is delayed by the total processing time of the detection algorithm. It is chosen empirically as 12-times the sampling interval, T, yielding z(k) = v(k ⫺ 12).

(5)

networks. The GAL is an incremental network for supervised learning. The output nodes of the GAL network are formed by choosing vectors from the training set. All vectors in the training set have their own classes. The procedure for the learning algorithm of the GAL network is as follows1: 1. Initially choose a number of vectors randomly from the training set as many as the number of classes. Each vector represents only one class. Initialize each chosen vector as an output node of the GAL. Initialize the iteration number as the maximum number of iterations allowed. 2. Increase the iteration number. If the iteration number is equal to the chosen maximum value, terminate the algorithm. Otherwise, go to step 3. 3. Choose one vector denoted by xi randomly from the training set. Compute the distance between each node of the GAL network and the input vector, and find the minimum distance as follows:

冘 30

dio =

(xij ⫺ Noj )2

(7)

j=1

dim = min(dio)

(8)

o

The outputs of the integration and delay units are multiplied and then presented to the decision rule (amplitude threshold) which declares a QRS detection if the output of the multiplier exceeds a threshold. The maximum amplitude in the QRS complex is taken as the R peak. After the detection of the R peak, feature extraction is carried out. Amplitudes of the significant frequency components are used to form the feature vectors5. Frequency analysis involves the discrete Fourier transform (DFT) of a window of data of length N around the R peak. The 1– 30 Hz frequency band was used by choosing the DFT frequencies as 1, 2, 3,….30 Hz. This yields a feature vector of length 30. The following equation is used for the frequency analysis:



N⫺1

X(f) =

x(k)exp( ⫺ j2␲fk/N),

(6)

k=0

where N equals 300 in the computer simulations discussed in the next section. Feature vectors obtained by this method are not affected by high frequency noise, and the spectral amplitudes are not dependent on the position of the R peak. Misdetection of the R peak appears as a delay and does not affect the parameters of the feature vectors. Four different ECG waveforms are detected: normal beat—N, left bundle branch block beat— L, premature ventricular contraction—V, and paced beat—P. These are shown in Figure 1(a)– (d). M feature vectors from each class are chosen to generate the training set of ANNs. In the computer experiments discussed in section 3, M was chosen to equal 15. In this paper, two ANNs are examined comparatively. These networks are the GAL and Kohonen

where xij is the jth element of the input vector xi; Noj is the jth element of the oth node of GAL; and O is the present number of output nodes. Compare the classes of the input vector and the mth node nearest to the input vector. If their classes are the same, go to step 2. Otherwise go to step 4. 4. Include the input vector in the GAL network as a node. The elements of the input vector are assigned as the associated weights of the new output node of GAL. Go to step 2. During learning with GAL, which nodes are generated depends on the order of the input vectors. A node previously stored may become useless when another node nearer to the class boundary is generated. When a useless node is eliminated from the GAL network, the classification performance of the network does not change. In order to decrease the network size, these nodes are extracted from the GAL by the forgetting algorithm given below1. 1. Select the maximum iteration number as one more than the number of output nodes in the GAL. Initialize the iteration number as zero. 2. Increase the iteration number. If the iteration number is equal to the maximum value, terminate the algorithm. Otherwise, go to step 3. 3. Choose the next node from the GAL in some order. This node is extracted from the network and is given as an input vector to the GAL network. 4. Compute Equations (7) and (8). Compare the classes of the input vector and the mth node of the GAL. If their classes are not the same, go to step 5. Otherwise, go to step 3.

739

Detection of ECG waveforms: Z. Dokur et al.

Figure 1 (a) Normal beat, N. (b) Left bundle branch block beat, L. (c) Premature ventricular contraction (PVC), V. (d) Paced beat, P.

5. Include the input vector again in the GAL. Go to step 2.

3. RESULTS AND CONCLUSIONS In our study, the QRS complexes and the R peaks in the ECG waveforms shown in Figure 1(a)–(d)

740

were correctly detected. Performances of the GAL and Kohonen networks are presented in Table 1. In this table, the ratios m/n show m correct classification out of n cases. The maximum iteration number of the two networks was chosen as 1000. There were 15 feature vectors for each class in the test set. It is observed from Table 1 that feature selection by using frequency analysis followed by ANN

Detection of ECG waveforms: Z. Dokur et al. Table 1 Performances of the GAL and Kohonen networks

GAL Kohonen

N

V

P

L

Learning time

Number of nodes

15/15 15/15

15/15 13/15

15/15 14/15

15/15 15/15

4s 7s

6 16

classification gives successful results. It is also observed that the GAL network results in faster learning, and better classification performance with fewer nodes, as compared with the Kohonen network. In particular, the Kohonen network was observed to give poor classification performance with less than 16 nodes in ECG waveform detection of the V type.

2. Bezdek, C. James. Computing With uncertainty. IEEE Communications Magazine, September 1992, pp. 24–36. 3. MIT-BIH Arrhythmia Database. Available from Beth Israel Hospital, Biomedical Engineering Division Room Kb-26, 330 Brookline Ave., Boston, MA. 4. Jiapu, P. and Willis, J.T., A real time QRS detection algorithm. IEEE Trans. Biomed. Eng., 1985, BME-32, 230–236. ¨ lmez, T., Koru¨rek, M. and Yazgan, E. Detec5. Dokur, Z., O tion of ECG waveforms by using fuzzy classifier. Proceedings of SIU 95, Vol. 2, Cappadocia, Turkey, 1995, pp. 208–213.

REFERENCES 1. Alpaydin, A. I. Ethem. Neural Models of Incremental Supervised and Unsupervised Learning, Ecole Polytechnique Federal de Lausanne, Switzerland, Ds. Thesis, 1990.

741