Pith. sign in

REVIEW 5 major objections 6 minor 24 references

Cardioformer: Advancing AI in ECG Analysis with Multi-Granularity Patching and ResNet

T0 review · 5 major / 6 minor · reviewed 2026-08-15 · deepseek-v4-flash

Pith's one-line read Cardioformer, a multi-granularity ECG transformer with two-stage self-attention and residual blocks, claims the highest AUROC among five models on the PTB, PTB-XL, and MIMIC-IV benchmarks, and reports a MIMIC-IV-trained model transferring…

desk verdict Cardioformer is a thin Medformer variant whose small gains don't match its claims, and the cross-dataset result is uninterpretable as reported. read the letter →

arxiv 2505.05538 v1 pith:UV72LKPD submitted 2025-05-08 cs.LG cs.AIeess.SP

classification cs.LGcs.AIeess.SP
keywords ECGClassificationTransformerResNetMulti-GranularityCross-ChannelSelf-AttentionTime-SeriesAnalysisPatchEmbeddingCross-DatasetGeneralization
verification ladder T0 review T1 audit T2 compute T3 formal

The pith

A machine-rendered reading of the paper's core claim, the machinery that carries it, and where it could break.

The reading

The paper proposes Cardioformer, an ECG classifier that splits each lead into patches at many time scales, refines them within and across scales using two stages of self-attention, and feeds the fused tokens through residual blocks. The central claim is that this multi-granularity design captures both local waveform morphology and long-range temporal context, which the four comparison transformers do not fully combine. On subject-independent splits of PTB, PTB-XL, and MIMIC-IV, the paper reports that Cardioformer achieves the highest area under the ROC curve (AUROC) among the five models (95.59, 89.99, and 96.34), and the best F1 on MIMIC-IV. It also claims that a model trained only on MIMIC-IV transfers to PTB-XL with 68.41% AUROC and to PTB with 49.18% AUROC, which it reads as evidence of cross-dataset robustness.

What carries the argument

The load-bearing mechanism is the two-stage multi-granularity self-attention with router tokens, supported by cross-channel patch embedding and residual blocks. A router token is a per-scale summary vector that carries that granularity's state into the cross-scale attention stage. ECG leads are split into non-overlapping patches whose lengths range from 2 to 32 time steps; each scale's patches are embedded through 1x1 convolutional residual blocks, and a fixed positional embedding plus a learnable granularity embedding marks each token's place in time and scale. Intra-granularity attention refines patch and router tokens within each scale; inter-granularity attention updates each scale's router against the concatenation of all routers, reducing the self-attention cost from quadratic in the total number of patches to $\mathcal{O}(nD^2)$ with $n$ granularities and embedding dimension $D$. The residual blocks act as the local-feature extractor that preserves morphological detail before the transformer's global stages.

What would settle it

Test the transfer claim by evaluating the MIMIC-IV-trained Cardioformer on PTB after truncating PTB from 15 leads to the 12 leads shared with MIMIC-IV and mapping PTB's binary labels into the four-class scheme; if AUROC remains at or below 50%, the cross-dataset result is an artifact of the mismatched protocol rather than evidence of generalization.

Watch

Extended reading notes

Core claim

In the paper's own account, the discovery is that combining cross-channel multi-granularity patching with hierarchical residual learning and a two-stage self-attention mechanism lets a single ECG model beat four time-series transformers on standard benchmarks. The input signal is divided into non-overlapping patches at granularities from 2 to 32 time steps; each scale is embedded with residual blocks, augmented, and given a router token. Intra-granularity attention refines the patches and router inside each scale; inter-granularity attention then lets the routers exchange information across scales. The refined representations are concatenated and classified. The paper reports that this yields the highest AUROC on all three datasets and the best F1 on MIMIC-IV, with the strongest within-dataset result at 96.34% AUROC on MIMIC-IV.

Load-bearing premise

