ECG Rhythm Analysis by Using Neuro-Genetic Algorithms

Similar documents
ECG Signal Analysis for Abnormality Detection in the Heart beat

Assessment of Reliability of Hamilton-Tompkins Algorithm to ECG Parameter Detection

Testing the Accuracy of ECG Captured by Cronovo through Comparison of ECG Recording to a Standard 12-Lead ECG Recording Device

ECG Beat Recognition using Principal Components Analysis and Artificial Neural Network

ISSN: ISO 9001:2008 Certified International Journal of Engineering and Innovative Technology (IJEIT) Volume 2, Issue 10, April 2013

Keywords: Adaptive Neuro-Fuzzy Interface System (ANFIS), Electrocardiogram (ECG), Fuzzy logic, MIT-BHI database.

A Review on Arrhythmia Detection Using ECG Signal

CHAPTER 5 WAVELET BASED DETECTION OF VENTRICULAR ARRHYTHMIAS WITH NEURAL NETWORK CLASSIFIER

Analysis of Fetal Stress Developed from Mother Stress and Classification of ECG Signals

IJRIM Volume 1, Issue 2 (June, 2011) (ISSN ) ECG FEATURE EXTRACTION FOR CLASSIFICATION OF ARRHYTHMIA. Abstract

SPECTRAL ANALYSIS OF LIFE-THREATENING CARDIAC ARRHYTHMIAS

Wavelet Neural Network for Classification of Bundle Branch Blocks

PERFORMANCE CALCULATION OF WAVELET TRANSFORMS FOR REMOVAL OF BASELINE WANDER FROM ECG

An ECG Beat Classification Using Adaptive Neuro- Fuzzy Inference System

Vital Responder: Real-time Health Monitoring of First- Responders

Performance Identification of Different Heart Diseases Based On Neural Network Classification

Neural Network based Heart Arrhythmia Detection and Classification from ECG Signal

HST-582J/6.555J/16.456J-Biomedical Signal and Image Processing-Spring Laboratory Project 1 The Electrocardiogram

Temporal Analysis and Remote Monitoring of ECG Signal

Extraction of Unwanted Noise in Electrocardiogram (ECG) Signals Using Discrete Wavelet Transformation

POWER EFFICIENT PROCESSOR FOR PREDICTING VENTRICULAR ARRHYTHMIA BASED ON ECG

Comparison of ANN and Fuzzy logic based Bradycardia and Tachycardia Arrhythmia detection using ECG signal

ECG Signal Characterization and Correlation To Heart Abnormalities

DIFFERENCE-BASED PARAMETER SET FOR LOCAL HEARTBEAT CLASSIFICATION: RANKING OF THE PARAMETERS

Comparison of Different ECG Signals on MATLAB

Automatic Detection of Heart Disease Using Discreet Wavelet Transform and Artificial Neural Network

CARDIAC ARRYTHMIA CLASSIFICATION BY NEURONAL NETWORKS (MLP)

REVIEW ON ARRHYTHMIA DETECTION USING SIGNAL PROCESSING

CLASSIFICATION OF CARDIAC SIGNALS USING TIME DOMAIN METHODS

Robust system for patient specific classification of ECG signal using PCA and Neural Network

ECG interpretation basics

Genetic Algorithm based Feature Extraction for ECG Signal Classification using Neural Network

SSRG International Journal of Medical Science ( SSRG IJMS ) Volume 4 Issue 1 January 2017

UNDERSTANDING YOUR ECG: A REVIEW

Quick detection of QRS complexes and R-waves using a wavelet transform and K-means clustering

DISEASE CLASSIFICATION USING ECG SIGNAL BASED ON PCA FEATURE ALONG WITH GA & ANN CLASSIFIER

Biomedical. Measurement and Design ELEC4623. Lectures 15 and 16 Statistical Algorithms for Automated Signal Detection and Analysis

Developing Electrocardiogram Mathematical Model for Cardiovascular Pathological Conditions and Cardiac Arrhythmia

