Skip to Content
  • Article
  • Open Access

25 April 2026

22 Pages

Explainable Combined Spatial Representations for ECG Arrhythmia Classification

and
Faculty of Electronics, Telecommunications and Information Technology, Gheorghe Asachi Technical University of Iasi, Bd. Carol I, No. 11A, 700506 Iasi, Romania
*
Author to whom correspondence should be addressed.
This article belongs to the Section Data

Abstract

The paper addresses ECG arrhythmia classification using a novel input fusion strategy that combines spatial representations of ECG time series recordings. Four distinct time series-to-image transformations are considered, namely classical spectrograms, Gramian Angular Field (GAF), Recursive Plot (RP), and the S-Transform (ST). Classification of combined 2 × 2 images generated from single-lead ECG recordings is performed using both custom and ResNet-50 deep learning architectures. Finally, several distinct explainability algorithms are used to identify the relevant regions in the input images that mainly influence the classification decisions. Experiments performed on the MIT-BIH and Chapman–Shaoxing arrhythmia datasets revealed performance comparable to more sophisticated approaches in terms of accuracy (99%), F1-score (98.6%), and AUC (0.999) values.

1. Introduction

According to recent studies, ischemic heart disease and stroke consistently represented the leading causes of worldwide deaths in the interval 1990–2023 [1]. While during the pandemic period COVID-19 temporarily ranked first, it rapidly dropped far lower on the leading causes list, with ischemic heart disease, stroke, chronic obstructive pulmonary disease (COPD), lower respiratory infections, and neonatal disorders placed in the top positions. Nevertheless, the age-standardized mortality rates for both ischemic heart disease and stroke showed a significant decrease, from 161.4 deaths per 100,000 population in 1990 to 99.8 deaths per 100,000 in 2023 [1].
Cardiac arrhythmias represent one of the most prevalent and clinically consequential manifestations of cardiovascular diseases, with a huge impact on therapeutic decisions and mortality reduction. The electrocardiogram (ECG) serves as the primary non-invasive diagnostic tool for detecting and classifying arrhythmias, aiming to identify subtle morphological features that may differentiate them. ECG classification faces a combination of signal-processing, physiological, and computational challenges that collectively hinder the development of robust, generalizable, and clinically deployable systems. There are numerous difficulties to be faced, including: (a) the non-stationary nature of ECG signals implies a significant temporal variability and complicates the extraction of stable, discriminative features across diverse patient cohorts; (b) there exists a pronounced inter- and intra-subject heterogeneity in terms of the waveform morphology, amplitude, and duration that may manifest for the same arrhythmia type, requiring large and representative datasets; (c) the necessity of modeling the complex spatio-temporal dependencies that exist between successive ECG segments and/or multiple recording leads; (d) even state-of-the-art classifiers may yield limited performances under realistic noise conditions.
Traditional manual interpretation of ECG signals by cardiologists is time-consuming, subject to inter-observer variability, and prone to human error, particularly in high-volume clinical settings [2]. Alternatively, machine learning and deep learning models offered a potentially automated, accurate, and scalable ECG signal analysis solution that rivals human expert interpretation, prompting significant research interest and clinical translation efforts [3,4,5]. Convolutional neural networks (CNNs) dominate the field, with recurrent neural networks (RNNs), long short-term memory (LSTM) networks, and hybrid architectures gaining prominence for temporal modeling. Such models achieved remarkable performance metrics, with reported accuracies exceeding 99% on benchmark datasets [4].
However, the clinical adoption of AI-based ECG classification systems faces substantial barriers. The black-box nature of deep learning models raises concerns about trustworthiness and interpretability, which are critical in high-stakes medical decision-making. General explainable AI (XAI) techniques—particularly SHAP, LIME, and Grad-CAM [6]—have been used to enhance clinical trust, along with ECG-specific adaptations such as K-GradCam and B-LIME [2,7] that address temporal dependencies and perturbation instability. Additionally, challenges related to data imbalance, limited generalization across diverse patient populations, computational demands, and the need for robust external validation continue to constrain real-world deployment [8].
One interesting line of research follows a two-step procedure, by first transforming the ECG data series under study into various 2D image representations, while further classifying these images using deep learning models. The approach has been successfully used for time-series analysis in anomaly detection and biometrics applications [9]. For ECG recordings, the method may preliminarily consider single- or multi-beat segmentation of the (preprocessed) signals corresponding to one (typically the modified LII) or several leads. The actual conversion methods may be chosen from a rather wide range of options, four of which are to be described in the next section.
To improve classification performance, various input- and/or output-fusion modalities have been proposed. Typically, one may choose between (a) combining the outcomes of distinct classification models that use a specific spatial representation of a given time series and (b) combining the outputs of a given model that uses different image types as input. The present paper proposes a novel approach that merges four distinct 2D representations of single-lead ECG recordings into 2 × 2 global images for use as input to several deep learning models. The rationale behind the proposal is two-fold: (a) various time series-to-image transformations may reveal distinct features of the ECG waveforms, hence their combination would be more informative than the individual ones; (b) explainable AI algorithms applied on the combined images may identify specific regions of interest that are arrhythmia class-specific, while additionally enabling a hierarchical ordering of the considered spatial representations according to their importance revealed by the XAI analysis.
The following sections describe the chosen time series-to-image transformations, illustrate the individual and merged arrhythmia-class-specific representations, and present classification performance metrics based on extensive experimental results on two widely used ECG arrhythmia benchmark datasets. Explainability analysis using four distinct methods and a comparative analysis against existing solutions are included in the discussion section, while suggested ideas for further study are finally outlined.

