Cardiac, diabetic and normal subjects classification using decision tree and result confirmation through orthostatic stress index

Cardiac, diabetic and normal subjects classification using decision tree and result confirmation through orthostatic stress index

Informatics in Medicine Unlocked xxx (xxxx) xxx Contents lists available at ScienceDirect Informatics in Medicine Unlocked journal homepage: http://...

1MB Sizes 0 Downloads 9 Views

Informatics in Medicine Unlocked xxx (xxxx) xxx

Contents lists available at ScienceDirect

Informatics in Medicine Unlocked journal homepage: http://www.elsevier.com/locate/imu

Cardiac, diabetic and normal subjects classification using decision tree and result confirmation through orthostatic stress index Ulka Shirole a, *, Manjusha Joshi b, Pritish Bagul c a

A.C. Patil College of Engineering, Navi Mumbai, India MPSTME, NMIMS University, Mumbai, India c B & J Superspeciality Hospital, Navi Mumbai, India b

A R T I C L E I N F O

A B S T R A C T

Keywords: Heart rate variability Decision tree Diabetic subjects Cardiac subjects Orthostatic stress index

Cardiac and diabetic diseases are common and troublesome complications, leading to increased morbidity and mortality rates that cause a large economic burden. Researchers have explored cardiac or diabetic diseases for analysis separately; however, combined study of both diseases is missing. A retrospective Heart Rate Variability (HRV) analysis on ECG data was performed, analyzing the data of 78 subjects, which includes 26 cardiac (suffering from congestive heart failure), 17 diabetic and 35 normal (healthy subject or control) subjects. These subjects were labeled as cardiac, diabetic and normal based on HRV parameters. A classification and regression tree (CART) was employed to develop an automatic classifier to infer implications of disease in the early stages. Furthermore, to cross verify the above results, an orthostatic stress index was calculated from HRV parameters of ECG data recorded in the sitting and supine position. Cardiac subjects have the lowest HRV values among the three classes, whereas healthy subjects have the highest. The results are consistent with OSI values. The results are consistent with the consensus shown by previous studies, namely that depressed HRV is a useful tool for risk assessment in patients, and implying that cardiac subjects are at highest risk. The proposed classification model has achieved an accuracy of 93.58%, and a precision and recall of 94%.

1. Introduction The heart is a complex control system, which is affected by various factors including sedentary lifestyle, physical and mental stress, and chronic diseases [1]. Cardiac diseases include conditions that affect the heart dysfunction due to diabetes, cardiac diseases, coronary artery diseases, cardiac arrhythmia, and many other such diseases, leading to cardiac death. Coronary artery diseases are common among heart dis­ eases and can cause more deaths than cancer, both in men and women. Arteries supply rich oxygenated blood to heart and muscular parts of the body [2] that may be blocked due to atherosclerosis. Atherosclerosis may occur due to risk factors, such as, family history, age, gender and ethnicity, which cannot be controlled. Other risk factors that can be controlled are diabetes, obesity, tobacco, physical inactivity, high blood pressure, cholesterol etc. These diseases have remained an important public health issue. Periodic diagnosis and medication are of utmost importance to save human lives. Diabetes is a major disease worldwide that causes dysfunction of various parts of the human body leading to complicated diseases like cardiovascular disease, blindness,

neuropathy, cancer, and gallstones, causing mortality [3]. DM is the condition where the blood glucose level in the human body is increased to an abnormally high level. It is an effect of reduced ca­ pacity of the pancreas to secrete insulin responsible for processing glucose and store it into energy (Type 1 DM), or the insulin may not respond to target cells (Type 2 DM) [4–6]. The functioning of the pancreas is controlled by genetic factors, therefore controlling this condition is extremely difficult. Having diabetes and cardiac diseases can affect human health and may lead to heart attack, stroke, and even death. Researchers experiment with HRV parameters to find minute changes to assess the heart health. The ECG signal is one of the most noninvasive techniques to observe cardiac rhythm. The ECG is a nonlinear signal; therefore manual analysis might lead to different in­ terpretations from expert to expert [7,8]. HRV is a beat-to-beat variation of RR interval in the ECG signal and is measured in milliseconds. Vari­ ations in the HRV is an indicator of the healthy heart whereas less variations imply an unhealthy heart [5]. Linear and nonlinear analysis of HRV parameters have a significant role in the detection of heart

* Corresponding author. E-mail addresses: [email protected] (U. Shirole), [email protected] (M. Joshi), [email protected] (P. Bagul). https://doi.org/10.1016/j.imu.2019.100252 Received 4 June 2019; Received in revised form 21 September 2019; Accepted 24 September 2019 Available online 8 November 2019 2352-9148/© 2019 Published by Elsevier Ltd. This is an open access article under the CC BY-NC-ND license (http://creativecommons.org/licenses/by-nc-nd/4.0/).

Please cite this article as: Ulka Shirole, Informatics in Medicine Unlocked, https://doi.org/10.1016/j.imu.2019.100252

U. Shirole et al.

Informatics in Medicine Unlocked xxx (xxxx) xxx