The load-bearing premise is that a model trained on MIMIC-IV's four-class, 12-lead heartbeats can be evaluated directly on PTB's two-class, 15-lead heartbeats and PTB-XL's five-class, 12-lead heartbeats without an explicit mapping of output labels or input channels.

Editorial extensions

If this is right

  • If the AUROC rankings are reproduced, Cardioformer becomes a reference point for ECG transformer comparisons on these three benchmarks.
  • Subject-independent splits mean the reported ranking is not an artifact of patient overlap; new patients recorded with the same protocols should see similar relative performance.
  • The PTB-XL transfer result (68.41% AUROC from a MIMIC-IV-only model) suggests a single pretrained model could serve smaller sites that cannot collect their own labeled ECGs.
  • Because inter-granularity attention cost grows with the number of granularities rather than the total number of patches, the architecture can be applied to longer recordings without quadratic attention blow-up.

Reading between the lines

Editorial extensions of the paper, not claims the author makes directly.

  • An ablation that compares the full multi-granularity patch list against a single patch length would isolate whether the reported gains come from scale fusion or simply from more parameters.
  • The PTB cross-dataset AUROC of 49.18% sits at the chance level for a binary task; a rerun with PTB channels restricted to the same 12 leads as MIMIC-IV and with labels mapped into the four-class scheme would tell whether the transfer evidence survives a fair protocol.
  • The patch-length list is fixed by the authors; an adaptive choice of granularities based on heart rate or signal quality is a natural next experiment.
Share X Bluesky LinkedIn Reddit HN

Signed reviews

No signed human review yet.

Editorial analysis

A structured set of objections, weighed in public.

Desk editor's note, referee report, and a circularity audit.

Referee Report

5 major / 6 minor

Summary. The paper proposes Cardioformer, a hybrid CNN-transformer for ECG classification that combines cross-channel multi-granularity patch embedding, a ResNet patch projector, and a two-stage intra-/inter-granularity self-attention mechanism. The authors evaluate Cardioformer against PatchTST, Reformer, Transformer, and Medformer on MIMIC-IV, PTB-XL, and PTB under subject-independent splits with three seeds, and report the highest AUROC on all three datasets (96.34, 89.99, and 95.59). The paper further claims strong cross-dataset generalization for a MIMIC-IV-trained model, reporting 49.18% AUROC on PTB and 68.41% AUROC on PTB-XL, and states that source code is released.

Significance. If the in-domain AUROC results hold, Cardioformer is a credible incremental contribution: it attains the best AUROC among the five compared models on three public ECG benchmarks, with standard deviations reported over three seeds and a stated subject-independent split, and the code release is a positive reproducibility step. The significance is substantially weakened, however, by three problems: the claim of winning 'all metrics' is directly contradicted by Table 3; the headline cross-dataset result is methodologically undefined (no label or lead mapping is given) and the PTB transfer number is at chance; and the architectural novelty relative to Medformer is thin, since Section 3 reproduces Medformer's patch embedding, router embeddings, and two-stage attention. The paper also acknowledges patch-length sensitivity in its limitations, which is relevant because the multi-granularity patch list is a dataset-specific free choice.

