Neural Network ECG

4
  Journal of A pplied Comp uter Scienc e, no.1 (2) /2 008, Sucea va 1843-1046 / 1 (2) /2008  © JACS  24  Interpretation of ECG Signal with a Multi-Layer  Neural Network D. Ostafe Ştefan cel Mare University of Suceava, Romania [email protected]  Abstract - In this article there are introduced the results obtained in the interpretation of the components of a biomedical signal, ECG, by using a multi-layer neural network, using the backpropagation algorithm. The neural network was simulated with the Neuroshell2.0 program. The new obtained network was used within the program of automate diagnosing of the ECG.  Keywords: ECG, neural network, hidden layer, backpropagation, P waves The ECG signal represents the electrical activity of a heart, is a periodical and analogical signal, and a full cycle of the signal represents a heart contraction. The electrocardiogram is using for the heart diseases diagnose,  being a non-invasive method of exploration [1]. The electrocardiogram corresponding of a fully heart cycle is  present in figure 1. Fig.1 Electrocardio gram The difference between a normal ECG and a pathological one, depends of the change of several features of the components of the ECG signal. In the following table there are shown the normal values of the components of the ECG signal, value that we shall use to diagnose the ECG signal with a neural network. Denomi nation  Normal duration Amplitudi ne normală Aspect P wave 0,06 0,10 seconds 0,10 – 0,25 mV Rounded, positive or negative direction QRS complex 0,08 – 0,10 seconds 1 –1,5 mV Single phase, two-phase or three-phase T wave QT 0,30 – 0,40 seconds 1/3 amplitude QRS Positive direction in most of the deviations In an electrocardiogram there can be noticed several characteristic sectors[1], the P wave, the QRS complex and the T wave. Also, it is noticed that the R peak is always the  point in which the signal reaches the maximum amplitudine, as it is shown in figure 2. Fig. 2 Main components of an ECG signal This property will be used for dividing the ECG signal in sectors. In fact, the difference between a normal ECG and a  pathological one consists in changing certain of the components of the ECG signal. The first phase in  processing the ECG signals consists in extracting the highly important information from a signal recording, meaning to find the three components: the P wave, the QRS complex and the T wave. Each of these three components has own features and forms A neural network will process each of the extracted components. Each of the

Transcript of Neural Network ECG

7/21/2019 Neural Network ECG

http://slidepdf.com/reader/full/neural-network-ecg 1/4

 Journal of Applied Computer Science, no.1 (2) /2008, Suceava

1843-1046 / 1 (2) /2008  © JACS  24

 

Interpretation of ECG Signal with a Multi-Layer

 Neural Network

D. OstafeŞtefan cel Mare University of Suceava, Romania

[email protected]

 Abstract - In this article there are introduced the results

obtained in the interpretation of the components of a

biomedical signal, ECG, by using a multi-layer neural

network, using the backpropagation algorithm. The neural

network was simulated with the Neuroshell2.0 program. The

new obtained network was used within the program of

automate diagnosing of the ECG. 

 Keywords:  ECG, neural network, hidden layer,

backpropagation, P waves

The ECG signal represents the electrical activity of aheart, is a periodical and analogical signal, and a full cycle

of the signal represents a heart contraction. Theelectrocardiogram is using for the heart diseases diagnose, being a non-invasive method of exploration [1]. Theelectrocardiogram corresponding of a fully heart cycle is present in figure 1.

Fig.1 Electrocardiogram

The difference between a normal ECG and a pathologicalone, depends of the change of several features of thecomponents of the ECG signal. In the following table thereare shown the normal values of the components of the ECG

signal, value that we shall use to diagnose the ECG signalwith a neural network.

Denomination

 Normalduration

Amplitudine

normală 

Aspect

P wave 0,06 –0,10

seconds

0,10 –0,25 mV Rounded, positiveor negative

direction

QRScomplex

0,08 –0,10

seconds

1 –1,5 mV Single phase,two-phase or

three-phase

