Next Article in Journal
Self-Organizing Neural Grove for Malware Detection in IoT Edge Devices
Previous Article in Journal
Close-Range 3D Hyperspectral Measurement System with a Physics-Guided Spectral Correction Model
Previous Article in Special Issue
The Application of an Ultra-Thin, High-Density μECoG Array in Dissecting Caffeine-Induced Cortical Dynamics in Mice
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

LightGBM-Based Classification of Heart Failure Phenotypes Using Morpho-Energy Features from High-Resolution ECG

by
Mohamed Amin Gader
1,2,3,*,
Sourour Karmani
4,5,
Ridha Djemal
1,2 and
Carlos Valderrama Sakuyama
3
1
Advanced Technologies for Medicine and Signals Laboratory (ATMS), National School of Engineering, University of Sfax, Sfax 3038, Tunisia
2
Electrical Engineering Department, National School of Engineering, University of Sfax, Sfax 3038, Tunisia
3
Department of Microelectronics & Electronics, Faculty of Polytechnic, University of Mons, 7000 Mons, Belgium
4
Laboratory of Electronics and Microelectronics (FSM), University of Monastir, Monastir 5000, Tunisia
5
Higher Institute of Applied Sciences and Technology of Sousse, University of Sousse, Sousse 4000, Tunisia
*
Author to whom correspondence should be addressed.
Sensors 2026, 26(11), 3397; https://doi.org/10.3390/s26113397
Submission received: 11 March 2026 / Revised: 24 April 2026 / Accepted: 1 May 2026 / Published: 27 May 2026

Abstract

Heart failure (HF) remains a major global health challenge, necessitating accurate yet accessible diagnostic tools. While the left ventricular ejection fraction (LVEF) is the primary metric for classifying HF into preserved (HFpEF), mid-range (HFmrEF), and reduced (HFrEF) phenotypes, conventional imaging modalities such as echocardiography are resource intensive. In contrast, the electrocardiogram (ECG) offers a low-cost, non-invasive alternative for continuous cardiac assessment. This paper proposes a multi-algorithm artificial intelligence (AI) framework for automated HF phenotype classification using high-resolution ECG signals from 303 patients with chronic heart failure from the MUSIC cohort. After preprocessing (normalization, bandpass filtering), we employed a hybrid approach combining the Pan–Tompkins algorithm for robust R-peak detection with the NeuroKit2 toolbox for the precise delineation of P, Q, S, and T waves. ECG recordings were then segmented using an adaptive beat-centric windowing strategy. From the segmented beats, we extracted a comprehensive set of temporal, morphological, and energy-based features, including RR, QRS, and QT intervals, along with P-wave, QRS-complex, and T-wave energies. These features were used to train and evaluate several ensemble machine learning models—Random Forest, XGBoost, CatBoost, LightGBM, and a stacking classifier—using a stratified 70–15–15 train–validation–test split with 5-fold cross-validation. The LightGBM model achieved the highest performance with a test accuracy of 98.45%, an AUC of 0.9989, and a macro F1-score of 0.9804, outperforming other ensembles and the stacking classifier. The results demonstrate that an AI-driven analysis of ECG-derived morpho-energy features can serve as a reliable, non-invasive screening tool for the accurate and early discrimination of HF phenotypes, potentially supporting clinical decision making and improving patient management in resource-limited settings.

1. Introduction

Over 64 million people worldwide suffer from heart failure (HF), which is a progressive cardiovascular disease marked by the heart’s incapacity to pump enough blood to meet the body’s metabolic demands [1,2]. Driven by population aging and the growing burden of comorbidities such as obesity, diabetes, hypertension, and coronary artery disease, its prevalence is rising [3,4]. While these comorbidities represent important risk factors for HF development, this paper focuses specifically on ECG-derived features for phenotypic classification in patients with established heart failure. Clinically, HF manifests through symptoms like dyspnea, exhaustion, and fluid retention, which have a substantial influence on patients’ quality of life and place a significant strain on healthcare resources [5]. Similarly, the analysis of other physiological signals, such as electroencephalography (EEG), has shown promise in detecting cognitive states like stress through advanced signal processing and machine learning techniques, highlighting the broader potential of AI-driven physiological signal analysis for healthcare applications [6].
The left ventricular ejection fraction (LVEF), which measures the proportion of blood expelled from the left ventricle during each cardiac cycle, is a key metric for HF diagnosis and treatment stratification. Based on the LVEF, patients are categorized into three phenotypic subtypes: heart failure with preserved ejection fraction (HFpEF, LVEF ≥ 50%), mid-range ejection fraction (HFmrEF, 41–49%), and reduced ejection fraction (HFrEF, LVEF ≤ 40%) [7]. Precise phenotypic classification is essential for guiding risk assessment, prognosis, and treatment selection.
Conventional imaging modalities for LVEF assessment include echocardiography, cardiac magnetic resonance (CMR), and nuclear imaging. Although these techniques yield precise readings, they are costly, time consuming, and reliant on specialized tools and operator expertise, which restricts their applicability for large-scale screening or ongoing monitoring.
Conversely, electrocardiography (ECG) is a widely accessible, inexpensive, and non-invasive method of recording the electrical activity of the heart [8]. Numerous studies have demonstrated that aberrant LVEF values and ventricular dysfunction are correlated with ECG parameters such as QRS duration, QT interval, T-wave morphology, and ST-segment deviations [9]. These characteristics, combined with the advent of machine learning (ML) and artificial intelligence (AI) methods, make ECG a compelling option for automated HF classification [10].
Indeed, recent developments in AI have enabled automated ECG-based HF identification with promising accuracy [11]. Broadly, existing approaches fall into two categories: traditional machine learning methods, which rely on handcrafted features such as temporal intervals, morphological descriptors, and nonlinear heart rate variability metrics [12,13], and deep learning approaches, which extract features directly from raw signals. In this paper, we deliberately focus on tree-based ensemble methods, which offer a better balance between performance, interpretability, and computational efficiency for structured tabular data, making them particularly suitable for clinical settings where model transparency is essential [14]. Despite these advancements, accurately differentiating between HF phenotypes HFpEF, HFmrEF, and HFrEF remains a clinical challenge because of their overlapping clinical manifestations [15].
To address this gap, a more robust method for HF classification may lie in combining ensemble machine learning models with a multi-domain feature extraction strategy (encompassing temporal, morphological, energy-based, and clinical characteristics) [16]. Such an approach allows models to leverage complementary information including RR intervals, QRS duration, QT interval, and waveform energy, as well as demographic and clinical data (age, sex, LVEF) to enhance predictive performance [17]. Ensemble techniques such as Random Forest, stacking, and gradient boosting (LightGBM, CatBoost, XGBoost) are particularly well suited for managing high-dimensional, heterogeneous features while guaranteeing model stability.
In this context, this paper introduces a comprehensive AI-based framework for classifying HF phenotypes from high-resolution ECG recordings of 303 patients with ischemic heart disease. There are three main contributions:
  • The design of a preprocessing and segmentation pipeline for ECG signals, featuring integrated wave detection (P, Q, R, S, T) and adaptive beat-centric windowing.
  • The extraction of a rich, multi-domain feature set comprising temporal, morphological, energy-based, and clinical descriptors to characterize cardiac dynamics.
  • A systematic evaluation and comparison of multiple ensemble ML algorithms, ultimately identifying the most accurate and stable model for distinguishing HFpEF, HFmrEF, and HFrEF subtypes.
This paper attempts to create a non-invasive, accurate, and accessible tool to enable early detection, improve risk stratification, and facilitate better clinical decision making in heart failure care by showcasing the efficacy of ECG-based AI models [18].

2. Related Works