ECG SIGNAL PROCESSING USING BPNN & GLOBAL THRESHOLDING METHOD

Fuzzy Based Early Detection of Myocardial Ischemia Using Wavelets

Removal of Baseline wander and detection of QRS complex using wavelets

MORPHOLOGICAL CHARACTERIZATION OF ECG SIGNAL ABNORMALITIES: A NEW APPROACH

Wavelet Decomposition for Detection and Classification of Critical ECG Arrhythmias

Heart Rate Calculation by Detection of R Peak

LABVIEW based expert system for Detection of heart abnormalities

Delineation of QRS-complex, P and T-wave in 12-lead ECG

A MULTI-STAGE NEURAL NETWORK CLASSIFIER FOR ECG EVENTS

AUTOMATIC ANALYSIS AND VISUALIZATION OF MULTILEAD LONG-TERM ECG RECORDINGS

An Enhanced Approach on ECG Data Analysis using Improvised Genetic Algorithm

Electrocardiography for Healthcare Professionals

Keywords : Neural Pattern Recognition Tool (nprtool), Electrocardiogram (ECG), MIT-BIH database,. Atrial Fibrillation, Malignant Ventricular

Basic Dysrhythmia Interpretation

DETECTION OF HEART ABNORMALITIES USING LABVIEW

Automatic Detection of Abnormalities in ECG Signals : A MATLAB Study

Simulation Based R-peak and QRS complex detection in ECG Signal

Signal Processing of Stress Test ECG Using MATLAB

Enhancement of Twins Fetal ECG Signal Extraction Based on Hybrid Blind Extraction Techniques

This presentation will deal with the basics of ECG description as well as the physiological basics of

AUTOMATIC CLASSIFICATION OF HEARTBEATS

IDENTIFICATION OF NORMAL AND ABNORMAL ECG USING NEURAL NETWORK

CHAPTER IV PREPROCESSING & FEATURE EXTRACTION IN ECG SIGNALS

Automated Diagnosis of Cardiac Health

Artificial Neural Networks in Cardiology - ECG Wave Analysis and Diagnosis Using Backpropagation Neural Networks

SPPS: STACHOSTIC PREDICTION PATTERN CLASSIFICATION SET BASED MINING TECHNIQUES FOR ECG SIGNAL ANALYSIS

ECG DE-NOISING TECHNIQUES FOR DETECTION OF ARRHYTHMIA

3/26/15 HTEC 91. EKG Sign-in Book. The Cardiac Cycle. Parts of the ECG. Waves. Waves. Review of protocol Review of placement of chest leads (V1, V2)

Detection and Classification of QRS and ST segment using WNN

Real-time Heart Monitoring and ECG Signal Processing

Mining of an electrocardiogram

A RECOGNITION OF ECG ARRHYTHMIAS USING ARTIFICIAL NEURAL NETWORKS

Available online at ScienceDirect. Procedia Technology 24 (2016 )

Various Methods To Detect Respiration Rate From ECG Using LabVIEW

Removing ECG Artifact from the Surface EMG Signal Using Adaptive Subtraction Technique

The Electrocardiogram

Electrocardiography Biomedical Engineering Kaj-Åge Henneberg

Heart Abnormality Detection Technique using PPG Signal

Separation of fetal electrocardiography (ECG) from composite ECG using adaptive linear neural network for fetal monitoring

ECG Generation using AFG with Arrhythmia. Detection and Analysis

ECG ABNORMALITIES D R. T AM A R A AL Q U D AH

5- The normal electrocardiogram (ECG)

ECG. Prepared by: Dr.Fatima Daoud Reference: Guyton and Hall Textbook of Medical Physiology,12 th edition Chapters: 11,12,13

Classification of ECG Data for Predictive Analysis to Assist in Medical Decisions.

Advanced Methods and Tools for ECG Data Analysis

Removal of Baseline Wander from Ecg Signals Using Cosine Window Based Fir Digital Filter