diseases. Earlier studies have shown that HRV parameter values are depressed for diseased subjects as compared to healthy subjects [9]. Researchers have distinguished normal and diabetic subjects [7], also some of the studies have classified low-risk patients from high risk ones. Fujita et al. [10] have predicted heart attack from ECG data recorded 3–5 min prior to its onset using HRV parameters. The assimilation of machine learning in medical diagnosis has pro­ found inferences for biomedical science. Machine learning has revolu­ tionized the biomedical field and transformed the healthcare system. Two categories of machine learning algorithms are observed: supervised and unsupervised [11–13]. supervised machine learning algorithms build a mode, which is based on labeled data known as training data to decide labels of new data. Unsupervised machine learning algorithms focus on the detection of patterns in data without knowing labels in advance. In this paper, we have generated a decision tree inference model, which is a supervised learning algorithm. This paper deals with HRV analysis to predict health of heart in cardiac and diabetic diseased subjects. Both diabetic and cardiac dis­ eases deteriorate the heart’s functionality. Although several researchers have done separate analysis for cardiac and normal subjects, and dia­ betic and normal subjects, a combined study of both diseases is not yet done. Therefore, we have attempted ternary class classification to analyze cardiac health through HRV parameters due to these diseases. The orthostatic stress index (OSI) is a numeric measure of heart’s functionality, indicating low-risk and high-risk subjects [14]. A low-risk subject has a positive OSI value and a high-risk subject has a negative OSI value. This index is exploited for confirming the results obtained from a machine learning inference model. The proposed classification model has achieved an accuracy of 93.58%, and a precision and recall of 94%, by combining linear (time domain and frequency domain) and nonlinear HRV features. Results showed that cardiac subjects have high negative OSI, diabetic subjects have mixed, low positive and negative OSI, and normal subjects have high positive OSI. The major contribution of this work is in the classification of cardiac, diabetic and normal subjects using a decision tree model and cross verification of results using OSI, thereby reasoning for misclassification. This paper is structured as follows: Section 2 presents related work. Section 3 describes the data collection method. Section 4 details the proposed model for classification. The machine learning model and its accuracy measurements are described in Section 5. Section 6 gives the results of the study. A brief discussion on results is presented in section 7. Finally, Section 8 concludes the paper.

employed the convolutional neural network technique to classify ECG signals as normal, having atrial fibrillation, atrial flutter, and ventricular fibrillation, with an accuracy of 92.50%. Authors suggested that the robustness and accuracy can further be improved if the database is large and the Keras model was employed instead of k-means cross-validation strategy for validation of CNN technique without data filtering. Corn­ forth et al. [18] have examined all linear (time and frequency domain) and nonlinear HRV parameters. Various machine learning algorithms were applied to separate subjects from early cardiac autonomic neu­ ropathy from those of healthy subjects. Genetic algorithm provided the best performance with an accuracy of 70% for maximum separation of two classes; however, authors declared that the method is not 100% accurate. Acharya et al. [5] compared diabetic and normal subjects using linear and nonlinear analysis, and it is shown that nonlinear fea­ tures, sample entropy and approximate entropy show low values for diabetic subjects. They used Student’s t-test to all nonlinear parameters like standard deviation, recurrence plot, detrended entropy, approxi­ mate entropy, sample entropy and correlation dimension to distinguish the normal and diabetic subjects. Fujita et al. [10] predicted sudden cardiac death (SCD) using nonlinear parameters of ECG signal, where recordings were taken 5 min before the SCD onset. Their work classifies normal subject and SCD subject using K-nearest mean, Decision Tree and SVM algorithms of machine learning. Nonlinear features which are ranked using the t value of Renyi entropy, Fuzzy entropy, Hjorths parameters, energy features of discrete wavelet transform, and Tsallis entropy. Among all classifiers, SVM gave the best result that predicted SCD 4 min before its onset with an accuracy of 94.7%. In summary re­ searchers are employing machine learning based algorithms to predict cardiac health of patients. We were motivated to research for diabetic and cardiac diseases to infer cardiac health. 3. Data collection ECG recordings of 97 subjects (22-diabetic, 35 cardiac and 40 normal) were collected at B & J Superspeciality Hospital, Navi Mumbai, and other hospitals in Navi Mumbai, India. Data of the cardiac subjects is collected in the intensive cardiac care unit (ICCU) where the patient’s heart activity is under 24 h observation. Data for diabetic and normal subjects were collected from the general ward when subjects visited the hospital for medication. Diabetic subjects do not have cardiac disease. Cardiac subjects have blockages in the arteries; some of them were suggested for bypass surgery and faced myocardial infarction. Data is collected using a 12 lead ECG acquisition machine for 15 min in sitting and 15 min in supine position. ECG records are the heart’s electrical activity in an analog signal form, and this signal is converted to discrete data using PCECG software. A sampling rate of 500 Hz, gain of 10mm/ mv, high pass filter 0.15 Hz, low pass filter 20 Hz, and AC filter of 50 Hz were configured for data collection. The filters were used for noise removal. Some ECG data were not properly recorded, which was uncovered during the data analysis phase. Such records were removed by identi­ fying outliers. Finally, data of 78 subjects (26-cardiac, 17-diabetic and 35 normal) was considered for experiment.

