Systematic Analysis and Classification of Cardiac Rate Variability using Artificial Neural Network

—Electrocardiogram (ECG) is acquisition of electrical activity signals in cardiology. It contains important information about the condition and diseases of heart. An ECG wave, pattern, size, shape and the time interval between different peaks of P-QRS-T wave provide useful information about the diseases which afflict heart. Heart rate signals vary and this variation contains important indicators of cardiac diseases. To assess autonomic nervous system, heart rate variability is popular and non-invasive tool. These indicators contained in ECG wave appear all the day or occur randomly in the day. So, computer based information is much useful over day long interval to diagnose heart disease. Thus, this paper deals with classification of heart diseases on the basis of heart rate variability using artificial neural network. Feed forward neural network is considered to be almost correct 85% of the test results.


INTRODUCTION
Electrocardiogram (ECG) is the study of electric activities coming from the heart through cardiac muscles.An ECG records the electric potential, its origin and propagation through cardiac muscles.For cardiac physiology, ECG is the representative signal [1].The ECG in cardiac physiology plays the role of finger print for cardiac state.A useful way to understand the state and the health of heart is using electrocardiogram (ECG).An ECG defines the measurement of the electric activity of the heart [2].A small electric impulse is produced when a heart beats.These impulses move in cardiac muscles when a heart contracts.So, ECG is responsible to detect these impulses.The ECG test has no pain and harm and that it does not put any extra activities on subject body.A healthy heart does not beat regularly it depends upon many factors like exercise, physical and mental stress [3].R-R interval gets changed even in rest around its mean value [4].

A. Heart Rate Variability
Heart rate variability measures variation of time interval between two consecutive intervals of time.Heart rate variability is non-invasive marker which is used to measure sympathy-vagal activities.Heart rate variability is also used to measure beat-to-beat variation of two consecutive R-R intervals.

B. Structure
An ECG consists of wires, electrodes and a reading machine.Fig. 1.Electrodes are connected to arms, legs and chest of the patients, the wires from the electrodes are connected with ECG.The machine records electric impulses coming from the heart through the cardiac muscles.The recorded beat is shown on the screen or paper strip.The ECG wave pattern determines the condition of heart [5].To have proper diagnosis, it requires several hours, using ECG and heart rate variability.
For clinical diagnosis, doctors often ask the patient to perform number of tests for the diagnosis of disease.It was observed that the tests results did not lead to effective diagnosis of the disease.So, the classification approach of neural network is useful to classify the diseases in different classes.Thus, Neural Network approach for diagnosing heart diseases is more feasible, faster and accurate.
Artificial neural network is a mathematical model, inspired from human brain; it models human brain, functioning and activation.Thus, it is very useful in classification and pattern recognition.In recent years, ANN has produced accurate results in medical field like in lungs cancer, heart diseases and also in other fields like weather forecasting, marketing, stock markets and computer sciences.
In section II, a review of the literature is presented, while section III contains the Methodology adopted for this work.Section IV is about the result and discussion and then finally we conclude in section V.

II. LITERATURE REVIEW
An artificial neural network which interconnects artificial neurons in a network is an inspiration of biological neurons with a task to classify information in different classes.The natural neurons and natural neural network system are considered imaginary while modeling ANNs.ANNs consist of inputs, hidden layers, outputs, sigmoid function, synaptic weights, and perceptron.These perceptrons are basically responsible to transfer information.ANN has many advantages as compared to conventional computers.An ANN is an experienced learning processing function which learns from experiences.ANN is used for classification of data in different classes; it puts information into its weights.
The heart rate is the study of variations of R-R interval in time [6].The rhythms of healthy heart are not same.It depends on many factors; if someone is exercising its heart beats fast as compared to beating in normal conditions.Also heart beat depends on physical and mental stress.So the interval between normal sinus beats varies in normal condition.One of the world"s most important and unsolved problems is sudden cardiac death [7].
The process of respiration, blood pressure, regulation, thermoregulation, circadian rhythms and other factors are the main sources of heart rate variability.
Basically the heart rate variability can be measured using two methods