Study and Design of a Shannon-Energy-Envelope based Phonocardiogram Peak Spacing Analysis for Estimating Arrhythmic Heart-Beat

Lung Cancer Diagnosis from CT Images Using Fuzzy Inference System

ECG signal analysis for detection of Heart Rate and Ischemic Episodes

Extraction of P wave and T wave in Electrocardiogram using Wavelet Transform

II. NORMAL ECG WAVEFORM

Deep Learning-based Detection of Periodic Abnormal Waves in ECG Data

PCA Enhanced Kalman Filter for ECG Denoising

Electrocardiography for Healthcare Professionals

CHAPTER 6 INTERFERENCE CANCELLATION IN EEG SIGNAL

Electrocardiography I Laboratory

2017 BDKA Review. Regularity Rate P waves PRI QRS Interpretation. Regularity Rate P waves PRI QRS Interpretation 1/1/2017

Lab Activity 24 EKG. Portland Community College BI 232

INTERNATIONAL JOURNAL OF ELECTRONICS AND COMMUNICATION ENGINEERING & TECHNOLOGY (IJECET)

International Journal of Advanced Research in Computer Science and Software Engineering

Diploma in Electrocardiography

Assessment of the Performance of the Adaptive Thresholding Algorithm for QRS Detection with the Use of AHA Database

Transcription:

MASAUM Journal of Basic and Applied Sciences, Vol. 1, No. 3, October 2009 522 ECG Rhythm Analysis by Using Neuro-Genetic Algorithms Safaa S. Omran, S.M.R. Taha, and Nassr Ali Awadh Abstract The heart is one of the most important organs in the human body, it is like a pump pumping the blood to the entire body. The walls of the heart contain myocardial tissues which contract to push the blood through the body. This contract occurs because of passing electrical current in the heart muscle. Many diseases may infect the heart and cause death if the diagnose of this disease is late. The electrical current can be captured and analyzed to diagnose the heart state. This operation is done by using electrocardiograph (ECG) device, this device captures the electrical signal, filters it from noise signals, and amplifies it. Then it displays the signal on the screen or prints it on the trace paper then the doctor interprets the ECG signal to diagnose the disease. Artificial intelligent (AI) to process and analyze the ECG signal to diagnose the heart disease directly and display detailed report about the heart state by using the artificial neural network (ANN) after training it and finding the values of the connection weights using the genetic algorithm (GA) to choose the best values to the weights. The GA is qualified in enhancing the weights of the ANN since the ANN is trained using the classical algorithm (back-propagation), the genetic algorithm is used as a co-training algorithm for enhancing the connection weights values and minimizing the error value to least possible value. The time required to enhancing the weights values using GA is longer than the time required to train the ANN using the classical algorithm especially when the number of training patterns and the number of variables are too much. This procedure has showed a good result and a very good performance. Using AI in analyzing the ECG signal has saving time, faster, and simple in diagnosing the disease. Index Terms artificial neural network, genetic algorithm, electrocardiograph, diagnose, training, QRS complex detection. E I. INTRODUCTION LECTROCARDIOGRAPH (ECG) is the representation of the electrical potential of the heart. Physicians record ECG easily by attaching small electrodes to the human body. ECG is a standard tool to diagnose heart diseases. In physical checkup at hospitals, physicians record the ECG after the Safaa S. Omran is with the College of electrical and electronic techniques, Foundation of Technical Education, Bagdad, Iraq. Safaa_omran@yahoo.com. S.M.R. Taha is with the College of engineering, University of Baghdad, Iraq. smr_taha@hotmail.com. Nassr Ali Awadh is with the Ministry of higher education and scientific Research, Iraq. n4c_8285@yahoo.com. patient has exercised to check his or her cardiac condition. The ECG device is used most frequently for recording the ECG. Physicians apply the device to a patient when they need to monitor his or her ECG to find the few abnormal cycles in the ECG throughout the day. Physicians first locate such fiducial points as Q, R, S in the ECG from which they locate P waves, QRS complexes and T waves as shown in Figure(1). Physicians then interpret the shapes of those waves and complexes. They calculate parameters to determine whether the ECG shows signs of cardiac disease or not. The parameters are the height and the interval of each wave, such as R-R interval, P-R interval, QT interval and S-T segment [1]. Figure (1) Basic shape of the normal ECG Recognition of the fiducial points and calculations of the parameters is a tedious routine for the physicians; approximately 100,000 cardiac cycles are recorded per patient in a day with an ECG device. The physicians have to interpret this large amount of ECG data to search for only a few abnormal cardiac beats in the ECG. Physicians may overlook some abnormal cycles because they have to interpret such a large amount of data. Therefore, there is an urgent need for an automatic ECG interpreting system to help to reduce the burden of ECG interpretation [2]. In making the judgment regarding cardiac abnormality, physiological knowledge of the ECG and statistical methods are used. An ECG interpreting system that is good enough to meet physicians needs has not yet been developed, however, because it is difficult to locate the fiducial points with a computer. Also the shape of the ECG varies with each patient. The ECG is recorded from the same patient changes as the time passes. Statistical methods are not useful for such kind of problem, because statistical criterion for one patient may not be applicable to another patient. However a fast recognition technique is developed to recognize the QRS complexes that can be further extended to detect the P and T waves and their corresponding intervals. And obviously this will be useful to the physician to detect the different heart diseases [2]. Various methods were used to detect the QRS complexes, some of them by using the ANN [3,5], and some by using