3. Spatial Representations of ECG Signals

Time series-to-image transformations encode temporal dependencies into spatial, geometric, or frequency-based alternatives that facilitate the analysis, visualization, and learning of relevant characteristics. Such transformations may preserve global characteristics, emphasize local temporal variations, or capture similarity and recurrence relationships within the data. Among the various methods proposed in the literature, we selected four options that have proven effective for ECG-based biometrics [9], namely: classical spectrograms, Gramian Angular Field (GAF), Recursive Plot (RP), and the S-Transform (ST). The description of those methods below closely follows [9], including examples for both single- and multi-beat ECG recordings from two benchmark arrhythmia datasets. Finally, we merge the individual 2D representations into a 2 × 2 global image for further classification by a CNN model.

3.1. Time-Frequency Spectrograms

Classical time-frequency spectrograms have been generated from MLII single-lead ECG recordings using 25 ms sliding segments with 12 ms overlap and a periodic Hanning window defined over 256 points.

3.2. Gramian Angular Field

To implement the Gramian Angular Field (GAF) transformation [22], we first rescale the time series in the [−1, 1] interval, followed by expressing the resulting signal in polar coordinates, using the angular cosine as the phase information, and coding time as the distance from the origin as (N is a scaling constant):
x ˜ i = x i − max ( x ) + x i − min ( x ) max ( x ) − min ( x ) ,   i = 1 … n φ i = arccos ( x ˜ i ) ,   − 1 ≤ x ˜ i ≤ 1 r = t i N ,   t i = 1 … n
We finally define the Gramian Angular Field as follows:
G A F = cos ( φ 1 + φ 1 ) cos ( φ 1 + φ 2 ) … cos ( φ 1 + φ n ) cos ( φ 2 + φ 1 ) cos ( φ 2 + φ 2 ) … cos ( φ 2 + φ n ) ⋮ ⋮   ⋮ cos ( φ n + φ 1 ) cos ( φ n + φ 2 ) …   cos ( φ n + φ n ) = = X ˜ T · X ˜ − I − X ˜ 2 T · I − X ˜ 2
The trigonometric sum of the phase values reflects the temporal correlation within various time intervals of the given time series. The scaling parameter N is set equal to the ECG sample length.

3.3. Recurrence Plots

Recurrence Plots (RPs) [23] are rooted in chaos theory as an efficient tool for visual inspection of time series. The method aims at efficiently exploring the high-dimensional phase space associated with a dynamical nonlinear system through a bidimensional representation of its recurrences. As such, we may construct the following RP matrix:
R P i , j = θ ε − s i − s j ,     s ( . ) ∈ ℜ m ,     i , j = 1 … N
where m defines the embedding dimension set, N is the total number of states, ε is a real-valued threshold, and θ(.) is the step function (the state vector s(.) is obtained by subsampling the given time series using a proper delay). The RP matrix may reveal trajectories that return close to previous states, exposing both the global characteristics (homogeneity, periodicity) and local patterns as isolated dots, diagonal, horizontal, or vertical lines [9]. The parameter ε defines the radius of the neighborhood around a given phase space vector used to count recurrence points [23] and is set to 0.05 based on the maximum phase space diameter of the normalized time series. The embedding dimension is m = 11, as in [9].

3.4. The S-Transform

The Short-Time Fourier Transform (STFT) has been widely used as a time-frequency tool for revealing the temporal dynamics of a signal’s spectral components, which the classical Fourier Transform (FT) cannot capture. Using a fixed width for the analysis window limits the efficiency of the method, especially for non-stationary data; hence, the Continuous Wavelet Transform (CWT) has been proposed as a solution to compensate for this limitation. The CWT introduces a frequency-dependent resolution of the time-frequency space, better identifying significant changes in the signal under study at both low and high frequencies. Since the standard CWT is unable to yield precise phase information that is critical for biomedical signal processing, the S-Transform (ST) has been introduced as a phase-corrected version of CWT as [24]:
S T ( t , f ) = C W T ( t , σ ) e − j 2 π f t = ∫ − ∞ + ∞ x ( τ ) ψ ( t − τ , σ ) e − j 2 π f τ d τ = = ∫ − ∞ + ∞ x ( τ ) f 2 π e − t − τ 2 f 2 2 e − j 2 π f τ d τ
by choosing a particular mother wavelet function ψ ( t , σ ) = 1 σ 2 π e − t 2 2 σ 2 with a frequency-dependent width σ ( f ) = 1 / f . Improved flexibility in resolution adjustment in the time-frequency plane can be achieved by using more complex dependencies of the σ parameter on frequency. ST is defined in a time-frequency plane, in contrast to the standard CWT, which uses a time-scale pair of axes, making the frequency information more interpretable. Additionally, ST provides both absolutely referenced phase information and frequency-independent amplitude response [24]. Detailed comparative analysis of ST against FT, STFT, and CWT has been presented in the literature [9].
Examples of the time series-to-image transformations defined above are shown in Figure 1 and Figure 2, corresponding to single- and multiple-beat segments selected from the MIT-BIH [25] and Chapman–Shaoxing [26] arrhythmia datasets, respectively. Each type of representation is normalized to the [−1, 1] range and resized to 227 × 227 pixels.
Figure 1. Image representations of MIT-BIH dataset ECG recordings (from top to bottom: single-beat ECG segments (1.25 s, z-score normalized), spectrograms, GAF, RP, and ST, respectively). From left to right columns: normal beat (class N), supraventricular ectopic beat (class S), ventricular ectopic beat (class V), fusion beat (class V), unclassified beat (class Q).
Figure 2. Image representations of SC dataset ECG recordings (from top to bottom: multiple-beat ECG segments (10 s, z-score normalized), spectrograms, GAF, RP, and ST, respectively). From left to right columns: atrial fibrillation (AFIB), supraventricular tachycardia (SVT), sinus bradycardia (SB), sinus rhythm (SR).
The result of merging the individual representations into a global 2 × 2 image is illustrated in Figure 3. Once again, the combined result is resized to 227 × 227 pixels to meet the input requirements of the CNN models.
Figure 3. Combined 2D representation of ECG recordings using ST, GAF, RP, and spectrogram images, respectively: (a) MIT-BIH; (b) Chapman–Shaoxing datasets.