2. Literature survey Researchers have applied various techniques for analysis and pre­ diction of cardiac and diabetic subjects. Classification and regression techniques are used by Refs. [15,16] for risk assessment of cardiac pa­ tients. Linear and nonlinear parameters of ECG signals are explored in Refs. [5,17,18]. Pecchia et al. [15] have designed a telemedicine platform for remote health monitoring based on the classification and regression technique of data mining. The platform supports the assessment of heart failure patient severity. The platform distinguishes mild and severe patients with an accuracy of 96.39%. However, assessment on a large number of elderly subjects and other parameters need to be considered. Melillo et al. [16] have proposed a CART based automatic classifier for the risk assessment of cardiac patients. They classified subjects as low risk and high risk based on long term HRV parameters. With their proposed approach they achieved a sensitivity of 93.33% and specificity of 63.3%; however the sample size used for building the decision tree is small, i.e., 33 patients. Acharya et al. [17] analyzed the short term ECG signal of 2–5 s morphologically for the detection of different arrhythmias. They

4. Proposed system The detailed workflow of the machine learning based classification process is shown in Fig. 1; it has four stages. In the first stage, data is collected using. A 12 lead ECG acquisition machine. Recorded digital data is stored in XML format that contains readings from 12 electrodes. In the second stage, R-script [19] is used to separate the combined data to individual channel data for further processing. The channel data is stored in csv format. It has been observed that the second channel data is good for analysis purposes because it is proximate to the left ventricle, 2

U. Shirole et al.

Informatics in Medicine Unlocked xxx (xxxx) xxx

Fig. 1. The workflow of the process for data capturing, analysis and classification.

Model learning. Machine learning algorithms play a significant role in medical diagnosis [23–25]. The decision tree classification method generates a tree-like structure having decision nodes and leaf nodes. A decision node has two or more branches, the last node of a branch is a leaf node that represents a classification or decision. The algorithm for building a decision tree employs a top-down greedy search starting with a root node that corresponds to the best predicate for possible branches to a leaf node. Commonly used criteria for splitting is Gini index [26], whose value ranges from 0 to 1. A Gini index zero indicates that all records at the node belong to the same class, and a Gini index one in­ dicates that all records belong to a different class. Gini index for classification at each node t in a tree can be defined as follows:

which is the main chamber that supplies oxygenated blood to all parts of the body. In the third stage, HRV analysis is carried out using Kubios software (available at http://kubios.uku.fi). Kubios software takes an input ECG signal file and it generates R-R interval series. Based on these R-R in­ terval series various linear and non-linear HRV parameters were calcu­ lated. The software generates the PDF file containing: a) R-R interval signal and time domain HRV parameters, b) FFT, AR spectrum and frequency domain HRV parameters, and c) Poincar�e plot and non-linear HRV parameters [20]. The required data is tabulated in Excel format for further processing. In addition, patient identification number (PID) and labels are assigned to each subject. The subjects are labeled as: D diabetic, C - cardiac, and N - normal. Labeling is done based on the physician’s diagnostic report. In the fourth stage, a supervised machine learning method is employed to train a model. Details of the machine learning process are discussed in the next section.

Gini index ¼ 1

(nc/N)2

(nd/N)2

(nk/N)2

(1)

where N is the total number of subjects considered at that node, i.e., N ¼ nc þ nd þ nk; nc - # cardiac subjects, nd - # diabetic subjects and nk # normal subjects. The classification tree building procedure is given in Algorithm 1. Its input is the training data and output is a decision tree. The algorithm constraints are a) number of subjects should not be null and b) the number of attributes should be more than zero. This algorithm calculates Gini index of all attributes, then finds the attribute which has a maximum Gini index. Such an attribute is used to partition all data. This process is repeated for all partitions. At the end we obtain a decision tree. Model evaluation. Different measures of model evaluation are dis­ cussed in sub-section 5.1. Prediction. Once the model is built and evaluated for different pa­ rameters, it is suitable for prediction. In this phase, new data is input to the model and its class is obtained as the classification decision.

5. Machine learning technique Machine learning algorithms are used to train machines to take de­ cisions/predictions based on input data. There are two types of algo­ rithms namely supervised and unsupervised [12]. Fig. 2 shows the machine learning process of supervised algorithms for model generation and prediction. There are four main processes: 1) pre-processing, 2) model learning (training), 3) model evaluation, and 4) class prediction of new data. In this work, we employed a decision tree algorithm (su­ pervised algorithm) for the machine learning process. Pre-processing. In this phase data is cleansed to obtain correct and complete data for model training. We have carried out null value removal, outliers removal of data. Not all features are important for model learning; therefore, some of the features were removed. There are three methods for elimination of the features: 1) Filter Method, 2) Wrapper Method, and 3) Embedded method [21,22]. To train and test a classification model, the whole data set is split into two sets: a training set, and a testing set. Generally, the data set is split into. 80% training data set and the remaining 20% to the testing data set.

Fig. 2. Machine learning process workflow. 3

U. Shirole et al.