MASAUM Journal of Basic and Applied Sciences, Vol. 1, No. 3, October 2009 523 wavelet transforms [4], or by using fuzzy hybrid NN [6]. In this paper, the system will train by using ANN and then it will enhance by using genetic algorithm GA as this will be explained in the following sections. II. THE PREPROCESSING ON THE CAPTURED SIGNAL Usually ECG signals are contaminated by various kinds of noise, this noise must be eliminated before any operation. Noise removal is accomplished by passing the ECG signals through filter whose cutoff frequency is a function of the noise frequency [7,8]. Baseline wander was solved by using, median filter the steps involved in the implementation of baseline wander removal are shown in Figure (2). First, the first 200ms of samples were extracted and sorted out in ascending order, and then its median was calculated. Then for every 200ms of samples till the end of the ECG signal, the same procedure is carried out. Now, these samples are fed as input to the 600ms window median filtering. Later, the median value is evaluated for every 600ms of samples. Then these median values are subtracted from the original waveform to remove the baseline wander from the ECG signal. Figure (3) shows the result of the baseline wander filter. Figure (4) (a) Power line interference filter characteristic (b) Magnitude response. Figure (2) Algorithm to remove the baseline wanders This filter is designed by using built-in functions in Matlab filter design toolbox. Figure (5) shows the result of using power line interference removal filter. Thus the output of the preprocessing stage is free noise signal, it's shown in Figure (6). Figure (3) Results of baseline wander algorithm. (a) Original signal. (b) Output of baseline wander filter. Power line interference can be removed using digital filter, its cutoff frequency equal to power line interference frequency (50-60Hz). The filter is used in the proposed algorithm band stop filter, its cutoff frequency band between 50 and 60 Hz (fc1 50Hz, fc2 60Hz) with 250 sampling frequency (Fs). Figure (4) shows the filter specifications. Figure (5) Power line interference removal output