major comments (5)
  1. [Section 4, Table 3] The claim that 'Cardioformer achieves the highest performance in all metrics on PTB, PTB-XL, and MIMIC-IV' is contradicted by the paper's own table. On PTB, Reformer reports higher Accuracy (93.87±0.27 vs 92.84±0.92) and higher Precision (88.15±0.75 vs 85.23±1.59); on PTB-XL, PatchTST reports higher Precision (68.09±1.41 vs 65.28±0.73); on MIMIC-IV, PatchTST reports higher Accuracy (85.00±0.10 vs 84.71±0.24) and higher Precision (82.17±0.24 vs 81.96±0.28). The defensible empirical claim is that Cardioformer attains the highest AUROC on all three datasets; the text as written overstates the results and must be corrected.
  2. [Section 4, Table 4, Appendix B] The cross-dataset experiment lacks a defined evaluation protocol. A model trained on MIMIC-IV outputs four classes from 12-lead inputs (Eq. (1) fixes the input channels at C=12), while PTB is a 2-class, 15-lead dataset and PTB-XL is a 5-class, 12-lead dataset. The paper never specifies how the four MIMIC-IV labels are mapped to PTB's binary classes or to PTB-XL's five classes, nor how 12 of the 15 PTB leads are selected or harmonized. Without this specification, the AUROC values in Table 4 are not well-defined and the transfer experiment cannot be reproduced or interpreted.
  3. [Abstract and Section 4, Table 4] The abstract and Section 4 describe 49.18% AUROC on PTB as 'strong cross-dataset generalization' and state that the model 'performs well' there, but for PTB's binary classification this value is at chance level (50%) and is below the Reformer baseline's 52.05±11.29 under the same protocol. No correction to the mapping protocol can turn this number into evidence of strong transfer; the PTB transfer result must be reported as a negative finding or removed from the claims.
  4. [Tables 3 and 4] Tables 3 and 4 report inconsistent in-domain MIMIC-IV numbers for what should be the same experiment: Cardioformer's MIMIC-IV Accuracy is 84.71±0.24 with AUROC 96.34±0.11 in Table 3 but 88.28±0.39 with AUROC 94.91±0.05 in Table 4. Since Table 4's caption states that all models are trained exclusively on MIMIC-IV, the MIMIC-IV rows there should match Table 3 under the same data splits and seeds. The discrepancy is unexplained and must be resolved or explicitly justified.
  5. [Section 3 vs Medformer] The architecture as described is very close to Medformer [9]: the multi-granularity patch embedding with granularity embeddings, router embeddings u(i), and the intra-/inter-granularity two-stage self-attention in Eqs. (1)-(5) reproduce Medformer's design, and the only structural difference stated is the use of a ResNet for the patch projection. The reported AUROC gains over Medformer are modest (1.10 on PTB, 1.06 on PTB-XL, 0.58 on MIMIC-IV). The paper should explicitly enumerate which components are new relative to Medformer; otherwise the 'novel' claim in the abstract is not supportable.
minor comments (6)
  1. [References] Reference [16] (Liu et al., iTransformer) is cited for the 'Transformer' baseline; the plain Transformer baseline should cite Vaswani et al. [4].
  2. [Title page] The first manuscript page contains the placeholder 'DOI: 0', which must be removed or filled in.
  3. [Section 3] The equations in Section 3 are typeset with broken superscripts (e.g., W(i) ∈ R(Li·C)×D); the exponent should be rendered as R^{(L_i·C)×D} and the patchified input x_p^{(i)} should be defined precisely.
  4. [Appendix C] The augmentation description in Appendix C is internally inconsistent: it says augmentations are drawn from 'none, jitter, scale, and mask,' but Appendix A defines channel shuffling, temporal masking, frequency masking, jittering, and dropout; 'scale' and 'mask' are not defined as standalone methods there.
  5. [Abstract and tables] There are several grammatical and typographical errors, including 'demonstrate that model consistently outperforms' in the abstract, 'performance ofCardioformer' in the Table 4 caption, and the garbled phrase 'while Intra-Granularity Self-AttentionConcatenate' in Section 3.
  6. [Introduction] The introduction reports 'AUPRC of 87.65' for MIMIC-IV; Table 3 reports 87.65±0.42, so the standard deviation should be included for consistency with the other reported values.

Circularity Check

0 steps flagged · score 0.0 of 10

No circularity: Cardioformer's claims are empirical benchmark comparisons, not derivations from fitted inputs.

full rationale