4. The Proposed Approach

The block diagram of the proposed approach is illustrated in Figure 4. It suggests the use of the merged spatial representations as the input to various CNN classification models, while additionally enabling the interpretation of the outcome through an XAI analysis. The dimensions of the input images should be properly set to accommodate the constraints imposed by the CNN models under study. When multiple classifiers are used, output fusion may also be performed by combining the individual decisions of the models (e.g., by weighting the response of each model in terms of class-oriented probabilities according to its accuracy). The figure suggests using explainable XAI algorithms to identify regions in input images that primarily influence the classification decision. When combined image representations are used as input, such tools may enable hierarchical ordering of the various time series-to-image transformations, revealing the most informative class-specific 2D mappings.
Figure 4. Block diagram of the proposed approach.
Three custom and a Resnet-50 CNN models have been used, as indicated in Figure 5. Model 1 is a simple, classical series-type architecture that includes standard 2D convolution, batch normalization, ReLU, pooling, and fully connected layers. Model 2 is inspired by [27] and includes residual-type connections and 1D convolutions before the fully connected classification module. Model 3 is built around standard 2D layers but adds residual connections. Finally, all models incorporate dropout layers. We used an ImageNet-pretrained Resnet-50 model, freezing the first 121 layers, adjusting the number of neurons in the output layer, and fine-tuning the updated architecture using the distinct ECG arrhythmia datasets.
Figure 5. Custom CNN architectures.

5. Experimental Protocol and Results

Extensive computer simulations have been performed using two benchmark ECG data sources, namely the MIT-BIH [25] and Chapman–Shaoxing [26] arrhythmia datasets, respectively. The next sections describe the characteristics of the recordings, the resampling/augmentation methods used to compensate for class imbalance, and the main performance metrics. The efficiency of both input and output fusion strategies is compared with that of using individual 2D representations and single models. Five explainability algorithms have been considered to assess the relative importance of the representations and identify class-specific regions of interest.

5.1. The ECG Arrhythmia Datasets

The MIT-BIH Arrhythmia Dataset [25] comprises 48 half-hour ambulatory ECG recordings collected from 47 adult subjects at Boston’s Beth Israel Hospital, monitoring two modified limb leads at a 360 Hz sampling frequency. The dataset provides expert beat-level annotations, classified into 24 subcategories, further grouped into five types according to the Association for the Advancement of Medical Instrumentation (AAMI) standard: normal (N), supraventricular ectopic beat (SVEB), ventricular ectopic beat (VEB), fusion beat (F), and unknown beat (Q). Typical preprocessing steps include single-beat segmentation, followed by beat-length and amplitude normalization, outlier removal, and R peak alignment.
Since the original data contains outliers (segments whose lengths deviate significantly from the average R-R time intervals) and the segmentation procedures may yield mixed samples from consecutive heartbeats, several new versions of the dataset have been proposed in the literature to improve the quality of the original recordings. We used the dataset introduced in [28] (using the Lead II of the recordings) that corrects some of the drawbacks of previous solutions. The method starts by computing the R-R intervals and eliminating segments whose lengths fall outside an interval defined by the 25th and 75th percentiles of the R-R segment distribution. The cleaned set is split into 10 second windows, and the mean heartbeat size is computed as the average of the R-R intervals within the current window. A new set of heartbeats, each with the mean length and centered around its own R peak, is finally generated, followed by zero-padding to yield a common global heartbeat size. The data distribution over the five classes is indicated in Table 1.
Table 1. Samples distribution per class for the original and MIT-BIH augmented datasets.
The Chapman–Shaoxing (SC) [26] arrhythmia dataset contains approximately 10,000 10 s-long 12-lead ECG signal recordings collected in a hospital facility between 1980 and 2018, featuring 11 common rhythms and a sampling rate of 500 Hz. The volume, duration, and population diversity established it as a benchmark dataset widely used for research purposes. The data are grouped into seven arrhythmia types: sinus bradycardia (SB), sinus rhythm (SR), atrial fibrillation (AFIB), sinus tachycardia (ST), atrial flutter (AF), sinus irregularity (SI), and supraventricular tachycardia (SVT). Many papers report classification performances on only four major types (SB, SR, AFIB, and GSVT), obtained by merging some of the original rhythms [4]. This option brings the additional advantage of an almost balanced sample distribution over the classes, as indicated in Table 2.
Table 2. Samples distribution per class for the Chapman–Shaoxing dataset.