The use of electrocardiographic (ECG) signals in conjunction with artificial intelligence (AI) methods for the early identification and classification of heart failure (HF) has been investigated in numerous studies [19,20]. Contemporary approaches can be broadly grouped into two paradigms: traditional machine learning models that utilize engineered features and deep learning architectures that learn representations directly from raw data.
In the domain of feature-based machine learning, Sona et al. [21] leveraged algorithms including SVM, KNN, neural networks, and decision trees to analyze circadian ECG data for predicting HF across various LVEF categories. By extracting temporal and frequency-domain variables such as QT, QRS, and ST intervals from 24-h recordings segmented into one-hour windows, they achieved an accuracy exceeding 91% using a tree-based classifier. Similarly, Alkhodari et al. [22] distinguished between HF subtypes (HFpEF, HFmrEF, and HFrEF) using clinical and demographic factors alone, such as age, BMI, diabetes, and arrhythmia history. Their method, which combined CNN-based feature extraction with machine learning classifiers, achieved an accuracy of 90.1%, thereby demonstrating that clinical markers can significantly aid in HF prediction even without temporal ECG segmentation. In a hybrid vein, Botros et al. [23] investigated the combination of CNN-derived representations with SVM-based classification, reporting encouraging outcomes in distinguishing HF patients from healthy controls. Our previous research focused on deep learning-based arrhythmia detection from ECG signals [24,25]. In contrast, this paper investigates ensemble machine learning approaches for heart failure phenotyping, demonstrating the versatility of ECG analysis across different cardiac pathologies.
Conversely, deep learning techniques have proven effective at automatically learning spatiotemporal representations from raw ECG data. For instance, Zhang et al. [26] presented a CNN-LSTM architecture using 30-min ECG recordings divided into 12-s intervals, capturing both morphological aspects and long-term temporal dependencies to reach an accuracy of 99.09% on the MIMIC-III and BIDMC datasets. Separately, Kwon et al. [27] developed a CNN-based model to identify HFpEF from brief (10-s) ECG segments augmented with demographic data. Trained on a multi-institutional cohort of over 34,000 patients, their approach demonstrated significant robustness and generalization. Further underscoring the value of AI-enhanced ECG interpretation, Akbilgic et al. [28] introduced ECG-AI, which is a deep learning framework integrating multi-cohort datasets for HF prediction and early risk stratification.
In summary, prior research illustrates two dominant trends: (1) machine learning models dependent on hand-engineered ECG and clinical parameters and (2) deep learning architectures capable of directly learning discriminative patterns from raw data. While these contributions are significant, several limitations persist in the literature. While deep learning approaches have demonstrated excellent performance, they typically require large datasets, and their “black-box” nature limits clinical adoption. Our work positions itself as a pragmatic alternative: leveraging interpretable ECG features with high-performing yet transparent ensemble models.
Many studies focus either on fully automated deep models or manually crafted descriptors with inadequate integration of multi-domain data that combines temporal, morphological, and clinical markers. For instance, Sona et al. [21] relied exclusively on temporal and frequency–domain ECG features (TP, QT, QRS, ST intervals, entropy, instantaneous frequency) without integrating morphological energy descriptors or clinical markers, achieving 91.2% accuracy. Conversely, Alkhodari et al. [22] utilized only clinical profiles (age, BMI, diabetes, arrhythmia history), omitting the rich electrical information contained in ECG waveforms, and attained 90.1% accuracy. Kwon et al. [27] combined limited ECG features (QRS, P-wave, T-wave) with demographic data but did not incorporate energy-based morphological parameters that reflect ventricular contraction strength, resulting in 86.6% accuracy. In contrast, our approach integrates temporal intervals (RR, QRS, QT), morphological energies (P-wave, QRS, T-wave), and clinical context, achieving 98.45% accuracy—representing a 7–12% absolute improvement over these single-domain methods. Moreover, numerous methods employ fixed-length signal segments, which may fail to capture patient-specific rhythm variability, and many rely on single-model designs without fully exploiting the advantages of ensemble strategies. These gaps collectively highlight the need for a more comprehensive framework that seamlessly integrates robust classification, rich multi-domain feature representations, and adaptive, patient-centric segmentation. Building upon these insights, the following section presents a methodology designed to incorporate these components into a coherent workflow for reliable HF phenotyping.
While deep learning models such as CNNs and CNN-LSTM architectures [26,27] learn representations directly from raw waveforms—requiring large cohorts (often >10,000 patients) for effective training and generalization—our feature-based ensemble strategy leverages clinically interpretable ECG parameters (RR, QRS, QT intervals; P/QRS/T-wave energies). This distinction is critical for two reasons. First, the moderate size of the MUSIC cohort (n = 303) favors handcrafted feature approaches over representation learning, which is prone to overfitting in small datasets. Second, the features we extract maintain direct physiological meaning (e.g., QRS prolongation indicating conduction delay, reduced QRS energy reflecting impaired ventricular contractility), whereas CNN-derived features operate as “black-box” representations that are difficult to interpret in clinical settings. Consequently, our approach achieves state-of-the-art performance (98.45% accuracy) while preserving the transparency required for clinical decision support—a balance that deep learning methods trained on similarly sized cohorts have not demonstrated.

3. Proposed Methodology

The overall pipeline for heart failure classification is organized into six sequential stages:
  • Data acquisition: collection of high-resolution ECG recordings and associated clinical metadata.
  • Preprocessing: signal normalization and robust detection of fiducial points (P, Q, R, S, T waves).
  • Segmentation: application of an adaptive, beat-centric windowing strategy centered on R-peaks.
  • Feature extraction: computation of temporal, morphological, energy-based, and clinical parameters from segmented beats.
  • Classification: training and evaluation of ensemble machine learning models (CatBoost, LightGBM, XGBoost, Random Forest, and a stacking ensemble).
  • Performance evaluation: comprehensive assessment using accuracy, recall, F1-score, confusion matrices, and ROC curves.
A schematic of the general structure is shown in Figure 1. Our approach aims to provide a more comprehensive and reliable depiction of cardiac electrical activity by fusing high-resolution ECG signals with clinical data. The synergy between adaptive segmentation, multi-domain feature extraction, and ensemble learning is designed to ensure the stable and precise prediction of HF phenotypes.
Consequently, this pipeline supports early risk assessment and clinical decision making by delivering an effective and interpretable tool to differentiate between HFpEF, HFmrEF, and HFrEF.
The extracted feature matrix is provided simultaneously as input to all five classifiers (CatBoost, LightGBM, XGBoost, Random Forest, and the stacking ensemble). Each model is trained independently on the same training data using 5-fold cross-validation. Final predictions are obtained from the best-performing individual model (LightGBM) or through the stacking meta-learner.

3.1. Dataset and Patients’ Enrollment

This paper utilized the publicly available MUSIC (Sudden Death in Heart Failure) database, which is hosted on PhysioNet [29]. The database provides high-resolution resting ECG recordings sampled at 1000 Hz with a three-lead orthogonal layout (X, Y, Z), which is accompanied by comprehensive clinical and demographic metadata. For all subsequent analyses, we utilized Lead X exclusively. Lead X corresponds to the left–right horizontal axis in the orthogonal Frank lead system and provides an optimal visualization of QRS complex morphology and T-wave characteristics—electrophysiological features central to HF phenotype discrimination. This single-lead approach also enhances translational potential to wearable and mobile ECG platforms, which typically employ 1–2 lead configurations.
The cohort consisted of 303 patients with chronic heart failure, aged 18 to 89 years, enrolled in the MUSIC study, which is a prospective registry designed to evaluate risk factors for sudden cardiac death in heart failure patients. All participants underwent standardized clinical examination and echocardiography to measure the left ventricular ejection fraction (LVEF). In accordance with ASE/EACVI guidelines [30], patients were stratified into three heart failure phenotypes (see LVEF on Table 1): HFpEF (n = 63, 20.8%), HFmrEF (n = 54, 17.8%), and HFrEF (n = 186, 61.4%). All LVEF measurements were performed by certified sonographers following institutional protocols. The study protocol was approved by the relevant institutional review boards and complied with the Declaration of Helsinki; written informed consent was obtained from all participants. Inclusion criteria required a diagnosis of stable ischemic cardiomyopathy and the availability of standardized echocardiographic data. Key exclusion criteria comprised congenital heart disease, acute decompensated heart failure at the time of recording, persistent atrial fibrillation, implanted cardiac devices (e.g., pacemakers or ICDs), or severe systemic illnesses (e.g., advanced hepatic, renal, or malignant diseases).
The collected clinical data included age, sex, body mass index (BMI), smoking status, diabetes, hypertension, and a history of myocardial infarction (MI). Patients with incomplete clinical data (demographics, medications, comorbidities) were excluded from the study. However, for ECG-derived features, occasional missing values occurred after segmentation (e.g., due to noisy segments where wave delineation failed). These missing values were handled using K-nearest neighbors (KNN) imputation during the preprocessing pipeline.
The dataset was split at the patient level into training (70%), validation (15%), and test (15%) sets while maintaining the distribution of HF phenotypes. Critically, all segments originating from a single patient were assigned to the same data split (training, validation, or test) to prevent data leakage. Segmentation and feature extraction were performed after the patient-level split to ensure that no information from test patients influenced the training process.
Table 1 summarizes the key demographic and clinical characteristics of the cohort.