MASAUM Journal of Basic and Applied Sciences, Vol. 1, No. 3, October 2009 524 number of inputs to the ANN would be very large. The value of 120ms (normal QRS duration is 0.09ms, 120ms is taken to caver the abnormal cases of QRS duration) duration of the QRS, since the sampling frequency of the ECG signal is 250 sample per second (SPS). Therefore the width of the window will be 30 samples, and the length of input vector to ANN is 30 inputs which is the same size of window's width. Figure (7) shows the detector structure. Figure (6) The output of filtering stage. III. PROPOSED ALGORITHM FOR ECG RHYTHM ANALYSIS The proposed algorithm for ECG rhythm analysis is divided into three parts: 1. Detection of the QRS complex in input signal using ANN. 2. Detecting the P wave in ECG input signal using ANN. Performing calculations to extract the features related to the rhythm analysis, and classify this feature to the specific rhythm class according to decision tree. IV. THE QRS COMPLEX AND P WAVE DETECTION NEURAL NETWORKS QRS complex detection is the most important task in electrocardiograph (ECG) signal analysis systems. Every one of these complex indicates the happening of a heart beat and their detection makes possible to get valuable information, ranging from the calculation of the heart rate to the diagnosis of cardiopathologies associated to abnormal waveforms. The procedure consists basically of analyzing the incoming ECG during a moving window that runs along the time axis. The normal procedure would be to input all the N samples in the window into the detection system. The number of samples per window would be dependent on the width T of the window and the original signal sampling frequency Fs. To have just one single ANN with a fixed number n of inputs, each one receiving one of the samples from the window, then the number of samples per window must be constant. Since Fs is variable, depending on the acquiring device, then the possibilities are either to adapt the width of the window to Fs in order to have always the same number of n samples, or simply fix the width of the window and choose a number n of uniformly distributed samples in it. If the width of the window was chosen too narrow, there would be risk to make the ANN learning inconsistent portions of signal and therefore to make it very sensitive to noise. If the width was too wide, the Figure (7) Structure of the detector The requirements for the ANN output are: low level while there is no QRS and high level when the QRS appears, keeping like this during all the happening of the QRS. A square pulse, coincident with the presence of the QRS, is thus generated. The structure of the QRS detector is consisting of 30 inputs, 2 hidden layers and 8 nodes for each layer. The requirement of the P wave detector is the same requirement of QRS complex detector except the training patterns are different. The same network architecture can be used to detect the P wave present. Figure (8) shows the output of QRS and P wave detectors ANN. Figure (8) The QRS complex & P wave detectors ANN responses V. RHYTHM INTERPRETATION The arrhythmia analysis is the most beneficial application of automatic ECG recognition machines, because it may be used to monitor the patients with critical conditions (coronary care

MASAUM Journal of Basic and Applied Sciences, Vol. 1, No. 3, October 2009 525 unit patients) this task needs fully engaged expert while this expert can be provided with significant help, if such system is used. Efficient monitoring of patient can be easily achieved and many more patients can be handled with more efficiency and reliability by the same expert. The heart rhythm interpretation needs both calculation capabilities and powerful pattern recognition. The heart rhythm is interpreted according to four features, these features are investigated after detecting the QRS and P wave, and they are P wave existence, QRS regularity, QRS rate, and QRS shape. The P wave existence may be related with P/QRS ratio. QRS rate is the mean of R-R interval, while the QRS regularity may be represented mathematically as the standard deviation of the R-R intervals. Still there is another feature, it is the QRS shape. This feature indicates a normal shaped QRS complexes if activated, while it is indicating an abnormal shaped QRS complexes if it is not active. A simple neural network can be learned to discriminate between the normal and abnormal shaped QRS complexes. The P wave existence can be easily evaluated by measuring the P/QRS ratio. Where if there are many QRS complexes occurring without atrial contracting (represented by the p wave), this ratio will have a small value indicating an arrhythmia. The QRS rate is calculated from the number of beats detected during 1 minute. The average R-R interval can be also used to indicate the QRS rate. The standard deviation of R-R interval can be scaled to represent the QRS regularity according to the following equation [9]. RR reg = beat 2 RRi i= 1 1 (1) beat 2 beat RRi i= 1 The first thing is calculating the number of weights in the entire network because it's decides the length of the chromosome in the population. Figure (9) ANN architecture of the detectors Figure (10) shows the proposed chromosome format to represent the connection weights in the chromosome. The first part in the chromosome represents the inputs weight (IW), it consists of 240 elements (30 inputs 8 nodes), the second part in the chromosome represents the hidden layer weights (LW 1 ), it consists of 64 elements (8 nodes of first hidden layer 8 nodes of second hidden layer). The third part represents the bias for the second hidden layer and it consists of 8 elements (8 nodes in the second hidden layer). The fourth part in the chromosome represents the second hidden layer weights (LW 2 ) and it consists of 8 elements (8 nodes in the second hidden layer 1 node in the output layer). The final part represents the bias weight of the output layer. The general format of the chromosome is shown in Figure (10). where RR reg = the regularity of the R-R intervals Beat = number of heart beats detected RR i = is the ith R-R interval Once these features are evaluated the program starts the rhythm interpretation and when this step is performed the rhythm is reported. VI. NEURAL NETWORK TRAINING USING THE GENETIC ALGORITHM The architecture of the neural network proposed in this paper for the QRS complex and P wave detector consist of input layer, 1 hidden layer and output layer, the number of nodes in each hidden layer is 8 nodes, the output layer have one node (single output). There are 30 inputs in the input layer according to the width of the window as shown in figure (9). Figure (10) The format chromosome All the connection weights represented in this chromosome have real number values. The genetic algorithm can be summarized in the following steps: 1. Start 2. Create the initial population of chromosomes. 3. Repeat until reach some criteria a) Compute the fitness for each chromosome b) Store the chromosomes that have the higher fitness values (elite chromosomes).