5.2. Data Preprocessing

The cleaned version of the MIT-BIH Arrhythmia Dataset described in [28] has been generated following a two-step procedure, by first eliminating the outlier segments whose lengths exhibited significantly different durations as compared to the average R-R intervals, and further constructing (zero-padded, common size) R-centered segments, as mentioned in the previous section. The resulting sequences are down-sampled from 360 Hz to 120 Hz, and finally z-score normalized according to z = x − μ σ , where μ and σ are the mean and standard deviation of vector x.
A series of denoising techniques has been employed to increase the quality of the recordings from the Chapman–Shaoxing arrhythmia dataset. These include Butterworth low-pass filtering, a local polynomial regression smoother (LOESS) to remove baseline wandering, and the non-local means (NLM) technique for reducing residual noise [26]. According to [26], the Butterworth filter has a 50 Hz pass-band and a 60 Hz stop-band, and the smoother used the weighted least squares method. Greatly similar to the MIT-BIH dataset, z-score normalization has also been applied, without altering the original sampling rate.
One key point concerns class-imbalance mitigation strategies to consider for the MIT-BIH dataset. Both down-sampling solutions to limit the number of samples in the normal (N) class and augmentation techniques to increase the number of exemplars in the other four classes have been considered. Down-sampling options include random resampling (prone to bias), clustering procedures (followed by retaining only the resulting cluster centroids or the original samples closest to those), and more sophisticated methods rooted in information theory [29,30]. We have considered the algorithm introduced in [30], given the comparative performance analysis against the other options.
Following current practice, we employed the (safe-level version of the) SMOTE algorithm [31] as an augmentation technique for the under-represented categories, namely supraventricular ectopic beat (SVEB), ventricular ectopic beat (VEB), and fusion beat (F). The resulting per-class data distribution is given in Table 1, showing a balanced distribution and the contribution of the generated data to the overall dataset dimensionality.

5.3. Experimental Results

Extensive experiments have been performed along three scenario setups. To start with, we considered the four distinct 2D representations applied as the input to each of the CNN models described in Section 4. Secondly, we used the combined 2 × 2 images and the same individual models. Finally, we evaluated the efficiency of input/output fusion strategies by: (a) combining the outputs of the various CNN models given a specific 2D representation; (b) combining the outputs of a given CNN model when the various 2D representations are used as input. The final result is computed as the weighted sum of the probabilities generated by the individual models on the validation set, while the weights are statically assigned and defined as the ratio between the individual models’ accuracy on the training set and their overall sum:
o u t k = max C ∑ i = 1 4 w i · p r o b C i , k w i = A c c i ∑ j A c c j
In the equation above, outk represents the predicted label of sample k, C is the category index, wi is the weight of a given model, and p r o b C i , k is the probability that sample k belongs to category C, as computed by model i.
In Table 3, Table 4, Table 5, Table 6, Table 7 and Table 8, we present comparative classification performances for each of the previously described scenarios. The performance metrics include accuracy (Acc), precision (P), recall (R), F1-score, Area Under the Curve (AUC), and Cohen’s Kappa coefficient [32] (a measure of the agreement between true and predicted single-classifier outputs, corrected for random chance agreement). All experiments used 10-fold cross-validation, and performance metrics are reported as mean values ± standard deviations.
Table 3. Classification performances for the MIT-BIH dataset using distinct 2D representations.
Table 4. Classification performances for the MIT-BIH dataset using combined 2D representations (2 × 2 images generated by merging the four distinct 2D representations).
Table 5. Classification performances for the MIT-BIH dataset using input fusion (for each model, combine predictions given distinct features as input).
Table 6. Classification performances for the Chapman–Shaoxing dataset using distinct 2D representations.
Table 7. Classification performances for the Chapman–Shaoxing dataset using combined 2D representations (2 × 2 images generated by merging the four distinct 2D representations).
Table 8. Classification performances for the Chapman–Shaoxing dataset using input fusion (for each model, combine predictions given distinct features as input).
The training setup was similar for all experiments: input images with 227 × 227 pixels, Adam optimizer, 0.0005 initial learning rate, 0.0005 L2 regularization parameter, batch size 64, dropout for the fully connected layers with 50% probability, focal loss, and best model parameters selected according to minimal loss on the validation set.

5.4. Explainability Analysis

