APPLICATION OF INSTANCE-BASED LEARNERS FOR ARRHYTHMIA DETECTION IN ECG SIGNALS.

Cardiac arrhythmia detection in heart activity related signals, like ECG, has been a center of attention for many researchers in medical field, and is as relevant, if not more, to this day. Aim of this paper is to investigate the accuracy of commonly used classifiers in classifying ECG signal segments of one heart beat into three classes – normal, unrecognizable and arrhythmia – and provide insight, which type of, or even specific classifier has a tendency to perform the best under given scenario. Results of the experiments showed that best performing classifiers are instance-based learning algorithms, top two performers being K* algorithm, based on entropic distance measure, with 99% correlation and 3,5% relative absolute error, while testing all input data as test data, 90% and 20% respectively, when testing with 75% of input data as training set, and the rest as testing set, along with IBk – nearest neighbor based algorithm, which was only applicable with percentage split training method (75% / 25%), resulting in 84% correlation and 19% relative absolute error.


ISSN: 2320-5407
Int. J. Adv. Res. 6(6), 976-982 977 Some researcher and engineers focus on single arrhythmia detection (Ortigosa et al. 2015;Felix et al. 2015; Chandra et al. 2016), others aim to detect arrhythmias in general, mostly for two reasonseither to initiate alarms to alert the medical personnel or to reduce the mentioned alarms that might have been detected incorrectly in order to reduce stress on medical personnel, utilizing either own built algorithms (Eerikäinen et al. 2015) or machine learning (Daluwatte et al. 2015). Machine learning applications are becoming very popular for solving these kind of problems, because of their constantly increasing performance and accuracy, and most importantlyability to be applied to very wide range of different problems.
Since machine learning is gaining more interest by year and evolving equally fast, in this paper the most well-known methods of machine learning are investigated, such as neural networks, decision trees and others to see which one performs the best in creating models for classification of different ECG signal features into classes of normal, distorted by noise and cardiac arrhythmic-signal. Software called WEKA was chosen in order to perform experiments with classifiersopen source software suite for machine learning, which utilizes an impressive range of different classification methods.
Mentioned software was used to measure the accuracy of all available classifiers, in order to conclude which is performing the best when trying to tackle the problem of classifying between normal, noisy and arrhythmic heart activity. Lastly results are discussed and further possible investigations are considered on how the performance could be improved even more. Experiments, described in this paper, were performed using PhysioBank MIMIC-III database by Physionet.org. Signals in the mentioned database varies in length from 5 minutes to in some case even an hour long measurements, but considering objective of this research investigation scope was limited to 20 seconds of individual signal measurements for one patienthigher emphasis was put on having more varied signals, with different shape of QRS, different forms of cardiac arrhythmias and different magnitudes of noise instead on analyzing large amounts of data for one signal.

Materials and methods:-
Mentioned 20 second windows of individual signals were not chosen randomly, they are manually picked segments where strong deformation in otherwise normal ECG waveform is clearly noticeable (Fig. 1.). These 20 seconds of ECG signals are then divided in single heart beat (QRS) segments by taking signal annotations, provided of expert physicians (annotations are also available in PhysioBank database), and centering a 100 sample wide window on it 978 ( Fig. 2)signals are sampled by 125 Hz frequency, so mentioned windows is about the width of one normal heart beat.

Fig. 2:-100 sample windowone heart beat (QRS)
To make the problem of classification easier, several features of the signal are extracted for each individual QRSmean value, standard deviation, variance, covariance, kurtosis and sum of squared difference of signal sample amplitude. It is possible to feed all sample values of each QRS window sample as input to the classifier, but that is considered to be a very primate approach and more prone to error, when compared with feature based classification, if the latter one is done right and well performing features are picked.
Each feature record for single QRS window is then assigned a signal state identifier in order to perform a supervised training method for our classifier. As was mentioned before, 100 sample windows were assigned with one of three indicators of signal state: 1normal heart beat (Fig.2); 2unrecognizable/distorted by noise (Fig. 3a); 3cardiac arrhythmia (Fig. 3b). ECG signals of 40 different patients were preprocessed as described above, which resulted in experimental dataset with states, presented in Table 1.
Described experimental data was used as input to the list of classifiers, provided by the software suite WEKA. 28 different classifiers were tested in total. Training set and percentage split training methods were used. Parameters for each classifier were kept as defaults recommended by WEKA, as the objective of the experiment is to measure general performance of all available methods of classification.