Informatics in Medicine Unlocked xxx (xxxx) xxx

Table 2 Model evaluation measures accuracy precision, recall, and F1-score. Accuracy Precision Recall F1-Score

(TP þ TN)/(TP þ FN þ TN þ FP) TP/(TP þ FP) TP/(TP þ FN) 2 � ((precision � recall)/(precision þ recall))

* TP- True Positive, TN- True Negative, FP- False Positive, and FN- False Negative.

recall, respectively. The F1 score is defined as the weighted harmonic mean of the test’s precision and recall. 5.2. Orthostatic stress index The orthostatic Stress Index (OSI) is obtained from the frequency domain term LF/HF. This ratio is also called the sympathovagal balance [28]. It is defined as � � � � LF HF

OSI ¼

sitting

LF HF

supine

(2)

sitting

LF corresponds to the sympathetic power and HF corresponds to the parasympathetic power [14]. Parasympathetic power predominates sympathetic power in the resting condition, in contrast the sympathetic power predominates parasympathetic power in the sitting position. Hence, a value of OSI index is expected to be low in the supine position and high in the sitting position. Heart capacity is good in healthy sub­ jects; therefore (LF/HF)sitting ratio is high, thus OSI is positive. In case of diseased subjects, heart capacity is not good, therefore (LF/HF)sitting ratio is less and thus OSI is negative. OSI is a verification tool to confirm the model prediction. Hence, we have used OSI as a confirmative tool to verify the classification predictions made by the decision tree.

Algorithm 1. Decision Tree model generation algorithms 5.1. Model evaluation measures

6. Results

A model for classification problem is built using a machine learning algorithm. The goal of predictive modeling is to develop a model that can make a prediction on new unseen data and have good performance. We use the following terms to define model evaluation measures. True Positive (TP): The observed sample is positive, and is predicted as posi­ tive. False Negative (FN): The observed sample is positive, but is pre­ dicted as negative. True Negative (TN): The observed sample is negative, and is predicted as negative. False Positive (FP): The observed sample is negative, but is predicted as positive. Total observation is a sum of all of the above terms. Confusion Matrix. A confusion matrix is also known as a confusion table. A confusion matrix summarizes the classification performance of a classifier with respect to test data [27]. This table has two columns and two rows for binary classification. The confusion matrix for binary classification is as shown in Table 1. The four cells of this table indicate the number of true positive, true negative, false positive, and false negative counts. The number of correct and incorrect class summary is given in this table. Accuracy, precision, recall, and F1-score of a model are as defined in Table 2. Model exactness and completeness is estimated by precision and

All data is analyzed using statistical methods to obtain a summary of data. The detailed statistical summary of normal, diabetic and cardiac subjects is given in Table 3. These details are used to identify outliers in the data. A total of 78 subjects remained out of 97 for processing after outliers removal, that include 26 cardiac, 17 diabetic and 35 normal subjects. The HRV parameters SDNN, pNN50, LF/HF, ApEn, SampleEn, DFA1, DFA2 have reduced values for cardiac subjects as compared to diabetics, indicating that cardiac subjects are at high risk. However, Mean HR, LF, HF, RR triangular index, and recurrence rate are exceptions. We carried out the experiment in two stages. In the first stage, we performed experiments in time domain, frequency domain, and for nonlinear parameters separately. Table 4 gives the results of experiments using a classification tree. Time domain parameters quantify the amount of HRV observed during the monitoring period. Time domain parame­ ters achieved an accuracy of 82.28%. Nonlinear parameters quantify the unpredictability and complexity of a series of inter-beat intervals and gave accuracy of 82.28%. Accuracy of 84.81% is obtained using fre­ quency domain parameters. Frequency domain parameters calculate the amount of signal energy within component bands. In the second stage, we have ranked attributes based on the value of the Gini index in the classification tree for time domain, frequency domain, and nonlinear parameters. Attributes having large Gini index are assigned high rank. We selected a group of attributes from each domain for final classification, namely. a) Time domain: RMSSD, SDNN, pNN50; b) Frequency Domain: Total power, LF/HF, HF; and c) Nonlinear: Sample Entropy (SampleEN), Approximate Entropy (ApEn), Recurrence rate, and D2. Using these combined features, we achieved an accuracy of 86.07%. Furthermore,

Table 1 The confusion matrix for binary classification where Class1 is positive and Class 2 is negative. Predicated Class Actual Class 1 Class Class 2

LF HF

� �

Class 1

Class 2

TP FP

FN TN

* TP- True Positive, TN- True Negative, FP- False Positive, and FN- False Negative. 4

U. Shirole et al.

Informatics in Medicine Unlocked xxx (xxxx) xxx

Table 3 Statistical analysis of the linear time domain and frequency domain, non-linear HRV parameters for cardiac and diabetic subjects. Features

Normal Subjects

Diabetic Subjects

Cardiac Subjects

1st quart.

Mean

3rd quart.

1st quart.

Mean

3rd quart.

1st quart.

Mean

3rd quart.

SDNN Mean HR pNN50 RRT Index LF HF LF/HF Total Power Rec. Rate ApEn SampleEn DFA1 DFA2 D2