3.2. Preprocessing and Feature Extraction

Given the susceptibility of ECG signals to inter-patient variability, baseline drift, and noise, a rigorous preprocessing pipeline was implemented to ensure reliable feature extraction and classification. The processing sequence is (1) bandpass filtering, (2) amplitude normalization, and (3) fiducial point detection.

3.2.1. Bandpass Filtering

A dual-stage bandpass filter (0.5–40 Hz) was first applied to suppress baseline wander and high-frequency noise. This can be represented as:
  • High-pass filter (0.5 Hz): suppresses baseline wander, which is mainly caused by respiratory movements.
  • Low-pass filter (40 Hz): reduces high-frequency noise, such as muscle activity or electrical interference.
Mathematically, this corresponds to a bandpass filter:
y ( t ) = x ( t ) h ( t ) , H ( f ) = 1 if 0.5 f 40 Hz 0 otherwise
where x ( t ) is the raw ECG signal, h ( t ) is the filter response, and  y ( t ) is the filtered signal.

3.2.2. Normalization

Following bandpass filtering, all ECG signals were normalized to the range [0, 1] using MinMaxScaler, which is a standard normalization technique that reduces amplitude variability across patients and stabilizes machine learning model training [31]. This step ensures that extracted morphological features are comparable across recordings irrespective of acquisition settings.

3.2.3. R-Peak and Fiducial Points Detection

On the filtered and normalized signals, the accurate automatic detection of ECG waves (P, QRS, and T) is critical for deriving reliable features. To this end, we employed a hybrid approach that integrates the robustness of the Pan–Tompkins algorithm for R-peak detection with the sophisticated delineation capabilities of the NeuroKit2 toolbox [32] for identifying the remaining fiducial points (P, Q, S, and T). The detection pipeline comprised three main steps:
  • R-peak detection (Pan–Tompkins): The Pan–Tompkins algorithm was applied, involving differentiation, squaring, and moving-window integration:
    y ( t ) = x ( t ) x ( t 1 ) ( derivative )
    y 2 ( t ) = ( y ( t ) ) 2 ( squaring )
    y int ( t ) = 1 N i = 0 N 1 y 2 ( t i ) ( integration )
    Peaks are then identified by comparing y int ( t ) against an adaptive threshold.
  • Wave delineation (P, Q, S, T): Two complementary methods were used:
    • Primary method (peak search): Local maxima/minima were identified within predefined windows around each R-peak (e.g., Q wave in [ R 40 ms , R ] , and the T wave in [ R + 60 ms , R + 400 ms ] .)
    • Fallback method (Discrete Wavelet Transform, DWT [33]): The ECG was decomposed into wavelet coefficients W j , k to isolate frequency components associated with P, QRS, and T waves:
      W j , k = n x ( n ) ψ j , k ( n )
      where ψ j , k is a wavelet function dilated by j and translated by k.
  • Noise Filtering: Invalid fiducial points (e.g., NaN values or physiologically implausible intervals) were removed to ensure consistency in the extracted features.
This hybrid methodology ensures precise fiducial point identification while maintaining robustness against noise and inter-patient variability. Figure 2 illustrates a 10-s ECG segment from patient P0001_H, showing how red filtering, normalization, and the hybrid detection pipeline accurately identify R-peaks and P–QRS–T waves.

3.2.4. Segmentation

Following preprocessing, ECG signals were segmented using an adaptive, beat-centric approach to preserve physiologically consistent cardiac dynamics and augment the effective number of training samples. The segmentation workflow involved the following:
  • R-peak detection: R-peaks were identified, defining consecutive RR intervals ( R R i ).
  • Average cardiac cycle computation: The mean R-R interval was calculated as
    R R avg = 1 N i = 1 N R R i
    where N is the total number of detected beats.
  • Window size determination: Each segment was designed to encompass approximately N b = 60 beats with the number of samples per window given by
    W = R R avg × f s × N b
    where f s = 1000 Hz is the ECG sampling rate.
  • Sliding window with overlap: Adjacent windows were overlapped by 50% to ensure continuity, resulting in a stride length
    P = W 2
  • Number of segments: For an ECG recording of length L samples, the total number of segments was
    N seg = L W P + 1
Illustrative example: For a recording with L = 180 beats, using N b = 60 beats per window and 50% overlap ( P = 30 ), the resulting number of segments is
N seg = 180 60 30 + 1 = 5 .
For patient P0001_H, segmentation yielded five windows of roughly 70 s each, with 50% overlap, producing 37 effective segments covering 22 min of ECG ( R R avg = 1163.1  ms).
This adaptive segmentation offers three key advantages: (i) it increases the number of training samples; (ii) it preserves local heart rhythm variations (e.g., arrhythmias); and (iii) controlled redundancy from overlapping segments enhances model robustness. This strategy is consistent with earlier deep learning research [34], which showed that clustering several cardiac cycles per segment stabilizes morphological, energy and temporal characteristics. Figure 3 illustrates how the 180-s ECG recording is divided into overlapping windows, highlighting the preservation of beat-to-beat variability and the creation of multiple effective segments for model training.

3.2.5. Feature Extraction

From each segmented beat, a set of attributes was calculated to capture the ECG’s morphological, energy, and temporal characteristics. First, key temporal intervals were extracted as reliable markers of cardiac electrophysiology and HF risk predictors [20]: the mean R-R interval (RR_mean), mean QRS duration (QRS_mean), and mean QT interval (QT_mean).
Additionally, the energy of the P-wave, QRS complex, and T-wave components was computed. These energy-based features provide complementary information on atrial depolarization, ventricular depolarization, and ventricular repolarization, respectively, and they have been shown to improve classification performance in automated ECG analysis.
In summary, the combination of interval-based and energy-based features enhances the diagnostic framework’s robustness by integrating both rhythm-related and morphology-related markers. The complete list and descriptions of these extracted features are detailed in Table 2.
Quality-Controlled Feature Aggregation: Features were computed exclusively from beats that passed quality control criteria. Invalid fiducial points (None or NaN values) were automatically filtered out during wave delineation. For each segmented window, temporal intervals and energy features were computed as the median across all valid beats, providing robustness against occasional detection errors and outlier beats. After aggregation, any remaining missing feature values at the segment level were imputed using K-nearest neighbors (KNN, k = 5 ) during the preprocessing pipeline. The missing value rates were: QRS_duration (29.2%), QT_interval (20.8%), P_Energy (4.8%), QRS_Energy (3.7%), and T_Energy (0.02%). The higher rates for QRS and QT reflect the challenge of automated wave delineation in patients with severe heart failure. KNN imputation preserves the underlying data structure while retaining clinically informative cases that would otherwise be excluded.

4. Machine Learning Methodologies and Training Configurations