Automated medical decision-making raises critical challenges given the black-box nature of current deep learning models. Revealing the underlying causes of specific outcomes and performance metrics could only contribute to increasing the trustworthiness and broader acceptance of various AI-based solutions, towards a synergistic cooperation between artificial systems and human experts.
In ECG signal analysis, several general explainable AI (XAI) techniques, including SHAP, LIME, Grad-CAM, and variants of these [6,13], have been used to enhance clinical trust, along with ECG-specific adaptations such as K-GradCam and B-LIME [2,7]. We considered five distinct XAI methods, namely standard grad-CAM, grad-CAM++ [33], score-CAM [34], LIME, and occlusion-based saliency maps to identify class-specific regions of interest in the spatial representations under study. The standard grad-CAM algorithm identifies significant regions in the input image by computing a linearly weighted combination of activation maps of the last convolutional layer before a global pooling layer. Grad-CAM++ and score-CAM represent improved versions of this method by refining the definition of the weights in the above linear combination based on the gradient of class confidence (grad-CAM++) and channel-wise increase in confidence score (score-CAM) with respect to the activation maps. Occlusion maps mask input image patches and evaluate the subsequent effect on the classification performances.
Figure 6 and Figure 7 show significant differences among the various classes in both datasets, while additional analysis indicated the robustness of the outcomes across different human subjects within the same arrhythmia category.
Figure 6. Explainability analysis of MIT-BIH recordings. From top to bottom: normal beat (class N), supraventricular ectopic beat (class S), ventricular ectopic beat (class V), fusion beat (class V), unclassified beat (class Q). Columns from left to right: ECG signal (1.25 s, z-score normalized); combined 2D representations; grad-CAM; grad-CAM++; score-CAM; LIME; occlusion maps.
Figure 7. Explainability analysis of Chapman–Shaoxing recordings. From top to bottom: atrial fibrillation (AFIB), supraventricular tachycardia (SVT), sinus bradycardia (SB), sinus rhythm (SR). Columns from left to right: ECG signal (10 s, z-score normalized); combined 2D representations; grad-CAM; grad-CAM++; score-CAM; LIME; occlusion maps.

6. Discussion and Conclusions

Classification metrics reported in Table 3, Table 4, Table 5, Table 6, Table 7 and Table 8 reveal top performance of 99% for accuracy, precision, and recall, and 0.999 for AUC, respectively, on the MIT-BIH Arrhythmia Dataset. For the Chapman–Shaoxing dataset, the performance is slightly lower, with 95% top accuracy and an AUC of 0.991. When separate 2D representations are used as input (Table 3 and Table 6), performance is comparable, with GAF and ST yielding marginally better results. Using combined 2 × 2 spatial representations yields a mild improvement in performance on the MIT-BIH dataset, whereas no clear positive effect is observed on the Chapman–Shaoxing data (Table 4 and Table 7). In all scenarios, the best results were obtained by following an output fusion strategy, namely combining the outcomes of the four classification models for each input image type. More specifically, the final result is computed as the weighted sum of the probabilities generated by the individual models, with weights defined as the ratio of each model’s accuracy to the sum of all models’ accuracies. The results presented in Table 5 and Table 8 refer to an alternative input fusion strategy, in which, for each model, we combined predictions using distinct features. For the MIT-BIH dataset, performance is comparable to the combined 2 × 2 input scenario, while for the Chapman–Shaoxing dataset, accuracy increases from 93.5% to 95%, with a mild improvement in AUC from 0.988 to 0.991.
The explainability analysis performed with the 2 × 2 combined 2D representations as input indicates that the spectrogram is the least significant option, while the other three methods are relevant, showing class-specific relative importance. It is worth noting that merging the 2D transformations as proposed may introduce artificial (high-frequency) patterns along the boundaries between representations, although the XAI analysis described in Section 5.4 and Figure 6 and Figure 7 shows that those boundaries are not indicated as significant by any of the used methods.
The explainability analysis presented in Figure 6 and Figure 7 reveals that the significant regions are rather irregular, hence it is quite difficult to establish an accurate correspondence between those regions and specific ECG segments. The problem is further complicated by the non-invertibility of the mappings that generate the GAF and RP images. Nevertheless, to facilitate visual inspection of the results, we provide in Figure 8 the correspondence between the various segments of a typical ECG sample and the associated regions of the 2D representations.
Figure 8. 2D representations of the P, QRS, and T segments (the first three lines) and of a complete (last line) typical ECG sample. Columns from left to right: ECG sample, spectrogram, GAF, RP, ST.
Moreover, in Figure 9, we have shown the relevant regions that influence the classification decision for the four categories available in the Chapman–Shaoxing (multi-beat) recordings. The results correspond to the grad-CAM algorithm applied to image representations generated by the ST method, since this time-frequency transformation enables better temporal localization of the segments of interest.
Figure 9. Relevant segments for the classification decision identified by the grad-CAM algorithm on samples extracted from the Chapman–Shaoxing dataset.
Simulations were performed on a Windows 10 workstation with an Intel Core i9-3.50 GHz CPU, 128 GB of RAM, and an NVIDIA GeForce RTX 3090 (24 GB) graphics card. The total computational cost of generating the FFT/GAF/RP/ST representations, including preprocessing steps and generation of resized color images, equals 25.5/26.6/27.5/27 ms, respectively. The inference time is in the 2.8–3.3 ms range across all four models, enabling real-time operation. The complexity of the models amounts to 452,500, 4.6 million, 2.4 million, and 25.5 million parameters for Models 1, 2, 3, and Resnet-50, respectively.
A valid comparative analysis against previously reported performances is not easy to conduct, since the various approaches described in the literature differ widely in the number of samples per arrhythmia category, preprocessing steps, the number of ECG leads, and the specific strategies used to tackle class imbalance. Classification results presented in Table 9 and Table 10 show favorable performance of the proposed approach against existing solutions, although many of the better performers use more sophisticated models (e.g., transformers, hybrid architectures), multi-lead recordings, or employ augmentation techniques that yield many more synthetically generated samples than the original ones.
Table 9. Comparative performance analysis for the MIT-BIH dataset.
Table 10. Comparative performance analysis for the Chapman–Shaoxing dataset.
For the MIT-BIH dataset, the results reported in Table 3, Table 4 and Table 5 refer to an intra-patient study, since the data were split record-wise. An inter-patient analysis is equally important and will be considered in the future along the lines described in the references [49,50]. Further work will consider enhancing the proposed combined spatial representations with (possible, multi-head) attention mechanisms. A fusion approach combining features generated by both 1D and 2D CNN models is also worth studying. Extending the type of time series-to-image representations may also prove effective, although merging too many individual 2D transformations into a single global, fixed-size image may obscure important details. Finally, collectively applying the various spatial representations as distinct input channels is a valid avenue to be explored.