37.40 72.66 1.00 9.78 88.00 69.25 0.94 477.00 30.07 1.16 1.22 0.95 0.82 0.38

41.75 78.85 2.35 10.88 188.50 136.00 1.65 754.00 41.84 1.53 1.52 1.13 1.20 0.56

53.16 84.74 19.08 13.49 408.75 327.75 3.39 1584.25 44.55 1.67 1.70 1.23 1.06 1.10

32.20 69.01 0.70 7.94 220.50 13400 0.65 850.50 29.06 1.06 1.12 0.76 0.75 0.56

39.10 75.63 2.00 9.67 363.00 429.00 1.29 1534.00 43.87 1.26 1.44 1.11 0.87 0.67

53.6 82.20 17.80 12.75 706.75 774.00 2.64 2709.00 50.74 1.43 1.69 1.23 1.03 3.69

26.95 76.17 0.33 4.78 173.50 48.00 0.59 772.75 42.29 0.67 0.53 0.47 0.62 0.13

40.75 79.95 1.15 7.25 397.50 635.50 0.82 1429.00 53.09 1.00 0.87 0.77 0.87 0.49

50.55 95.33 5.70 8.19 780.00 1333.75 2.60 3035.00 81.80 1.17 1.19 1.12 1.11 0.78

* SDNN- Standard deviation of RR intervals, Mean HR-The mean of RR intervals. -pNN50-NN50 divided by the total number of RR intervals. -RRT Index- The integral of the RR interval histogram divided by the height of the histogram. -LF- Low Frequency band, HF- High Frequency Band. -Rec. Rate- Recurrence rate, ApEn- Approximate entropy, SampleEn- Sample entropy. -DFA1-of Short-term fluctuations of detrended fluctuation analysis. -DFA2- Long-term fluctuations of detrended fluctuation analysis (DFA), D2-Correlation dimension.

7. Discussion

Table 4 Accuracy of the classification for Linear, frequency domain and nonlinear features. Features

Parameters

Testing Accuracy (%)

Time Domain

PNN50, SDNN, RRT Index, Mean RR, RMSSD, TINN50, Mean HR, and NN50 HF, VLF, LF, LF/HF, Total Power

82.28

Frequency Domain Nonlinear

SD1, SD2, DFA1, DFA2, Rec. rate, Shannon entropy, Sample Entropy, D2, ApEn

We have proposed a classification tree model for diabetic, cardiac, and normal subjects based on linear and nonlinear HRV parameters. In this section we discuss the relevance of selection of HRV parameters and reasoning for cross verification by OSI. pNN50 is a widely used time domain HRV measure to assess para­ sympathetic activity of the heart. pNN50 requires data to be captured for a long time and range of values change with number of samples. Therefore, we have captured data for 15 min in all subjects. In the study, we found that the pNN50 is low for the cardiac subjects compared to diabetic and normal subjects. The mean pNN50 value of the cardiac subjects is 1.15, whereas diabetic subjects have mean pNN50 value of 2.00, thereby giving a clear discrimination between cardiac, diabetic and normal subjects. Melillo et al. [16] have observed mean values for low risk 3.02 and high risk are 1.70. A similar trend is observed in our study. LF/HF ratio is a frequency domain linear measure of HRV. It is a measure of sympathovagal balance, i.e., LF power, reflects sympathetic nervous system, and HF power reflects parasympathetic nervous sys­ tems. In our study, it has been observed that mean of LF/HF ratio is low (0.82) for cardiac subjects, high (1.29) for diabetic subjects, and higher (1.65) for normal subjects. A low LF/HF ratio reflects parasympathetic dominance, which engages in tend and befriend behaviors [29]. In contrast, a high LF/HF ratio indicates sympathetic dominance, which occurs when we engage in fight-or-flight behaviors or parasympathetic withdrawal [30]. ApEn quantifies the unpredictability of fluctuations in a time series such as an instantaneous heart rate time series [31]. A time series con­ taining many repetitive patterns has a relatively small ApEn; a less predictable (i.e., more complex) process has a higher ApEn. ApEn values extracted from low and high frequency components of healthy subjects were higher than those of diabetes patients [32]. Our observations in the experiment support these results. We observed some misclassification in cardiac and diabetic subjects as shown in Table 5. These results are cross verified using OSI values. An OSI of 25 samples is shown in Table 7, which shows the PID, labeled class, predicted class and OSI for diseased and normal subjects. The table also lists subject details regarding medical history and symptoms noted from the patient’s file as diagnosed by the cardiologist. Some mis­ classifications are due to the model; however, we have also observed

84.81 82.28

-RRT Index- The integral of the RR interval histogram divided by the height of the histogram, Mean RR-The mean of RR intervals, RMSSD-Square root of the mean squared differences between successive RR intervals, TINN50-Baseline width of the RR interval histogram. NN50-Number of successive RR interval pairs that differ more than 50 ms, D2Correlation dimension.