A. Time Domain B. Frequency Domain
Time domain measures the "total variability occurred in heart rhythms" while frequency domain states the "the underlying rhythms" [8].
An ECG consists of many significant points to state the condition of a heart.To analyze the heart state, spectral analysis is of great importance [9].An ECG consists of important points when afflicting the heart.It has different results in different interval of time.Sometimes it is not able to show the symptoms of the diseases.For proper diagnosis, ECG and HRV may require several hours which is time consuming and there is a chance of missing of important points, because of large data and excess of information volume.The HRV is measured between the R-R intervals of PQRST waves.The useful frequencies measured by ECG often lies between 40Hz.While plotting HRV, we draw heart variability against time axis.In this paper we classify the heart diseases by artificial neural network into four classes and the heart rate variability (HRV) as base signal.Two parameters obtained from heart rate signals were used for the required classification.

III. METHODOLOGY
The data for the proposed study was collected from "Civil hospital" and "BMC hospital Quetta".The collected data contained 500 ECG papers of four different kinds of heart diseases (normal ECG, left bundle branch block, complete heart block, ischemic and sick sinus syndrome).The heart diseases in this paper are classified by artificial neural network and back propagation algorithm as methodology classifies using heart rate variability as base signals.

A. Neural Network Classifier
Artificial Neural network is basically a mathematical concept which is used to model the human brain.As the name suggests, the neural network is an inspiration of human brain.The study of human brain has been an interesting phenomenon in every time for human itself.The development and advancement in modern electronics have a natural effect to develop a machine which could work like human brain.ANN is used to solve many problems and multilayer perceptron is used for solution of problems and modeling [10].When we model ANN the structure of biological neuron is very abstracted [11].To predict a disease is one of the most interesting and challenging phenomena for modern world [12].ANN is one of the powerful subjects for predicting and forecasting [13].ANN is also used to identify cancer cells and the best cure of cancer is to identify cancer cells in its early stage [14].ANN has many useful applications in medicines [15].A biological brain contains billion of cells of different type and length [16].
Artificial Neural Network (ANN) is an attempt to develop an artificial network system that could work like human brain.As in biological neurons, a highly interconnected network of neurons performs the task of processing information from one place to another.In the same way ANN is also working in parallel to process the information.For weather forecasting ANN has much accurate results [17].ANN is very useful in areas such as pattern recognition and classification.In ANN, input of the network determines activation of the function that determines if the function has an output or not.This is the result of total aggregate of total input given to the system.Physicians make decisions on the tests related to the diseases or on the conditions observed on patients earlier [18].www.ijacsa.thesai.orgANN has self-learning capabilities that enables it to produce better results.The more it is trained the more it can produce correct results.
The problems that has no algorithmic solution, ANN is very useful to solve those problems.An ANN is very useful for the phenomena like predictions, pattern recognitions, image analysis and medical diagnosis.A layer in ANN is the subgroup of processing elements.The ANN consists of two or more than two layers.The first layer which receives input from some source is called input layer, while the last layer which is dependent of the input layer and the layers lying between input and output layers are called hidden layers.
The structure of ANN is parallel, if some element of the ANN fails to function then it does not affect the whole system of perceptron and it has ability to learn from experience.The input data given to the system is classified into accurate and fair classifications.The information received from inputs are stored in connection weights (synapse) which makes decisions on total aggregate.It has a result when comparing the output with a threshold.When the output value is greater than threshold than the function is activated and the mentioned function is not activated when output value is less than threshold value.ANN has different number of layers in different situations.ANN may have only feedback or feed forward structure for the classification of data.ANN is the network from which we can configure an output of our desire.Multilayer perceptron feed forward neural network with the back propagation algorithm and multilayer is a supervised learning process.In this process the desired output is trained and the input data is transformed into desired output.The linear combination of weights and inputs can be calculated as In summation form it can be written as Where is n-number of inputs and are the corresponding weights.
An ANN contains input layer, one or more than one hidden layers and an output layer.A multilayer network with the neuron with t iterations having actual output y and desired output d with an error "e" is given by And the sigmoid function is given by Fig. 2. (3)