The paper's derivation chain is an architecture proposal followed by empirical evaluation on three external ECG benchmarks (PTB, PTB-XL, MIMIC-IV). No theoretical prediction is derived from a fitted parameter, no constant is relabeled as a result, and no load-bearing step reduces by construction to an input. The method section defines the model (Eq. 1 and the attention/residual equations), and the experimental section compares it against four baselines under a subject-independent split. The reported AUROC/F1 values are measured outcomes on held-out test sets, not outputs of the model's own equations. The resemblance to Medformer is a novelty-overlap concern, not circularity, and Medformer is an external prior work by different authors. The cross-dataset generalization section lacks an explicit mapping between MIMIC-IV's 4-class, 12-lead format and PTB's 2-class, 15-lead format or PTB-XL's 5-class format, and the 49.18% PTB AUROC is near chance; however, these are experimental-validity and interpretability problems, not circular reasoning. There is no evidence of self-citation being used as a load-bearing premise, no uniqueness theorem imported from the authors' own prior work, and no fitted parameter disguised as a prediction. The central claims stand or fall on the correctness and reproducibility of the experiments, not on a circular chain.

Assumptions & free parameters 3 free parameters · 3 assumptions · 0 invented entities

The paper's empirical claims rest on standard ML training choices plus domain assumptions about ECG preprocessing and cross-dataset comparability. We list the hand-chosen patch, augmentation, and hyperparameter values as free parameters because no ablation shows their effect. The main assumptions concern leakage-free splitting and label/channel compatibility in cross-dataset evaluation; without these, the reported AUROC values are not interpretable.

free parameters (3)
  • Patch length list = {2, 4, 8, 8, 16, 16, 16, 16, 32, 32, 32, 32, 32, 32, 32, 32}
    Chosen by hand for all three datasets; no ablation shows how this list affects the reported AUROC values.
  • Data augmentation parameters = drop 0.5; jitter 0.2; scale 0.2; mask ratio 0.1
    Augmentation types and strengths are chosen per dataset without a sensitivity analysis.
  • Model hyperparameters = D=128, FF=256, 6 layers, 3 residual blocks, lr=1e-4, batch sizes 32/16/16
    Standard choices, but no tuning or ablation is reported to show how sensitive the central comparison is to these values.
assumptions (3)
  • domain assumption R-peak detection and heartbeat segmentation preserve class-relevant morphology across all channels.
    Appendix B.1 and B.3 rely on R-peak detection and outlier removal; if beats are misaligned or noisy segments are not cleanly removed, the downstream AUROC numbers would be affected.
  • domain assumption The subject-independent split prevents any heartbeat or segment from the same patient appearing in both training and test partitions.
    The paper states a subject-independent split but does not describe how multiple beats or multiple trials per subject are assigned to splits, so leakage remains a possible source of inflated performance.
  • ad hoc to paper A model trained on MIMIC-IV's 4-class, 12-lead format can be evaluated on PTB's 2-class, 15-lead format and PTB-XL's 5-class format without architectural adaptation.
    Table 4 reports cross-dataset AUROC without specifying label or channel mapping; without that mapping, the cross-dataset results are undefined.

how reviews work

0 comments
Cite this review

Pith. "Pith review of Cardioformer: Advancing AI in ECG Analysis with Multi-Granularity Patching and ResNet." pith.science (2026). https://pith.science/paper/UV72LKPD

