Visualization of the Machine Learning Process Using J48 Decision Tree for Biometrics through ECG Signal ()
1. INTRODUCTION
The domain of biometrics is a rapidly advancing field that provides verification of a person based on the individual’s uniquely intrinsic physiological characteristics [1-3]. For example, a standard biometric application pertains to a person’s fingerprint. More sophisticated biometric techniques involve identification of the voice, face, and aspects of the eye, such as the retina and iris [1]. The ECG signal is also a candidate for the domain of biometrics that characterizes the electrical attributes of the heart that infers the heart’s functional status with augmented relevance through the evolution to portable and wearable systems [1-9].
The technology domain of biometrics displays trends of rampant interest with substantial impact on both government and private industry sectors. Traditional strategies for authenticating a person’s identity incorporate cryptographic techniques, such as through the use of a secret string of characters representing a password and/or a possession of a card or token. However, an inherent dilemma with the traditional cryptographic strategy is the observation that passwords can be forgotten, and cards or tokens can be lost [1,7].
Biometrics involves the recognition of persons from their unique physiological characteristics, such as their ECG signal. Since biometrics enables a person’s identity to be authenticated, this domain is extremely pertinent to personal security, which implies a substantial amount of potential applications [1,7]. The ECG signal has been proposed as a robust candidate for biometrics, and the relevance of the ECG signal has been further augmented with its confluence to the fields of portable and wearable systems [1-3,6-8]. Additionally, the ECG signal is suitable for continuous measurement and highly resistant to counterfeiting [2,3,8].
Central to the application of ECG signals to distinguish subject identity is the role of machine learning, but a potential issue involves the complexity of comprehending machine learning, especially for research team subject matter experts external to the domain of machine learning. For example, the consolidation of a feature set through the use of relevant and readily discernible numeric attributes for the comprehension of machine learning is significant. LeMoyne and Mastroianni achieved preliminary resolution of the dilemma of machine learning complexity by developing a temporally organized feature set derived from the maxima of the P, R, and T waves and minima of the Q and S waves. LeMoyne and Mastroianni succeeded in attaining considerable classification accuracy to differentiate subjects in a biometric context through the support vector machine and multilayer perceptron neural network [10,11].
However, the support vector machine and multilayer perceptron neural network involve sophisticated algorithms of considerable complexity [12,13]. The degree of complexity for comprehending the implementation of machine learning algorithms, such as the support vector machine and multilayer perceptron neural network, may be somewhat daunting for research team subject matter experts external to the domain of machine learning. Essentially, machine learning algorithms can constitute “black boxes”, and the issue of trust in the classification results is paramount [14].
The J48 decision tree provided by the Waikato Environment for Knowledge Analysis (WEKA) provides a visualization of the machine learning process. The visualization of the J48 decision tree presents an informative branching structure that derives a classification of the feature set through the use of a series of thresholds applied to the most significant numeric attributes [12,15-17]. Therefore, the objective of the research endeavor is to apply the J48 decision tree to provide a visualization of the machine learning process for the distinction of subjects’ ECG signals using the temporal organization of the ECG signals to develop the feature set with consideration to both the classification accuracy and time to develop the model.
2. BACKGROUND
2.1. ECG Signal, an Electric Representation of the Heart’s Functional Properties
A general ECG signal is presented in Figure 1 [18,19]. The ECG signal is characterized by five segments: the P, Q, R, S, and T waves that represent unique functional aspects of the heart. These waves proceed in sequence [4,5,9].
During the P wave, atrial depolarization occurs symbolizing the commencement of atrial contraction, for which the P wave consists of two segments involving the first half depolarizing the right atrium and the second half involving left atrium depolarization. The QRS complex is composed of a collection of the Q, R,
Figure 1. A representative ECG signal consisting of a single heartbeat. The P, Q, R, S, and T waves proceed as a function of increasing time. The maxima of the P, R, and T waves and the minima of the Q and S waves are defined by the filled circle [18,19].
and S waves that involve depolarization of both the right ventricle and left ventricle, which initiates ventricular contraction. The T wave symbolizes ventricular repolarization that precedes the relaxation of the ventricles [4,5,9].
2.2. Machine Learning Incorporating the ECG Signal Temporal Organization to Derive the Feature Set
Based on visualization of Figure 1 the temporal organization of the ECG signal can be applied to derive a feature set consisting of four numeric attributes. In particular, the maximum of the R wave is prevalent for the ECG signal. Two numeric attributes can be acquired by ascertaining the temporal differential of the P wave and T wave maxima relative to the R wave maximum. Additionally, two numeric attributes can be established from the temporal differential of the Q wave and S wave minima relative to the R wave maximum. An advantage of this approach is that the temporal organization of the ECG signal to compose the feature set is readily discernible. This strategy for defining the numeric attributes of the feature set in the context of the ECG signal temporal organization has been successfully applied by LeMoyne and Mastroianni through the application of the support vector machine and multilayer perceptron neural network with considerable classification accuracy [10,11].
2.3. Trust Issue with Machine Learning
Although the support vector machine and multilayer perceptron neural network have been successfully applied for the achievement of considerable classification accuracy, they rely on sophisticated techniques that may transcend the knowledge base of subject matter experts external to the domain of machine learning. The support vector machine applies a network of support vectors to differentiate the feature set’s classes that utilize a maximum margin hyperplane enabled by a kernel [12,15-17,20-22]. The multilayer perceptron emulates the neuron and incorporates backpropagation, which relies on gradient descent for optimization and the application of the sigmoid function [12,13,15-17,22-25].
However, an issue with these machine learning algorithms is they effectively constitute “black boxes”, especially for subject matter experts external to the domain of machine learning. The issue of trust with respect to machine learning classification presents a dilemma. Trust is imperative for efficacious human interaction in conjunction with machine learning applications. Additionally, explaining the basis for deriving machine learning classification is significant for determining trust [14]. A potential resolution to the issue of trust is the application of the J48 decision tree that provides visualization for the process of achieving classification accuracy through machine learning.
2.4. J48 Decision Tree for Visualized Machine Learning
The J48 decision tree is an algorithm that offers a visually discernible strategy for machine learning. Upon the development of the machine learning model, the J48 decision tree enables visualization of the process for classifying the respective instances of the feature set. The visualized J48 decision tree utilizes a branching structure of thresholds for the numeric attributes to establish classification of the instances [12,15-17]. Additionally, the J48 decision tree has been successfully implemented for distinguishing human health scenarios using quantified signal data for visualizing the means of achieving machine learning classification accuracy [26].
The J48 decision tree available in the Waikato Environment for Knowledge Analysis (WEKA) is based on the C4.5 machine learning algorithm evolution of ID3 that was invented by Quinlan [12,15-17,27-29]. This algorithm has been widely utilized [30]. The J48 decision tree available by WEKA applies a top-down strategy incorporating a recursive divide and conquer technique [15-17,31].
This approach enables subjects matter experts who are external to the domain of machine learning with better understanding of the machine learning process. As an alternative to more “black box” machine learning algorithms, such as the support vector machine and multilayer perceptron neural network, the process of deriving the classification accuracy by the J48 decision tree is visualized through its branching structure. In essence, this strategy enables subjects matter experts who are external to the domain of machine learning to contribute to the machine learning endeavor by evaluating the plausibility of the numeric attributes selected for the decision tree and the thresholds that invoke the branching process. Therefore, the J48 decision tree potentially offers a means for augmented trust respective of the attained classification accuracy.
3. MATERIALS AND METHODS
The online homepage resource known as PhysioNet provided the ECG signal data for two subjects. This resource enables access to clinically relevant physiological signal data on a broad scale. The homepage is supervised by MIT Laboratory for Computational Physiology, and the data is freely available [18,19].
The research endeavor was conducted from the vantage of engineering proof of concept. The ECG signal data was selected for two subjects and sampled at 500 Hz. Data post-processing applied Python through the Jupyter Notebook. The post-processing enabled the visualization and development of an Attribute-Relation File Format (ARFF) consisting of a series of numeric attributes that characterized the temporal organization of the ECG signal for the subsequent application of machine learning.
The Waikato Environment for Knowledge Analysis (WEKA) provided the machine learning platform. The J48 decision tree was selected as the machine learning algorithm, which inherently visualizes the machine learning process based on the structure of the decision tree. Supervised learning was applied, which incorporated tenfold cross-validation [15-17].
Below is the pseudo code applied to achieve the objectives of the post-processing through Python:
1) Upload the ECG signal data in a manner amenable to Comma-Separated Values (CSV) files.
2) Conduct steps 2 through 9 in a sequential manner based on the temporal differential of a series of 15 heartbeats for the two subjects.
3) Ascertain the temporal location of the R wave maximum.
4) Utilizing the temporal location of the R wave maximum determine the temporal location of the P wave maximum and T wave maximum.
5) With the temporal location of the P wave, R wave, and T wave maxima, acquire the temporal location of the Q wave and S wave minima.
6) Visualize the temporal orientation of the P wave maximum, Q wave minimum, R wave maximum, S wave minimum, and T wave maximum for each heartbeat of the ECG signal that is resemblant to Figure 1.
7) Acquire the temporal differential of the P wave maximum and T wave maximum relative to the correlated R wave maximum.
8) Acquire the temporal differential of the Q wave minimum and S wave minimum relative to the correlated R wave maximum.
9) Write the four temporal differentials determined in steps 7 and 8 to the ARFF file as four numeric attributes in terms of their absolute values.
4. RESULTS AND DISCUSSION
The automated post-processing of the ECG signal data for visualization and consolidation to a feature set derived from the temporal organization was enabled by Python. The visualization of the ECG signal for the two subjects’ 15 heartbeats inclusive of the maxima for the P, R, and T waves and minima for the Q and S waves was representative of Figure 1. The feature set for the ARFF file consisted of four numeric attributes established from the ECG signal temporal organization:
· P wave maximum and R wave maximum temporal differential
· Q wave minimum and R wave maximum temporal differential
· S wave minimum and R wave maximum temporal differential
· T wave maximum and R wave maximum temporal differential
These four numeric attributes were recorded in the ARFF file in terms of absolute values.
The J48 decision tree derived through WEKA is presented in Figure 2 comprised of two leaves. Note that the temporal differential between the T wave maximum and R wave maximum predominates. The J48 decision tree attains a classification accuracy of 96.7% for differentiating the two subjects through their respective ECG signals with 29 correctly classified instances from 30 available instances. In consideration of the associated confusion matrix, which clarifies correctly and incorrectly classified instances, one instance of the first subject was misclassified as the second subject. The machine learning model was developed in 0.01 seconds, which emphasizes the computational efficiency of the J48 decision tree.
Additional investigation of machine learning distinction of subjects based on the temporal organization of their ECG signal data by the J48 decision tree was conducted by evaluating the influence of reducing the number of attributes in the feature set. Reducing the feature set can influence the performance of the machine learning model, such as in terms of classification accuracy and time to develop the machine learning model [26].
Previous machine learning endeavors utilizing the support vector machine and multilayer perceptron neural network explored two reduced feature sets. These reduced feature sets consisted the temporal organization involving the P and T wave maxima relative to the R wave maximum and the Q and S wave
Figure 2. J48 decision tree for differentiating subjects based on the temporal organization of their ECG signal data.
minima relative to the R wave maximum [10,11]. However, Figure 1 illustrates the sequential nature of the procession from P, Q, R, S, and T waves for the ECG signal representing the functional electrical activity of the heart. Therefore, the reduced feature sets were segmented in a sequential manner consisting of the temporal differential of the P wave maximum and Q wave minimum relative to the R wave maximum and S wave minimum and T wave maximum relative to the R wave maximum.
The J48 decision tree for the reduced feature set pertaining to the P, Q, and R waves is illustrated in Figure 3. This J48 decision tree consisted of two leaves that emphasize the temporal differential between the P wave maximum and R wave maximum. The reduced feature set pertaining to the P, Q, and R waves demonstrated considerable decrement to the classification accuracy, which achieved only 50% classification accuracy. The machine learning model required less than 0.01 seconds to be developed. With respect to the confusion matrix 10 instances of the first subject were misclassified as the second subject and 5 instances of the second subject were misclassified as the first subject.
The J48 decision tree for the reduced feature set incorporating the R, S, and T waves is demonstrated in Figure 4. This J48 decision tree applied two leaves that underscore the significance of the R wave maximum and T wave maximum temporal differential. The reduced feature set applying to the R, S, and T waves attained 96.7% classification accuracy. The machine learning model required less than 0.01 seconds to be developed. The confusion matrix misclassified one instance of the first subject as the second subject.
The findings elucidate the utility of further investigation with respect to a reduced feature set. The reduced feature set pertaining to the temporal organization aspects of the R, S, and T waves of the ECG signal maintains the classification accuracy achieved by the full feature set. However, the time to classify the machine learning model is notably reduced. The acquisition of the two numeric attributes for the reduced feature set from the respective ECG signal data is relatively more computationally efficient than the derivation of four numeric for the full feature set.
The implication for the more computationally efficient reduced feature set based on time to develop the machine learning model and consolidate the ECG signal data is the feasibility to apply the findings to
Figure 3. J48 decision tree for differentiating subjects based on the temporal organization of their ECG signal data with respect to the reduced feature set involving the P maximum and Q wave minimum relative to the R wave maximum.
Figure 4. J48 decision tree for differentiating subjects based on the temporal organization of their ECG signal data involving the reduced feature set pertaining to the S wave minimum and T wave maximum relative to the R wave maximum.
system architectures with reduced processing power. For example, these computations can be conducted at a Cloud computing level with considerable processing power or the sensor level with reduced processing power. For the latter architecture more computationally efficient machine learning algorithms with streamlined consolidation of the signal data to a feature set would be intuitively desirable.
Another primary advantage of the J48 decision tree is the visualization of the machine learning process to classify the instances of the feature set. As illustrated in Figures 2-4 the J48 decision tree utilizes a tree-like structure that branches into leaves based on comparative thresholds. This visualization can ameliorate the concerns of a machine learning algorithm being considered a “black box”, since subject matter experts with skills outside the realm of machine learning can even apply the visualized J48 decision tree to the instances of the feature set.
The findings of the reduced feature set imply the significance of the temporal organization of the R, S, and T waves of the ECG signal to distinguish the subjects. With the visualization of the machine learning strategy presented, a diverse organization of subject matter experts external to the domain of machine learning can better comprehend and gain trust in the process that achieves machine learning classification accuracy. By presenting an informative approach that engages subject matter experts external to machine learning through visualization of the machine learning classification process, a more collaborative environment may transpire. Improved collaboration may facilitate the development of more sophisticated and representative feature sets.
The J48 decision tree achieves superior performance in the context of classification accuracy and time to develop the machine learning model relative to the support vector machine and multilayer perceptron neural network [10,11]. The performance of the J48 decision tree can be improved through a technique known as pruning, which modifies the complexity of the resultant decision tree [15-17]. Additional machine learning models warrant consideration, such as random forest, K-nearest neighbors, naïve Bayes, and logistic regression. More sophisticated techniques, such as deep learning, are also recommended.
Deep learning constitutes the state-of-the-art for present methodologies involving classification and recognition. An example of deep learning is the convolutional neural network, which is conceptually similar to the visual cortex. A significant advantage of deep learning is the ability to process the signal data from its original state [32]. By contrast, the J48 decision tree involving WEKA requires an ARFF file consisting of numeric attributes [15-17]. A general strategy for developing the ARFF file is achieved through the consolidation of signal data to numeric attributes through automation software [33-35].
Another implication of the research pertains to advanced diagnostics for a subject’s cardiac health. A subject’s current ECG signal could be ascertained as exceeding a prescribed machine learning classification threshold based on historical ECG signal data. This distinction could activate emergency response and cardiology resources from a data science perspective.
5. CONCLUSION
The research objective has been satisfied through the application of the J48 decision tree to enable a visualized representation of the machine learning process for the distinction of subjects based on their ECG signal data. The J48 decision tree achieved considerable classification accuracy, and the machine learning model was swiftly developed. The feature set for the machine learning application utilized the temporal organization of the ECG signal based on the maxima and minima of the P, Q, R, S, and T waves. The inherent strategy of the research objective enables subject matter experts external to the domain of machine learning to more fully comprehend the machine learning process for differentiating subjects through their ECG signal data.
Future extrapolations of the research objective are warranted. Other machine learning algorithms, such as random forest, K-nearest neighbors, naïve Bayes, and logistic regression provided by WEKA, can be evaluated in the context of their classification accuracy and time to develop the model. Furthermore, more sophisticated techniques, such as deep learning, are recommended. The implications establish a pathway for advanced cardiology diagnostics for the ability to apply therapeutic interventions prior to the manifestation of perceptible morbidities.