Enhancing myocardial infarction detection with vectorcardiography: fusion-based comparative analysis of machine learning methods Authors: Jaroslav Vondrak, Marek Penhaker Published: 2026 ABSTRACT BackgroundEarly detection and diagnosis of myocardial infarction (MI) help physicians save lives through timely treatment. Vectorcardiography (VCG) is an alternative to the 12-lead electrocardiography, providing not only characteristic changes in cardiac electrical activity in MI patients but also unique spatial information often overlooked by traditional methods. Despite its potential, comprehensive comparative studies applying machine learning (ML) techniques specifically to VCG data remain limited.MethodsThis study proposes a novel VCG processing methodology using a comparative analysis of machine learning-based algorithms for the automated detection of MI patients from VCG recordings, utilizing extracted domain knowledge VCG features that monitor morphological changes in cardiac activity. For this purpose, records from the PTB Diagnostic dataset were used. The extracted domain knowledge dataset of morphological features was then fed into a diverse set of 210 machine learning configurations, including K-nearest neighbor, Support Vector Machine, Discriminant Analysis, Artificial Neural Network, Decision Tree, Random Forest, Naive Bayes, Logistic Regression, and Ensemble Methods. To further improve classification performance, we combined analyzed high-performing models using a stacking ensemble strategy, which integrates multiple base classifiers into a meta-classifier.ResultsThe stacking-based decision-level fusion achieved high accuracy of 95.55%, sensitivity of 97.70%, specificity of 86.25%, positive predictive value of 96.86%, negative predictive value of 89.61% and f1-score of 97.27%.ConclusionThe results demonstrate that decision-level fusion via stacking improves classification performance and enhances the reliability of MI detection from VCG recordings, supporting cardiologists in decision-making. Introduction Myocardial infarction (MI) is a heart disease caused by a blockage of a coronary artery, causing insufficient flow of oxygenated blood to the heart muscle. A frequent clinical manifestation is long-lasting chest pain, shortness of breath or dizziness of varying intensity depending on where exactly in the coronary artery basin the blockage occurred (Thygesen et al., 2007; Zhao et al., 2021). There are, however, known cases where MI can occur in some patients as a clinically silent event without obvious symptoms. This fact can cause more serious problems for patients in the future. The American Health Association estimates that approximately 750,000 residents of the United States have a heart attack each year, of which 210,000 have a recurrent heart attack (Mozaffarian et al., 2016; Acharya et al., 2017). This means that there is a serious risk that patients can have a silent heart attack, which has damage to the myocardium without any clinical symptoms. The result of this fact is a very high risk of mortality. Mortality due to MI is increasing every year, while the age of onset of MI is decreasing (Acharya et al., 2017; Amini et al., 2021; He et al., 2022). The result of MI is irreversible damage to the myocardium and early diagnosis is necessary. Among non-invasive diagnostic methods, the 12-lead ECG is the most commonly used in clinical practice for diagnosing MI and other heart diseases. It measures the electrical activity of the heart using electrodes placed on the patient’s body. The diagnosis is made based on changes in the shape of the curve, rhythm, and other characteristics that correspond to a specific pathology. As part of automated detection, the ECG is analyzed using Machine Learning (M-L) methods to support diagnostics. Various machine learning techniques are used Hammad et al. (2022), such as K-nearest neighbor (KNN) (Sharma and Sunkaria, 2018), Ensemble bagged trees (Fatimah et al., 2021), Support vector machine (SVM) (Sharma and Sunkaria, 2018; Dhawan et al., 2012; Dohare et al., 2018), a combination of Fourier decomposition method (FDM) and SVM Fatimah et al. (2021) or Convolutional neural networks (CNN) (Śmigiel et al., 2021). The use of 12-lead ECG for MI detection has been studied by several authors using different methods (Acharya et al., 2017; Zhang et al., 2021; Sharma et al., 2018; Zeng et al., 2020; Barmpoutis et al., 2019; Han and Shi, 2019; Tadesse et al., 2021). Murat et al. (2021) extracted ECG features from lead II, which were subsequently input to nine different classification methods for arrhythmia detection. Using ECG features, the random forest classifier achieved the highest accuracy of 90.30%. Zhang et al. (2021) achieved a detection accuracy of 99.40% using the Tree Bagger classification to locate 11 kinds of MI. Acharya et al. (2017) achieved a detection accuracy of 93.53% from unfiltered ECG recordings using CNN. In a previous study (Sharma et al., 2018), they also dealt with the KNN classifier for extracted features. Another use of SVM for MI classification was used by Dohare et al. (2018), where their proposed model does not include pre-processing of signals in the form of filtering. Other processing options of ECG were presented by Weng et al. (2014) in the form of a combination of Principal Component Analysis (PCA) and polynomial approximation in the feature extraction phase of MI classification in order to increase the accuracy of the SVM classifier where they achieved accuracy of 98.07%. Machine learning methods were also used for ECG classification by Zhou and Tan (2020), where they proposed a combination of CNN and extreme learning machine (ELM). While Ripoll et al. (2016) derived a new CNN-based screening method to assess whether a patient should be referred to a cardiology service from ambulatory care or the emergency department. In addition to the commonly used 12-lead ECG, there is also lesser-known method of 3-lead Vectorcardiography (VCG), which provides spatial information about the electrical activity of the heart. VCG measurement is performed in three mutually perpendicular anatomical planes: sagittal, horizontal and frontal. Figure 1 shows individual VCG leads X, Y, Z together with spatial visualization. Compared to a standard 12-lead ECG, VCG achieves higher sensitivity and is more suitable for automated processing to detect heart diseases due to the smaller number of leads, no redundant information and higher measurement accuracy with corrected orthogonal leads (Malmivuo and Plonsey, 1995; Kijonka et al., 2022). In clinical practice, vectorcardiography is most often measured using the Frank lead system (Frank, 1956). In addition to the Frank lead system, there are also other lead systems such as (McFee and Parungao, 1961), SVEC III (Schmitt and SIMONSON, 1955), and hybrid lead systems (Dellborg et al., 1995), which were only used in specialized workplaces. VCG recording for HC (A) and for MI (B) in individual leads X, Y, Z and three-dimensional recurrent loop. Early detection of heart diseases is a frequently discussed topic these days (Hammad et al., 2018; Ketu and Mishra, 2022; Jambukia et al., 2015; Zhang X. et al., 2022, Zhang et al., 2020). There are known cases where automated detection from ECG recordings does not achieve sufficient accuracy (Filos et al., 2017). For example, studies dealing with the diagnosis of atrial enlargement (Bartall et al., 1978), right ventricular hypertrophy (Zhou et al., 2001; Cowdery et al., 1980) or even posterior MI (PMI) (Khan and Pachori., 2021a; Prabhakararao and Dandapat., 2020; Khan and Pachori., 2021b) found that VCG achieves a higher detection success compared to classical ECG. A reevaluation of the frequency of ECG use in favor of VCG has also been suggested (Van Bemmel et al., 1992; Khan and Pachori, 2021a). To detect MI from VCG recordings, the authors used similar principles of machine learning as in the case of ECG as mentioned above (Dehnavi et al., 2011; Dima et al., 2013; Panagiotou et al., 2013; Khan and Pachori, 2021a; Correa et al., 2016; Tripathy and Dandapat, 2017). For example, Dehnavi et al. (2011) extracted 22 VCG features, which were subsequently applied to a neural network (ANN). To detect myocardial scar as a consequence of MI, Dima et al. (2013) used ECG and VCG recordings from which they extracted features analyzing the pathophysiological consequences of a scarred myocardium causing electrical conduction failure. They used the SVM method for the extracted features. Another use of SVM was used by the authors in Panagiotou et al. (2013); Khan and Pachori (2021a) for the extracted features. The authors in Sharma and Sunkaria (2018) compared two classification methods for the detection of inferior MI, where they used the KNN and SVM methods and looked for which of these used methods achieves more accurate results. The information extracted from VCG led the authors in Chuang et al. (2023) to develop a patient-specific transformation for VCG synthesis. They used temporal convolutional networks in the variational mode decomposition domain to potentially differentiate MI patients and localize the infarct area. Perkins et al. (2024) used LASSO logistic regression to predict heart failure in patients after STEMI, using data from VCG and clinical information. Their model performed best at predicting heart failure within 90 days. They focused on important features that track changes in the heart’s shape, like the 3D sum or the shape of the heart in specific areas. In addition, the VCG recordings were also used in the analysis of the same MI patient before and during percutaneous transluminal coronary angiography (PTCA) (Hernandez et al., 2018). The results of this study indicate the potential for the diagnosis of acute myocardial infarction (AMI) using fewer leads. Limitations of existing work Machine learning methods have become an integral part of the automated processing of both ECG and VCG recordings for the early detection of various heart diseases. The limitation of the aforementioned publications is mainly the inconsistency of the analyzed machine learning methods for MI detection, where different authors achieve different detection accuracy results with different methods, even if many authors use similar features. Most authors do not dwell further on the choice or reason for using a given machine learning method. Furthermore, the spatial information of the VCG is not fully utilized in the processing of the measured signals. Another problem is the insufficient analysis of VCG features, especially within the framework of the analysis of the morphological properties of the given curve. A more detailed analysis of these features can contribute to a better understanding of the morphological changes that arise in individual patient records. Comparison of different classification methods can increase the accuracy, reliability and efficiency of myocardial infarction detection and contribute to better care of patients suffering from this serious disease. The benefit of this study is the consolidation of knowledge in the processing of VCG records using machine learning methods for MI detection. These insights can further be beneficial in improving automated detection to support diagnostics. Furthermore, also for the subsequent selection of a suitable classifier when solving similar problems, which are often solved in the literature recently. The main novelty lies in the development of a unique methodology combining structured feature extraction, comparative analysis of multiple machine learning classifiers, and the final implementation of a stacking model that integrates their strengths. The key contributions of this work can be summarized as follows:Extraction of domain-specific VCG features capturing morphological changes in VCG loops relevant to myocardial infarction.Analysis of the contribution and relevance of VCG features using statistical and permutation importance of features analysis for MI detection.Comparative analysis and tuning of various machine learning classifiers to assess their suitability for MI detection.Enhancing MI detection performance through a novel methodology that integrates feature-based analysis and the fusion of machine learning models using a stacking approach to achieve higher accuracy in automated diagnosis. Extraction of domain-specific VCG features capturing morphological changes in VCG loops relevant to myocardial infarction. Extraction of domain-specific VCG features capturing morphological changes in VCG loops relevant to myocardial infarction. Analysis of the contribution and relevance of VCG features using statistical and permutation importance of features analysis for MI detection. Analysis of the contribution and relevance of VCG features using statistical and permutation importance of features analysis for MI detection. Comparative analysis and tuning of various machine learning classifiers to assess their suitability for MI detection. Comparative analysis and tuning of various machine learning classifiers to assess their suitability for MI detection. Enhancing MI detection performance through a novel methodology that integrates feature-based analysis and the fusion of machine learning models using a stacking approach to achieve higher accuracy in automated diagnosis. Enhancing MI detection performance through a novel methodology that integrates feature-based analysis and the fusion of machine learning models using a stacking approach to achieve higher accuracy in automated diagnosis. Paper organization The rest of the article is organized as follows: Section 2 describes the methods and data used with the analysis of extracted VCG features, Section 3 deals with the comparative analysis of individual machine learning methods within the MI detection accuracy, Section 4 focuses on the discussion of the achieved results and Section 5 concludes the paper. Materials and methods The main goal of this section is to design a methodology for improving the accuracy of MI detection from VCG recordings. The proposed methodology includes signal preprocessing, feature extraction for analyzing the morphological properties of VCG loops, feature relevance analysis for MI detection, and a comparative analysis of machine learning methods for automatic MI classification. The individual sub-steps of processing VCG records for the purpose of MI detection are represented in Figure 2. Furthermore, each VCG record obtained from the Physikalisch Technische Bundesanstalt (PTB) database was filtered in order to remove interfering components that may affect the subsequent analysis. For this purpose, the procedures applied in previous work (Vondrak and Penhaker, 2022b) were used. After data preprocessing, VCG features were subsequently extracted, which analyze the morphological characteristics of cardiac activity. To verify the relevance of the extracted features, each feature was analyzed by the Mann-Whitney (M-W) statistical test to verify their predictive value. After statistical verification of significance, the features were fed into a total of 210 different types classification method configurations with variously set hyperparameters. The individual sub-steps mentioned above are discussed in more detail in the following subsections. Block diagram of the sub-steps addressed in this work for the purpose of MI detection. Study population For the purposes of this study, a public PTB diagnostic database was used, which contains records from healthy patients and patients with various heart diseases (MI, cardiomyopathy, bundle branch block, dysrhythmia). Recordings were taken at the Department of Cardiology of University Clinic Benjamin Franklin in Berlin, Germany. Each recording is sampled at a frequency of 1 kHz and contains simultaneously measured 12-lead ECG and 3-lead VCG. Each patient record contain 15 simultaneously recorded signals: conventional 12-lead ECG and 3-lead Frank orthogonal VCG. The signals were acquired for 2 min with a 16-bit resolution in the range of ± 16.384 mV (Bousseljot et al., 1995; Goldberger et al., 2000). The following signal processing and applied machine learning methods for MI detection were analyzed in Matlab 2023a environment. For the purposes of this study, all 347 MI and 80 H C full-length recordings were used. Data preprocessing ECG and VCG recordings are often affected by disturbing components such as baseline wandering or high-frequency transients during measurement. This interference needs to be removed in order to obtain valid data from the desired biological signal. Since the data used mainly contain baseline wandering interference in all measured leads, a second-order Savitz-Golay (SG) filter with a window length of 1,201 was used. Unlike Butterworth or Chebyshev filters, the cut-off frequency of the SG filter is not strictly defined. Its value depends on the window length (window) and the filter order, which, according to Equation 1, is approximately 0.416 Hz. fcut−off=12⋅window⋅fsampling (1) This type of filtering is often used to remove the interfering component for subsequent analysis (Khan and Pachori, 2021b) and was also used in our previous works (Vondrak and Penhaker, 2022b). For illustrative purposes, Figure 3 shows the curve before filtering (blue), after filtering (red) and the fluctuating component (black). In addition, the effect of filtering on VCG spatial loops is shown in Figure 4. It can be noticed that this filter reliably removes interfering components in the signal that can affect the success of automatic detection. An illustrative example of signal filtering, where red curve represents the filtered signal, blue represents the original, and black represents the detected fluctuating component. An example of spatial filtering of VCG loops, where the red curve is the filtered signal and the blue curve is the original signal. Feature extraction Based on our previous work, features extracted from VCG signals have proven effective for the detection of MI (Vondrak and Penhaker, 2022a; Vondrak et al., 2024). A total of 12 VCG features were used for the following analysis, analyzing the morphological properties of the QRS and T loop. These VCG features can be considered as mathematical operations applied to measured signals that do not require high computational requirements and can be applied to any recording. Furthermore, these features encapsulate domain knowledge, as they are derived from predefined characteristics based on specific insights into heart physiology (Rossello et al., 2013). Each of these extracted features was analyzed by a statistical analysis test using the Mann-Whitney test to verify their predictive value. The following features were extracted: The length of the QRS curve (arcQRS): The length of the QRS loop was calculated from the projection to the optimal plane (OP) using the PCA method. This projection measures the total length of the loop with the ability to detect changes in the contour of the loop. The PCA method here represents the dimension reduction from a spatial loop to an optimal two-dimensional curve. The principle of projection into the OP is based on the decomposition of the centered matrix Xc , according to Equation 2, whose rows correspond to N samples of the QRS loop with zero mean. The columns of the centered matrix correspond to the three orthogonal leads. Xc=U⋅Λ⋅WT (2) where Λ is a diagonal N × 3 matrix of positive singular values, U is a real N × N matrix whose columns are orthogonal unit vectors of length n, referred to as the left singular vectors of the centered matrix X, and WT is a transposed 3×3 matrix whose columns are orthogonal unit vectors, referred to as the right singular vectors of the centered matrix X. The columns of the matrix WT form a new orthogonal system into which the values of the matrix X are projected, known as the principal components, according to Equation 4. The first two vectors of the matrix W, together with the centroid T of the QRS loop, define the optimal plane ρ as given by Equation 3, which is specified parametrically. ρ:A=T+t⋅w1+s⋅w2 (3) where A is an arbitrary point of the optimal plane, T is a known point of the plane–the centroid of the QRS, w1 and w2 are the first two vectors of the matrix W, and t and s are the parameters of the optimal plane equation. P=Xc⋅W=U⋅Λ (4) The first two principal components of the matrix P correspond to the projection of the loop points onto the optimal plane. The length of the curve can be expressed as shown in Equation 5. arcQRS=∫xPCA′t2+yPCA′t2dt (5) where xPCA′ is the derivative of the first PCA component and yPCA′ is the derivative of the second PCA component. Maximum QRS and T loop vector (maxVecQRS, maxVecT): The maximum size of the vector in the QRS complex occurs during depolarization of the ventricles marked as the R wave. The QRS complex is followed by the T wave, which represents the repolarization of the ventricles. The maximum vectors for both loops were calculated from the maximum values in the given parts of the cardiac revolution (R peak, T peak) in individual leads X, Y, Z according to Equation 6. maxVecQRS/T=XR/T2+YR/T2+ZR/T2 (6) where XR/T,YR/T,ZR/T represents maximum values in QRS or T loop in individual leads. Maximum distance from the center of gravity (MaxGravQRS): The maximum distance from the centroid was calculated for individual points in the QRS loop according to Equation 7: MaxGravQRS=maxXG−Xi2+YG−Yi2+ZG−Zi2 (7) where XG , YG , ZG are coordinates of the center of gravity of the QRS loop. These values are obtained as average values in individual leads X, Y, Z and Xi , Yi , Zi are individual points of the QRS loop. Velocity of the QRS and T loop (VelQRS, VelT): The propagation velocity of the electrical vector was calculated for the QRS and T loop and can be obtained as the derivative of the curve K in time t according to the Equation 8. VelQRS/Tt=dKdt (8) where VelQRS/T(t) is the velocity of the loop, K is the analyzed vectorcardiographic QRS or T loop and t is time. Additional features were then calculated from the velocity obtained this way, namely the maximum speed (maxVelQRS/T), mean velocity (meanVelQRS/T) and standard deviation of the velocity (stdVelQRS/T). Similarly, all of these features were also obtained for the T loop. The area under QRS and T loop (areaQRS/T): The area under the QRS and T loops was calculated from the projection in the OP according to Equation 9. Area under the curve was calculated for both QRS and T loop. areaQRS/T=12|∑i=1nxPCA1i+xPCA2iyPCA1i−yPCA2i (9) where xPCA is the first PCA component, yPCA is the second PCA component and i is the number of samples of the first and second PCA. Classifications The classification methods most commonly used in the literature for distinguishing between MI patients and healthy individuals were selected. These include K-nearest neighbor (KNN) (Mucherino et al., 2009), Support Vector Machine (SVM) (Hearst et al., 1998), Discriminant Analysis (DA) (Balakrishnama and Ganapathiraju, 1998), Artificial Neural Network (ANN) (Dreiseitl and Ohno-Machado, 2002), Decision Tree (DT) (Mantas and Abellan, 2014), Random Forest (RF) (Belgiu and Dr Drăfuţ, 2016), Naive Bayes (NB) (Murphy, 2006), Logistic Regression (LR) (Ng and Jordan, 2001) or Ensemble Methods (EM) (Dietterich, 2000). However, several factors must be taken into account when analyzing individual classifiers. These factors include the nature of the data distribution, the variability of the data, and the diversity or existence of noise. It is also necessary to keep in mind the advantages and possible limitations of individual classifiers. For example, KNN must have training and test data available at all times, so the classifier relies on memory-based learning. For noisy data, the choice using DT is more preferred (Mantas and Abellán, 2014). Or for linear and non-linear features, SVM classifiers are effective (Noble, 2006). In this study, we experimented with the above-mentioned classifiers using 10-fold cross-validation, while each of the used classifiers was tuned with respect to the relevant parameters. The DT has been tuned with respect to the split criterion (Cross entropy and Gini diversity index (GDI)), minimum number of leaves as 2n (2, 4, 8, 16), and maximum number of decision splits (5, 10, 20, 50). In the case of SVM, the classifier has been tuned with regard to kernels, namely Linear kernel, Polynomial kernel [with degree (2, 3, 4)], Radial Basis Function (RBF) kernel, and Gaussian kernel. A kernel scale from 1 to 5 was used for each of the kernels. The KNN was tuned with respect to the size of K, which was chosen between 5 and 20 with a step of 5. The distance type was chosen as Euclidian, City block, and Chebyshev. A distance parameter was chosen Equal, Inverse, and Squared inverse. DA has been tuned with respect to the type of discriminant analysis, namely linear, diagonal linear, pseudo-linear, quadratic, diagonal quadratic and pseudo-quadratic. The ANN has been tuned by adjusting both the number of hidden layers (ranging from 1 to 2 layers) and the size of each hidden layer (with units set at 5, 10, 20, and 50 neurons). This tuning is focused on finding the right balance between model complexity and generalization, helping the network better capture complex patterns in the data. The NB has been tuned with respect to the Prior (uniform, empirical), distribution (normal, kernel) and in the case of distribution kernel the kernel type as normal, box, epanechnikov and triangle. The Random forests are based on a similar principle as Decision Trees. For this method, the parameters that were tuned included the Number of Trees, ranging from 100 to 500 in steps of 100, and the Minimum Number of Leaves, ranging from 1 to 5 in steps of 1. Higher values were not considered due to the risk of potential overfitting. The Logistic Regression was tuned with the Prior parameter set to uniform and empirical, which influences how class weights are assigned in the training data. For Regularization, Least Absolute Shrinkage and Selection Operator (lasso) and ridge methods were selected to prevent overfitting by penalizing overly complex models. Additionally, various optimization algorithms (Solver) such as Stochastic gradient descent (sgd) (Shalev-Shwartz et al., 2007), Average stochastic gradient descent (asgd) (Xu, 2011), Dual sgd for SVM (dual) (Hsieh et al., 2008), Broyden-Fletcher-Goldfarb-Shanno quasi-Newton algorithm (bfgs) (Nocedal and Wright, 1999), Limited-memory bfgs (lbfgs) (Nocedal and Wright, 1999), and Sparse Reconstruction by Separable Approximation (sparsa) (Wright et al., 2009) were tested to find the optimal model parameters. Next, the Ensemble Methods were tuned with regard to different techniques: Adaptive Boosting, which enhances weak learners by focusing on misclassified examples; Robust Boosting, designed to handle noisy data by adjusting the impact of outliers; and Random Undersampling Boosting, which balances class distribution by reducing the size of the majority class. The Learner type was set to either Tree or Discriminant, depending on the model’s requirements. Learning cycles were tested with values of 50, 100, 150, and 200 to optimize the model’s performance. According to the aforementioned hyperparameter settings, a total of 210 different configurations of machine learning methods are analyzed. These hyperparameters were chosen with consideration for preventing overfitting of individual classifiers, computational complexity, and appropriate optimizations for each model. Finally, the Stacking ensemble learning method was used for classification, combining predictions from multiple base models to enhance classification performance. The input for logistic regression as a meta-classifier will consist of the best-performing trained models. Stacking ensemble learning is a machine learning method that combines the outputs of multiple base models and utilizes a meta-classifier to achieve better performance (Alexandropoulos et al., 2019; Yoon and Kang, 2023; Zhou, 2025). Each base model learns from the data from different perspectives, reducing the risk of overfitting and improving generalization. The meta-classifier, often logistic regression, is trained on the outputs of these models and learns to weigh their predictions based on their accuracy. This approach represents a form of decision-level fusion, as it integrates multiple model predictions to leverage the strengths of different algorithms and increase the overall robustness of the classification. The result is a model with higher accuracy and reliability compared to individual classifiers. To prevent data leakage and ensure that the meta-classifier learned only from unseen samples, the stacking layer was trained using out-of-fold (OOF) predictions obtained during cross-validation. Each base model produced predictions exclusively for data that were not part of its training fold. These predictions were subsequently used as input features for training the meta-classifier. Performance parameters In this study, the performance of the classifiers was evaluated by calculating accuracy (Acc) (Equation 10), sensitivity (Sens) (Equation 11), specificity (Spec) (Equation 12), positive predictive value (PPV) (Equation 13), negative predictive value (NPV) (Equation 14), and f1-score (f1) (Equation 15). Whereby TN (True Negative) represents the number of correctly detected healthy records. TP (True Positive) represents the number of correctly detected MI records. FN (False Negative) represents the number of false-negative samples, i.e. the number of MI records that were not correctly detected. FP (False Positive) represents the number of false-positive samples, i.e. the number of healthy records that were incorrectly detected as MI. Sens=TPTP+FN (10) Spec=TNTN+FP (11) PPV=TPTP+FP (12) NPV=TNTN+FN (13) Acc=TN+TPTN+TP+FN+FP (14) f1=2⋅PPV⋅SensPPV+Sens (15) In addition to the above parameters a confusion matrix is also included, which gives a count of how well the classification model works by showing the number of correct and incorrect predictions for each class. It allows distinguishing between true positive, false positive, true negative and false negative predictions, which is key to evaluating model performance. Results The VCG signals in individual leads and the three-dimensional loop corresponding to HC and MI can be seen in Figure 1. From Figure 1, morphological changes are evident both in individual leads and in the spatial display. These morphological changes indicate the non-stationarity of the VCG signal. In this study, we used VCG features to analyze these morphological changes. We extracted a total of 12 VCG features that focus on morphological changes in both the QRS and the T segment. Relevance of VCG features To verify the informative value of individual features, each feature was tested with the M-W statistical test, due to the fact that for each feature we are dealing with two-sample data (MI and HC), where a statistically significant difference is sought. The use of M-W statistical test was expedient, because according to the Shapiro-Wilk (S-W) test, the data do not come from a normal distribution, the p-values of the S-W test for all VCG features are ≪ 0.05. The following hypotheses were analyzed for the S-W test: H0 : The data are samples from a normal distribution. HA : ¬H0 (negation of the null hypothesis) H0 : The data are samples from a normal distribution. H0 : The data are samples from a normal distribution. HA : ¬H0 (negation of the null hypothesis) HA : ¬H0 (negation of the null hypothesis) The results of the M-W test confirmed the significance (p-value ≪ 0.05) of individual features for distinguishing the analyzed MI and HC groups. The results of the S-W and M-W test with p-values for individual features can be seen in Table 1. The following hypotheses were analyzed for the M-W test: H0 : MI0,5 = HC0,5 (There are no statistically significant differences between the median MSE of MI and HC.) HA : ¬H0 (negation of the null hypothesis) H0 : MI0,5 = HC0,5 (There are no statistically significant differences between the median MSE of MI and HC.) H0 : MI0,5 = HC0,5 (There are no statistically significant differences between the median MSE of MI and HC.) HA : ¬H0 (negation of the null hypothesis) HA : ¬H0 (negation of the null hypothesis) TABLE 1The p-values for the 12 extracted features dividing records into MI and HC groups.No.VCG featureS-W p-valueM-W p-value1Std velocity T 6.8⋅10−10 2.4⋅10−17 2Area QRS 2.6⋅10−13 1.7⋅10−15 3Std velocity QRS 6.1⋅10−15 7.4⋅10−14 4Max vector T 3.3⋅10−16 1.3⋅10−13 5Length of QRS 4.9⋅10−17 8.2⋅10−13 6Max velocity QRS 4.8⋅10−18 1.3⋅10−10 7Mean velocity T 2.4⋅10−11 6.2⋅10−10 8Mean velocity QRS 3.7⋅10−14 4.8⋅10−9 9Max velocity T 1.9⋅10−13 7.9⋅10−9 10Max grav distance QRS 5.6⋅10−12 1.7⋅10−8 11Max vector QRS 4.3⋅10−9 2.3⋅10−8 12Area T 6.9⋅10−11 1.7⋅10−6 The p-values for the 12 extracted features dividing records into MI and HC groups. Clinically, the observed differences in VCG features reflect alterations in the processes of ventricular depolarization and repolarization that occur as a result of ischemic injury. The lower T-loop velocity and smaller QRS loop area found in MI patients indicate delayed or weakened propagation of electrical activity within the infarcted myocardium. These findings suggest that the extracted VCG features not only provide statistically significant discrimination between HC and MI recordings but also have clear physiological relevance, supporting their use in automated MI detection. A similar comparison is shown in Figure 5, where boxplots of individual features for the MI and HC groups are shown. We prioritized features for which the distributions of the MI and HC groups showed minimal overlap. For each group, there are also outlier observations that are usually removed from the observed dataset in common statistical tests. However, these values were not removed because they are real data that can occur in clinical practice. Since all the extracted VCG features show a significant ability to distinguish the analyzed groups, we came to the conclusion that for further processing all 12 features will be fed into the classification phase. The relevance of individual features can be seen in Table 1, sorted according to the p-value of the M-W test, while the most relevant feature is the one with the lowest p-value. Since all features show a result of statistical tests lower than the level of significance α , all VCG features are used for subsequent analyses. Boxplots of the values of individual VCG features for the analyzed MI and HC records, where the red boxes belong to MI and the blue boxes belong to HC. Analysis of classification methods The results of individual classification methods are shown in Tables 3–10. However, it is important to note that we used a 10-fold cross-validation analysis. This approach helps to avoid overfitting due to data imbalance and the inclusion of multiple segments from the same patient, which can bias the results. To determine the best results, accuracy is used as the primary performance metric for each classification method. The setting that achieves the highest accuracy is highlighted in the corresponding tables. In the literature, the Support Vector Machine method is frequently used for classification problems due to its ability to work with various kernel types and effectively separate nonlinearly separable data classes. In this analysis, different SVM classifier configurations with various hyperparameters were tested, and their results are summarized in Table 2. The best performance was achieved with a polynomial kernel of order 3 and a scale parameter set to 1, reaching the highest accuracy of 91.10%. TABLE 2Performance of Support Vector Machine classifier with different set hyperparameters using 10-fold cross-validation.KernelScaleSensSpecAccPPVNPVf1Polynomial order 210.95680.61250.89230.91460.76560.935320.96830.46250.87350.88650.77080.925530.97120.42500.86890.87990.77270.923540.97690.38750.86650.87370.79490.923250.97980.21250.83610.84370.70830.9068Polynomial order 3 1 0.9510 0.7375 0.9110 0.9402 0.7763 0.9456 20.96830.51250.88290.89600.78850.930530.97120.45000.87350.88450.78260.925840.96830.43750.86890.88190.76090.923850.97690.42500.87350.88050.80950.9259Polynomial order 410.94240.71250.89930.93430.74030.938320.95680.67500.90400.92740.78260.941930.97120.47500.87820.88920.79170.928540.97120.42500.86890.87990.77270.924450.97410.42500.87120.88020.79070.9258Linear10.96830.46250.87350.88650.77080.925520.96540.36250.85250.86790.70730.913430.97690.12500.81730.82890.55560.897440.99140.05000.81500.81900.57140.898950.99420.03750.81500.81750.60000.8987RBF10.95970.52500.87820.89760.75000.927720.95680.42500.85710.87830.69390.916030.96250.41250.85950.87660.71740.918640.96250.36250.85010.86750.69050.914150.97410.22500.83370.84500.66670.9077Performance of Support Vector Machine classifier with experimentally adjusted hyperparameters with the best result marked in bold. Performance of Support Vector Machine classifier with different set hyperparameters using 10-fold cross-validation. Performance of Support Vector Machine classifier with experimentally adjusted hyperparameters with the best result marked in bold. The results for individual types of discriminant analysis are shown in Table 3, where linear discriminant analysis (LDA) achieves the most accurate results with accuracy of 90.40%. The accuracy value is similar to the DT classifier, however, with different sensitivity and specificity values. TABLE 3Performance of Discriminant Analysis classifier with different set hyperparameters using 10-fold cross-validation.Discriminant typeSensSpecAccPPVNPVf1 Linear 0.9510 0.7000 0.9040 0.9322 0.7671 0.9415 Diag. Linear0.89050.67500.85010.92240.58700.9062Pseudolinear0.94810.70000.90160.93200.75680.9399Quadratic0.93080.72500.89230.93620.70730.9335Diag. Quadratic0.89340.62500.84310.91180.57470.9025Pseudoquadratic0.93080.75000.89700.94170.71430.9361Performance of Discriminant Analysis classifier with experimentally adjusted hyperparameters with the best result marked in bold. Performance of Discriminant Analysis classifier with different set hyperparameters using 10-fold cross-validation. Performance of Discriminant Analysis classifier with experimentally adjusted hyperparameters with the best result marked in bold. Table 4 shows the results of the KNN classification method for experimentally set hyperparameters. KNN setting K = 10, distance type City block and distance parameter Squared inverse achieved the most accurate results, where it achieved a detection accuracy of 89.93%. TABLE 4Performance of KNN classifier with different set hyperparameters using 10-fold cross-validation.Number of neighborsType of distanceDistance parameterSensSpecAccPPVNPVf1K = 5EuclidianEqual0.93080.67500.88290.92550.69230.9281Inverse0.92510.71250.88520.93310.68670.9291Squared inverse0.92220.71250.88290.93290.67860.9274City blockEqual0.92510.72500.88760.93590.69050.9304Inverse0.92510.75000.89230.94130.69770.9328Squared inverse0.92800.73750.89230.93880.70240.9333ChebyshevEqual0.92800.56250.85950.90200.64290.9151Inverse0.92800.63750.87350.91740.67110.9226Squared inverse0.92800.67500.88060.92530.68350.9266 K = 10 EuclidianEqual0.94810.58750.88060.90880.72310.9280Inverse0.93370.70000.88990.93100.70890.9323Squared inverse0.92220.65000.87120.91950.65820.9208 City block Equal0.93660.56250.86650.90280.67160.9194Inverse0.93660.70000.89230.93120.71790.9337 Squared inverse 0.9366 0.7375 0.8993 0.9393 0.7284 0.9379 ChebyshevEqual0.93370.53750.85950.89750.65150.9152Inverse0.91930.67500.87350.92460.65850.9219Squared inverse0.92220.65000.87120.91950.65820.9208K = 15EuclidianEqual0.93080.60000.86890.90990.66670.9202Inverse0.93660.66250.88520.92330.70670.9295Squared inverse0.93660.70000.89230.93120.71790.9337City blockEqual0.93080.58750.86650.90730.66200.9188Inverse0.93660.67500.88760.92590.71050.9310Squared inverse0.92510.71250.88520.93310.68670.9289ChebyshevEqual0.93080.57500.86420.90480.65710.9175Inverse0.93370.68750.88760.92840.70510.9310Squared inverse0.92800.62500.87120.91480.66670.9209K = 20EuclidianEqual0.94810.53750.87120.89890.70490.9229Inverse0.94240.65000.88760.92110.72220.9316Squared inverse0.93080.65000.87820.92020.68420.9252 City blockEqual0.94520.51250.86420.89370.68330.9189Inverse0.94240.63750.88520.91850.71830.9302Squared inverse0.93080.66250.88060.92290.68830.9256ChebyshevEqual0.93950.50000.85710.89070.65570.9144Inverse0.93660.61250.87590.91290.69010.9245Squared inverse0.93080.62500.87350.91500.67570.9225Performance of KNN classifier with experimentally adjusted hyperparameters with the best result marked in bold. Performance of KNN classifier with different set hyperparameters using 10-fold cross-validation. Performance of KNN classifier with experimentally adjusted hyperparameters with the best result marked in bold. Table 5 shows that the decision tree classifier achieves its highest accuracy of 90.40% using Cross entropy as the split criterion, with a minimum of 4 leaves and a maximum of 5 splits. Alternative settings, such as those using the Gini criterion or higher leaf counts, yield high sensitivity but often lower specificity, leading to reduced accuracy. Therefore, Cross entropy with 4 leaves and 5 splits emerges as the optimal setup for balanced classification on this dataset. TABLE 5Performance of Decision Tree classifier with different set hyperparameters using 10-fold cross-validation.Split criterionMin leafMax splitsSensSpecAccPPVNPVf1GDI250.91640.72500.88060.93530.66670.9258100.92510.71250.88520.93310.68670.9291200.91070.67500.86650.92400.63530.9169500.90490.65000.85710.91810.61180.9113450.91930.72500.88290.93550.67440.9273100.94810.63750.88990.91900.73910.9333200.92220.65000.87120.91950.65820.9208500.92800.63750.87350.91740.67110.9223850.92220.62500.86650.91430.64940.9180100.93660.61250.87590.91290.69010.9244200.91640.63750.86420.91640.63750.9164500.94240.58750.87590.90830.70150.92501650.91640.68750.87350.92710.65480.9215100.90490.66250.85950.92080.61630.9116200.90780.67500.86420.92380.62790.9146500.93370.58750.86890.90760.67140.9202 Cross entropy 250.91640.83750.90160.96070.69790.9380100.91640.81250.89700.95500.69150.9353200.93370.71250.89230.93370.71250.9337500.93370.65000.88060.92050.69330.9268 4 5 0.9308 0.7875 0.9040 0.9500 0.7241 0.9400 100.90780.78750.88520.94880.66320.9278200.94240.73750.90400.93970.74680.9409500.93080.71250.88990.93350.70370.9321850.90200.78750.88060.94850.64950.9245100.92800.75000.89460.94150.70590.9343200.93080.70000.88760.93080.70000.9308500.92510.65000.87350.91980.66670.92191650.89050.78750.87120.94790.62380.9179100.92220.68750.87820.92750.67070.9248200.92220.72500.88520.93570.68240.9289500.91070.75000.88060.94050.65930.9251Performance of Decision Tree classifier with experimentally adjusted hyperparameters with the best result marked in bold. Performance of Decision Tree classifier with different set hyperparameters using 10-fold cross-validation. Performance of Decision Tree classifier with experimentally adjusted hyperparameters with the best result marked in bold. Another tested method was ANN, see Table 6, which achieved the most accurate results for hidden layers 2, where the size of the first layer is 10 and the size of the second layer is 20 with accuracy of 89.93%. Higher values of layer size and hidden layers already led to worse classification results and were not analyzed further. TABLE 6Performance of ANN classifier with different set hyperparameters using 10-fold cross-validation.Hidden layersLayer size - 1Layer size - 2SensSpecAccPPVNPVf1 2 550.93080.56250.86180.90220.65220.9163100.92510.70000.88290.93040.68290.9277200.95100.61250.88760.91410.74240.9322500.95390.55000.87820.90190.73330.9277 10 50.93950.62500.88060.91570.70420.9273100.93370.73750.89700.93910.71950.9364 20 0.9337 0.7500 0.8993 0.9419 0.7229 0.9378 500.93370.68750.88760.92840.70510.93092050.96540.56250.88990.90540.78950.9350100.92220.71250.88290.93290.67860.9274200.94520.68750.89700.92920.74320.9369500.91640.65000.86650.91910.64200.91785050.90490.71250.86890.93180.63330.9176100.95100.67500.89930.92700.76060.9390200.93660.63750.88060.91810.69860.9271500.93370.73750.89700.93910.71950.936415-0.95390.57500.88290.90680.74190.929810-0.93950.68750.89230.92880.72370.934020-0.95390.63750.89460.91940.76120.936250-0.92800.63750.87350.91740.67110.9222Performance of ANN classifier with experimentally adjusted hyperparameters with the best result marked in bold. Performance of ANN classifier with different set hyperparameters using 10-fold cross-validation. Performance of ANN classifier with experimentally adjusted hyperparameters with the best result marked in bold. Another widely used method is Naive Bayes, with its results presented in Table 7. This method achieved the highest accuracy of 85.25% with the hyperparameter settings ’Prior empirical’ and a ’Distribution Kernel’ of the epanechnikov type. Despite the fact that this method is frequently analyzed, it achieves the worst results in our study compared to other classification methods. TABLE 7Performance of Naive Bayes classifier with different set hyperparameters using 10-fold cross-validation.PriorDistributionKernel typeSensSpecAccPPVNPVf1UniformNormal-0.88180.66250.84070.91890.56380.9000KernelNormal0.81560.82500.81730.95290.50770.8786Box0.82130.80000.81730.94680.50790.8783Epanechnikov0.81840.81250.81730.94980.50780.8792Triangle0.83000.81250.82670.95050.52420.8852 Empirical Normal-0.89630.62500.84540.91200.58140.9039 Kernel Normal0.85300.75000.83370.93670.54050.8930Box0.88180.71250.85010.93010.58160.9054 Epanechnikov 0.8761 0.7500 0.8525 0.9383 0.5825 0.9068 Triangle0.87320.72500.84540.93230.56860.9019Performance of Naive Bayes classifier with experimentally adjusted hyperparameters with the best result marked in bold. Performance of Naive Bayes classifier with different set hyperparameters using 10-fold cross-validation. Performance of Naive Bayes classifier with experimentally adjusted hyperparameters with the best result marked in bold. In the Random Forest classification method, which operates similarly to decision trees, the highest accuracy was achieved with hyperparameters set to 300 Trees and a Minimum Leaf Size of 1. Increasing the number of trees beyond 500 had no further effect on the overall accuracy of the classifier. It’s worth noting that the best accuracy was obtained with a Minimum Leaf Size of 1, which allows the trees to fit the specific patterns in randomly selected data subsets. However, this can result in trees that are too specialized. Therefore, 10-fold cross-validation was used, with the results shown in Table 8. TABLE 8Performance of Random Forest classifier with different set hyperparameters using 10-fold cross-validation.Num. TreesMin leafSensSpecAccPPVNPVf110010.95970.69900.90180.79860.92240.872020.95340.65780.89480.77900.91990.857430.95160.65320.89450.76130.92320.847840.94690.66670.89010.74970.91870.839550.94310.63670.88740.69570.92290.801620010.95390.66430.90150.75760.92810.844220.94320.67420.89220.72300.92700.817230.94780.67830.89010.74270.91920.832140.95120.63820.89450.74640.92210.836350.95010.62430.88990.74790.91550.8361 300 1 0.9529 0.6963 0.9038 0.7800 0.9300 0.8570 20.95010.66720.89710.77550.92420.853530.94880.65650.89690.74880.92260.839640.94450.68870.89700.74600.92830.835750.95070.59590.89460.67320.92130.788940010.95150.66190.89680.74640.92460.834520.94520.62960.88750.72160.91920.819730.95140.67610.89920.77130.92650.853340.94230.65180.88990.73340.92420.824450.95030.62810.88780.77670.91270.853650010.95470.65740.90140.76690.92730.851620.95440.64980.89470.75600.92040.845730.95050.63510.89480.75830.92450.843640.95030.67190.89720.77450.92360.853450.94460.62040.88520.70290.91660.8038Performance of Random Forest classifier with experimentally adjusted hyperparameters with the best result marked in bold. Performance of Random Forest classifier with different set hyperparameters using 10-fold cross-validation. Performance of Random Forest classifier with experimentally adjusted hyperparameters with the best result marked in bold. Within the Logistic Regression method, the highest detection accuracy of 87.61% was achieved with the hyperparameters: Prior: empirical (class weights are determined based on their frequency in the training data), Regularization: lasso (uses regularization to eliminate irrelevant variables, simplifying the model), and Solver: sparsa (an optimization algorithm efficient for sparse data and large datasets, based on gradient descent). The results of individual logistic regression settings are shown in Table 9. The Table also lists empty values as NaN because these types of hyperparameters settings are not supported. TABLE 9Performance of Logistic Regression classifier with different set hyperparameters using 10-fold cross-validation.PriorRegularizationSolverSensSpecAccPPVNPVf1UniformLassosgd0.83190.40720.49170.32170.96740.3696AsgdNaNNaNNaNNaNNaNNaNDualNaNNaNNaNNaNNaNNaNbfgsNaNNaNNaNNaNNaNNaNlbfgsNaNNaNNaNNaNNaNNaNSparsa0.84970.84200.85010.56540.96190.6800Ridgesgd0.35280.88170.43900.36130.97040.3569AsgdNaNNaNNaNNaNNaNNaNDualNaNNaNNaNNaNNaNNaNbfgs0.85730.83250.85240.57350.96000.6853lbfgs0.85910.83820.85490.58730.95900.6977SparsaNaNNaNNaNNaNNaNNaN Empirical Lasso sgdNaNNaNNaNNaNNaNNaNAsgdNaNNaNNaNNaNNaNNaNDualNaNNaNNaNNaNNaNNaNbfgsNaNNaNNaNNaNNaNNaNlbfgsNaNNaNNaNNaNNaNNaN Sparsa 0.9647 0.5325 0.8761 0.7842 0.8941 0.8647 RidgesgdNaNNaNNaNNaNNaNNaNAsgdNaNNaNNaNNaNNaNNaNDualNaNNaNNaNNaNNaNNaNbfgs0.97050.38680.86170.77000.87270.8572lbfgs0.97120.39960.86400.75880.87510.8530SparsaNaNNaNNaNNaNNaNNaNPerformance of Logistic Regression classifier with experimentally adjusted hyperparameters with the best result marked in bold. Performance of Logistic Regression classifier with different set hyperparameters using 10-fold cross-validation. Performance of Logistic Regression classifier with experimentally adjusted hyperparameters with the best result marked in bold. Finally, the last type tested is Ensemble Methods, which are machine learning techniques that combine the outputs of several models (base models) to achieve better performance than any single model alone. Among these methods is Adaptive Boosting, which iteratively improves classification by placing greater emphasis on examples that were misclassified in previous iterations. In our case, the Tree Learner Template was used, meaning that the base models in the ensemble are Decision Trees. The number of Learning Cycles is set to 200, which determines the number of repetitions during which the models in the ensemble learn and improve their predictions. Higher values for Learning Cycles were not used to prevent potential overfitting of the classifier. With the above hyperparameter settings, the model achieves the highest accuracy of 92.74% compared to the other tested methods. Overall, the results of individual types of Ensemble Methods, see Table 10, achieve better results compared to other methods used in this work based on a different basis. TABLE 10Performance of Ensemble Method classifiers with different set hyperparameters using 10-fold cross-validation.MethodLearner templateLearning cyclesSensSpecAccPPVNPVf1Adaptive boosting Tree 500.95970.72500.91570.93800.80560.94871000.96540.67500.91100.92800.81820.94641500.95970.71250.91330.93540.80280.9473 200 0.9683 0.7500 0.9274 0.9438 0.8451 0.9558 Discriminant500.94810.68750.89930.92940.75340.93871000.94520.68750.89700.92920.74320.93701500.94810.70000.90160.93200.75680.93962000.94520.68750.89700.92920.74320.9370Robust boostingTree500.94520.68750.89700.92920.74320.93701000.92800.70000.88520.93060.69140.92931500.92800.67500.88060.92530.68350.92662000.93660.66250.88520.92330.70670.9296Discriminant500.94240.62500.88290.91600.71430.92881000.94520.67500.89460.92660.73970.93561500.94240.67500.89230.92630.72970.93402000.94520.68750.89700.92920.74320.9370Random undersampling boostingTree500.90780.83750.89460.96040.67680.93341000.90490.77500.88060.94580.65260.92491500.91640.76250.88760.94360.67780.92962000.91930.77500.89230.94660.68890.9319Discriminant500.90490.77500.88060.94580.65260.92491000.89910.78750.87820.94830.64290.92281500.91070.78750.88760.94890.67020.92862000.89630.78750.87590.94820.63640.9217Adaptive logistic regressionTree500.95390.70000.90630.93240.77780.94291000.95970.70000.91100.93280.80000.94591500.96540.66250.90870.92540.81540.94512000.95970.66250.90400.92500.79100.9420Gentle adaptive boostingTree500.96540.72500.92040.93840.82860.95171000.96250.70000.91330.93300.81160.94741500.95970.72500.91570.93800.80560.94732000.96250.75000.92270.94350.82190.9526Performance of Ensemble Method classifier with experimentally adjusted hyperparameters with the best result marked in bold. Performance of Ensemble Method classifiers with different set hyperparameters using 10-fold cross-validation. Performance of Ensemble Method classifier with experimentally adjusted hyperparameters with the best result marked in bold. The best results for each machine learning method are highlighted in bold in the respective tables. Of all the tested individual classification methods with experimentally set hyperparameters, the Ensemble Methods achieved the highest classification accuracy with an accuracy of 92.74%, a sensitivity of 96.83% and a specificity of 75.00%. Due to the class imbalance (80 H C vs. 347 MI) and the chosen ROC operating point, the specificity metric is highly sensitive to even a small number of false positives from the HC group. Among other things, the parameters PPV and NPV are also presented here, where PPV tells us the proportion of subjects with a positive test result who truly have the outcome of interest, while NPV reflects the proportion of subjects with a negative test result who truly do not have the outcome of interest. To better understand which features contributed most to model performance, permutation importance of features (PIF) was computed for all nine base classifiers, see Figure 6. This method estimates the importance of each feature by measuring the increase in classification error when the feature values are randomly shuffled. The higher the increase in loss, the more critical the feature is to the model’s predictions. Positive PIF values indicate that shuffling the feature increases the model’s error, suggesting that the feature is important for prediction. In contrast, negative PIF values imply that randomizing the feature slightly improves the model performance, which may indicate redundancy or noise. As shown in Figure 6, certain features consistently showed higher importance across multiple classifiers–such as maxVelT, arcQRS, and maxVecQRS–suggesting their robust discriminative power for myocardial infarction detection. Notably, logistic regression, decision tree, and artificial neural network placed strong emphasis on a small subset of features, while methods like Random Forest and KNN demonstrated a more balanced distribution of feature importance. Permutation Importance of Features across all nine classifiers. The y-axis represents the increase in classification loss when a given feature is randomly permuted–higher values indicate greater importance. Finally, the stacking ensemble learning method was employed for classification, utilizing decision-level fusion by combining predictions from multiple base models to enhance classification performance. The input for logistic regression as a meta-classifier consisted of the best-performing trained models (basic models from Table 11), ensuring that only the most informative classifiers contributed to the final prediction. To avoid data leakage, OOF predictions from the base models were used as inputs. This means that each base classifier generated predictions only for samples that were not included in its training fold. The strong performance of the stacking approach can be attributed to the behavior of the individual base classifiers, which shows diverse error patterns across different patient groups. This diversity allowed the meta-classifier to effectively learn how to weigh individual model outputs. In particular, methods such as SVM, DT and ANN contributed different decision boundaries and sensitivities to feature variations. These different boundaries can together improve the final prediction. The results demonstrate high sensitivity of 97.70%, specificity of 86.25%, accuracy of 95.55%, PPV of 96.86%, NPV of 89.61%, and f1-score of 97.27%. These results confirm the effectiveness of the fusion-based approach, where decision-level integration of multiple classifiers improved robustness. This analysis also supports the conclusion that the success of a layering model lies not only in the combination of strong individual classifiers, but also in exploiting their diversity to mitigate individual weaknesses. TABLE 11Summary of the performance parameters of individual classification methods that achieved the most accurate results.Classification methodSensitivity (%)Specificity (%)Accuracy (%)PPV (%)NPV (%)f1-score (%)KNN93.6673.7589.9393.9372.8493.79SVM95.1073.7591.1094.0277.6394.55DT93.0878.7590.4095.0072.4194.03DA95.1070.0090.4093.2276.7194.15ANN93.3775.0089.9394.1972.2993.78NB87.6175.0085.2593.8358.2590.61RF95.2969.6390.3893.0078.0094.13LR96.4753.2587.6189.4178.4292.81 EM 96.83 75.00 92.74 94.38 84.51 95.59 STACKING 97.70 86.25 95.55 96.86 89.61 97.27 Performance of basic models with the EM method selected, which achieved the best results individually, and the STACKING method as a combination of all basic models. Summary of the performance parameters of individual classification methods that achieved the most accurate results. Performance of basic models with the EM method selected, which achieved the best results individually, and the STACKING method as a combination of all basic models. Figure 7 shows a heatmap comparing the performance metrics of all classifiers. It highlights the superior results of the stacking method, followed by strong performance from SVM, DA, and RF, while NB and LR performed worse in specificity and NPV. This graphical representation helps illustrate the overall superiority of ensemble-based methods compared to single classifiers. Heatmap visualization of classification performance metrics for all evaluated methods. The stacking and ensemble models achieved consistently higher scores across all metrics. Figure 8 illustrates the principle of the Stacking method, which integrates multiple M-L models into a single meta-classifier to enhance detection accuracy. This meta-classifier receives the outputs of the base M-L models, providing it with additional information for better decision-making. In cases of misclassifications by the base M-L models, the meta-classifier learns to recognize patterns in these errors and optimizes the final prediction. Block diagram of the Stacking method principle combining M-L models into a meta-classifier. The aforementioned M-L methods were analyzed using 10-fold cross-validation, where each iteration produces a specific accuracy value for detection. This variability is shown in Figure 9 for the M-L methods that achieved the best results, as listed in Table 11. It can be observed that the accuracy variability in the Stacking method is lower compared to individual M-L models, highlighting the robustness of this approach. Output accuracy variability for individual M-L methods using 10-fold cross-validation. Table 11 shows summarization of the performance parameters for the classification methods with set hyperparameters that achieved the most accurate results. Correspondingly, Table 12 presents the confusion matrix for these methods, as detailed in Table 7. From the confusion matrices can be observed that the base classifiers made different types of errors. For example, KNN and DT tended to misclassify borderline HC as MI, while SVM and DA performed better in these cases but occasionally failed to detect atypical MI. ANN showed higher sensitivity but slightly lower specificity, reflecting its tendency to overestimate positive cases. LR achieved high sensitivity, but also achieved a higher false positive rate. These variations in error patterns indicate a high degree of model diversity, which the stacking ensemble effectively exploited. TABLE 12The confusion matrices for the analyzed machine learning methods that achieved the most accurate results.KNNSVMDTDAANNMIHCMIHCMIHCMIHCMIHCMI32522MI33017MI32324MI33017MI32423HC2159HC2159HC1763HC2456HC2060NBRFLREMSTACKINGMIHCMIHCMIHCMIHCMIHCMI30443MI33116MI33512MI33611MI3398HC2060HC2456HC3743HC2060HC1169 The confusion matrices for the analyzed machine learning methods that achieved the most accurate results. Another way to illustrate the results is shown in Figure 10, which corresponds to the data presented in Table 12. From these visuals, it is evident that the Ensemble Method delivers the highest accuracy among all the tested methods. Given the class imbalance in the dataset (347 MI vs. 80 healthy), we also show ROC curves and AUC (area under curve) as performance metrics. Unlike accuracy, AUC is less sensitive to class imbalance and provides a more reliable evaluation of model performance across thresholds, see Figure 11, with the marked cut-point of the ROC curve (Habibzadeh et al., 2016). This cut-point is obtained from the true ROC curve representing the MIs. ROC curves describe the quality of a binary classifier depending on the setting of its classification threshold. Similarly, the cut-point can be obtained from the false ROC curve, which in this case would be the mirror values of the true curve. Table 13 presents the AUC values for the analyzed classifiers that achieved the highest accuracy. The stacking method reached the highest AUC value of 99.04%, confirming its ability to distinguish between classes. Although techniques such as SMOTE or cost-sensitive learning could be applied to mitigate class imbalance, we opted to evaluate model performance without resampling in order to preserve the natural class distribution. Nonetheless, we highlight this as a limitation and propose exploring such methods in future work. Comparison of values of sensitivity, specificity, accuracy, PPV, NPV and f1-score for individual analyzed machine learning methods with set hyperparameters that achieved the most accurate results. ROC with indication of the true and false operating point of classifiers: KNN with K = 10, distance type City Block, distance weight Squared Inverse; SVM with kernel type Polynomial and Order 3, Scale 1; DT with split criterion Cross entropy, Min. leaf 4, Max. splits 5; DA with discriminant type Linear; ANN with 2 hidden layers, layer 1 size 10 and layer 2 size 20, which achieve the highest accuracy; NB with Prior empirical, Distribution Kernel type of epanechnikov; RF with Number of trees 300, Min leaf size 1; LR with Prior empirical, Regularization lasso, Solver sparsa; EM as Adaptive Boosting, Learner template Tree, learning cycles 200; Stacking ensemble learning combining M-L method models. TABLE 13AUC values for the analyzed M-L methods according to the Table 11.M-L MethodKNNSVMDTLDAANNNBRFEMLRStackAUC (%)91.2491.6690.1992.9489.1588.1987.8993.6590.40 99.04 AUC values for the analyzed M-L methods according to the Table 11. Discussion VCG features are a suitable parameter that can capture morphological changes in physiological and pathological recordings. The advantage of the used domain knowledge VCG features is the capture of morphological changes in the QRS and T loop, which is changed in the presence of pathology. We analyzed a total of 12 VCG features that were extracted from 80 physiological and 347 pathological recordings from PTB Physionet database. Each of these features was tested by the M-W statistical test to verify its predictive value. Since all features had a p-value less than 0.05, see Table 1, all features were fed into the classification methods. Various methods have been investigated for classification, including KNN, SVM, ANN, DA, DT, NB, RF, LR, EM, and Stacking Ensemble Learning. Each of these classifiers was trained using 10-fold cross-validation. To maximize the information obtained, each of these classifiers was analyzed with experimentally adjusted hyperparameters. The performance of individual classifiers was investigated using various parameters, including Sensitivity, Specificity, Accuracy, Positive Predictive Value, and Negative Predictive Value. It can be observed from Table 11 that the most accurate classification results were achieved by the Stacking Ensemble Learning method, which combined the predictions of multiple base classifiers and used logistic regression as a meta-classifier. This approach yielded an accuracy of 95.55%, a sensitivity of 97.70%, a specificity of 86.25%, a positive predictive value of 96.86%, a negative predictive value of 89.61% and f1-score of 97.27%. To ensure the robustness of the used classifiers and to prevent overfitting, the 10-fold cross-validation method was applied, where the analyzed data was divided into 10 subsets with samples having approximately equal distribution in each group. Comparison with existing studies The following paragraphs compare the achieved results with existing studies. The focus is primarily on a similar problem, namely the extraction of VCG features and machine learning methods for the possibility of automatic pathology detection. Among recent studies focused on MI detection, the authors in Correa et al. (2013b) analyzed a total of seven QRS features and their classification ability, achieving a sensitivity of 88.5% and a specificity of 92.1%. The authors further expanded their analysis in Correa et al. (2013a), where they extracted 4 features analyzing the QRS loop and 3 features analyzing the T loop for 51 ischemic and 52 healthy subjects. Using the LDA classifier, they achieved a sensitivity of 95.4% and a specificity of 95.2%. The authors also devoted their attention to the classification of anterior and inferior infarctions in Correa et al. (2016), where they achieved an accuracy of 89.8% using nine features and the LDA classifier. The spatial velocity dynamics of the QRS loop VCG of patients with AMI was also analyzed by Ghosal et al. (2024). Using quasi-orthogonal leads I, aVF, and V2, they constructed the VCG and examined spatial velocity, spatial distance and spatial magnitude. The results showed decreased spatial velocity and spatial distance values in patients with AMI. Another important analysis of VCG features was performed by the authors in De la Garza Salazar and Egenriether (2024), where they analyzed 315 VCG parameters from the P, QRS and T loops using derived VCG via the Kors transformation (Kors et al., 1990). They identified significant associations between VCG features and patient characteristics, such as age, sex, BMI, hypertension, and echocardiographic findings. The results highlight the potential of VCG analysis in cardiovascular disease assessment. Dehnavi et al. (2011) compared the success of MI detection from ECG and VCG recordings. For this purpose, they extracted 22 features from 60 ischemic and 10 healthy recordings and used a neural network for classification. They observed a significant improvement in the processing of VCG data, achieving an accuracy of 86%, compared to 73% for ECG. Zhao et al. (2022) used a combination of features extracted from ECG and VCG and achieved accuracy of 90.3%, sensitivity of 90.3% and specificity of 90.5% using SVM classifier. Additionally, Dima et al. (2013) used 25 features extracted from 158 MI and 52 H C recordings to detect MI. For classification, they employed an SVM classifier, which resulted in an accuracy of 89.22%, sensitivity of 76%, and specificity of 87.5%. SVM was also used as a classification method by the authors in Panagiotou et al. (2013); Khan and Pachori (2021a). In Panagiotou et al. (2013), the authors extracted 27 morphological features from 158 pathological and 102 healthy records, achieving an accuracy of 82.36%, sensitivity of 84.31%, and specificity of 77.36%. In contrast, the authors in Khan and Pachori (2021a) used 12 features based on the frequency components of the signal, achieving an accuracy of 95.52%, sensitivity of 91.08%, and specificity of 97.45%. Another use of features based on the wavelet transform of the signal was used by the authors in Keshtkar et al. (2013). The authors proposed the evaluation of the wavelet coefficients obtained over the averaged ECG signal. From the obtained set of parameters and using a neural network, they achieved an accuracy of 89.5%, a sensitivity of 93% and a specificity of 86%. Tripathy and Dandapat (2017) also obtained VCG features using wavelet transformation. In their analysis, they employed the relevance vector machine method, using 100 MI and 50 H C records, which resulted in a sensitivity of 98.40% and specificity of 98.66%. Furthermore, the authors in Zhang J. et al. (2022) detected MI localization with a detection success rate exceeding 99% using the decomposition of the detected individual beats using the wavelet transform. However, these high detection success rates in the above-mentioned works dealing with signal decomposition using wavelet transformation are limited by the high computational complexity and the need for a large operating memory, as stated for example in Zhang J. et al. (2022). The concept of ensemble learning was also applied by the authors in Sun et al. (2022), who extracted features from transformed VCGs based on the spectral fitting exponent, Lyapunov exponent, and Lempel-Ziv complexity. These features were processed through an ensemble learning algorithm based on bagging, combining various classifiers using weighted voting. The proposed algorithm achieved a detection accuracy of 91.11%, sensitivity of 90.49%, and specificity of 92.88% on the PTB database. Hafshejani et al. (2021) applied the Classification and Regression Tree (CART) method on a balanced dataset consisting of 80 MI and 80 H C records. Using octant theory, they extracted a total of 48 features. With the dataset split into 90% for training and 10% for testing, the authors achieved an accuracy of 98.1%, sensitivity of 98.8%, and specificity of 97.5%. Karisik and Baumert (2019) extracted VCG features based on the morphological properties of the QRS and T loops, and using a long short-term memory network, they achieved MI detection accuracy of 89.1%, with a sensitivity of 89.1% and a specificity of 90%. In their analysis, they used 78 MI and 69 H C records from the PTB database. The authors in Aranda Hernandez et al. (2023) also applied ensemble methods for detecting various types of MI, focusing on the automatic localization of MI using four different M-L methods with 98 VCG features as input data. They report that Lasso or ensemble models can achieve better detection results in situations with limited data, compared to more complex models based on deep learning approaches. Attention was also paid to comparing different types of classifiers using VCG features analyzing signal decompositions using wavelet variation Sharma and Sunkaria (2018); Khan and Pachori (2021b), where in Sharma and Sunkaria (2018) authors analyzed two classification methods (SVM and KNN) to see which one would perform better. From the dataset of features based on signal decomposition, they achieved a higher accuracy of detection with the SVM method, which achieved very good results: sensitivity 99.35%, specificity 98.29% and accuracy 98.41%. However, it should be mentioned that the authors in Sharma and Sunkaria (2018) used 30 pathological and 52 healthy subjects. Gragnaniello et al. (2024) compared two methods for MI detection based on M-L and deep learning (D-L) techniques from a proposed single microcontroller-based system. They used 4-s recordings from the PTB database for analysis and achieved detection accuracy of 89.40% for M-L and 94.76% for D-L. We also present a comparison with relevant publications analyzing a similar problem is shown in Table 14, where attention is mainly paid to the number of extracted features, the number of records used and the M-L method used. TABLE 14A summary of selected relevant publications related to the topic of this work analyzing VCG features using machine learning methods for myocardial infarction detection.AuthorsYearM-L MethodNum. Of recordsNum. Of featuresPerformance (%) Dehnavi et al. (2011) 2011Forward neural networks60 ischemic; 10 H C22Sens: 70.00Spec: 86.00 Correa et al. (2013b) 2013LDA82 MI; 52 H C8Sens: 88.50Spec: 92.10 Keshtkar et al. (2013) 2013Probabilistic neural networks50 MI; 50 H C25Sens: 93.00Spec: 86.00 Dima et al. (2013) 2013SVM158 MI; 52 H C25Sens: 76.00Spec: 87.50 Panagiotou et al. (2013) 2013SVM112 MI; 80 H C8Sens: 84.31Spec: 77.36 Goernig et al. (2015) 2015Discrimination analysis59 MI; 55 H C8Sens: 71.70Spec: 88.70 Correa et al. (2016) 2016LDA95 MI; 52 H C9Acc: 89.80 Tripathy and Dandapat (2017) 2017 Relevance vector machine100 MI; 50 H C15Sens: 98.40Spec: 98.66 Hernandez et al. (2018) 2018The gradient boosting98 ischemic before (control) and during PTCA7 out of 328Sens: 89.60Spec: 82.70 Diker et al. (2018) 2018SVM148 MI; 52 H C23Acc: 87.80 Sharma and Sunkaria (2018) 2018SVM and KNN368 MI; 80 H C10Sens: 79.01Spec: 79.26 Prabhakararao and Dandapat (2019) 2019SVM4 PMI; 80 H C12Acc: 96.69Sens: 80.00Spec: 98.40 Prabhakararao and Dandapat (2020) 2020SVM13 PMI; 80 H C12Acc: 96.94 Hafshejani et al. (2021) 2021Classification and regression tree80 MI; 80 H C48Sens: 98.80Spec: 97.50 Khan and Pachori (2021a) 2021SVM13 PMI; 50 H C12Sens: 91.08Spec: 97.45 Zhao et al. (2022) 2022SVM148 ischemic; 52 H C3Acc: 90.30 Sun et al. (2022) 2022Heterogeneous ensemble383 myocardial ischemia; 116 H C6Acc: 91.11Sens: 90.49Spec: 92.88 Aranda Hernandez et al. (2023) 2023Lasso ensemble method148 MI; 52 H C98AUC: 81.45Sens: 75.80Spec: 87.80 Zeng and Yuan (2023) 2023Dynamical estimators148 MI; 52 H C > 20Acc: 98.20Sens: 98.37Spec: 97.44 This work 2025 Stacking ensemble learning 347 MI; 80 H C 12 Acc: 95.55 Sens: 97.70 Spec: 86.25 A summary of selected relevant publications related to the topic of this work analyzing VCG features using machine learning methods for myocardial infarction detection. Advantages and limitations of proposed study It is worth mentioning that the authors in Khan and Pachori (2021b) analyzed three different classifiers for posterior MI (PMI) detection by using derived VCG from a 12 lead ECG, whereas, in the present study, attention is paid to the possibility of MI detection from directly measured VCG records. In contrast, in the present study, we extracted 12 features that analyze the morphological properties of cardiac revolution caused by infarct conditions, while in Khan and Pachori (2021b) authors used features based on signal decomposition using a specialized wavelet transform. In this work, VCG features can be considered as mathematical operations applied to VCG signals that do not require high computational complexity and can be applied to any recording. Compared to other publications, this work ranks among the publications using a lower number of features, which may affect the subsequent computational complexity. These features were analyzed to verify their informative value and their relevance was confirmed using statistical analysis. The present work also addresses the issue of utilizing a larger or comparable number of patient records compared to the previous studies, as indicated in Table 14 and the chapter dealing with comparison with existing studies. It is evident from the table that different authors use varying numbers of records from the same database for their analyses. This inconsistency can be misleading, as some studies do not specify which subset of data was used. We are also aware of the imbalance between the MI and HC groups, which is subsequently reflected in the specificity values in our study. Achieving consistently high specificity is particularly challenging when working with a relatively small number of HC. Even a few misclassified cases can influence this metric. Nevertheless, the obtained values correspond to the selected operating point on the ROC curve, which reflects the trade-off between sensitivity and specificity and was chosen to favor higher sensitivity due to its greater clinical importance in MI detection. This choice inevitably leads to a slight decrease in specificity, which becomes more apparent given the small HC cohort. Furthermore, due to the imbalance between the analyzed groups (MI and HC), additional metrics such as NPV, PPV, and f1-score were used, which is more appropriate in this case. Another challenge in the literature is the unavailability of data used by some authors who do not rely on publicly accessible databases. The limited availability of VCG data remains a barrier to comprehensive analyses of VCG recordings. Future research may focus on developing a modern database of ECG and VCG records to address this limitation. Furthermore, this work examines commonly used machine M-L for detecting various heart diseases based on ECG and VCG recordings. A review of methods applied in the last 5 years was conducted. The analyzed M-L methods were experimentally optimized to determine their best performance through a comprehensive comparative analysis. The results of MI detection using M-L methods, combined in a Stacking ensemble model, achieve better results compared to the state-of-the-art, particularly in the analysis of morphological features in both the time and frequency domains. To the best of our knowledge, the used combination of features based on the morphological properties of cardiac revolution with verification of their predictive value using a statistical test and the detailed analysis of classifiers with experimentally set hyperparameters with subsequent creation of a Stacking ensemble learning model with high detection success rate has been used for the first time on directly measured VCG recordings in order to find a suitable methodology for detecting MI and a subsequent option to support diagnostics in clinical practice. This work contributes to the existing literature by demonstrating the benefits of MI detection based on a detailed analysis of M-L methods using morphological VCG features, followed by the design of a Stacking model of M-L methods. The results achieved have the potential to enhance clinical diagnostics. Furthermore, this work offers additional potential directions for addressing the given issue, such as extracting additional VCG features that could enhance the informative value within classification, or applying the described methodology to transformed VCG recordings derived from 12-lead ECG, which is the most commonly measured in clinical practice. These derived VCGs could provide complementary information to existing ECG-based diagnostic systems and support clinicians in their decision-making. The 12-lead ECG, routinely used in clinical examinations, can be mathematically transformed into VCG leads using established transformation methods. Such reconstructed VCG recordings expand the scope of cardiac electrical activity analysis and can serve as a valuable supplement to conventional ECG interpretation. From these derived VCG leads, the same set of VCG features can be extracted, and the described classification approach using both standard machine learning and stacking techniques can be applied. In this way, the proposed method could be implemented on already acquired ECG data for diagnostic verification or integrated into real-time clinical analysis, thereby contributing to the improvement of the necessary treatment. Conclusion Early diagnosis and detection of myocardial infarction can help physicians provide timely and effective treatment, potentially saving the lives of at-risk patients. In this study, a methodology for processing of vectorcardiographic records for the automated detection of MI records was proposed, based on the analysis of extracted VCG features analyzing the morphological properties of the QRS and T loop. Among 210 different M-L settings, the highest accuracy was achieved using the Stacking Ensemble Learning method, which combines multiple base models and employs logistic regression as a meta-classifier. This approach yielded high accuracy of 95.55%, sensitivity of 97.70%, specificity of 86.25%, positive predictive value of 96.86%, negative predictive value of 89.61%, and f1-score of 97.27%. These results confirmed the usefulness of the VCG method and can aid physicians in decision-making regarding subsequent treatment plans.