based on Gini index values we reduced the attributes and conducted the experiment. The maximum accuracy of 93.58% is achieved by combining ApEn, SampleEn, pNN50 and LF/HF with a precision 94%, Recall of 94% and F1-score of 94% with a tree depth of 7. This is known as wrapper method to eliminate the least significant features. Fig. 3 shows the resultant classification tree generated using com­ bined features. We have also tried different models with a height ranging from 2 to 10. It was observed that after a certain tree depth, accuracy drops or remain constant and does not improve. A reduced depth tree is easy to understand and apply but is more general and does not provide the required accuracy. A complete tree with maximum depth is complex and gives the highest accuracy but not a good model. In other words, as we reduce the tree depth, the tree gets pruned to generalize the model at the same time accuracy is lost. Hence there is a trade-off between ac­ curacy and tree depth. The confusion matrix of the result is as shown in Table 5, where 24 cardiac patients are classified correctly out of 26, thus achieving 96% precision. A total 14 diabetic subjects are classified correctly out of 17, thus achieving 90% precision. Total 35 normal subjects are classified correctly out of 35, thus achieving 100% precision. The classification summary report of the model is as shown in Table 6. The average pre­ cision, recall, and F1-score of the model is 94%. This indicates that the model has good exactness and completeness. 5

U. Shirole et al.

Informatics in Medicine Unlocked xxx (xxxx) xxx

Fig. 3. Classification tree using combined linear and non-linear features.

Melillo et al. [16] have done classification for congestive heart fail­ ure patients, as low risk and high risk. The results were supported by the New York Heart Association (NYHA) classification scheme. They have used 12 low-risk and 34 high risk patients for analysis purposes. They have achieved 85.4% accuracy using the decision tree method. How­ ever, there is no consideration of diabetic subjects in their study. Moreover, sample space is of 46 subjects only. In our study 78 total subjects are considered with improved accuracy. Faust et al. [7] have performed a cardiac assessment of diabetic patients and shown that nonlinear HRV parameters are superior over linear parameters, and the HRV values dominate for the normal subjects compared to diabetics. They have used 15 normal and 15 diabetic subjects for the study. Experimental analysis of their work suggests a relationship between linear and non-linear parameters, which are consistent with our study.

Table 5 Confusion matrix of the final result. Cardiac Diabetic Normal

Cardiac

Diabetic

Normal

24 1 0

0 14 0

2 2 35

Table 6 Summary of classification report. Subjects

Precision

Recall

F1-score

Support

Cardiac Diabetic Normal Average/Total

0.96 1.00 0.90 0.94

0.92 0.82 1.00 0.94

0.94 0.90 0.95 0.94

26 17 35 78

8. Conclusion that some misclassifications are due to change in the state of subject medical condition due to surgery or continuous medication. For example, PID P25 and P19 were initially labeled as cardiac but predi­ cated by decision tree model as normal subjects. PID 25 went through the medical surgery where subject’s 4 blockages were removed, and 2 stents were placed. PID 19 is new patient with recent single blockage found in angiography. Similarly, PID P40 and P04 were initially labeled as diabetic, but predicted by the decision-tree model as a normal subject because these subjects are taking regular medication. However PID P36 was initially labeled diabetic is misclassified as cardiac; this subject has a diabetes history for the last 20 years and has negative OSI. Thus OSI has provided the correct reasoning and increased confidence in the decision tree model.

A machine learning based classification approach is proposed for cardiac health. In total 78 subjects were analyzed to build a classifica­ tion model. We have applied a two-stage approach to train the classifi­ cation model. In the first stage, individual HRV features were explored to obtain classification model with an accuracy of 82.28%, 84.81%, and 82.81% for time domain, frequency domain, and nonlinear parameters, respectively. In the second stage, based on these results we have ranked attributes in each domain to build the final model. Results have shown that individual parameters may not be a good choice to generate a model for classification. Hence, we combined selected features from all three HRV parameters to achieve 93.58% accuracy of the model and 94% precision, recall and F1-score. This proposed model can be used to predict and give concerned warning by the clinicians regarding cardiac 6

U. Shirole et al.

Informatics in Medicine Unlocked xxx (xxxx) xxx

manuscript.

Table 7 Orthostatic stress index cardiac, diabetic and normal subjects. PID

Gender

Age

Labeled class

Predicted class

OSI

P70

F

60

C

C

28.2188

P15

F

65

C

C

10.8619

P57

F

57

C

C

9.70714

P01

M

52

C

C

3.02646

P80

M

70

C

C

1.90506

P24

M

30

C

C

1.76838

P36

F

62

D

C

1.67422

P29

M

56

D

D

1.00000

P52

M

49

D

D

0.85938

P04

F

66

D

N

0.59267

P13

M

65

C

D

0.49903

P19

F

36

C

N

0.41667

P20

F

62

D

D

0.36256

P07

M

36

D

D

0.34422

P25

M

62

C

N

0.10417

P47 P49

F F

40 51

N N

N N

0.000000 0.000000

P50

M

47

N

N

0.000000

P42 P27

F F

65 32

N N

N N

0.038244 0.197814

P08 P46 P40

F F M

32 40 53

N N D

N N N

0.347868 0.412668 0.572995

P65

F

45

N

N

0.713757