MASAUM Journal of Basic and Applied Sciences, Vol. 1, No. 3, October 2009 526 c) Apply the selection method (RWS) to find pairs of chromosomes to apply the crossover operation between these chromosomes. d) Apply the crossover operation between each pair in the selection set according to the crossover probability. e) Apply the mutation operation to the chromosomes in the population if it satisfies the mutation probability. f) Create a new population containing the new chromosomes. VIII. TRAINING RESULTS OF R PEAKS DETECTOR NEURAL NETWORK The function of this network is to detect the locations of R peaks in the cardiac signal. The classical training algorithm is used in training ANN, the perceptron neural network is the back propagation training algorithm, in this algorithm the network is trained. The training of this network is accomplished by using neural network toolbox in Matlab. Figure (12) shows the performance of the training session. VII. RHYTHM ANALYSIS PROGRAM After extracting the required features from the ECG signal the rhythm is analyzed and interpreted to the specific rhythm class according to the decision tree. (The mean of decision tree is the clinical procedure used by cardiologists is automated) this approach implements the comparison of the extracted feature and medical criteria at the nodes of the decision tree to reach a non-conflicting statement describing the heart condition. The flowchart of this program is shown in Figure (11). The program starts by initializing the system parameters and loading the networks that are trained before. Then loading the input signal and removing the noise from it. After removing the noise the detection of R peak is started by calling R peak detector ANN, the detection of the R peaks is easy because the nature of wave itself. Figure (12) Training graph of R peak detector neural network It is clear in figure (12) the network approaches error 5.9487e-28 after 75 Epochs. The detecting R peak is not difficult thing because the nature of R peak, it has the maximum amplitude in the ECG signal. The simulation of R peak detector is shown in Figure (13). Figure (13) Simulation results of R peak detector Figure (11) Rhythm interpretation program IX. TRAINING RESULTS OF P WAVES DETECTOR ANN The same neural network architecture shown in Figure (9) is used to detect the P wave, except the training patterns and targets are different. The detecting of P wave is not an easy job like the detecting R peaks, because the P wave has small variation than the R peak in amplitude of the ECG signal, The mass of atrial is small compared with the mass of ventricular, so that the electrical activity of atrial (atrial depolarization) has less visibility from the ventricular depolarization. Figure (14) shows the training session of P wave detector ANN.