Author Contributions

Conceptualization—I.B.C.; methodology—I.O.; software, validation—I.B.C. and I.O.; writing—original draft preparation, I.B.C. and I.O.; writing—review and editing, I.B.C. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Data Availability Statement

The original data presented in the study are openly available in the MIT-BIH Arrhythmia Database at https://physionet.org/content/mitdb/1.0.0/ (accessed on 4 August 2025) and in the Chapman–Shaoxing dataset at https://figshare.com/collections/ChapmanECG/4560497/2 (accessed on 8 August 2025).

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. Naghavi, M.; Kyu, H.H.; Aalipour, M.A.; Aalruz, H.; Ababneh, H.S.; Abafita, B.J.; Abaraogu, U.O.; Abbafati, C.; Abbasi, M.; Abbaspour, F.; et al. Global burden of 292 causes of death in 204 countries and territories and 660 subnational locations, 1990–2023: A systematic analysis for the Global Burden of Disease Study 2023. Lancet 2025, 406, 1811–1872. [Google Scholar] [CrossRef] [Scilit]
  2. Singh, P.; Sharma, A. Interpretation and classification of arrhythmia using deep convolutional network. IEEE Trans. Instr. Meas. 2022, 71, 2518512. [Google Scholar] [CrossRef] [Scilit]
  3. Talukder, M.A.; Talaat, A.S.; Muna, N.J.; Alazab, A.; Kazi, M.; Das, U.K. An explainable deep learning framework for trustworthy arrhythmia detection from ECG signals. Sci. Rep. 2025, 15, 39496. [Google Scholar] [CrossRef] [Scilit]
  4. Ansari, Y.; Mourad, O.; Qaraqe, K.; Serpedin, E. Deep learning for ECG Arrhythmia detection and classification: An overview of progress for period 2017–2023. Front. Physiol. 2023, 14, 1246746. [Google Scholar] [CrossRef] [Scilit]
  5. Sun, H.; Luo, D.; Niu, X.; Zeng, X.; Zheng, B.; Liu, H.; Pan, J. Classification algorithms in automatic diagnosis of ECG arrhythmias: A review. IEEE Access 2024, 12, 191921–191935. [Google Scholar] [CrossRef] [Scilit]
  6. Manimaran, G.; Peimankar, A.; Puthusserypady, S.; Momeni, M.; Asyari, R.A.I.; Jahan, M.S.; Moll, J.; Will, U.K.; Ebrahimi, A. Explainable deep learning based techniques for ECG-Based heart disease classification: A systematic literature review and future direction. Comp. Biol. Med. 2025, 199, 111324. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  7. Abdullah, T.A.A.; Zahid, M.S.M.; Ali, W.; Hassan, S.U. B-LIME: An improvement of LIME for interpretable deep learning classification of cardiac arrhythmia from ECG signals. Processes 2023, 11, 595. [Google Scholar] [CrossRef] [Scilit]
  8. Oporto, E.; Mauricio, D.; Maculan, N.; Uribe, G. Challenges in the classification of cardiac arrhythmias and ischemia using end-to-end deep learning and the electrocardiogram: A systematic review. Diagnostics 2026, 16, 161. [Google Scholar] [CrossRef] [Scilit]
  9. Ciocoiu, I.B. Comparative analysis of bag-of-words models for ECG-based biometrics. IET Biom. 2017, 6, 495–502. [Google Scholar] [CrossRef] [Scilit]
  10. Apandi, Z.F.M.; Aziz, N.S.; Othman, W.R.W.; Mustapha, N.; Ikeura, R.; Rofar, N.A.N.A. Heartbeat classification for arrhythmia detection in ambulatory monitoring: A comprehensive systematic review. Biomed. Sig. Process. Control 2026, 116, 109496. [Google Scholar] [CrossRef] [Scilit]
  11. Ahmed, A.A.; Ali, W.; Abdullah, T.A.A.; Malebary, S.J. Classifying cardiac arrhythmia from ECG signal using 1D CNN deep learning model. Mathematics 2023, 11, 562. [Google Scholar] [CrossRef] [Scilit]
  12. Khan, F.; Yu, X.; Yuan, Z.; ur Rehman, A. ECG classification using 1-D convolutional deep residual neural network. PLoS ONE 2023, 18, e0284791. [Google Scholar] [CrossRef] [Scilit]
  13. Atwa, A.E.M.; Atlam, E.S.; Ahmed, A.; Atwa, M.A.; Abdelrahim, E.M.; Siam, A.I. Interpretable deep learning models for arrhythmia classification based on ECG signals using PTB-X dataset. Diagnostics 2025, 15, 1950. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  14. Baig, Z.; Nasir, S.; Khan, R.A.; Haque, M.Z.U. ArrhythmiaVision: Resource-conscious deep learning models with visual explanations for ECG arrhythmia classification. arXiv 2025, arXiv:2505.03787. [Google Scholar]
  15. Silva, G.; Silva, P.; Moreira, G.; Freitas, V.; Gertrudes, J.; Luz, E. A systematic review of ECG arrhythmia classification: Adherence to standards, fair evaluation, and embedded feasibility. arXiv 2025, arXiv:2503.07276. [Google Scholar] [CrossRef] [Scilit]
  16. Imane, A.; Abdelmajid, B.; Hilal, D.L.; Frederic, E.D.Y.; Hanaa, O.H. Artificial intelligence for atrial fibrillation detection: A systematic review of recent advances in ECG-based deep learning models. In Proceedings of the 5th International Conference on Innovative Research in Applied Science, Engineering and Technology (IRASET), Fez, Morocco, 15–16 May 2025; pp. 1–6. [Google Scholar]
  17. Sepahvand, M.; Abdali-Mohammadi, F. A novel method for reducing arrhythmia classification from 12-lead ECG signals to single-lead ECG with minimal loss of accuracy through teacher-student knowledge distillation. Inf. Sci. 2022, 593, 64–77. [Google Scholar] [CrossRef] [Scilit]
  18. Shah, A.; Singh, D.; Mohamed, H.G.; Bharany, S.; Rehman, A.U.; Hussen, S. Electrocardiogram analysis for cardiac arrhythmia classification and prediction through self attention based auto encoder. Sci. Rep. 2025, 15, 9230. [Google Scholar] [CrossRef] [Scilit]
  19. Guhdar, M.; Mohammed, A.O.; Mstafa, R.J. Advanced deep learning framework for ECG arrhythmia classification using 1D-CNN with attention mechanism. Knowl.-Based Syst. 2025, 315, 113301. [Google Scholar] [CrossRef] [Scilit]
  20. Islam, M.R.; Qaraqe, M.K.; Qaraqe, K.A.; Serpedin, E. CAT-Net: Convolution, attention, and transformer based network for single-lead ECG arrhythmia classification. Biomed. Signal Process. Control 2024, 23, 106211. [Google Scholar] [CrossRef] [Scilit]
  21. Shah, H.A.; Saeed, F.; Diyan, M.; Almujally, N.; Kang, J.-M. ECG-TransCovNet: A hybrid transformer model for accurate arrhythmia detection using electrocardiogram signals. CAAI Trans. Intell. Technol. 2024, 1–14. [Google Scholar] [CrossRef] [Scilit]
  22. Wang, Z.; Oates, T. Encoding time series as images for visual inspection and classification using tiled convolutional neural networks. In Proceedings of the 29th AAAI Conference on Artificial Intelligence, Austin, TX, USA, 25–30 January 2015; pp. 40–46. [Google Scholar]
  23. Eckmann, J.; Kamphorst, S.O.; Ruelle, D. Recurrence plots of dynamical systems. Europhys. Lett. 1987, 4, 973–977. [Google Scholar] [CrossRef] [Scilit]
  24. Stockwell, R.G.; Mansinha, L.; Lowe, R.P. Localization of the complex spectrum: The S-transform. IEEE Trans. Sig. Process. 1996, 44, 998–1001. [Google Scholar] [CrossRef] [Scilit]
  25. Moody, G.; Mark, R. MIT-BIH Arrhythmia Database. PhysioNet: MIT Laboratory for Computational Physiology, 2005. Available online: https://physionet.org/content/mitdb/1.0.0/mitdbdir/#files-panel (accessed on 4 August 2025).
  26. Zheng, J.; Zhang, J.; Danioko, S.; Yao, H.; Guo, H.; Rakovski, C. A 12-lead electrocardiogram database for arrhythmia research covering more than 10,000 patients. Sci. Data 2020, 7, 48. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  27. Zeng, W.; Shan, L.; Yuan, C.; Du, S. Advancing cardiac diagnostics: Exceptional accuracy in abnormal ECG signal classification with cascading deep learning and explainability analysis. Appl. Soft Comp. J. 2024, 165, 112056. [Google Scholar] [CrossRef] [Scilit]
  28. Benmessaoud, A.S.; Medjani, F.; Bousseloub, Y.; Bouaita, K.; Benrahem, D.; Kezai, T. High quality ECG dataset based on MIT-BIH recordings for improved heartbeats classification. In Proceedings of the IEEE International Conference on Omni-Layer Intelligent Systems (COINS), Berlin, Germany, 23–25 July 2023; pp. 1–4. [Google Scholar]
  29. Yen, S.-J.; Lee, Y.-S. Cluster-based under-sampling approaches for imbalanced data distributions. Expert Syst. Appl. 2009, 36, 5718–5727. [Google Scholar] [CrossRef] [Scilit]
  30. Hoyos-Osorio, J.; Alvarez-Meza, A.; Daza-Santacoloma, G.; Orozco-Gutierrez, A.; Castellanos-Dominguez, G. Relevant information undersampling to support imbalanced data classification. Neurocomputing 2021, 436, 136–146. [Google Scholar] [CrossRef] [Scilit]
  31. Bunkhumpornpat, C.; Sinapiromsaran, K.; Lursinsap, C. Safe-level-SMOTE: Safe-level-synthetic minority over-sampling technique for handling the class imbalanced problem. In Proceedings of the 13th Pacific-Asia Conference on Knowledge Discovery and Data Mining, Bangkok, Thailand, 27–30 April 2009; pp. 475–482. [Google Scholar]
  32. Cohen, J. A coefficient of agreement for nominal scales. Educat. Psych. Meas. 1960, 20, 37–46. [Google Scholar] [CrossRef] [Scilit]
  33. Chattopadhyay, A.; Sarkar, A.; Howlader, P.; Balasubramanian, V.N. Grad-CAM++: Improved Visual Explanations for Deep Convolutional Networks. arXiv 2017, arXiv:1710.11063. [Google Scholar]
  34. Wang, H.; Wang, Z.; Du, M.; Yang, F.; Zhang, Z.; Ding, S.; Mardziel, P.; Hu, X. Score-CAM: Score-weighted visual explanations for Convolutional Neural Networks. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition Workshops, Seattle, WA, USA, 14–19 June 2020; pp. 111–119. [Google Scholar]
  35. Anand, R.; Lakshmi, S.V.; Pandey, D.; Pandey, B.K. An enhanced ResNet-50 deep learning model for arrhythmia detection using electrocardiogram biomedical indicators. Evol. Syst. 2024, 15, 83–97. [Google Scholar] [CrossRef] [Scilit]
  36. Mallikarjunamallu, K.; Syed, K. Arrhythmia classification for non-experts using infinite impulse response (IIR)-filter-based machine learning and deep learning models of the electrocardiogram. PeerJ Comput. Sci. 2024, 10, e1774. [Google Scholar]
  37. Lamba, S.; Kumar, S.; Diwakar, M. Fadlec: Feature extraction and arrhythmia classification using deep learning from electrocardiograph signals. Disc. Artif. Intell. 2025, 5, 82. [Google Scholar] [CrossRef] [Scilit]
  38. Eleyan, A.; Alboghbaish, E. Electrocardiogram signals classification using deep-learning-based incorporated convolutional neural network and long short-term memory framework. Computers 2024, 13, 55. [Google Scholar] [CrossRef] [Scilit]
  39. Chen, Z.; Yang, D.; Cui, T.; Li, D.; Liu, H.; Yang, Y.; Zhang, S.; Yang, S.; Ren, T.L. A novel imbalanced dataset mitigation method and ECG classification model based on combined 1D_CBAM-autoencoder and lightweight CNN model. Biomed. Signal Process. Control 2024, 87, 105437. [Google Scholar] [CrossRef] [Scilit]
  40. Bayani, A.; Kargar, M. LDCNN: A new arrhythmia detection technique with ECG signals using a linear deep convolutional neural network. Physiol. Rep. 2024, 12, e16182. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  41. Dong, X.; Si, W. Heartbeat dynamics: A novel efficient interpretable feature for arrhythmias classification. IEEE Access 2023, 1, 87071–87086. [Google Scholar] [CrossRef] [Scilit]
  42. Zhou, F.; Fang, D. Multimodal ECG heartbeat classification method based on a convolutional neural network embedded with FCA. Sci. Rep. 2024, 14, 8804. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  43. Di Paolo, I.F.; Castro, A.R.G. Intra- and interpatient ECG heartbeat classification based on multimodal convolutional neural networks with an adaptive attention mechanism. Appl. Sci. 2024, 14, 9307. [Google Scholar] [CrossRef] [Scilit]
  44. Yildirim, O.; Talo, M.; Ciaccio, E.J.; Tan, R.S.; Acharya, U.R. Accurate deep neural network model to detect cardiac arrhythmia on more than 10,000 individual subject ECG records. Comput. Methods Programs Biomed. 2020, 197, 105740. [Google Scholar] [CrossRef] [Scilit]
  45. Meqdad, M.N.; Abdali-Mohammadi, F.; Kadry, S. A new 12-lead ECG signals fusion method using evolutionary CNN trees for arrhythmia detection. Mathematics 2022, 10, 1911. [Google Scholar] [CrossRef] [Scilit]
  46. Yoon, T.; Kang, D. Bimodal CNN for cardiovascular disease classification by co-training ECG grayscale images and scalograms. Sci. Rep. 2023, 13, 2937. [Google Scholar] [CrossRef] [Scilit]
  47. An, X.; Shi, S.; Wang, Q.; Yu, Y.; Liu, Q. Research on a lightweight arrhythmia classification model based on knowledge distillation for wearable single-lead ECG monitoring systems. Sensors 2024, 24, 7896. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  48. Hassan, A.A.; Abdali-Mohammadi, F. Automatic extraction of medical latent variables from ECG signals utilizing a mutual information-based technique and capsular neural networks for arrhythmia detection. Comp. Mat. Contin. 2024, 81, 971–983. [Google Scholar] [CrossRef] [Scilit]
  49. Dias, F.M.; Monteiro, H.L.M.; Cabral, T.W.; Naji, R.; Kuehni, M.; Luz, E.J.S. Arrhythmia classification from single-lead ECG signals using the inter-patient paradigm. Comput. Methods Programs Biomed. 2021, 202, 105948. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  50. Chazal, P.d.; O’dwyer, M.; Reilly, R.B. Automatic classification of heartbeats using ECG morphology and heartbeat interval features. IEEE Trans. Biomed. Eng. 2004, 51, 1196–1206. [Google Scholar] [CrossRef] [Scilit] [PubMed]
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.

Article Metrics

Citations

Article Access Statistics

Multiple requests from the same IP address are counted as one view.