Symptoms

Acknowledgment

Heart attack, BP- since 10 yrs. 10 yrs ago MI occurred twice Blood pressure since 10yrs. bypass suggestion, 10 blockages case of atrial fibrillation 95% blockage, bradycardia diabetes since 20 yrs. Diabetes since 30 yrs, daily insulin dose Diabetes 2 years BP 2 yrs. Diabetes since last 10 yrs with regular medication diastolic dysfunction, angioplasty done one blockage found in angiography Diabetes since last 8 yrs Diabetes since 4 yrs. 4 blockages removed, 2 stents placed normal asthma from childhood chest pain due to Gas in stomach normal admitted due to abdomen pain normal normal Diabetes since 2 yrs, regular medication normal

We would like to acknowledge the biomedical laboratory of V. J. T. I., Matunga, Mumbai, India, and B & J superspeciality Hospital, Kamothe, Navi Mumbai, India, for their support and service. References [1] Sangster J, Furber S, Phongsavan P, Redfern J, Mark A, Bauman A. Effects of a pedometer-based telephone coaching intervention on physical activity among people with cardiac disease in urban, rural and semi rural settings: a replication study. 2017 Heart Lung Circ 2017;26(4):354–61. https://doi.org/10.1016/j. hlc.2016.07.004. URL. [2] Acharya UR, Hagiwara Y, Koh JEW, Oh SL, Tan JH, Adam M, Tan RS. Entropies for automated detection of coronary artery disease using ECG signals: a review. 2018 Biocybern. Biomed. Eng. 2018;38(2):373–84. https://doi.org/10.1016/j. bbe.2018.03.001. [3] Aune D, Schlesinger S, Norat T, Riboli E. Diabetes mellitus and the risk of sudden cardiac death: a systematic review and meta analysis of prospective studies. 2018 Nutr Metab Cardiovasc Dis 2018;28(6):543–56. https://doi.org/10.1016/j. numecd.2018.02.011. URL. [4] Young LH, Viscoli CM, Curtis JP, Inzucchi SE, Schwartz GG, Lovejoy AM, Furie KL, Gorman MJ, Conwit R, Dawn Abbott J, Jacoby DL, Kolansky DM, Pfau SE, Ling FS, Kernan WN. Cardiac outcomes after ischemic stroke or transient ischemic attack effects of pioglitazone in patients with insulin resistance without diabetes mellitus. 2017 Circulation 2017;135(20):1882–93. https://doi.org/10.1161/ CIRCULATIONAHA.116.024863. [5] Rajendra Acharya U, Faust O, Adib Kadri N, Suri JS, Yu W. Automated identification of normal and diabetes heart rate signals using nonlinear measures. 2013 Comput Biol Med 2013;43(10):1523–9. https://doi.org/10.1016/j. compbiomed.2013.05.024. URL. [6] Thangasami SR, Chandani AL. Emphasis of yoga in the management of diabetes. URL bJ Diabetes Meta 2015;6(10). https://doi.org/10.4172/2155-6156.1000613. https://www.omicsonline.org/open-access/emphasis-of-yoga-in-the-mana gement-of-diabetes-2155-6156-1000613.php?aid¼61561. [7] Faust O, Acharya U, Molinari F, Chattopadhyay S, Tamura T. Linear and non-linear analysis of cardiac health in diabetic subjects. Biomed Signal Process Control 2012; 7(3):295–302. https://doi.org/10.1016/j.bspc.2011.06.002. bioSignal Processing for Engineering and Computing: the MEDICON conference case (2012), http:// www.sciencedirect.com/science/article/pii/S1746809411000553. URL. [8] Shirole U, Joshi M, Bagul P. Linear and nonlinear analysis of cardiac and diabetic subjects. In: International conference on intelligent information technologies. Springer; 2018. p. 130–40. 2018. [9] Soydan N, Bretzel RG, Fischer B, Wagenlehner F, Pilatz A, Linn T. Reduced capacity of heart rate regulation in response to mild hypo- glycemia induced by glibenclamide and physical exercise in type 2 diabetes. 2013 Metab Clin Exp 2013; 62(5):717–24. https://doi.org/10.1016/j.metabol.2012.12.003. URL. [10] Fujita H, Acharya UR, Sudarshan VK, Ghista DN, Sree SV, Eugene LWJ, Koh JE. Sudden cardiac death (SCD) prediction based on nonlinear heart rate variability features and SCD index. March Appl. Soft Comput. J. 2016;43:510–9. https://doi. org/10.1016/j.asoc.2016.02.049. 2016. [11] Witten IH, Frank E, Hall MA, Pal CJ. Data Mining: practical machine learning tools and techniques. Morgan Kaufmann; 2016. p. 2016. [12] Mitchell TM. Machine learning. first ed. New York, NY, USA: McGraw-Hill, Inc.; 1997. p. 1997. [13] Kotsiantis SB, Zaharakis I, Pintelas P. Supervised machine learning: a review of classification techniques. Emerg. Artif. Intell. Appl. Comput. Eng. 2007;160:3–24. 2007. [14] Shirole U, Joshi M, Bagul P. Cardiac autonomous function assessment in congestive heart failure using HRV analysis. Int J Sci Eng Res 2017;8(11):287–9. 2017. [15] Pecchia L, Melillo P, Bracale M. Remote health monitoring of heart failure with data mining via CART method on HRV features. IEEE Trans Biomed Eng 2011;58(3 PART 2):800–4. https://doi.org/10.1109/TBME.2010.2092776. 2011. [16] Melillo P, De Luca N, Bracale M, Pecchia L. Classification tree for risk assessment in patients suffering from congestive heart failure via long-term heart rate variability. IEEE J. Biomed. Health Inf. 2013;17(3):727–33. https://doi.org/10.1109/ JBHI.2013.2244902. 2013. [17] Acharya UR, Fujita H, Lih OS, Hagiwara Y, Tan JH, Adam M. Automated detection of arrhythmias using different intervals of tachycardia ECG segments with convolutional neural network. September Inf Sci 2017;405:81–90. https://doi.org/ 10.1016/j.ins.2017.04.012. 2017. [18] Cornforth D, Tarvainen MP, Jelinek HF. Automated selection of measures of heart rate variability for detection of early cardiac autonomic neuropathy, Computing in Cardiology Conference. CinC); 2014 (2014) 93–96 (2014). [19] Gentleman R. R programming for bioinformatics. Chapman and Hall/CRC; 2008. 2008. [20] Tarvainen MP, Niskanen JP, Lipponen JA, Rantaaho PO, Karjalainen PA. Kubios HRV - heart rate variability analysis software. 2014 Comput Methods Progr Biomed 2014;113(1):210–20. https://doi.org/10.1016/j.cmpb.2013.07.024. URL. [21] Dash M, Liu H. Feature selection for classification. Intell Data Anal 1997;1(1–4): 131–56. 1997.