@misc{pith2026250505538,
  author       = {Pith},
  title        = {Pith review of: Cardioformer: Advancing AI in ECG Analysis with Multi-Granularity Patching and ResNet},
  year         = {2026},
  howpublished = {\url{https://pith.science/paper/UV72LKPD}},
  note         = {Machine review of arXiv:2505.05538}
}
abstract

Electrocardiogram (ECG) classification is crucial for automated cardiac disease diagnosis, yet existing methods often struggle to capture local morphological details and long-range temporal dependencies simultaneously. To address these challenges, we propose Cardioformer, a novel multi-granularity hybrid model that integrates cross-channel patching, hierarchical residual learning, and a two-stage self-attention mechanism. Cardioformer first encodes multi-scale token embeddings to capture fine-grained local features and global contextual information and then selectively fuses these representations through intra- and inter-granularity self-attention. Extensive evaluations on three benchmark ECG datasets under subject-independent settings demonstrate that model consistently outperforms four state-of-the-art baselines. Our Cardioformer model achieves the AUROC of 96.34$\pm$0.11, 89.99$\pm$0.12, and 95.59$\pm$1.66 in MIMIC-IV, PTB-XL and PTB dataset respectively outperforming PatchTST, Reformer, Transformer, and Medformer models. It also demonstrates strong cross-dataset generalization, achieving 49.18% AUROC on PTB and 68.41% on PTB-XL when trained on MIMIC-IV. These findings underscore the potential of Cardioformer to advance automated ECG analysis, paving the way for more accurate and robust cardiovascular disease diagnosis. We release the source code at https://github.com/KMobin555/Cardioformer.

Figures

Figures reproduced from arXiv: 2505.05538 by the authors.

Figure 1
Figure 1. multi￾Granularity workflow Transformer [4] and Medformer [9] explore cross-channel or patch-based representa￾tions. PatchTST struggles with cross-channel dependencies, while Medformer addresses this but suffers from information loss and limited feature extraction. Despite advance￾ments, capturing cross-channel dependencies while preserving high-resolution information remains a challenge. To address these, we propose… view at source ↗
Figure 2
Figure 2. Architecture of Cardioformer for ECG classification, integrating multi-granularity embeddings, self-attention, and residual networks for en￾hanced feature extraction and classification. (1) Cross-Channel Multi-Granularity Patch Embedding: ECG channels represent distinct heart regions with inherent correlations. To capture these, we introduce cross￾channel multi-granularity patch embedding. Given input xin ∈ R T ×C ,… view at source ↗

Discussion (0). Continue with ORCID to comment.

Reference graph

Works this paper leans on

24 extracted references · 18 canonical work pages

  1. [9]

    Y. Wang, N. Huang, T. Li, Y. Yan, and X. Zhang.Medformer: A Multi-Granularity Patching Transformer for Medical Time-Series Classification. 2024. arXiv:2405.19363 [eess.SP]

  2. [1]

    Cardiovascular diseases (CVDs).Accessed:2025-02-16.2025

    W.H.Organization. Cardiovascular diseases (CVDs).Accessed:2025-02-16.2025. url: https: //www.who.int/health-topics/cardiovascular-diseases

  3. [2]

    A. H. Association. 2025 Heart Disease and Stroke Statistics Update. Accessed: 2025-02-16

  4. [3]

    Global burden of cardiovascular diseases: projections from 2025 to 2050

    B. Chong et al. “Global burden of cardiovascular diseases: projections from 2025 to 2050”. In: Eur J Prev Cardiol(2024). doi: 10.1093/eurjpc/zwae281

  5. [4]

    Attention is all you need

    A. Vaswani et al. “Attention is all you need”. In:Advances in Neural Information Processing Systems 30 (2017)

  6. [5]

    Autoformer: Decomposition transformers with auto-correlation for long-term series forecasting

    H. Wu et al. “Autoformer: Decomposition transformers with auto-correlation for long-term series forecasting”. In:Advances in Neural Information Processing Systems34 (2021)

  7. [6]

    Informer: Beyond efficient transformer for long sequence time-series forecast- ing

    H. Zhou et al. “Informer: Beyond efficient transformer for long sequence time-series forecast- ing”. In:Proceedings of the AAAI Conference on Artificial Intelligence. Vol. 35. 2021

  8. [7]

    A time series is worth 64 words: Long-term forecasting with transformers

    Y. Nie and et al. “A time series is worth 64 words: Long-term forecasting with transformers”. In: International Conference on Learning Representations. 2023

Show all 24 references
  1. [8]

    Reformer: The efficient transformer

    N. Kitaev, L. Kaiser, and A. Levskaya. “Reformer: The efficient transformer”. In:International Conference on Learning Representations. 2019

  2. [10]

    Deep learning-based ECG arrhythmia classification: A systematic review

    Q. Xiao, K. Lee, S. A. Mokhtar, I. Ismail, and et al. “Deep learning-based ECG arrhythmia classification: A systematic review”. In:Applied Sciences13.8 (2023), p. 4964

  3. [11]

    Hierarchical deep learning with generative adversarial network for automatic cardiac diagnosis from ECG signals

    Z. Wang et al. “Hierarchical deep learning with generative adversarial network for automatic cardiac diagnosis from ECG signals”. In:Computers in Biology and Medicine155 (2023)

  4. [12]

    TimesNet: Temporal 2D-Variation Modeling for General Time Series Analysis

    H. Wu, T. Hu, Y. Liu, H. Zhou, J. Wang, and M. Long. “TimesNet: Temporal 2D-Variation Modeling for General Time Series Analysis”. In: (2023)

  5. [13]

    CATS: Enhancing Multivariate Time Series Forecasting by Constructing Auxil- iary Time Series as Exogenous Variables

    J. Lu et al. “CATS: Enhancing Multivariate Time Series Forecasting by Constructing Auxil- iary Time Series as Exogenous Variables”. In:arXiv preprintarXiv:2403.01673 (2024)

  6. [14]

    EEGNet: A compact convolutional neural network for EEG-based brain–computer interfaces

    V. J. Lawhern and et al. “EEGNet: A compact convolutional neural network for EEG-based brain–computer interfaces”. In:Journal of Neural Engineering15.5 (2018), p. 056013

  7. [15]

    EEG Conformer: Convolutional Transformer for EEG Decoding and Visual- ization

    Y. Song et al. “EEG Conformer: Convolutional Transformer for EEG Decoding and Visual- ization”. In:IEEE Transactions on Neural Systems and Rehabilitation Engineering31 (2022)

  8. [16]

    iTransformer: Inverted transformers are effective for time series forecasting

    Y. Liu and et al. “iTransformer: Inverted transformers are effective for time series forecasting”. In: International Conference on Learning Representations. 2024

  9. [17]

    Multi-resolution time-series transformer for long-term forecasting

    Y. Zhang et al. “Multi-resolution time-series transformer for long-term forecasting”. In:In- ternational Conference on Artificial Intelligence and Statistics. PMLR, 2024

  10. [18]

    Pathformer: Multi-scale transformers with adaptive pathways for time series forecasting

    P. Chen et al. “Pathformer: Multi-scale transformers with adaptive pathways for time series forecasting”. In:The Twelfth International Conference on Learning Representations. 2024

  11. [19]

    PhysioBank, PhysioToolkit, and PhysioNet: Components of a New Research Resource for Complex Physiologic Signals

    A. L. Goldberger et al. “PhysioBank, PhysioToolkit, and PhysioNet: Components of a New Research Resource for Complex Physiologic Signals”. In:Circulation 101.23 (2000), e215– e220. doi: 10.1161/01.CIR.101.23.e215

  12. [20]

    PTB-XL, a large publicly available electrocardiography dataset (version 1.0.3)

    P.Wagneretal. PTB-XL, a large publicly available electrocardiography dataset (version 1.0.3)

  13. [21]

    Gow et al

    B. Gow et al. MIMIC-IV-ECG: Diagnostic Electrocardiogram Matched Subset (version 1.0)

  14. [2022]

    doi: 10.13026/kfzx-aw45

  15. [2023]

    url: https://doi.org/10.13026/4nqg-sb35

    doi: 10.13026/4nqg-sb35. url: https://doi.org/10.13026/4nqg-sb35. 7 Appendix A. Data Augmentation Techniques In the embedding stage, we incorporate a set of data augmentation strategies to enhance the robustness and generalization capability of the model. During each forward p...

  16. [2025]

    url: https://www.heart.org/en/- /media/PHD- Files- 2/Science- News/2/2025- Heart-and-Stroke-Stat-Update/2025-Statistics-At-A-Glance.pdf

Pith tools

Reviewed August 15, 2026 · model on record in the stance chip above.