scieee AI-readable full text Open interactive document viewer

The EEG signal prediction bz using neural network

Babušiak, Branko

Abstract

The neural network is computational model based on the features abstraction of biological neural systems. The neural networks have many ways of usage in technical field. They have been applied successfully to speech recognition, image analysis and adaptive control, in order to construct software agents or autonomous robots. In this paper is described usage of neural networks for ECG signal prediction. The ECG signal prediction can be used for automated detection of irregular heartbeat – extrasystole. The automated detection system of unexpected abnormalities is also described in this paper.

Full text

342 Advances in Electrical and Electronic Engineering THE ECG SIGNAL PREDICTION BY USING NEURAL NETWORKS B. Babušiak, J. Mohylová Katedra micí a ídicí techniky, Fakulta elektrotechniky a informatiky, VŠB – TU Ostrava T. 17. listopadu 15, 708 33 0strava-Poruba, Czech Republic, e-mail: [email protected] Summary: The neural network is computational model based on the features abstraction of biological neural systems. The neural networks have many ways of usage in technical field. They have been applied successfully to speech recognition, image analysis and adaptive control, in order to construct software agents or autonomous robots. In this paper is described usage of neural networks for ECG signal prediction. The ECG signal prediction can be used for automated detection of irregular heartbeat – extrasystole. The automated detection system of unexpected abnormalities is also described in this paper. 1. INTRODUCTION Neural networks are an efficient, pervasive, and powerful means of computation. The creation of neural networks was inspired by the study of the human brain. Indeed, many aspects of neural networks attempt to emulate biological function, but neural networks do not accurately model biology. Neural networks are pattern classifiers. They do not store "knowledge" in a memory bank. The information is distributed throughout the network and is stored in the form of weighted connections. The most valuable characteristics of neural networks are adaptability and tolerance to noisy data. In general, they are well suited for applications that involve classification of input (e.g., digital image, natural language, and speech processing). Neural networks are not appropriate for problems that require precise, unary answers, such as solving mathematical problems. Neural networks have ability to “learn” itself - change their parameters and structure in order to satisfy requirements. To do this, they must imply feedback which tells how accurately neural network meet its task and according to this fact it will change its parameters. In any case neural network is trying to create its own internal model which imitates real system. This ability adds new excellent feature – the possibility of prediction. The first main difference between neural network and computer program is that neural networks are robust against errors. If computer program contains an error, the system will collapse. Errors or divergences in neural networks don’t lead to collapse in the system. The second difference is that neural networks perform their tasks in parallel, what increase their speed. The parallel processing of signal is typical feature of brain neural networks. 2. NEURON AND TOPOLOGY OF NEURAL NETWORK The basic element of neural network is a neuron. The structure of the neuron is in the Fig. 1. Fig. 1. Model of neuron Neuron consists of following parts: • inputs (dendrites) x • outputs (axons) y • bias θ θθ θ (b) • transfer (activation) function f • synaptic weights w In general neural network has structure which can be described by arbitrary directed graph with vertices (neurons) and directed edges (connections). In neural networks can be recognized following layers: • input layer, in which neurons get information only from external world and outputs often continue to the other neurons • hidden layer, in which neurons get information from other neurons or from external world through bias connections and outputs continue to neural network • output layer has similar features like hidden layer, but outputs end in external world Fig. 2. Structure of feed-forward neural network In addition to this situation we recognize input, hidden and output neurons. input layer hidden layer output layer input values output s ynaptic weights transfer function bias The ECG signal prediction using neural networks 343 In general neural networks can be divided into two basic groups: • Feed-forward neural network. In this network, the information moves in only one direction, forward, from the input nodes, through the hidden nodes (if any) and to the output nodes. There are no cycles or loops in the network. • Recurrent neural network (Fig. 3) is a neural network where the connections between the units form a directed cycle. Recurrent neural networks can also behave chaotically. Usually, dynamical systems theory is used to model and analyse them. Fig. 3. Structure of recurrent neural network 2.1 THE BACKPROPAGATION METHOD Backpropagation, or propagation of error, is a common method of teaching artificial neural networks how to perform a given task. It is a supervised learning method. It requires a teacher that knows, or can calculate, the desired output for any given input. It is the most useful for feed-forward networks (networks that have no feedback, or simply, that have no connections that loop). The term is an abbreviation for "backwards propagation of errors". Backpropagation requires that the transfer function used by the artificial neurons (or "nodes") be differentiable. 3. GENERALLY ABOUT ECG An electrocardiogram (ECG) is a graphic product from an electrocardiograph, which records the electrical activity of the heart over time. An ECG displays the voltage between pairs of the electrodes, and the muscle activity that they measure, from different directions. This display indicates the overall rhythm of the heart, and weaknesses in different parts of the heart muscle. It is the best way to measure and diagnose abnormal rhythms of the heart. The heart activity repeats periodically; therefore, in record are recognized intervals which are similar and repeated (Fig. 4). Each interval consists of a P wave, a QRS complex and a T wave (Fig. 5). Fig. 4. A sample of ECG Fig. 5. Schematic representation of normal ECG 4. PREDICTION OF THE ECG BY USING NEURAL NETWORKS Let us consider that “healthy” ECG record consists of periodically repeated intervals. Then it is possible to predict the following sample of the digitalised ECG record when a few previous samples are known. To estimate next time sample is possible to use the neural network. Realization of this task is performed in MATLAB environment. The neural network will be designed and simulated over the signal displayed in the Fig. 6. Fig. 6. ECG signal (length 8 second, sampling frequency 128 Hz) At first it is needed to extract suitable training signal from the whole signal. As it is seen in Fig. 6, signal has fluctuating (sinusoidal) progress. For that reason the training signal (set) have to be part of the whole signal which includes at least one period of mentioned sine wave (Fig. 7). A training signal consists of 640 samples and sampling frequency is also 128 Hz. 344 Advances in Electrical and Electronic Engineering Fig. 7. Training signal for neural network Now, let us try to create neural network which is able to estimate next sample if previous five samples are known. To solving this problem are used two different types of neural network – the linear layer with one neuron and multi-layered backpropagation neural network. The linear layer with one neuron is shown on the Fig. 8. Transfer function is linear. It is very important to create correct matrix of inputs P and vector of expected outputs T. Each column of the matrix P stands for five consecutive samples (dimension P is [5x640]). T is a row vector with 640 expected outputs (following sample after five samples in P). Fig. 8. Linear layer with one neuron After training process for each possibility from the training signal we can try to verify functionality of the designed neural network. To verify, we use the part of signal which wasn’t included in training signal. Consequently neural network will be working with signal which is new and unknown. The result is displayed in the Fig. 9. Fig. 9. Difference between estimated (by linear layer) and original signal Now, let us create the backpropagation neural network with three layers (Fig. 10). A network has three neurons in first layer, two neurons in second (hidden) layer and one neuron in last layer. In all layers is used log-sigmoid transfer function (logsig). The learning rate has value 0, 05 and tolerable error is 5.10 -4 . For weights w and bias b was use training function trainlm, which is based on LevenbergMarquardt optimalization. Designed network was applied to the same signal like in the previous case. The result is again shown in the Fig. 11. Fig. 10. Three-layered neural network. Transfer function on the right. Fig. 11. Difference between estimated (by backpropagation network) and original signal In this case the backpropagation network achieves better precision as in the first case. Otherwise time for training process is much longer, but this fact is irrelevant. 5. AUTOMATED DETECTION SYSTEM The three-layered neural network is used for the automated detection system as was described before. Let us assume that a few-hours record is available. Because of very long time of recording ECG activity, this record contains many abnormalities (bad electrode contact, extrasystoles,…). A shorttime part with negative peak is shown in the Fig. 13 B. In the training process is very important to use long enough part of record without any abnormalities (Fig. 13 A). After successful training process, the signal in the Fig. 13 B is used for this neural network. The output signal from the neural network is displayed in Fig. 13 C in comparison with real signal. If difference between these two signals is computed we get result graphically represented in the Fig. 13 D. When we set appropriate difference boundary then we can detect any abnormality if boundary is overpassed. This automated detection system can be used in two ways: • Offline – abnormality detecting and marking in record with long-time duration • Online – because estimation of new sample is very fast (17,7 µs – mobile Intel Core 2 Duo 1.50 GHz) it allow to use this system in online applications (e.g. for monitoring patients in the hospitals) The ECG signal prediction using neural networks 345 Fig. 13. System for abnormality detection. A-training signal; B -signal with abnormality (test signal); C - comparison of estimated and real signal; D - difference between estimated and real signal 6. CONCLUSION The designed system for abnormality detection can be improved by another choice of network type, changing number of neurons and transfer function type or changing of algorithm in training process. These changes require much experimental verifications and of course, time. REFERENCES [1] SINÁK, P., ANDREJKOVÁ, G.: Neurónové siete I. (inžiniersky prístup), ELFA Press, Košice, 1996. [2] SINÁK, P., ANDREJKOVÁ, G.: Neurónové siete II. (inžiniersky prístup), ELFA Press, Košice, 1996. [3] VONDRÁK, I.: Umlá inteligence a neurónové sít. Katedra informatiky, FEI, VŠB – TU Ostrava, 2002. [4] MATLAB Neural Network Toolbox: http://www.mathworks.com/access/helpdesk/he lp/toolbox/nnet [5] Wikipedia, the free encyclopedia: http://www.wikipedia.org [6] Neural network: http://gseacademic.harvard.edu/~elsheish [7] MOHYLOVÁ, J., KRAJA, V.: Zpracování signál v lékaství, Žilinská Univerzita v Žiline, 2004 [8] JAVORKA, K.: Lekárska fyziológia, Osveta, Martin, 2001