MASAUM Journal of Basic and Applied Sciences, Vol. 1, No. 3, October 2009 527 Figure (16) Training graph of QRS abnormality detector Figure (14) Training graph of P wave detector neural network The training of ANN is completed and the simulation results are shown in Figure (15). The ANN for P wave detector tested by ECG signal belongs to a healthy subject, this signal is never being used for training the ANN before. Also the P wave detector ANN is tested, the response of P wave detector is shown in Figure (15). Figure (15) Simulation result for P wave detector neural network X. TRAINING RESULT OF QRS SHAPE ABNORMALITY DETECTOR ANN The function of this network is to detect the abnormality in the shape of QRS complex, if the shape is normal the output of this network is zero, if abnormality is detected in the shape of QRS complex the output will be one. Also the same proposed structure of P wave and R peak detector ANN is used but the training data and target are different. The training of this neural network is easy because the ANN just needs discriminating between normal and abnormal shape of QRS complex. Figure (16) shows the training graph of this ANN. The training of this network took just 63 Epochs with 2.489e-12 of sum square error. All the previous training for the ANN was accomplished by using classical training method (BP) in the Matlab version (7.0) neural network toolbox. The training neural network with genetic algorithm will be discussed in the next section. XI. ENHANCING R PEAK, P WAVE AND QRS ABNORMALITY DETECTORS ANN WEIGHTS BY USING GENETIC ALGORITHM As mentioned in chapter three the training of ANN in GA can be achieved by representing the weights of network connection in the chromosome and applying the GA to this chromosome. The training of ANN by GA may take very long time, because of the nature of this algorithm. GA is a searching algorithm, when running this algorithm the GA will start searching for the solutions in the solution space (to find the best values for the weights) according to specific criterion, sometimes the initial values of the population (the initialization of the population is random) is too close to the desired value so that it will not take a very long time. In our problem the length of the chromosome is 321 genes, so that the searching space will be huge and the time required to approach is very long time. The GA is used in this paper to enhance the training of ANN trained in standard learning technique such as backpropagation, and minimize the error value. After training this ANN, the weight evaluated by the classical algorithm is used as initial population to the GA, and the GA is applied to find the optimum values to the weights. When GA parameters are configured, the algorithm is ready to run for optimizing the connection weights of the ANN. Figure (17) shows the result of optimizing the R peak detector neural network. As is clear from this figure the error evaluated from GA is 2.3116e-29 after 100 generations. The error was 5.9487e-28 obtained from the classical algorithm. The new weights are applied to R peak detector neural network Figure (18) shows testing R peak detector ANN.

MASAUM Journal of Basic and Applied Sciences, Vol. 1, No. 3, October 2009 528 Figure (17) Results of optimizing R peak detector weights Figure (20) Tasting P wave detector ANN As shown in Figure (19) the error evaluated using GA is 1.0379e-13 after 100 generations, the error was 1.5899e-11 obtained using the classical algorithm. Figure (21) shows the result of optimizing QRS shape abnormality detector ANN. After long optimizing session using GA, the results can be compared in Figure (17), Figure (19) and Figure (21) with the results of training ANN by the classical algorithm shown in Figure(12), Figure(14) and Figure(16) respectively, and it is found the GA successfully enhances the network performance by optimizing the weights of ANN. Figure (18) Testing R peak detector ANN Figure (19) shows the results of optimizing P wave detector ANN weights and figure (20) shows tasting of P wave detector. Figure (21) result of optimizing QRS abnormality detector ANN Figure (19) Result of optimizing P wave detector weights XII. RHYTHM ANALYSIS PROGRAM Before running the program the input signal must be prepared in the Matlab work space. Also the sampling rate of the signal must be 250 SPS with at least 10 second length to get the best performance. The program starts analyzing the ECG input signal. After few minutes the analysis is completed and the report is displayed. The next figures show the analysis report window with eight different cases of ECG signals.

