1 Introduction
VENTRICULAR FIBRILLATION (VF) is a lethal cardiac arrhythmia which can be stopped by prompt application of a DC shock (defibrillation). On the electrocardiogram (ECG), VF appears as an irregular, undulating waveform. (Fig. 1) ECG monitoring systems and automatic defibrillators attempt to reduce delays in recognising VF by incorporating automatic detection algorithms. However, electrode artifact and other cardiac arrhythmias can produce VF-like ECG signals which lead to false positive detections. In addition, the ECG waveform during VF is poorly characterised and this can lead to false negative detections. Development and testing of VF detection algorithms has relied on a limited database of VF recordings because VF is unpredictable, and hence rarely recorded in a form suitable for analysis. Although many VF detection techniques have been developed and claim good performance (JAKOBSSENe t al., 1990), independent evaluation has shown that some techniques are not optimal (CLAYTONet al., 1993). There is clearly room for further development. One approach with potential lies in the area of neural computing. Neural computing is a rapidly growing field (MILLER et al., 1992; BEALE and JACKSON, 1990). Simple processing units (neurons) are linked together by weighted connections. Each neuron processes its weighted inputs according to its activation function, and the output is then passed on to the inputs of the next layer of neurons. The remarkable feature of a neural network lies in its flexibility. By allocating appropriate values to the weights, a network can perform specific and complicated operations on its inputs. A network can hence be trained to perform a particular operation, using a set of training data comprising a series of input patterns for which the correct output is known. Each training pattern is repeatedly presented to the inputs. The network weights, orginally set to random values, are progressively optimised using a training algorithm which attempts to produce the correct output for the training patterns. Training continues until the errors associated with Correspondence should be addressed to Dr R. H. Clayton. First received 27 April 1992 and in final form 25 January 1993
9 IFMBE: 1994
Medical & Biological Engineering & Computing
the training set are minimised. The most commonly used training algorithm is back-propagation, described in detail by McClelland and Rumelhart (McCLELLAND, and RUMELHART, 1988). In the field of electrocardiology, neural networks have already been used for diagnostic classification of 12 lead ECGs (BORTOLANet al., 1991), detection of atrial fibrillation from RR interval sequences (ARTIS et al., 1991) and classification of ventricular tachyarrhythmias from intracardiac signals (Cm and JABRI, 199t). The aim of this study was to establish whether simple neural networks could be trained to distinguish between VF and VF-like artifact.
2. M e t h o d s
2.1 E C G recordings Recordings of VF and VF-like events were obtained from patients in a Coronary Care Unit using an automatic data acquisition system (CLAYTONet aL, 1991). Patients in all ten cubicles were monitored on a single bipolar ECG lead. Automatic data capture was triggered when the RMS of any ECG signal lying between 3 and 6 Hz exceeded 75% of the total for more than 2 s. Data were continuously recorded into a circular buffer in the computer memory, which was able to contain I rain of data. Following a trigger, 4 min of data were recorded while the data from the preceding minute were held in memory. The pre- and post-trigger data were then recorded to disk to give a continuous 5 min recording. All data were digitised at a sampling rate of 250 Hz. As the electronic detector was intended to have high sensitivity and low specificity, many recordings of VF-like events were available in addition to recordings of genuine VF events. All VF events were confirmed as such by the Coronary Care Unit staff. 2.2. Training and test data A group of 4.096 s (1024 samples) ECG data segments containing either a VF or a VF-like event were selected from the database. VF was defined as a ventricular tachyarrhythmia with sudden onset, rate > 300 min- 1 and irregular ECG complexes. The VF-like data segments included a wide range of signals with a similar appearance
M a r c h 1994
217
pafi'em inputs
N d d e n layer
outputs
Peak ~quency
FSMN I
I
5
10
time, s
A1
o VF
Fig. 1 ECG recording showing four beats of sinus rhythm followed by ventricular fibrillation
to VF and examples of ventricular tachycardia, atrial flutter, movement artifact, and noise arising from poor electrode contact. These data segments were grouped into a training set and a test set. The VF training set comprised 40 data segments from five patients, and the VF-like training set comprised 40 data segments from six patients. The VF test set comprised 70 data segments from 15 patients, and the VF-like test set 40 data segments from ten patients. The test set had already been used for assessment of VF detection algorithms in a previous study (CLAYTON et al., 1993). 2.3 Data processing Most automatic VF detection techniques derive quantities from either time or frequency domain analysis. Decision-making is achieved by comparing these quantities with threshold values. In this study, the threshold values were replaced with two trained neural networks, each exploiting features previously used in VF detection algorithms. The first neural network assessed in this study (NET1) was based on analysis of the Fourier spectrum of 1024 point (4.096 s) data segments. It is well known that the Fourier spectrum of the ECG changes from a broadband signal to a narrow band signal at the onset of VF (HERBSCHLEBe t al., 1979; MURRAY et aL, 1985). Each 1024 point data segment was transformed into the frequency domain by a Fast Fourier Transform (FFT) algorithm with a Hanning window. As the ECG during VF is concentrated in the range of 4 to 7 Hz, only signal amplitudes in the range 1.95 Hz to 16.84 Hz were retained. To minirnise the complexity of the network, alternate amplitudes between 1.95 Hz and 16.59 Hz (with a resolution of 0.488 Hz) were used to provide 31 inputs to NET1. These were normalised to the maximum amplitude to provide input patterns in the range 0-1. For the second network (NET2), the data segments were preprocessed to give six quantities, which were then used as network inputs. Five of these quantities were calculated from the Fourier spectrum of each data segment using the technique described by Barro et al. (BARRO,et al., 1989). (a) F = frequency in the range 0.5-9 Hz with the largest amplitude. (b) F S M N =first spectral moment normalised. (c) A1 = proportion of the signal between 0.5 Hz and F/2. (d) A2 = proportion of the signal between 0.7 F and 1.4 F. (e) A3 = proportion of the signal in harmonics of F. The final quantity was the mean threshold crossing interval (TCI) of each data segment which was calculated as described by Thakor et al. (THAKOR et al., 1990).
o not-W
A3 rc~ Fig.2
Configuration of the neural network NET2. The input layer comprised six neurons, each corresponding to a component of the input pattern. There were four neurons in the middle layer and two neurons comprised the output
trained using a range of techniques (McCLELLANDand RUMELHART, 1988). NET1 comprised three layers of 31 input, 18 hidden and two output neurons. NET2 comprised three layers of six input, four hidden and two output neurons (Fig. 2). Neither network had any feedback connections. Neurons in the second and third layers had bias inputs in addition to inputs from the preceding layer. For each neuron, the activation function was (1 + e-X) - 1, where x is the sum of weighted inputs. 2.5 Network training Each network was trained and assessed using three different sets of initial random weights with a learning rate of 0.05. Each network was then trained again, using the first set of random weights and a learning rate of 0.005. During training, the networks were monitored using tile total sum of squares (tss) error between the correct and actual outputs, summed over all the patterns in the training set. During each training epoch, each input and output pattern in the training set was presented to the network once. For each input pattern, the network output was calculated and compared with the desired output. At the end of each training epoch, the errors for each pattern were combined and a new set of weights calculated. 2.6 Network assessment A network was considered to have detected VF in a test set data segment if the VF output exceeded the not-VF output. Network performance was assessed by calculating sensitivity and specificity of VF detection using the test set. Sensitivity is a measure of the ability of a detection technique to correctly identify VF and was calculated as the ratio of correct VF detections to the number of recordings in the VF test set. Specificity is the ability to correctly reject VF-like signals and was calculated as the ratio of correct rejections to the number of recordings in the. VF-like test set.
3 Results
2.4 Neural network configuration The software used for this Project was part of a program library which allows a neural network to be configured and 218
The fall in tss following network training from each set of random starting weights is shown for NET1 in Fig. 3 and for NET2 in Fig. 4. For each set of random weights,
Medical & Biological Engineering & Computing
March 1994
Table 1
NET1
NET2
Network performance
random weights
learning rate
number of epochs
tss error
sensitivity, %
specificity, %
setl set2 set3 set 1 set4 set5 set6 set4
0.05 0.05 0.05 0.005 0.05 0.05 0.05 0.005
30 30 30 500 2000 2000 2000 20000
0.26 0.25 0.42 0.21 3.06 2.88 2.95 3.00
16 17 16 19 83 86 84 83
83 85 88 88 60 58 58 58
tss = total sum of squares error between calculated outputs and known outputs in training set. 40-
resulted in a similar tss value following 500 epochs and the results of the assessment are also given in Table 1. The performance of NET1 was disappointing, with poor values of sensitivity but better values of specificity. Training of N E T 2 was halted after 2000 epochs with a learning rate of 0.05 (Table 1). For the smaller learning rate, 20000 epochs were required to reach a similar point (Table 1). Although the tss values were higher than those for NET1, the performance of NET2 was better with a greatly improved sensitivity but a smaller difference in specificity. In Table 2, the sensitivity and specificity for NET2 (taking the mean of the four values) are compared with the performance of conventional VF detection techniques evaluated using the same test set of recordings (CLAYTONet al., 1993).
30-
"6
20-
"5 40-
30
t0 nurnt~r
of training eoochs
Fig. 3 Reduction of total sum of squares error for NET1 durin 9 trainin9 with a learnin9 rate of O.05. Each symbol represents trainino with a different set of initial random weights
Table 2 Comparison of network performance with conventional algorithms, results from Clayton et al. 's work (CL.~rrON, et al., 1993)
technique
40"
sensitivity, % specificity, %
30-
al., 1993)
TCI
ACF
VF-filter
spectrum
NET2
53 93
67 38
77 55
46 72
84 ,59
TCI = threshold crossing interval (THAKORet aL, 1990 and CLAYTONet ACF = autocorrelation function (CHENet aL, 1987) VF-filter = frequency domain technique (Kuo and DILLMAN,1978) spectrum = Fourier spectrum analysis (BARROet aL, 1989) o"
"6
20-
4 Discussion t0-
u
0
~ 500
i I OOO
510 l 0
I 2000
number of trainingepocins
Fig. 4. Reduction o f total sum of squares error for NET2 durin9 training with a learnin9 rate of 0.05. Each symbol represents trainin9 with a different set of initial random weights
tss converges to similar values, although the stable value of tss for NET1 was much lower than for NET2. The tss for NET1 fell much more quickly with training than the tss value for NET2. Training of NET1 was halted after 30 epochs with a learning rate o f 0.05. The assessment of the network trained with the three random starting points is given in Table 1. Training of the network with a learning rate of 0.005 M e d i c a l & Biological Engineering & C o m p u t i n g
This study has shown that neural networks are capable of distinguishing VF signals from VF-like signals. Although poor performance was achieved with a network which processed the Fourier spectrum, an improvement in performance was obtained when the characteristics of the spectrum were distilled into five quantities, together with a time domain parameter. This second network, operating with a smaller number of inputs, was much less complex but took longer to train. Neither the choice of different initial values for the network weights nor the learning rate affected the network performance, although a ten-fold reduction in learning rate required an approximate ten-fold increase in the number of training epochs required. Table 2 shows how the best results from this study compare with the performance of four conventional VF detection algorithms assessed using the same test set of data (CLAYTON et al., 1993). The input patterns for NET2 were derived from the spectrum and TCI techniques, which, using a conventional approach, demonstrated a relatively low sensitivity and a relatively high specificity. However, the
M a r c h 1994
219
results for NET2 gave a high sensitivity but a relatively low specificity. Generally, in monitoring, it is preferable to have an improved sensitivity for VF detection, even if this is at the expense of a reduced specificity. The convergence of network weights to produce similar results, despite different initial random weights, shows that the problem for VF detection may have well defined solutions. The differing performance of NET1 and NET2 suggests that improved performance results from some preprocessing of the signal, although this is achieved at the expense of additional training. If implemented clinically, NET1 would be good at ignoring VF-like signals, but would also miss many genuine VF events. In contrast, NET2 would be good at correctly recognising genuine VF events, but would also produce some false alarms triggered by VF-like events. Neural networks are currently the subject of intense study and appear to offer a solution to many processing problems for which the processing rates are difficult to define. However, at present, no formal technique for designing or training neural networks exists. Although a neural network can be shown to 'learn' a particular problem, the processing rules it applies are difficult to deduce from the weighting values chosen. A major advantage offered by a neural network lies in its ease of implementation and speed of processing once trained. In an area such as on-line E C G signal-processing, the ability to perform complex operations quickly without resorting to equally complex electronic hardware is important. In this study, relatively simple neural network techniques have been employed. The results are encouraging and it is expected that, as the understanding of neural networks advances, substantial improvements in arrhythmia recognition will follow. 5 Conclusion
This study has focused on one aspect of arrhythmia monitoring which poses a difficult problem for automatic analysis. The results show that neural networks are capable of recognising patterns in the spectrum of the E C G during VF and can distinguish genuine VF from VF-like artifact. The best performance was obtained a network which required some preprocessing of the signal spectrum as well as additional training. This neural network had a better sensitivity for VF detection than conventional techniques assessed previously using the same data set. Acknowledgments--The authors would like to thank the District Research Committee of Newcastle Area Health Authority for supporting this research, and the British Heart Foundation for a Fellowship awarded to R. H. Clayton.
220
References ARTIS, S. G., MARK,R. G., and MooDY, G. B. (1991): 'Detection of atrial fibrillation using neural networks'. Computers in Cardiology 1991 Conf. (IEEE Computer Society Press, Los Alamitos) pp. 173-176 BARRO,S., RuIz, R., CABELLO,D., and MIRA,J. (1989): 'Algorithmic sequential decision making in the frequency domain for life threatening ventricular arrhythmias and imitative artifacts: a diagnostic system', J. Btomed. Eng., 11, pp. 320-328 BEALE, R., and JACKSON, T. (1990): 'Neural computing, an introduction' (Adam Hilger, Bristol) BORTOLAN, G., DEGANI, R., and WILLEMS, J. L. (1991): 'ECG classification with neural networks and cluster analysis'. Computers in Cardiology 1991. Conf. (IEEE Computer Society Press, Los Alamitos) pp. 177-180 CHEN, S., THAKOR,N. V., and MOWER, M. M. (1987): 'Ventricular fibrillation detection by a regression test on the autocorrelation function', Med. Biol. En 9. Comput., 25, pp. 241-249 CHt, Z., and JABRI,M. A. (1991): 'Identification of sup~aventricular and ventricular arrhythmias using a combination of three neural networks'. Computers in Cardiology 1991. Conf. (IEEE Computer Society Press, Los Alamitos) pp. 169-172 CLAYTON,R. H., MURRAY,A., WHITTAM,A. M., and CAMPBELL,R. W. F. (1991): 'Automatic recording of ventricular fibrillation'. Computers in Cardiology 1991. Conf. (IEEE Computer Society Press, Los Alamitos) pp. 685-688 CLAYTON, R. H., MURRAY,A., and CAMPBELL, R. W. F. (1993): 'Comparison of four techniques for recognition of ventricular fibrillation form the surface ECG', Med. Biol. Eng. Comput., 31, (2), pp. 111-117 HERBSCHLEB, J. N., HETHAAR, R. M., VAN DER TWEEL, I., ZIMMERMANN, A. N. E., and MEIJLER, F. L. (1979): 'Signal analysis of ventricular fibrillation'. Computers in Cardiology 1979 Conf. (IEEE Computer Society Press, Long Beach, California) pp. 49-54 JAKOBSSEN, J., REHNQVIST, N., and NQVIST, 0. (1990): 'Clinical experience with three different defibrillators for resuscitation of out of hospital cardiac arrest', Resuscitation, 19, pp. 167-173 Kuo, S., and DfLLMAN, R. (1978): 'Computer detection of ventricular fibrillation'. Computers in Cardiology 1978 Conf. (IEEE Computer Society Press, Long Beach, California) pp. 347-349 McCLELLAND,J. L., and RUMELHART,D. E. (1988): 'Explorations in parallel distributed processing' (MIT Press, London) MILLER,A. S., BLOTT,B. H., and HAMES,T. K. (1992): 'Review of neural network applications in medical imaging and signal processing', Med. Biol. Eng. Comput., 30, pp. 449--464 MURRAY, A., CAMPBELL,R. W. F., and JUL1AN, D. G. (1985): 'Characteristics of the ventricular fibrillation waveform'. Computers in Cardiology 1985. Conf., Washington DC (IEEE Computer Society Press) pp. 275-278 THAKOR, N. V., YI-SHENO, Z., and KONO-YAN, P. (1990): 'Ventricular tachycardia and fibrillation detection by a sequential hypothesis testing algorithm', IEEE Trans., BME-37, pp. 837-843
Medical & Biological Engineering & Computing
March 1994