T wave QT –

0,30 –0,40

seconds

1/3

amplitudeQRS

Positive direction

in most of thedeviations

In an electrocardiogram there can be noticed severalcharacteristic sectors[1], the P wave, the QRS complex and

the T wave. Also, it is noticed that the R peak is always the

 point in which the signal reaches the maximumamplitudine, as it is shown in figure 2.

Fig. 2 Main components of an ECG signal

This property will be used for dividing the ECG signal insectors. In fact, the difference between a normal ECG and a pathological one consists in changing certain of thecomponents of the ECG signal. The first phase in processing the ECG signals consists in extracting thehighly important information from a signal recording,

meaning to find the three components: the P wave, theQRS complex and the T wave. Each of these threecomponents has own features and forms A neural networkwill process each of the extracted components. Each of the

7/21/2019 Neural Network ECG

http://slidepdf.com/reader/full/neural-network-ecg 2/4

 Journal of Applied Computer Science, no.1 (2) /2008, Suceava

1843-1046 / 1 (2) /2008  © JACS  25

three components consists of a certain number of samples-the input data in the neural network. As output we shall anumber that will classify each of three components invarious categories.

Thus, we have the following table:

Component Property Output value

P wave Normal 10 : 29

Mitral 30 : 39

Isoelectric 0 : 9

QRS complex Q greater than 0,40 s 10 : 19

S wide and deep 30 : 39

S great in comparisonwith R

40 : 49

Under-denivelation ST 20 : 29

 Normal 0 : 9

T wave Tall and pointed 10 : 19

 Normal 0 : 9

As it comes out from the table, to each of the features of

component corresponds a certain value in an interval.These values along other few information were used asinputs in a neural network for the ECG signal diagnostic.

For the analysis of these three components it was used aneural network, that were simulated with the Neuroshell2.0 program. Each of the three neural networks has a set ofsampled as input. As output, a number. Here is the number

of samples required by each component in order to be processed [2]:

•  the P wave needs 25 samples

•  the QRS complex needs 31 samples

•  the T wave needs 71 samples

As it was mentioned above, each of the components of

the ECG signal are processed by a neural network. Weshall have three neural networks, one for each component,

 because the ECG signal consists of three components (theP wave, the QRS complex and the T wave). Theconfiguration of the three networks coresponds to themulti-layer type, with a single hidden layer.The differences

 between the three networks consist in the number ofneurons from input and hidden layer. Here are the number

of neurons in each layer, that correspond to eachcomponent [3]:

For the P wave•  the input layer 25 neurons

•  a hidden layer with 18 neurons

•  the output layer 1 neuron

For the QRS complex

•  the input layer 31 neurons

•  a hidden layer with 24 neurons

•  the output layer 1 neuron

For the T wave

•  the input layer 71 neurons

• 

a hidden layer with 42 neurons•  the output layer 1 neuron

For the input layer the neurons are integers, and theactivation function is a linear function with values varying between [-1,1], and for the hidden and output layers it waschosen the function of logistic activation.

In this application, there were used two types of neuronal

networks with a single hidden layer. A neuronal network

with a single hidden layer has the configuration as in figure3.

Fig. 3 Neural network with a single hidden layer

And a neural network with a single hidden layer, divided inthree sub-layer

Fig.4 Neural network with a single hidden layer, divided in three

sub-layer

The hidden layer was divided in three individual groups,each of them having in their componence the same number

of neurons (6 neurons for the P wave, 8 neurons for theQRS complex and 14 neurons for the T wave). Thefunctions of the neurons activation in these groups are

different:

•  the gaussian function for the first plate

•  the hyberbolic tangential function for the second plate

•  the complementary gaussian for plate 3

These three function, along the fact the hidden layer wassplit in three enable a faster detection of various events inthe recognition process of the specific paths for the the

three components of the ECG signal. The three plate willsucceed various interpretations of the information. Thecombinations between the three outputs of the plates will

7/21/2019 Neural Network ECG