In this paper, we employed four ensemble-based machine learning models to categorize patients into HFpEF, HFmrEF, and HFrEF groups: CatBoost, LightGBM, XGBoost, and Random Forest. These models were selected for their proven performance in handling structured tabular data and their ability to capture complex nonlinear relationships.
The primary evaluation metric was classification accuracy. To optimize model performance, hyperparameters were tuned systematically using GridSearchCV with 5-fold cross-validation. A predefined hyperparameter grid was explored for each model, encompassing learning rates, the number of estimators, tree depths, and other model-specific parameters. For CatBoost, early stopping based on a validation set was implemented to prevent overfitting.
Our preprocessing pipeline included K-nearest neighbors (KNN) imputation for missing values, the standardization of features using StandardScaler, and label encoding for the target classes. To ensure robust evaluation, the dataset was split into training (70%), validation (15%), and test (15%) sets. Finally, a stacking ensemble was constructed using the individually optimized base models with a multinomial logistic regression acting as the meta-classifier to further enhance classification robustness.
This comprehensive approach ensures that each model is carefully tuned and validated, leveraging the complementary strengths of multiple ensemble methods for reliable heart failure classification.
Hyperparameter Optimization Protocol: For each model, we conducted systematic grid search using 5-fold stratified cross-validation on the training partition (70% of patients). The optimization objective was macro-averaged F1-score to account for class imbalance (HFrEF: 61.4%, HFmrEF: 17.8%, HFpEF: 20.8%). Table 3 summarizes the search space and selected configurations. For boosting models (CatBoost, LightGBM, XGBoost), we employed early stopping with a patience of 50 rounds on a 10% validation split within each cross-validation fold to prevent overfitting. The optimal hyperparameters were selected based on the highest mean validation F1-score across folds with the constraint that the training–validation performance gap remained below 5% to ensure generalization.

4.1. CatBoost

CatBoost is a gradient boosting technique specifically optimized for categorical data and resistant to overfitting [35]. Tuned hyperparameters included the number of iterations [500, 1000], learning rate [0.01, 0.1], depth [6, 8, 10], and early stopping rounds [50, 100]. We determined an optimal configuration: iterations = 1000, learning rate = 0.01, depth = 8, early stopping rounds = 50.

4.2. LightGBM

LightGBM is a histogram-based gradient boosting framework designed for high efficiency with large datasets [36]. We tuned the hyperparameters to the following values: n_estimators [500, 1000], learning rate [0.01, 0.1], max_depth [6, 8, 10], and num_leaves [15, 30]. We found an optimal configuration: n_estimators = 1000, learning rate = 0.01, max_depth = 8, num_leaves = 30.

4.3. XGBoost

XGBoost is a widely used regularized gradient boosting algorithm. We tuned the hyperparameters to the following values: n_estimators [500, 1000], learning rate [0.01, 0.1], and max_depth [6, 8, 10]. Afterwards, we found the optimal values: n_estimators = 1000, learning rate = 0.01, max_depth = 8.

4.4. Random Forest

Random Forest is an ensemble method that builds multiple decision trees and aggregates their predictions. We tuned the hyperparameters to the following values: n_estimators [100, 200, 300] and max_depth [5, 10, 20]. Then, we found an optimal setting: n_estimators = 200, max_depth = 10.

4.5. Stacking Ensemble

A stacking classifier was implemented by combining the individually optimized CatBoost, LightGBM, XGBoost, and Random Forest models. Logistic regression was used as the meta-estimator. No additional hyperparameter tuning was performed on the stacking classifier itself.

4.6. Summary of Hyperparameters

For clarity, Table 3 summarizes the tuned hyperparameter ranges and the selected optimal configuration for each model.

5. Results

All analyses were performed on a workstation equipped with an Intel Core i5-13420H processor and 24 GB of RAM.

5.1. ECG Feature Summary and Statistical Analysis

Table 4 summarizes the extracted ECG characteristics, including the RR interval, QRS duration, QT interval, P-wave energy, QRS energy, and T-wave energy for each of the three heart failure subtypes (HFpEF, HFmrEF, and HFrEF). Values are presented as median (interquartile range, Q1–Q3) due to the non-normal distribution of ECG features confirmed by Shapiro–Wilk testing.
Given that ECG data typically follow a non-normal distribution, normality was first assessed using the Shapiro–Wilk test. Since the results confirmed deviations from normality, group comparisons were performed using the non-parametric Kruskal–Wallis test. Subsequently, post hoc pairwise comparisons were conducted with Mann–Whitney U tests to identify significant differences between specific HF subtypes.To account for multiple comparisons, we applied a Bonferroni correction, adjusting the significance threshold to p < 0.017 (0.05/3). Furthermore, nonlinear features, such as entropy-based measures [37], can be applied to ECG signals to capture subtle dynamics and complex irregularities that are not fully characterized by conventional temporal descriptors (e.g., RR, QRS, and QT intervals). The wide interquartile ranges observed in some features reflect the substantial clinical heterogeneity inherent in heart failure populations.

5.2. Correlation Analysis of ECG Features

To examine monotonic relationships between ECG characteristics and demographic variables, we performed Spearman’s rank correlation analysis, which is more appropriate for non-normally distributed data. The resulting correlation heatmap is displayed in Figure 4, where strong positive correlations are represented in darker red and weak correlations are reported in blue.

5.3. Model Performance and Evaluation

Each model’s performance was evaluated using validation accuracy, test accuracy, AUC, macro F1-score, and training time. Table 5 presents a comprehensive comparison of the classifiers considered in this paper: CatBoost, LightGBM, XGBoost, Random Forest, and the stacking ensemble.
The results confirm the efficacy of ECG-derived features in distinguishing between HFpEF, HFmrEF, and HFrEF with all classifiers achieving test accuracies above 95%. Future improvements could address class imbalance through synthetic signal generation techniques, as demonstrated in EEG studies [38].
Notably, LightGBM achieved the highest performance with a validation accuracy of 98.66%, a test accuracy of 98.45%, and the best AUC score (0.9989). It also exhibited the lowest training time among the boosting-based models (2.88 s), highlighting its computational efficiency.
In terms of per-class performance, LightGBM achieved F1-scores of 0.962 (HFpEF), 0.967 (HFmrEF), and 0.993 (HFrEF), demonstrating strong minority class performance despite the class imbalance.
Following closely, XGBoost and CatBoost achieved test accuracies of 97.68% and 97.26%, respectively, both with high AUC values (0.9973 and 0.9965). While Random Forest maintained competitive performance (test accuracy 95.77%, AUC 0.9963) and the fastest training time, it demonstrated reduced precision compared to boosting methods.
The stacking ensemble delivered strong performance (test accuracy 98.19%, AUC 0.9979) and the lowest cross-validation variability, indicating high stability. However, this came at the expense of a substantially longer training time (121.37 s).
Figure 5 presents the normalized confusion matrices for all five models, illustrating classification performance across the three HF categories. All models show strong diagonal dominance, reflecting low misclassification rates. Specifically, LightGBM achieved the highest per-class accuracies: 95.6% for HFpEF, 97.4% for HFmrEF, and 99.5% for HFrEF.
Furthermore, the ROC curves for each model are displayed in Figure 6, demonstrating strong discriminatory power across all HF subtypes. LightGBM again achieved the highest class-specific AUC values (0.9991 for HFpEF, 0.9990 for HFmrEF, and 0.9984 for HFrEF).

5.4. Model Stability and Overall Comparison

To provide a holistic comparison, Figure 7 and Figure 8 integrate multiple performance and stability metrics. The radar chart (Figure 7) compares models across key criteria: Precision, Avg AUC, Avg F1, Stability, and Training Time. LightGBM dominates across most dimensions, particularly in Precision, Avg AUC, and Stability.
Complementing this, the bar plot (Figure 8) compares models based on a combined score and stability metric. LightGBM achieves the highest combined score (0.9970) and stability (0.8938), reflecting its superior balance of performance and reliability.
In summary, the comparative analysis demonstrates that LightGBM provides the best trade-off between predictive accuracy, stability, and computational efficiency, making it the most suitable model for scalable and reliable HF phenotype classification in clinical settings.

6. Discussion