Results:-
For classifier performance evaluation five parameters were taken into considerationcorrelation coefficient, mean absolute error, root mean squared error, relative absolute error and root relative squared error. Results for using whole data as training set are described in Table 2. Some classifiers returned with correlation coefficient as zero (and consequentially relative absolute error as 100%), indicating that classifier modeled values has no correlation to real values. This does not mean that said classifiers are bad, they are just not fit solving problems with either the data format we've provided as input or training method is not one of our picked methods for this investigationwe will not be considering these classifiers in our further measurements. Instance-based learning algorithm K* performs the best with proposed input data while using all of the input data as a training set, displaying correlation close to 100% (99.45%) and relative absolute error 3.5%. Second and third best classifiers for the first part of the experiment are Regression by Discretization and Random Forest algorithms with 98.76% and 94.75% correlation respectively. It is also worth noting that there are a few instances where certain classifiers have resulted in correlation of 100% and error 0%. Sadly, that does not indicate perfect choice for given problem solving, quite the oppositeit shows that these classifiers are not testing themselves against the training set, and need separate set of data for testing the classification model. As a result, output of mentioned classifiers is more realistic looking, when performing second part of the experimenttraining the classifier with 75% of data and using the rest as testing set. Also a drop in accuracy for all classifiers can be witnessed, but that is to be expected, since algorithms are working with less data while training, which lets us safely assume that the more date of same type classifier gets for training procedure, the more accurate the created model is.  Another notable point is that during the second part of the experiment the top performing algorithm remained instance-based learner K*, even though it's relative absolute error increased to 20% and correlation decreased by 9% (Fig. 4, 5). Second best, considering its relatively high correlation coefficient (0.8433) and lowest relative absolute error -19%, that makes two of the best performing algorithms instance-based learners. Decision tree algorithms have performed considerably well in the second part of the experiment too, specifically -Random Tree and Random Forest algorithms which performed just as effectively as previously mentioned instance-based learners.

Conclusions and discussion:-
While experimenting with preprocessed data of ECG signal in a form of feature set for single QRS complexes in order to classify the mentioned records into three classesnormal, distorted by noise or unrecognizable and cardiac arrhythmia -28 different classifiers were tested using two training methodsall input data as training set and percentage split -75% as training set and 25% as testing set. During tests with the first training method it quickly became apparent that instance-based learning algorithm K* performed the best out of the rest, displaying the highest correlation between predicated and actual values and lowest relative absolute error.
In second phase of the experiment where percentage split K* again displayed very promising performance and stood out of the rest of the classifiers, this time along with another instance-based learning algorithm -IBk. This made it safe to conclude, that instance-based learning algorithms are a solid choice for this specific classification scenario, followed by decision tree based algorithms, which were relatively very close in accuracy to the mentioned K* and IBk.
Even though the objective of this experiment was to measure general performance or accuracy of large set of classifiers, there is still room for improvement in both data preparation and preprocessing as well as algorithm tweaks: 1. During the performed test the tendency was noticed, that the performance of most classifiers directly relates to the amount of training data provided. The more data we can feed to the input of the algorithm the more likely it is to perform better. In this experiment we've used around 1250 unique records, all of them were used for 982 training in the first part of the experiment and 75% of themin the second part. But that is still relatively small amount of data when considering machine learning. These algorithms are capable to process 10 or even 100 times more input data which would most likely positively affect the overall accuracy of the model. 2. Our approach to the classification might have been too straightforward and could've made classification problem more complex than it could've been otherwise. As mentioned, three distinct signal states were used as classes in our experimentsnormal, noisy and arrhythmic heartbeat. It is possible that accuracy would improve if we would do two classification models instead of oneby classifying the data into normal and abnormal first, and classifying the abnormal records into unrecognizable or arrhythmias afterwards. This theory will be investigated in future experiments. 3. As the aim of the work was to measure general performance of investigated classifiers, recommended default settings by WEKA were used for all classifiers in the experiments. After choosing the best performing classifiers it is possible that their accuracy could be further improved by tweaking the mentioned settings. 4. More features could be introduced in the data preprocessing stage, what would make the input data potentially more informative for the classifier, making its problem less complicated.