MASAUM Journal of Basic and Applied Sciences, Vol. 1, No. 3, October 2009 529 Figure (22) also represents normal sinus rhythm. The HR is 66 bps, with regular RR interval, The P: QRS ratio is 1 and normal QRS shape. Figure (23) represents sinus bradicardia. The HR is 30 bps, the shape of the QRS complex is normal, the QRS regularity is regular and P: QRS ratio equals 1. Figure (24) represents atrial fibrillation, the HR is slow (48 bps) and the shape of the QRS is normal, the heart beat is irregular and the P: QRS ratio is 0.375. This case indicates that the P wave is not visible in the signal. The program can diagnose fifteen different cases related with the rhythm of the heart, they are: 1. Normal sinus rhythm 2. Sinus tachycardia 3. Sinus bradycardia 4. Sinus arrhythmia 5. Atrial escape 6. Atrial tachycardia with block 7. 2nd heart block 8. Complete heart block 9. Nodal tachycardia 10. Nodal escape 11. Nodal tachycardia with bundle block 12. Ventricular tachycardia 13. Atrial tachycardia 14. Atrial fibrillation 15. Ventricular fibrillation or standstill Figure (22) ECG signal representing normal sinus rhythm Figure (23) ECG signal representing sinus bradycardia Figure (24) ECG signal representing atrial fibrillation XIII. CONCLUSION The time required to train an ANN to recognize a specific number of input patterns using GA is unpredictable and it can take different time periods for different GA runs (for the same number of patterns). That is because in GA the connection weights are created randomly and the GA operations depend on the natural selection (crossover, mutation), so there are no specific steps used to train these ANN to strength the connection weights as in classical algorithm which has a specific steps to strength the connection weight. From the practical work of this paper it can be concluded that there are some limitations in using GA in training the ANN such as: 1. Sometimes it could happen that though the ANN could theoretically solve certain problem when it is trained using GA it will not return a correct solution at all the time, this is because of the random nature of the algorithm and its reliance on natural selection and crossover. 2. GA is not effectively able to train multilayer pereceptron whose chromosomal representation of its weights is large. The time required for learning using GA is larger than the time required to learn the same patterns using classical algorithm because the dimensions of the search space will be very large. 3. GA can be used to enhance the training of classical algorithm, after training the ANN by the classical algorithm the weights found are used as initial population for GA to enhance the performance of ANN. The Genetic Algorithm is used to enhance the training of the classical learning algorithm (back-propagation) by optimizing the values of the connection weights. This is the difference between the present work and the previous works. The final ANN shows a good performance in analyzing the cardiac signal, when it is used online in the main program.

MASAUM Journal of Basic and Applied Sciences, Vol. 1, No. 3, October 2009 530 REFERENCES [1] Michael W. Zimmerman, 'Classification of ECG ST Events as ischemic or non-ischemic using reconstructed phase spaces' MSc thesis, Marquette University, Milwaukee, Wisconsin, May 2004 [2] Abdullah S. 'ECG pattern recognition' MSc. Sharif University of Technology, Tehran, Iran 2003. [3] Yukinori Suzuki, Self- Organizing QRS-Wave Recognition in ECG Using Neural Networks IEEE Transaction on Neural Networks, Vol.6, No.6, November 1995. [4] Cuiwei Li, Chongxun Zheng and Changfeng Tai, Detection of ECG Characteristic Points Using Wavelet Transforms, IEEE Transaction on Biomedical Engineering, Vol. 42, No. 1, January 1998. [5] Yu Hen Hu, Surekha Palreddy and Willis J. Tompkins, A Patient - Adaptable ECG Beat Classifier Using a mixture of Expert Approach, IEEE Transaction on Biomedical Engineering, Vol. 44, No. 9, September 1997. [6] Stanislaw Osowski and Tran Hoai Linh, ECG Beat Recognition Using Fuzzy Hybrid Neural Network, IEEE Transaction on Biomedical Engineering, Vol. 48, No. 11, November 2001. [7] Rajendra Acharya U, Jasjit S., Jos A.E. Spaan and Shankar M. Krishnan, 'Advances in Cardiac Signal Processing', Springer-Verlag, Berlin Heidelberg, 2007 [8] World invisible, "The human heart", World invisible webmaster, November 13, 2005 http://www.worldinvisible.com [9] Zaid S. Ali 'Neural networks for ECG analysis', MSc. thesis, Electrical Engineering Department, University of Baghdad.1996