*OSI- Orthostatic Stress Index.

or diabetic symptoms of the patient. Misclassified results are reasoned by cross verifying classification results with OSI. OSI has confirmed the accuracy of the classification model and reasoning for the misclassifi­ cation of some subjects. Declaration of competing interest All authors have participated in (a) conception and design, or anal­ ysis and interpretation of the data; (b) drafting the article or revising it critically for important intellectual content; and (c) approval of the final version. This manuscript has not been submitted to, nor is under review at, another journal or other publishing venue. The authors have no affiliation with any organization with a direct or indirect financial interest in the subject matter discussed in the 7

U. Shirole et al.

Informatics in Medicine Unlocked xxx (xxxx) xxx

[22] Chandrashekar G, Sahin F. A survey on feature selection methods. Comput Electr Eng 2014;40(1):16–28. 2014. [23] Gokgoz E, Subasi A. Comparison of decision tree algorithms for emg signal classification using dwt. Biomed Signal Process Control 2015;18:138–44. 2015. [24] Kourou K, Exarchos TP, Exarchos KP, Karamouzis MV, Fotiadis DI. Machine learning applications in cancer prognosis and prediction. Comput Struct Biotechnol J 2015;13:8–17. 2015. [25] Luo W, Phung D, Tran T, Gupta S, Rana S, Karmakar C, Shilton A, Yearwood J, Dimitrova N, Ho TB, et al. Guidelines for developing and reporting machine learning predictive models in biomedical research: a multidisciplinary view. J Med Internet Res 2016;18(12):e323. 2016. [26] Raileanu LE, Stoffel K. Theoretical comparison between the gini index and information gain criteria. Ann Math Artif Intell 2004;41(1):77–93. 2004. [27] Ting KM. Confusion matrix. Encyclopedia of Machine Learning and Data Mining; 2017. 260–260 (2017). [28] Hynynen E, Konttinen N, Kinnunen U, Kyr€ ol€ ainen H, Rusko H. The incidence of stress symptoms and heart rate variability during sleep and orthostatic test. Eur J

[29]

[30]

[31] [32]

8

Appl Physiol 2011;111(5):733–41. https://doi.org/10.1007/s00421-010-1698-x. 2011. von Rosenberg W, Chanwimalueang T, Adjei T, Jaffer U, Gover- dovsky V, Mandic DP. Resolving ambiguities in the lf/hf ratio: Lf-hf scatter plots for the categorization of mental and physical stress from hrv. 2017 Front Physiol 2017;8: 360. https://doi.org/10.3389/fphys.2017.00360. URL, https://www.frontiersin. org/article/10.3389/fphys.2017.00360. Shaffer F, Ginsberg JP. An overview of heart rate variability metrics and norms. 2017 Front. Public Health 2017;5:258. https://doi.org/10.3389/ fpubh.2017.00258. URL, https://www.frontiersin.org/article/10.3389/fpubh .2017.00258. physinet. Approximate entrophy. URL, https://physionet.org/physiotools/ApEn/; 2015. Li X, Yu S, Chen H, Lu C, Zhang K, Li F. Cardiovascular autonomic function analysis using approximate entropy from 24-h heart rate variability and its frequency components in patients with type 2 diabetes. J. Diabetes Investig. 2014;6(09). https://doi.org/10.1111/jdi.12270.