Our comparative analysis highlights the diversity of methods, input features, and segmentation techniques employed in recent research on heart failure (HF) classification, as summarized in Table 6. To achieve optimal classification accuracy across HF subtypes (HFpEF, HFmrEF, and HFrEF), different methodologies leverage various information sources, ranging from clinical indicators to raw ECG waveforms.
Sona et al. [21] examined ECG-derived temporal and frequency-domain features including TP, QT, QRS, and ST intervals, mean entropy, and mean instantaneous frequency from 24-h recordings segmented into 1-h intervals. Their best model, a tree-based classifier, reached an accuracy of 91.2%. While this approach demonstrated the predictive value of ECG features, its coarse 1-h segmentation may limit its ability to capture brief electrophysiological fluctuations occurring over shorter timescales.
In contrast, Zhang et al. [26] proposed a CNN-LSTM framework that combined spatial and temporal features extracted from 30-min ECG recordings divided into 12-s intervals. By employing fine-grained segmentation, they achieved an impressive accuracy of 99.09% on the MIMIC-III and BIDMC datasets. However, their heavy reliance on a complex deep-learning architecture may pose challenges for clinical interpretability and deployment in resource-constrained settings.
Alkhodari et al. [22] adopted a different strategy, stratifying patients based solely on clinical markers such as age, BMI, diabetic status, arrhythmic history, and prior myocardial infarction. Their CNN-based model achieved an accuracy of 90.10%, underscoring the utility of non-ECG data. Nevertheless, relying exclusively on clinical profiles omits the rich electrical information contained in the ECG, which could restrict the model’s generalizability to populations with different clinical characteristics.
Kwon et al. [27] evaluated a large multi-hospital cohort (n = 34,103) using brief 10-s ECG segments augmented with demographic data. Their CNN model attained an accuracy of 86.6%, demonstrating the feasibility of large-scale HF screening. Yet, its relatively lower performance compared to feature-rich, ECG-based models suggests that integrating temporal ECG descriptors with demographic data could yield improved outcomes.
In this paper, we have shown that optimized ensemble machine learning models, applied to carefully curated ECG-derived features (RR, QT, and QRS intervals, along with P-wave, T-wave, and QRS complex energies), achieve state-of-the-art performance. As summarized in Table 6, using 1-min adaptive segments from the MUSIC database (303 patients), our models obtained test accuracies of 97.26% (CatBoost), 98.45% (LightGBM), 97.68% (XGBoost), 95.77% (Random Forest), and 98.19% (Stacking). All comparative accuracy values discussed in this section are test-set metrics reported in the respective original studies. These results demonstrate high internal performance on the MUSIC dataset, comparing favorably with earlier ECG-only [21,26] and clinical-profile-based approaches [22]. However, we acknowledge that external validation on independent cohorts is necessary to confirm robustness and generalizability.
Importantly, our findings emphasize the clinical relevance of temporal ECG metrics such as QT and QRS intervals which reflect underlying electromechanical cardiac dynamics. The exceptional accuracy, stability, and computational efficiency of LightGBM highlight its strong potential for integration into practical clinical decision-support systems that require robustness, speed, and interpretability. The MUSIC cohort exhibits moderate class imbalance (HFrEF: 61.4%, HFpEF: 20.8%, HFmrEF: 17.8%). Notably, our LightGBM model achieved excellent per-class performance despite this imbalance with sensitivities of 99.5%, 95.6%, and 97.4% for HFrEF, HFpEF, and HFmrEF, respectively. Given the already high baseline performance (98.45% test accuracy), the expected absolute improvement from explicit class balancing is limited—likely below 1% in overall accuracy. The primary benefit would instead be improved stability and probability calibration for minority classes. We also caution that synthetic oversampling in the feature space may generate physiologically implausible combinations of ECG parameters, potentially degrading external validity. A more principled approach would involve the targeted collection of additional minority class samples in prospective studies.
In summary, this paper advances the field of ECG-based HF phenotyping: (1) validating the high predictive power of a focused set of morpho-energy ECG features, (2) demonstrating the superiority of LightGBM among ensemble models, and (3) proposing a scalable, efficient pipeline that bridges advanced computational techniques with clinical applicability particularly in settings where access to echocardiography or specialist expertise is limited. Although deep learning models (CNNs, LSTMs) have shown promising results in the literature [26], our methodological choice is motivated by several factors. First, the moderate size of our cohort (n = 303) favors handcrafted feature approaches over representation learning. Second, interpretability is crucial for clinical adoption; ensemble models enable the identification of the most discriminative ECG features (via SHAP or feature importance analysis). Third, the computational efficiency of LightGBM (2.88 s) makes it deployable in resource-limited settings. These considerations justify our feature-based approach as a pragmatic and clinically relevant solution.

7. Conclusions

This paper demonstrates that a carefully selected set of ECG-derived features, processed through an optimized machine learning pipeline, can effectively classify heart failure patients into preserved (HFpEF), mid-range (HFmrEF), and reduced (HFrEF) ejection fraction phenotypes. The proposed framework serves as an efficient and supplementary tool to routine echocardiography, addressing the need for accessible and non-invasive screening methods.
By leveraging advanced ensemble models, particularly gradient boosting techniques such as LightGBM, our approach achieves superior accuracy, stability, and computational efficiency compared to earlier ECG-only and clinical-profile-based methods. Specifically, LightGBM attained a test accuracy of 98.45%, an AUC of 0.9989, and a macro F1-score of 0.9804, outperforming other ensemble models and the stacking classifier while maintaining a low training time.
Our results underscore the clinical relevance of temporal ECG metrics including QT and QRS intervals, which reflect underlying electrical and mechanical cardiac dynamics. The use of adaptive 1-min segmentation from the MUSIC dataset enabled the capture of essential temporal patterns while preserving computational feasibility.
Importantly, this methodology holds significant potential to simplify HF assessment in resource-limited environments where access to echocardiography or specialized expertise is constrained. The framework provides a cost-effective, efficient, and interpretable solution for continuous cardiac monitoring, early HF detection, and treatment response evaluation.
The primary limitation of this paper is the absence of external validation. Future work must prioritize prospective validation on independent, multi-center cohorts to confirm generalizability. Additionally, the integration of deep learning architectures and multi-lead ECG analysis could further enhance predictive performance. Furthermore, a complete end-to-end timing analysis of the full pipeline—including preprocessing, segmentation, feature extraction, and model inference—should be conducted to evaluate the total latency for real-time clinical deployment.
In summary, this paper advances the field of ECG-based HF classification by delivering a practical and scalable approach that effectively bridges sophisticated computational techniques with tangible clinical utility, particularly for underserved communities and point-of-care applications. To strengthen clinical interpretability, future research should incorporate explainable AI (XAI) techniques, including SHAP and LIME [39], to elucidate feature contributions and support clinical decision making.

Author Contributions

Conceptualization, M.A.G. and S.K.; methodology, M.A.G.; software, M.A.G.; validation, M.A.G., S.K. and R.D.; formal analysis, M.A.G.; investigation, M.A.G.; resources, R.D. and C.V.S.; data curation, M.A.G.; writing—original draft preparation, M.A.G.; writing—review and editing, S.K., R.D. and C.V.S.; visualization, M.A.G.; supervision, R.D. and C.V.S.; project administration, R.D.; funding acquisition, C.V.S. All authors have read and agreed to the published version of the manuscript.

Funding

The APC for this paper was funded by the Department of Microelectronics & Electronics, University of Mons, Belgium.

Data Availability Statement

The ECG data used in this study are available from the MUSIC (Sudden Death in Heart Failure) database on PhysioNet at https://physionet.org/content/music-sudden-cardiac-death/1.0.1/, accessed on 25 August 2025. Derived features and analysis code are available from the corresponding author upon reasonable request.

Acknowledgments

