Data Compression of the ECG. Usina Neural Network for. Digikl Holter Monitor alter monitoring, a 24-hours cassette output and input units is the same. The.
Data Compression of the ECG Usina Neural Network for Digikl Holter Monitor output and input units is the same. The alter monitoring, a 24-hours cassette r e c o r d i n g system of the A k a Iwata, Yasunori Nagasakat backpropagation algorithm is used for learning [ l ] [2]. The network is tuned up Nobuo Suzumura electrocardiogram (ECG), is useful for detecting cardiac disorders and ar- Deportment of Eledrical and (omputer Engineering with supervised signals which are the same as the inmt signals. rhythmias. Conventional Holter systems Nagoya Instituteof Technology Figure fshows the functional use a magnetic cassette to block diagram of the digital record the ECG. However, Holter monitoring system Holter monitors with a digital using dual three-layered neural IC memory card is now exA networks. ECGs measured pected to improve fidelity of with two electrodes on the recording and make the systhorax surface is sampled and tem more compact. reproduced signal digitized by an AD converter The amount of digitized with a sampling frequency of ECG data for two channels for lOOHz and 12-bit accuracy. 24 hours is about 20MB, and The digital signal data are sent the memorizing capacity of to a buffer and R-wave detecan available IC memory card tor. The ECG is normally a peis 256KB to 512KB. Thereriodic signal with an interval fore, data compression is inequal to a heart beat. The Rdispensable for a digital wave is detected with a low Holter system. In order to pass differential digital filter. s t o r e a 2 4 - h o u r elecThe ECG is divided into segtrocardiogram recording of 2 ments of every heart beat with channels into an IC memory R-wave event signals. The card of 512KB, a data comlatest 30 consecutive signal pression rate of 1:30 is necessegments are held in the firstsary. This paper describes a in-first-out buffer. An input data compressing algorithm signal segment is composed of of electrocardiogram for digiinput layer 70 samples which corresponds tal Holter recording using to the duration of a heart beat. artificial neural networks During the P and ST segments (ANNs). every 2 samples are picked up A 3 layered neural network that has a hidden layer with a Figure 1. 3-layered neural network is used. A network is from the original signals since few units (Fig.l), is used to composed of 70 units in the input layer, a few units in the hidden those portions have no high extract features of the ECG layer, and 70 units in the output layer. The hidden units are fully frequency components. Dual three-layered neural netwaveform as a function of the interconnected to both the input and output units. The hidden works are implemented on an activation levels of the hidden and output units are connected to a bias unit. ANN processor composed of layer units. The number of
H
.+
~~
IC memory
I
I
Figure 2. The functional block diagram of the digital Holter monitoring system using a dual three-layered neural network. The ECG is measured with two electrodes on the thorax surface and is sampled and digitalized by an A-to-D converter. The digitized data are sent to the buffer and R-wave detector. The dual three-layer neural networks is implemented on an ANN processor that is composed of digital signal processors. One network is used for data compression and a second is used for learning current signals. The compressed data are stored in IC memory. SEPTEMBER 1990
IEEE ENGINEERINGIN MEDICINEAND BIOLOGY
53
1
00 1212
1063
2125
3188
5313
6375
7938
8500
9563
10625
11688
I2750
I9875
15938
17000
‘1250
-
997 -
4
I
I
I
I
653 8500
Figure 3. Initially, the interconnecting weights {Wjk) of the first neural network are stored in IC memory. The activation levels {h,) of hidden units are then stored for every subsequent heart beat. If the error, E, between the input signal sequence and the activation levels of output units exceeds a threshold, the original input signal sequence {et) is stored instead of {hj}. If E exceeds the threshold frequency, the second network is copied to the first network and the new interconnecting weights are stored in the memory.
4
693 12750
I
I
681 9250
I
I
1
I 13813
0
digital signal processors. One network (Networkl) is used for data compression and another (Network2) is used for learning with current signals. The compressed data are stored on IC memory. Each network is composed of 70 units of input layer, a few units in the hidden layer, and 70 units in the output layer. The hidden units are fully interconnected to both the input and output units. The hidden and output units are also connected to a bias unit. At the start of the recording, Networkl is tuned up with supervised signals that are the same as input signals in the buffer. Once the network is tuned up, common features of waveforms are encoded with the interconnecting weights of the network.
00
00
-I
’1250
1063
2125
5313
6375
7’138
8500
9563
I0625
I1688
I 2750
13813
IC1875
15938
3188
‘t250
I
I
I
I
..
0500
{ w i k ; j = I to Nh; k = I to N J
where No is the number of output units. The activation levels of hidden units are:
!
{h,; j = I to Nh ]
where Nh is the number of hidden units 54
I
00 -
12750
1
I7000
Figure 4. An original waveform in the MIT-BIH arrhythmia database (a). The reproduced waveform as the activation level of output units (b). IEEE ENGINEERING IN MEDICINE AND BIOLOGY
SEPTEMBER 1990
REPRODUCED WAVEFORM
ACT LVL O F
REPRODUCED WAVEFORM I USING 4 B I T S FOR STORING ACT LVL O F HDN U N T 00
'1
REPRODUCED WAVEFORM USING 6 B I T S . FOR STORING A C T LVL O F HON U N T 00
500
00
I
1
I
I
-I
IO00
I 50 0
00
2000
1500
1000
1500
2000
1500
2000
REPRODUCED WAVEFORM USING 8 BITS FOR STORING ACT LVL OF HDN U N T
~
Figure 5. An original waveform and its reproducedwaveform with different bit lengths for storing the activation level of hidden units. The waveform has been reproduced even withonly two bits.
0.5
4
.................................................. ........................
that express the features of waveforms for every consecutive heart beat. Since the original waveforms are reproduced from the interconnecting weights and the activation level of the hidden units, only the interconnecting weights of the network and the activation levels of hidden units for every consecutive heart beat need to be stored in the memory, rather than the original data sequence. An ECG waveform may change because of movement, such as standing or lying down. Once the waveform is changed, the neural network does not work as well. To deal with this situation, we prepared a dual neural network system. As long as the ECG waveform stays the same as that used for learning, Network1 works well and the activation levels of the hidden units represent the features of the waveform. The input signal sequence is exactly reproduced at the activation levels of the output units. The fitness of the network is monitored with the error, E, between the input signal sequence and the activation levels of the output units. As long as the Network1 is fitted to current waveforms, the error is kept in a small value. However, once the waveform is changed, the error increases immediately because the activation levels of the output unit do not coincide with the input signal sequence. At the start, Network2 has the same interconnecting weights as does Network1 . However, Network2 continuously learns with the latest data and modifies the interconnecting weights accordingly. Network 2 is always tuned up and fitted to the waveforms of the current signals.
I
0.4 h
E e:
0.3
3 1
7
I-
0.1 ........................I. ....................
0.0
I
2
...)(........................
I
-------~-----------*----------I
I
6
4
8
NUMBER OF BITS
INPUT LAYER: 70 UNITS HIDDEN LAYER : 2 UMTS OUTPUT LAYER : 70 UNITS STORING WEIGHT : 8 BITS STORING ORG WAVEFORM : 8 BITS
Figure 6. The root-mean-square error between original and reproduced waveforms with various bit lengths for storing the activation levels of hidden units for several data sets. SEPTEMBER 1990
0.01 ........................ 0.00
....................
x
I 2
1
4
6
8
NUMBER OF BITS
Figure 7. Data compression rates with various bit lengths for storing the activation levels of hidden units for several data sets.
IEEE ENGINEERING IN MEDICINE AND BIOLOGY ~
........................
55
0.5 .................................................
0.09
........................
1
0.4
-?z,
-----------
8
___________4
0.1 -
.......................... X...... ........................................... ;, !L - - - - - - - - - - - * - - - - - - - - - - - * - - - - - - - - - - - 4:
0.0
1
I
0.00
1
4
8
12
I 16
NUMBER OF BITS
Figure 8. The root-mean-square error between original and reproduced waveforms with various bit lengths for storing the interconnecting weights between hidden and output units for several data sets.
Figure 3 shows the data stored on the IC memory. At the start, interconnecting weights { W j k } of Network1 are stored. Then activation levels of hidden units { hj } are stored for every consecutive heart beat. If the error E exceeds a threshold, the original input signal sequence { e t ) is stored instead of { hj } . If the error frequently exceeds the set threshold, then Network1 does not fit the current waveform. In this case, Network2 is copied to Networkl, and new interconnecting weights { Wjk} are stored in the memory. With this procedure, Networkl is sometimes replaced by Network2 in order to fit the current signal. The capability of the network to fit several waveforms depends upon the numbers of hidden units. A network with N hidden units may work well in the case of up to 2N waveform patterns. In Holter recording, there are not this many waveforms at the time. Since the dual network sysrem can follow ECG waveform changes by replacing the network, two hidden units may be enough for Holter monitoring [3]. An experimental study has been performed using the data from the Massachusetts Institute of Technology-Beth Israel Hospital (MIT-BIH) database to estimate performance. Figure 4(a) shows one set of data. It contains abrupt changes of waveform caused by premature ventricular contractions. Figure 4(b) shows the waveform reproduced from the 56
Figure 9. Data compression rates with various bit lengths for storing the interconnecting weights between hidden and output units for several data sets.
activation levels of the hidden units and the interconnecting weights between the hidden and output units. The reproduced waveform is essentially identical to the original. The data stored in IC memory do not require floating point numbers. Fixed point integers are sufficient to reproduce the original waveforms. We have investigated how many bits are needed for storing the data. Figure 5 shows an original waveform and waveforms reproduced with different bit lengths for storing the activation levels of hidden units. As seen, the waveform has been fairly well reproduced with only two bits. We evaluated the errors between original and reproduced waveforms for several data sets in the database. Figure 6 shows the root-mean-square errors between original and reproduced waveforms with various bit lengths for storing activation levels of hidden units for several data sets. While there are not so many differences in error values for these bit lengths, the errors for the two-bit case are a little larger than for the others. Figure 7 shows the data compression rates with various bit lengths for storing activation levels of hidden units for several data sets. The data compression rate is estimated by the following: D,C.R, = no. bits for storing data" no. bits, original data
IEEE ENGINEERING IN MEDICINE AND BIOLOGY
where the interconnecting weights { Wjk}, the activation of hidden units [ hj}, and the original input sequence {et)for an error, E, e5ceeding a threshold, comprise the data . The compression rates of the two-bit cases are worse than for the others. This because the two-bit lengths for storing activation levels are not sufficient to represent features of the waveforms. Therefore, the interconnecting weights of Networkl have frequently been replaced with those of Network2. From these experiments, it has been concluded that four bits is the optimal length for storing activation levels of hidden units. Figure 8 shows the root-mean-square error between original and reproduced waveforms with various bit lengths for storing interconnecting weights between hidden and output units for several data sets. While there are not as many differences of error values for these bit lengths, the errors with four bits are a little larger than for the others. Figure 9 shows the data compression rates with various lengths for storing interconnecting weights between hidden and output units for several data sets. The compression ;rates for the four-bit cases are worse than for the others. This because the four-bit length for storing interconnecting weights between hidden and output units is not enough to reproduce the features of the waveform. Therefore, the interconnecting weights of Network1 are SEPTEMBER 1990
often replaced by those of Network2. From these experiments, it has been concluded that eight bits is the optimal bit length for storing interconnecting weights between the hidden and output units. The final data compression rate of one-fifteenth to one-hundredth have been achieved with a root-mean-square error of 0.1 to 0.5 percent.
Summary A data compression algorithm for Holter recording with artificial neural networks (ANN) is proposed. A dual three-layered (one hidden layer) neural network system that has a few units in the hidden layer is used for this purpose. The network is tuned up with supervised signals that are the same as input signals. The backpropagation is used as the learning algorithm. Network1 is used for data compression and Network2 is always learning with current signals. If the ECG waveform is changed, the neural network is also replaced so that it can follow those changes. Once the network is tuned up, the common waveform features are encoded with the interconnecting weights of the network. The activation levels of the hidden units then express the respective feat u r e s of the w a v e f o r m s f o r e a c h c o n s e c u t i v e heart beat. O r i g i n a l waveforms are reproduced from the activation level of the hidden units and the interconnecting weights. Thus, the interconnecting weights of the network and the activation levels of the hidden units for each consecutive heart beat need only be stored in memory, instead of the entire data sequence. Since the number of hidden layer units is extremely limited, data compression is accomplished by storing the activation levels rather than the original signal. From the experiments using the MITBIH arrhythmia database, it has been concluded that four bits is the optimal length for storing the activation levels of the hidden units. Eight bits is the optimal length for storing the interconnecting weights between hidden and output units. The data compression rate of one-fifteenth to onehundredth has been achieved with an rms error of 0.1 to 0.5 percent. Since Network2 should always learn with current signals, a processing speed of 300 kiloconnections per second (KCPS) for the ANN processor is required. We have developed an ANN accelerator that uses four digital signal processors [4]. Since, for the learning process, this accelerator performs neural network computing at a rate of 2MCPS, 300 KCPS is possible with a single processor system.
Akira Iwata received the B.S. degree in 1973, the M.S. degree in 1975, and the Ph.D. in 1981, all in electrical and elecSEPTEMBER 1990
tronics engineering from the Faculty of Engineering, Nagoya University, Nagoya, Japan. There, he presently is Associate Professor in the Department of Electrical and Computer Engineering. He was an Alexander Humbolt Foundation Research Fellow at Giessen University, Federal Republic of Germany, in 1982-83. His current interests are in the field of signal and image processing, neural network architecture, neuro computing, and applications of neural networks. Professor Iwata can be reached at Nagoya Institute of Technology, Department of Electrical and Computer Engineering, Showa, Nagoya 466, Japan.
Yasunori Nagasaka received the B.S. degree in information engineering from the Nagoya Institute of Technology in 1988. He is presently a graduate student in the Department of Electrical and Computer Engineering. His interests include neural network architecture, neuro computing, and applications of neural networks. Nohuo Suzumura received the B.S. degree in electrical engineering in 1951, and the Ph.D. degree in e l e c t r i c a l and electronics engineering in 1971 from the Faculty of Engineering, Nagoya University. He is currently Professor of Electrical and Computer Engineering at the Nagoya Institute of Technology. Professor Suzumura’s research interests include signal and image processing of biomedical data.
References 1 . Rumelhart DE, Hinton GE and Williams RJ: Learning Representations by Backpropagating Errors. Nature 323:9: 533-536, 1986. 2. Rumelhart DE, Hinton GEand Williams RJ: Learning Internal Representations by Error Propagation. Parallel Distributed Processing Vol 1 , The MIT Press, pp. 318-363, 1986. 3. Iwata A, Nagasaka Y and Suzumura N: A Digital Holter Monitoring System with Dual 3Layer Neural Networks. Proc. of Int. Joint Con5 on Neural Networks, Washington D.C. 2:6974,1989. 4. Iwata A, Yoshida Y, Matsuda S, Sato Y and Suzumura N: An Artificial Neural Network AcceleratorUsing General Purpose 24 Bits Floating Point Digital Signal Processors. Proc. of Int. Joint Conf.on NeuralNehvorks.Washington D.C. 2:171-175, 1989
IEEE ENGINEERING IN MEDICINEAND BIOLOGY
It’s tough to keep up with change. That’s why over 300,000 scientific and engineering professionals belong to The Institute of Electrical and Electronics Engineers, Inc. -the worlds largest transnational technical organization. IEEE. Joinus!
.-------------
FOR A FREE IEEE MEMBERSHIP INFORMATION KIT USE THIS COUPON.
4b
Name Title
0 Phone
Firm Address City
Statfiuntry
postat Code
MAIL TO: IEEE MEMBERSHIP DEVELOPMENT The Institute of Electrical and Electronics Engineers, Inc. 445 Hoes Lane, P.O. Box 1331 Piscataway, N.J. 08855-1331, USA (201) 562-5524
57