ISSN: 2229371X
Ashraf Anwar^{*1}, Said Ghoniemy^{2}

Corresponding Author: Ashraf Anwar, Email: ashraaf@tu.edu.sa 
Related article at Pubmed, Scholar Google 
Visit for more related articles at Journal of Global Research in Computer Sciences
In this paper we present Support Vector Machine (SVM) and Artificial Neural Network (ANN) as two machine learning tools in classification problem concerning Normal/ PAF object in Paroxysmal Atrial Fibrillation (PAF) Prediction. PAF is a really life threatening disease and it is the result of irregular and repeated depolarization of the atria.. Using PAF prediction challenge database (afpdb), we divide the 30min preceding the PAF into 6 periods with 5min each. In each suggested period we get the classification result using support vector machine (SVM) and Artificial Neural Network (ANN). The performance evaluation of the two classifiers is compared in accordance of the measured sensitivity, specificity, positive predictivity and accuracy. The results indicate that the SVM classifier yields slightly higher prediction accuracy than ANN. The two classifiers realize significant results comparable to obtained results in the same field in the literature
Keywords 
PAF prediction; ECG signal; continuous wavelet transform; artificial neural network (ANN); Feature Extraction; Support Vector Machine (SVM) 
INTRODUCTION 
With the increase of the number of people suffering from heart disease, accurate diagnosis at an early stage followed by the proper treatment can result in a significant life saving. Atrial fibrillation (AF) is one of the most common arrhythmias associated with the upper chambers of the heart, the atria. In human, the incidence of AF is generally higher as they get older. AF is strongly associated with increasing strokerelated morbidity and mortality, lowered quality of life and heart failure [1]. Paroxysmal atrial fibrillation (PAF) of the heart muscle is defined as short duration episodes of AF lasting from 2min. to less than 7 days, while chronic AF is defined as lasting more than 7 days. The main reason for this is not the immediate effect of the onset of atrial fibrillation over the patient’s health (AF detection) but the longterm effects: increase in heart muscle fatigue, increase in thromboembolic and stroke events due to the formation of blood clots and an irregular onset that makes it hard to detect on normal ECG tests. Thus it is necessary for cardiologists to benefit from a robust and precise tool that could predict the onset of such events, in order to prevent them by defibrillation, drug treatment and antitachycardia pacing techniques. Chronic AF is usually preceded by (PAF). Therefore, in addition to use antiarrhythmic drugs, the physicians are trying to develop pacing devices in order to surpass the onset of AF.The automated method to predict the onset PAF is interesting topic to help treating this problem. During recent years several researchers proposed many techniques to predict the onset of PAF. Useful reviews describing different techniques for PAF or chronic AF prediction, from technical to clinical points of view [25]. 
The “Computers in Cardiology Challenge 2001” revealed a maximum obtained accuracy of about 80% [68]. Hariton, et al., [9] proposed a new method for PAF automatic prediction based on heart rate variability (HRV) metrics and morphologic variability (MV), and (HRV+MV) decision rule, the obtained specificity and sensitivity are between (83.93% 89.29%), (84.51%89,44%) respectively. Artificial neural network (ANN) in recent years has proved to be an advanced tool in solving classification [1012], 
Wavelets proved usefulness in feature extraction from nonstationary signal like ECG [1314]. Support vector machine (SVM) in recent years has proved to be an advanced tool in solving classification [1517]. In general, these above prediction models are able to detect the transition to PAF events with accuracies of 70–90%, by means of records of at least tens of minutes and rather complex analysis procedures. 
In the present work, two set of features are extracted: Feature set1 (FS1), directly from ECG signal and feature set2 (FS2) with the aid of continuous wavelet transform(CWT), which converts the time domain signal to timefrequency domain where several features can be carefully extracted, the extracted features are then applied to SVM/ANN to classify the normal object from that one who suffers from PAF The performance evaluation of the two classifiers is compared in accordance of the measured sensitivity, specificity, positive predictivity and accuracy. 
MATERIAL AND METHODS 
The database used for this task was PAF Prediction Challenge Database 2001 from physionet.org. It consists of 3 record sets: the first one has records that begin with the letter 'n' and comes from 50 subjects who do not have documented PAF. The length of these records is 30 min. The second record that begin with letter 'p' comes from 48 
testing with a letter't' of 30 min. and unknown documentation. Each record contains two channels simultaneous recorded Holter ECG signal digitized at 128 Hz with 12 bit resolution over a 20 mv range. We used in this task both channels of the ECG signal, 50 normal channels and 50 PAF channel (25 even record x 2 channel) to form the database. 
Continuous Wavelet Transform (CWT) 
CWT allows a time domain signal to be transformed into timefrequency domain where frequency characteristics and the location of particular features in a time series may be highlighted simultaneously. Thus it allows accurate extraction of feature from nonstationary signal like ECG [18]. The CWT wavelet transform is a tool that divides up data, functions, or operators into different frequency components and then studies each component with a resolution matched to its scale. Unlike the short time Fourier transformation (STFT) the wavelet transformation has very good time and frequency resolution making it ideal in the analysis of nonstationary signals such as an ECG signal. The continuous wavelet transformation (CWT) of a signal x(t) is the convolution product of x (t) with a scaled and translated kernel function [19] different subjects who have documented PAF, and it is divided into 50 record sets, the even one has a record of 30 min preceding the PAF, and the odd one has a record of 30 min. but distant from PAF. All the previous record has a continuation 5 min record with a letter 'c'. The third record contains 100 annotated recordings for 
Where Φ((tτ)/s)is a scaled and translated (shifted) version of a mother wavelet which is the basic unit of wavelet decomposition, s is a scale parameter and τ is a space parameter. To analyze the CWT coefficients obtained for ECG signal of PAF record and nonPAF, predominant frequency vs. time plot of selected ECG signal has been obtained. From these plots translation, scale and coefficient values of the peaks, which represent P, Q, R, S,T and U wave has been extracted for PAF and nonPAF records. Figure 2 and Figure 4 show the normal ECG signal plot and the ECG signal preceding PAF plot respectively. Figure 3 and Figure 5 illustrate the difference in the amplitude and duration of RR and QRS among PAF and nonPAF records at different scales with the aid of CWT 
Feature Extraction 
We utilized two feature sets: FS1, (1 3) related to signal statistical and FS2, (411) by mean of continuous wavelet transform as follows: 
1. Sigmean: mean value of the signal during the specified period. We can note that most of PAF records have a high negative value. 
2. Sigstd: the standard deviation of the recorded signal, we can note that most of PAF records have a high positive value 
3. Sigdiff: difference between the maximum signal and the minimum signal, we can note that most of PAF records have a small positive value 
4. RRno: number of RR interval inside each period. We first detect R peak inside each period, and with the aid of CWT, we can discriminate the extremes values and their locations 
5. RRdiff: The difference between max. RR interval and min. RR interval inside each period 
6. RRmax : maximum values of RR interval inside each period 
7. RRmean: mean values of RR interval inside each period 
8 . RRstd : standard deviation of RR interval inside each period 
9. RRrms : root mean square values of RR interval inside each period 
10. Ramp : mean value of R peak inside each period 
11. QRSmean: mean value of QRS duration inside each period 
Neural Network 
A supervised ANN is developed to recognize and classify the features of ECG signal for normal and PAF record. Typically, multilayer feedforward neural network (newff) can be trained as nonlinear classifier using the generalized back propagation algorithm (BPA). The BPA is a supervised learning algorithm, in which a sum square error function is defined, and the learning process aims to reduce the overall system error to a minimum. The architecture of the neural network used in this work is the pattern recognition neural network (newpr), (newpr), returns a network exactly as (newff) would, but with an output layer transfer function of 'tansig' and additional plotting functions included in the network's net.plotFcn property. The Network include 10, 5 hidden neurons in the second and third layer respectively. The number of input nodes are determined by the finalized data; the number of hidden neurons are determined through trial and error; the number of output nodes are 1 in case of 'newpr' since we have only two classes 
Support Vector Machine (SVM) 
The SVM is a discriminative classifier formally defined by a separating hyperplane (the plane with maximum margins) between the two classes of the training samples within the feature space by focusing on the training cases placed at the edge of the class descriptors so not only an optimal hyperplane is fitted, but also training samples are effectively used. In that way high classification accuracy is achieved with small training sets [16]. 
In soft margin classification, the SVM algorithm can be summarized as the following optimization problem: given a training set (xi, yi), i=1,2,..,n 
Subjected to: yi (wT Φ(xi )+ b) ≥ 1 and i ≥ 0 for all i 
Where : Φ(x) is a nonlinear function that maps x into a higher dimensional space. W, b, and are the weight vector, bias, and slack variable respectively. C is a constant determined a priori. Parameter C can be viewed as a way to control over fitting. Most “important” training points are support vectors; they define the hyperplane. Quadratic optimization algorithms can identify which training points xi are support vectors with nonzero Lagrangian multipliers αi. By constructing a Lagrangian and transforming it into a dual maximization of the function Q(α), defined as follows: 
max Q(α) =Σαi  ½ΣΣ αi αj yi yj K(xi, xj) 
Where K(xi, xj) = is the kernel function and αi is vector of non negative Lagrange multipliers. The kernel function plays the role of the dot product in the feature space. Suppose that the optimum values of the Lagrange multipliers are denoted α0, it is then to determine the corresponding optimum value of the linear weight vector wo and the optimal hyperplane as in (4) and (5), respectively: 
In this task, we used radial basis function (RBF) as kernel function where: σ (kernel width) : is the distance between closest points with different classifications C, σ were experimentally defined to achieve the best classification result. 
RESULTS AND DISCUSSION 
To evaluate the performance of the two classifiers (SVM, ANN) during 30min preceding the (PAF), we divide 30min period into 6 intervals, 5min each. Four criterias are used as follows: 
Where: 
TP: True Positive, when an object having (PAF) is classified correctly. 
TN: True Negative when a normal object is classified correctly. 
FN: False Negative when an object having (PAF) is classified as normal incorrectly 
FP: False Positive when a normal person is classified as having PAF incorrectly 
Using SVM classifier 
To optimize the learning cost and the classification performance, the SVM classifier parameters, kernel width σ and regularization constant C, must be chosen effectively [16]. So we chose the parameters σ and C as 10 and 1 respectively. To evaluate the performance of the proposed classifier (SVM), we used 60 records (30 n and 30 p) for training and 40 records (20 n and 20 p) for testing. The four previously mentioned measures are calculated in each 5min interval. The experiments were repeated 5 trials. In each trial a different set of randomly shuffled samples is done and the mean values are tabulated in Table 1. 
Using NEWPR classifier 
To evaluate the performance of the proposed classifier (NEWPR), we used 60 records (30 n and 30 p) for training and 40 records (20 n and 20 p) for testing. The four previously mentioned measures are calculated in each 5min interval. To confirm the obtained results, we perform 100 run simulations for the (NEWPR), and then take the mean value for the mentioned measures. The mean values of the criteria's for each 5 min interval are tabulated in Table I. 
The result of (NEWPR) output classifier and SVM classifier in training data set and testing another one are illustrated in Figure 6 and Figure 7respectively. 
We can deduce the following points from analysis of the obtained results: 
We can predict PAF efficiently even in 30 min prior to PAF 
The average percentage of the sensitivity, specificity, positive predictivity and accuracy are higher during 5min interval preceding the PAF directly, and also during 20min prior PAF 
The SVM classifier yields slightly higher prediction accuracy than ANN. 
Robustness of (SVM) and (NEWPR) classifier to handle large feature spaces. 
The comparison between the obtained results and other results, in the same field, in the literature [9, 12, 13] is shown in Table II 
CONCLUSION 
In this paper, we compare the performance of SVM and ANN based classifier in PAF prediction. We extract two feature sets, feature set1 directly from ECG signal and feature set2 with the aid of CWT, to allow accurate extraction of feature from nonstationary signal like ECG, from 100 ECG recorded signals of 'afpdp' database. (NEWPR) and (SVM) are used to classify the patterns inherent in the features extracted, into normal record and PAF record. The results show that both classifiers are doing well in classification but the SVM outperform the NEWPR in most periods prior the PAF. The obtained results show the efficiency of the proposed method in predicting the onset of PAF. IN case of SVM, the average personage of sensitivity, specificity, positive predictivity and accuracy are 94%, 94%, 96.36%, and 94% respectively, and these values overpass the obtained results in the literature. 
References 