http://slidepdf.com/reader/full/neural-network-ecg 3/4

 Journal of Applied Computer Science, no.1 (2) /2008, Suceava

1843-1046 / 1 (2) /2008  © JACS  26

represent inputs for the output layer. The function ofneurons activation from the output layer is the logisticfunction. The networks were created with the help of the Neuroshell program.

For network training it was used a set of 100 pairs of

input vector – output vector. The learning was stopped

when the error calculated between the expected output andthe network’s answer were small then 0,00001.

In figure 5 it is presented the value of the sample withnumber 8, for the P wave, along the 100 input pattern.

Fig.5 Amount of sample no.8 for the P wave

The experimental results for the neural network with asingle hidden layer divided in three sub-layers.

In figure 6 it is introduced the wanted output and thatobtain for the P wave and the error signal.

Fig. 6 The wanted P wave, the obtain P wave, error

In the following table there are listed the results obtainedwith the neuroshell program for the P wave:

Output:

R squared: 0,9942

r squared: 0,9943

Mean squared error: 0,328Mean absolute error: 0,239

Min. absolute error: 0

Max. absolute error: 3,65

Correlation coefficient r: 0,9971

Percent within 5%: 87

Percent within 5% to 10%: 8

Percent within 10% to 20%: 2

Percent within 20% to 30%: 0

Percent over 30%: 1

 In figure 7 it is introduced the error of the neural network

for the P wave:

Fig. 7 Error for the p wave

Results for the QRS complex

Output:

R squared: 0,9976

r squared: 0,9976

Mean squared error: 0,411

Mean absolute error: 0,141

Min. absolute error: 0

Max. absolute error: 3,559

Correlation coefficient r: 0,9988

Percent within 5%: 95

Percent within 5% to 10%: 0

Percent within 10% to 20%: 3,333

Percent within 20% to 30%: 0

Percent over 30%: 0

 

7/21/2019 Neural Network ECG

http://slidepdf.com/reader/full/neural-network-ecg 4/4

 Journal of Applied Computer Science, no.1 (2) /2008, Suceava

1843-1046 / 1 (2) /2008  © JACS  27

 

Fig.8 Error for the QRS complexResults for the T wave

Output:

R squared: 0,9087

r squared: 0,9536

Mean squared error: 1,825

Mean absolute error: 0,531

Min. absolute error: 0,003

Max. absolute error: 7,113

Correlation coefficient r: 0,9765

Percent within 5%: 31

Percent within 5% to 10%: 23

Percent within 10% to 20%: 26

Percent within 20% to 30%: 7

Percent over 30%: 12

 

Fig. 9 Error for the T wave

Output:

R squared: 0,965

r squared: 0,9668

Mean squared error: 1,97

Mean absolute error: 0,368

Min. absolute error: 0

Max. absolute error: 11

 

Correlation coefficient r: 0,9833

Percent within 5%: 87

Percent within 5% to 10%: 7

Percent within 10% to 20%: 2

Percent within 20% to 30%: 0

Percent over 30%: 2

 

In figure 10 it is present the error for the P wave for aneural network with a single hidden layer.

Fig. 10 Error for the P wave

We present the results for the P wave only, for the othercomponents of ECG signal, the QRS complex and the T wave

apply the conclusion drawn from the analysis of the P wave.

CONCLUSIONS

As it comes out from the error graphics for the P wave, theneuronal networks with a hidden layer divided in three sub-layer,

each of them with different functions of activation, behaves betterthan a neuronal network with a single hidden layer with a singlefunction of activation.

R EFERENCES: 

[1] Dale Dubin, M.D., Informatică Medical ă , Interpretarea Rapid ă a ECG, Editura Medicală, Bucureşti, 1983;[2] Sămpleanu M., Circuite pentru conversia datelor ,

Editura tehnică, Bucureşti, 1980;[3] Ward Systems Group Inc.,  NeuroShell2, Ed. Ward

Systems Group, 1999.