The authors would like to thank the Department of Microelectronics & Electronics, University of Mons, for covering the publication fees.

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Ziaeian, B.; Fonarow, G.C. Epidemiology and aetiology of heart failure. Nat. Rev. Cardiol. 2016, 13, 368–378. [Google Scholar] [CrossRef]
  2. Shahim, B.; Kapelios, C.J.; Savarese, G.; Lund, L.H. Global public health burden of heart failure: An updated review. Card. Fail. Rev. 2023, 9, e11. [Google Scholar] [CrossRef] [PubMed]
  3. Dunlay, S.M.; Roger, V.L.; Redfield, M.M. Epidemiology of heart failure with preserved ejection fraction. Nat. Rev. Cardiol. 2017, 14, 591–602. [Google Scholar] [CrossRef] [PubMed]
  4. Benjamin, E.J.; Muntner, P.; Alonso, A.; Bittencourt, M.S.; Callaway, C.W.; Carson, A.P.; Chamberlain, A.M.; Chang, A.R.; Cheng, S.; Das, S.R.; et al. Heart Disease and Stroke Statistics—2019 Update: A Report From the American Heart Association. Circulation 2019, 139, e56–e528. [Google Scholar] [CrossRef]
  5. Yancy, C.W.; Jessup, M.; Bozkurt, B.; Butler, J.; Casey, D.E.; Drazner, M.H.; Fonarow, G.C.; Geraci, S.A.; Horwich, T.; Januzzi, J.L.; et al. 2013 ACCF/AHA guideline for the management of heart failure: A report of the American College of Cardiology Foundation/American Heart Association Task Force on Practice Guidelines. J. Am. Coll. Cardiol. 2013, 62, e147–e239. [Google Scholar] [CrossRef]
  6. Belwafi, K.; Mejri, S.; Alsuwaidi, A.; Djemal, R. Analyzing Cognitive Load: EEG Signal Processing for Stress Detection in Arithmetic Tasks. Brain Inform. 2025, 12, 34. [Google Scholar] [CrossRef]
  7. Pieske, B.; Tschöpe, C.; De Boer, R.A.; Fraser, A.G.; Anker, S.D.; Donal, E.; Edelmann, F.; Fu, M.; Guazzi, M.; Lam, C.S.; et al. How to diagnose heart failure with preserved ejection fraction: The HFA–PEFF diagnostic algorithm: A consensus recommendation from the Heart Failure Association (HFA) of the European Society of Cardiology (ESC). Eur. Heart J. 2019, 40, 3297–3317. [Google Scholar] [CrossRef] [PubMed]
  8. Attia, Z.I.; Kapa, S.; Lopez-Jimenez, F.; McKie, P.M.; Ladewig, D.J.; Satam, G.; Pellikka, P.A.; Enriquez-Sarano, M.; Noseworthy, P.A.; Munger, T.M.; et al. Screening for cardiac contractile dysfunction using an artificial intelligence-enabled ECG. Nat. Med. 2019, 25, 70–74. [Google Scholar] [CrossRef]
  9. Hummel, S.L.; Skorcz, S.; Koelling, T.M. Prolonged electrocardiogram QRS duration independently predicts long-term mortality in patients hospitalized for heart failure with preserved systolic function. J. Card. Fail. 2009, 15, 553–560. [Google Scholar] [CrossRef]
  10. Ribeiro, A.H.; Ribeiro, M.H.; Paixão, G.M.M.; Oliveira, D.M.; Gomes, P.R.; Canazart, J.A.; Ferreira, M.P.S.; Andersson, C.R.; Macfarlane, P.W.; Meira, W., Jr.; et al. Automatic diagnosis of the 12-lead ECG using a deep neural network. Nat. Commun. 2020, 11, 1760. [Google Scholar] [CrossRef]
  11. Hong, S.; Zhou, Y.; Shang, J.; Xiao, C.; Sun, J. Opportunities and challenges of deep learning methods for electrocardiogram data: A systematic review. Comput. Biol. Med. 2020, 122, 103801. [Google Scholar] [CrossRef]
  12. Reinier, K.; Narayanan, K.; Uy-Evanado, A.; Teodorescu, C.; Chugh, H.; Mack, W.J.; Gunson, K.; Jui, J.; Chugh, S.S. Electrocardiographic Markers and Left Ventricular Ejection Fraction Have Cumulative Effects on Risk of Sudden Cardiac Death. JACC Clin. Electrophysiol. 2015, 1, 542–553. [Google Scholar] [CrossRef]
  13. Grün, D.; Rudolph, F.; Gumpfer, N.; Hannig, J.; Elsner, L.K.; von Jeinsen, B.; Hamm, C.W.; Rieth, A.; Guckert, M.; Keller, T. Identifying Heart Failure in ECG Data With Artificial Intelligence—A Meta-Analysis. Front. Digit. Health 2021, 2, 584555. [Google Scholar] [CrossRef]
  14. Shah, M.; Maludum, O.; Bhalla, V.; De Venecia, T.A.; Patil, S.; Curet, K.; Chinualumogu, N.; Pressman, G.S.; Figueredo, V.M. QRS duration and left ventricular ejection fraction (LVEF) in non-ST segment elevation myocardial infarction (NSTEMI). Int. J. Cardiol. 2016, 221, 524–528. [Google Scholar] [CrossRef] [PubMed]
  15. Alhamaydeh, M.; Gregg, R.; Ahmad, A.; Faramand, Z.; Saba, S.; Al-Zaiti, S. Identifying the most important ECG predictors of reduced ejection fraction in patients with suspected acute coronary syndrome. J. Electrocardiol. 2020, 61, 81–85. [Google Scholar] [CrossRef] [PubMed]
  16. Hendry, P.B.; Krisdinarti, L.; Erika, M. Scoring System Based on Electrocardiogram Features to Predict the Type of Heart Failure in Patients With Chronic Heart Failure. Cardiol. Res. 2016, 7, 110–116. [Google Scholar] [CrossRef]
  17. Liu, F.; Li, R.; Liu, Y. Prognostic implications of left ventricular mechanical dispersion in comparison with QRS duration in heart failure with reduced ejection fraction. Quant. Imaging Med. Surg. 2025, 15, 7510–7523. [Google Scholar] [CrossRef] [PubMed]
  18. Krittanawong, C.; Virk, H.U.H.; Bangalore, S.; Wang, Z.; Johnson, K.W.; Pinotti, R.; Zhang, H.; Kaplin, S.; Narasimhan, B.; Kitai, T.; et al. Machine learning prediction in cardiovascular diseases: A meta-analysis. Sci. Rep. 2020, 10, 16053. [Google Scholar] [CrossRef]
  19. Yoon, M.; Park, J.J.; Hur, T.; Hua, C.H.; Hussain, M.; Lee, S.; Choi, D.J. Application and Potential of Artificial Intelligence in Heart Failure: Past, Present, and Future. Int. J. Heart Fail. 2024, 6, 11–19. [Google Scholar] [CrossRef]
  20. Ayano, Y.M.; Schwenker, F.; Dufera, B.D.; Debelee, T.G. Interpretable Machine Learning Techniques in ECG-Based Heart Disease Classification: A Systematic Review. Diagnostics 2022, 13, 111. [Google Scholar] [CrossRef]
  21. Al Younis, S.M.; Hadjileontiadis, L.J.; Khandoker, A.H.; Stefanini, C.; Soulaidopoulos, S.; Arsenos, P.; Doundoulakis, I.; Gatzoulis, K.A.; Tsioufis, K. Prediction of heart failure patients with distinct left ventricular ejection fraction levels using circadian ECG features and machine learning. PLoS ONE 2024, 19, e0302639. [Google Scholar]
  22. Alkhodari, M.; Jelinek, H.F.; Karlas, A.; Soulaidopoulos, S.; Arsenos, P.; Doundoulakis, I.; Gatzoulis, K.A.; Tsioufis, K.; Hadjileontiadis, L.J.; Khandoker, A.H. Deep learning predicts heart failure with preserved, mid-range, and reduced ejection fraction from patient clinical profiles. Front. Cardiovasc. Med. 2021, 8, 755968. [Google Scholar] [CrossRef]
  23. Botros, J.; Mourad-Chehade, F.; Laplanche, D. CNN and SVM-Based Models for the Detection of Heart Failure Using Electrocardiogram Signals. Sensors 2022, 22, 9190. [Google Scholar] [CrossRef] [PubMed]
  24. Gader, M.A.; Karmani, S.; Djemal, R. Detection and Classification of Cardiovascular Arrhythmias From ECG Signals Using Deep Learning Algorithms (CNN1D). In Proceedings of the 2025 International Conference on Emerging Technologies and Computing (IC_ETC), Brest, France, 23–26 June 2025; pp. 1–6. [Google Scholar] [CrossRef]
  25. Gader, M.A.; Karmani, S.; Djemal, R.; Valderrama, C. A CNN–Transformer Synergistic Framework for Robust Multi-Class ECG Beat Classification. In Proceedings of the 2025 IEEE 22nd International Conference on Sciences and Techniques of Automatic Control and Computer Engineering (STA), Hammamet, Tunisia, 20–22 December 2025; pp. 306–311. [Google Scholar] [CrossRef]
  26. Zhang, C.-J.; Yuan, L.; Tang, F.-Q.; Cai, H.-P.; Qian, Y.-F.; Wang, C. Heart failure classification using deep learning to extract spatiotemporal features from ECG. BMC Med. Inform. Decis. Mak. 2024, 24, 17. [Google Scholar] [CrossRef]
  27. Kwon, J.-M.; Kim, K.-H.; Eisen, H.J.; Cho, Y.; Jeon, K.-H.; Lee, S.Y.; Park, J.; Oh, B.-H. Artificial intelligence assessment for early detection of heart failure with preserved ejection fraction based on electrocardiographic features. Eur. Heart J.-Digit. Health 2020, 2, 106–116. [Google Scholar] [CrossRef]
  28. Akbilgic, O.; Butler, L.; Karabayir, I.; Chang, P.P.; Kitzman, D.W.; Alonso, A.; Chen, L.Y.; Soliman, E.Z. ECG-AI: Electrocardiographic artificial intelligence model for prediction of heart failure. Eur. Heart J.-Digit. Health 2021, 2, 626–634. [Google Scholar] [CrossRef] [PubMed]
  29. Martin-Yebra, A.; Martínez, J.P.; Laguna, P. PhysioNet. MUSIC (Sudden Cardiac Death in Chronic Heart Failure) Database (Version 1.0.1). 2025. Available online: https://physionet.org/content/music-sudden-cardiac-death/1.0.1/ (accessed on 25 August 2025).
  30. Lang, R.M.; Badano, L.P.; Mor-Avi, V.; Afilalo, J.; Armstrong, A.; Ernande, L.; Flachskampf, F.A.; Foster, E.; Goldstein, S.A.; Kuznetsova, T.; et al. Recommendations for Cardiac Chamber Quantification by Echocardiography in Adults: An Update from the American Society of Echocardiography and the European Association of Cardiovascular Imaging. Eur. Heart J. Cardiovasc. Imaging 2015, 16, 233–271. [Google Scholar] [CrossRef] [PubMed]
  31. Pedregosa, F.; Varoquaux, G.; Gramfort, A.; Michel, V.; Thirion, B.; Grisel, O.; Blondel, M.; Prettenhofer, P.; Weiss, R.; Dubourg, V.; et al. Scikit-learn: Machine learning in Python. J. Mach. Learn. Res. 2011, 12, 2825–2830. [Google Scholar]
  32. Makowski, D.; Pham, T.; Lau, Z.J.; Brammer, J.C.; Lespinasse, F.; Pham, H.; Schölzel, C.; Chen, S.H.A. NeuroKit2: A Python Toolbox for Neurophysiological Signal Processing. Behav. Res. Methods 2021, 53, 1689–1696. [Google Scholar] [CrossRef]
  33. Karmani, S.; Djemal, R.; Tourki, R. Efficient hardware architecture of 2D-scan-based wavelet watermarking for image and video. Comput. Stand. Interfaces 2009, 31, 801–811. [Google Scholar] [CrossRef]
  34. Kiranyaz, S.; Ince, T.; Gabbouj, M. Real-Time Patient-Specific ECG Classification by 1-D Convolutional Neural Networks. IEEE Trans. Biomed. Eng. 2016, 63, 664–675. [Google Scholar] [CrossRef] [PubMed]
  35. Dorogush, A.V.; Ershov, V.; Gulin, A. CatBoost: Gradient boosting with categorical features support. arXiv 2018, arXiv:1810.11363. [Google Scholar] [CrossRef]
  36. Ke, G.; Meng, Q.; Finley, T.; Wang, T.; Chen, W.; Ma, W.; Ye, Q.; Liu, T.Y. LightGBM: A highly efficient gradient boosting decision tree. In Advances in Neural Information Processing Systems 30, Proceedings of the 31st International Conference on Neural Information Processing Systems, Long Beach, CA, USA, 4–9 December 2017; Curran Associates Inc.: Red Hook, NY, USA, 2017; pp. 3149–3157. [Google Scholar]
  37. Ibrahim, S.; AlSharabi, K.; Djemal, R.; Alsuwailem, A. An adaptive learning approach for EEG-based computer aided diagnosis of epilepsy. In Proceedings of the 2016 International Seminar on Intelligent Technology and Its Applications (ISITIA), Lombok, Indonesia, 28–30 July 2016; pp. 55–60. [Google Scholar] [CrossRef]
  38. Bouallegue, G.; Djemal, R.; Belwafi, K. Artificial EEG signal generated by a network of neurons with one and two dendrites. Results Phys. 2022, 20, 103699. [Google Scholar] [CrossRef]
  39. Jridi, A.; Belwafi, K.; Djemal, R.; Valderrama Sakuyama, C.; Mejri, S.B.; Kaaniche, W. Explainable AI-Driven EEG Channel Selection for Accurate and Interpretable Epilepsy Diagnosis. IEEE Access 2025, 13, 158108–158122. [Google Scholar] [CrossRef]