Fig. 2. Sigmoid Function
To the input layer, data is given in the form of numbers.The hidden layers process the data with the help of an activation function, Fig. 3. and in this way the data is forwarded to output layer.The hidden layer and output layer b k can be calculated as =∑ + ) ( 4) Where and are the weights of connection and and are called biases terms.And partial derivative of total error can be calculated as Where μ is the learning rate, its value is 0.9 and is the weight from neuron j to neuron k.
Input layer receives data through nodes or units, the subsequent layers process the data with the help of an activation function.The output layer consists of four neurons.The network has the ability to identify only four outputs.i.e. (0001, 0010, 0100, 1000) decoded in binary number system.

B. Back Propagation
It is the method in which input data are fed from input layer to hidden layer, from hidden layer to output layer and then from output layer to input layer through hidden layers, in the form of adjusted weights.Initially, the weights are assigned random numbers and then modified to minimize the error.The weights are updated from output layer towards input layer.www.ijacsa.thesai.org

C. Diseases Classification using ANN
For the current paper we classify the heart diseases into four classes as The ANN was used to classify the input data in different classes feed by Spectral entropy and Poincare plot geometry.

D. Spectral entropy
The variation in time interval between R-R peaks of an ECG is referred as heart rate variability (HRV) [19].Spectral entropy determines the complex form of time series.The Fourier transformation is one of the basic tool to transform time domain into frequency domain and determines the power of heart rate at the given frequency f.Fourier transformation converts time domain into frequency domain [20].It expresses the power as function of frequency f.The spectral entropy H is given by H = ∑ log ( ) Here is the power density function at frequency f and 0

E. Poincar ́ Plot Geometry
Poincare plot geometry is consisting of R-R intervals of an ECG.Fig. 4. It represents the ( ) intervals at the co-ordinate axis and each point on the co-ordinate axis are corresponding to two consecutive intervals of time recorded at ECG [21].The cloud of points can be determined by its length which is parallel to the identity line y = x and its breadth can be determined by across the line .
And are the short and long term heart rate variability respectively, Fig. 5.

The expression
⁄ gives the relation between these components [22].

IV. RESULTS AND DISCUSSION
An ECG wave pattern consists of important information about the condition of heart.Different shape and size of an ECG wave with different time interval between different peaks provide significant information like whether the heart is healthy or not.To study pinpoint cardiovascular disease in large quantities of data consisted on several hours is time consuming and sometimes there is chance for misreading of important points about diseases contained in ECG wave.So computer based technology is very useful in predicting and diagnosing disease.A well trained and well-designed neural network is used to predict and classify cardiac diseases into four different classes as shown in the table 1. Multilayer neural network with input set of data derived the results related to non-linear parameter of heart diseases by increasing the number of hidden layers.The more hidden layers we have the less mean square error we obtain.Precisely by increasing the number of hidden layers we can successfully train neural network and an accurate prediction about classification is possible.The classification of cardiovascular diseases by back propagation algorithm feed by input data (spectral entropy and Poincare plot geometry) is predicted in table 1.To have better predictions about diseases the algorithm was trained and weights were modified and updated.This research is going to be a pioneer one in application of Artificial Intelligence particularly the Artificial Neural Network in classification of heart diseases.This area of the subject is not much studied by the researchers.So, this research is a kind of corridor that opens the new avenues to further studies in the application of ANN especially in the diagnosis and classification of heart diseases.The artificial neural network classifier is the new human brain inspired mathematical modeling having very useful results in medical while diagnosing diseases and their classifications.It enhances the patient abilities in diagnosing diseases.To predict disease with certainty and accuracy rate of 100% is not possible yet.The accuracy rate depends on many factors including input data"s size and quality of training data and parameters selected for input data.So the results evaluated in table 1 by back propagation is effective the range of 80-85%.

TABLE I .
RANGE FOR INPUT DATA FOR ANN FOR CLASSIFICATION