Figure 1. Overall architecture of the proposed heart failure classification framework: six-step machine learning pipeline: (1) data acquisition, (2) preprocessing, (3) segmentation, (4) feature extraction, (5) classification using ensemble models, and (6) performance evaluation. The workflow integrates adaptive ECG analysis with clinical metadata to predict heart failure phenotypes.
Figure 1. Overall architecture of the proposed heart failure classification framework: six-step machine learning pipeline: (1) data acquisition, (2) preprocessing, (3) segmentation, (4) feature extraction, (5) classification using ensemble models, and (6) performance evaluation. The workflow integrates adaptive ECG analysis with clinical metadata to predict heart failure phenotypes.
Sensors 26 03397 g001
Figure 2. Example of a 10-s ECG segment for patient P0001_H. The panels show (top) the raw signal, (middle) the filtered (green) and normalized (red) signal, and (bottom) the results of R-peak detection and P-QRS-T wave delineation.
Figure 2. Example of a 10-s ECG segment for patient P0001_H. The panels show (top) the raw signal, (middle) the filtered (green) and normalized (red) signal, and (bottom) the results of R-peak detection and P-QRS-T wave delineation.
Sensors 26 03397 g002
Figure 3. Beat-centric segmentation strategy: (Top) A 180-s ECG recording from patient P0001_H divided into five overlapping windows (50% overlap, color-coded). Each window encompasses approximately 60 cardiac cycles to ensure consistent morphological context. (Bottom) Magnified view of a single 60-beat segment showing R-peak detection (red markers) and P-QRS-T wave delineation (blue annotations). This segmentation approach preserves beat-to-beat variability while augmenting the effective number of training samples.
Figure 3. Beat-centric segmentation strategy: (Top) A 180-s ECG recording from patient P0001_H divided into five overlapping windows (50% overlap, color-coded). Each window encompasses approximately 60 cardiac cycles to ensure consistent morphological context. (Bottom) Magnified view of a single 60-beat segment showing R-peak detection (red markers) and P-QRS-T wave delineation (blue annotations). This segmentation approach preserves beat-to-beat variability while augmenting the effective number of training samples.
Sensors 26 03397 g003
Figure 4. Spearman correlation matrix with values from 1 to 1. Correlation heatmap for ECG features and demographic variables. Strong positive correlations are represented in red, and weak correlations are represented in blue.
Figure 4. Spearman correlation matrix with values from 1 to 1. Correlation heatmap for ECG features and demographic variables. Strong positive correlations are represented in red, and weak correlations are represented in blue.
Sensors 26 03397 g004
Figure 5. Confusion matrices (in %) for the classification models on the test set. High diagonal values indicate accurate predictions with low off-diagonal errors across all HF categories.
Figure 5. Confusion matrices (in %) for the classification models on the test set. High diagonal values indicate accurate predictions with low off-diagonal errors across all HF categories.
Sensors 26 03397 g005
Figure 6. ROC curves for the classification models on the test set, showing class-specific performance for HFpEF, HFmrEF, and HFrEF. High AUC values (close to 1.0) indicate strong discriminatory power across all categories.
Figure 6. ROC curves for the classification models on the test set, showing class-specific performance for HFpEF, HFmrEF, and HFrEF. High AUC values (close to 1.0) indicate strong discriminatory power across all categories.
Sensors 26 03397 g006
Figure 7. Radar chart comparing models across multiple performance criteria. LightGBM dominates across most metrics, particularly in Precision, Avg AUC, and Stability, making it the most well-rounded and robust model.
Figure 7. Radar chart comparing models across multiple performance criteria. LightGBM dominates across most metrics, particularly in Precision, Avg AUC, and Stability, making it the most well-rounded and robust model.
Sensors 26 03397 g007
Figure 8. Comparison of models based on the combined score and stability. LightGBM achieves the highest combined score (0.9970) and stability (0.8938), reflecting its superior balance of performance and reliability.
Figure 8. Comparison of models based on the combined score and stability. LightGBM achieves the highest combined score (0.9970) and stability (0.8938), reflecting its superior balance of performance and reliability.
Sensors 26 03397 g008
Table 1. Baseline clinical characteristics of the study cohort stratified by heart failure phenotype: HFpEF (n = 63), HFmrEF (n = 54), and HFrEF (n = 186).
Table 1. Baseline clinical characteristics of the study cohort stratified by heart failure phenotype: HFpEF (n = 63), HFmrEF (n = 54), and HFrEF (n = 186).
VariableOverall (n = 303)HFpEF (n = 63)HFmrEF (n = 54)HFrEF (n = 186)
LVEF ≥ 50%LVEF 41–49%LVEF ≤ 40%
LVEF (%)25–8250–8241–4925–40
Age (years)18–8918–7940–8940–89
Sex (Male)/(Female)217/8650/1339/15128/58
Diabetes (Yes)/(No)114/18926/3718/3670/116
Hypertension (Yes)/(No)181/12234/2942/12105/81
Table 2. Descriptions of ECG features extracted in this paper.
Table 2. Descriptions of ECG features extracted in this paper.
ECG FeatureDefinition
RR_mean (ms)Mean interval between successive R-peaks, reflecting average heart rate.
QRS_mean (ms)Mean duration of the QRS complex, representing ventricular depolarization.
QT_mean (ms)Average uncorrected QT interval between ventricular depolarization onset (QRS start) and repolarization (end of T wave).
P-wave EnergyEnergy of the P wave, reflecting atrial depolarization.
QRS EnergyEnergy of the QRS complex, reflecting ventricular contraction strength.
T-wave EnergyEnergy of the T wave, indicating ventricular repolarization.
Table 3. Optimized hyperparameters for classification models.
Table 3. Optimized hyperparameters for classification models.
ModelTuned HyperparametersOptimal Setting
CatBoostIterations [500, 1000], Learning Rate [0.01, 0.1], Depth [6, 8, 10], Early Stopping Rounds [50, 100]1000, 0.01, 8, 50
LightGBMn_estimators [500, 1000], Learning Rate [0.01, 0.1], Max Depth [6, 8, 10], Num Leaves [15, 30]1000, 0.01, 8, 30
XGBoostn_estimators [500, 1000], Learning Rate [0.01, 0.1], Max Depth [6, 8, 10]1000, 0.01, 8
Random Forestn_estimators [100, 200, 300], Max Depth [5, 10, 20]200, 10
StackingBase models optimized individuallyBase models optimized individually
Table 4. ECG features [median (Q1–Q3)] for each HF phenotype.
Table 4. ECG features [median (Q1–Q3)] for each HF phenotype.
ECG FeatureHFpEF (n = 63)HFmrEF (n = 54)HFrEF (n = 186)p-Value *
RR_interval (ms)905.9 (736.0–1075.8)871.6 (697.1–1046.1)855.7 (524.0–1187.4)0.042
QRS_duration (ms)123.4 (67.4–179.4)136.7 (83.5–189.9)143.0 (83.9–202.1)0.008
QT_interval (ms)343.9 (243.9–443.9)371.3 (303.6–439.0)347.2 (258.3–436.1)0.156
P_Energy 0.8 (0.2–2.6)0.7 (0.1–2.2)1.4 (0.3–3.9)0.023
QRS_Energy 0.8 (0.2–2.7)0.6 (0.1–2.1)0.9 (0.2–2.9)0.187
T_Energy 0.7 (0.1–2.4)0.6 (0.1–2.1)1.3 (0.2–3.7)0.031
* Kruskal–Wallis test for overall group differences. Values are normalized; units depend on preprocessing (µV2·ms or arbitrary units).
Table 5. Performance comparison of classification models on HF phenotypes.
Table 5. Performance comparison of classification models on HF phenotypes.
ModelVal AccuracyTest AccuracyAvg AUCAvg F1Training Time (s)
CatBoost0.98040.97260.99650.964813.77
LightGBM0.98660.98450.99890.98042.88
XGBoost0.98240.97680.99730.96986.14
RandomForest0.96540.95770.99630.94661.78
Stacking0.98550.98190.99790.9768121.37
Table 6. Comparison of recent studies on LVEF-based HF classification. Bold classifiers indicate the best performance (AGC: American, Greek cohorts).
Table 6. Comparison of recent studies on LVEF-based HF classification. Bold classifiers indicate the best performance (AGC: American, Greek cohorts).
Author (Year)ECG DurationDatabaseMethod/FeaturesClassifierAcc. (%)
Sona et al. [21]1 h (24 h study)AGC (229 patients)TP, QT, QRS, ST, entropy, inst. freq.TREE91.2
KNN90.9
SVM87.8
NN84.3
Zhang et al. [26]30 minMIMIC-III (268); BIDMC; Fantasia; THEWSpatial + temporal ECG featuresCNN-LSTM99.09
Alkhodari et al. [22]NAAGC (303 patient)Clinical markers (BMI, diabetes, MI, VT, meds)CNN90.1
Kwon et al. [27]10 s34,103 patients (multi-hospital)Demographics + QRS, T-wave, P-waveCNN86.6
This paper 1 min (20 min study)MUSIC (303 patients)RR, QT, QRS, P/T/QRS energyLightGBM 98.45
CatBoost97.26
XGBoost97.68
RandomForest95.77
Stacking98.19
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Gader, M.A.; Karmani, S.; Djemal, R.; Sakuyama, C.V. LightGBM-Based Classification of Heart Failure Phenotypes Using Morpho-Energy Features from High-Resolution ECG. Sensors 2026, 26, 3397. https://doi.org/10.3390/s26113397

AMA Style

Gader MA, Karmani S, Djemal R, Sakuyama CV. LightGBM-Based Classification of Heart Failure Phenotypes Using Morpho-Energy Features from High-Resolution ECG. Sensors. 2026; 26(11):3397. https://doi.org/10.3390/s26113397

Chicago/Turabian Style

Gader, Mohamed Amin, Sourour Karmani, Ridha Djemal, and Carlos Valderrama Sakuyama. 2026. "LightGBM-Based Classification of Heart Failure Phenotypes Using Morpho-Energy Features from High-Resolution ECG" Sensors 26, no. 11: 3397. https://doi.org/10.3390/s26113397

APA Style

Gader, M. A., Karmani, S., Djemal, R., & Sakuyama, C. V. (2026). LightGBM-Based Classification of Heart Failure Phenotypes Using Morpho-Energy Features from High-Resolution ECG. Sensors, 26(11), 3397. https://doi.org/10.3390/s26113397

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop