Paper deep dive
DR-net-Mamba: Selective State-Space Modeling for Long-Range ECG Time-Series Denoising
Basile Morel, Samuel Ruiperez-Campillo, Andreas P. Streich, Julia E. Vogt, Thomas Hofmann
Intelligence
Status: not_run | Model: - | Prompt: - | Confidence: 0%
Entities (0)
Relation Signals (0)
No relation signals yet.
Cypher Suggestions (0)
No Cypher suggestions yet.
Abstract
Abstract:Electrocardiogram (ECG) recordings are corrupted by non-stationary noise sources that degrade diagnostic reliability, particularly in ambulatory and long-duration recordings. Deep learning denoisers exist, but convolutional architectures are limited by their receptive field, transformer-based models scale quadratically with sequence length, and diffusion-based approaches incur prohibitive inference cost. We propose a Mamba-augmented model that inserts selective state-space blocks at the convolutional bottleneck, combining local feature extraction with long-range temporal modeling at linear complexity. We comprehensively evaluate the proposed model with respect to reconstruction fidelity, noise robustness, recording-length scaling, and downstream diagnostic classification across over 40 pathology classes. On synthetic and real datasets, our model achieves the highest SNR and lowest RMSE, with the Mamba advantage increasing with sequence length and in low-SNR regimes. On classification with two independent classifiers, the proposed Mamba-based models achieve the best macro AUROC among all denoisers and improve over their convolutional base models. Calibration is more nuanced and classifier-dependent: denoising improves Binary Cross-Entropy and Brier score on Inception1D but often fails to beat the noisy input on ResNet1D-Wang, and the lead-specific Mamba variant is the only denoiser to improve both calibration metrics over the noisy baseline on both classifiers. Per-class analysis reveals a morphology-dependent benefit: Mamba substantially improves ST/T-change diagnoses, which depend on broad, context-sensitive waveforms.
Tags
Links
- Source: https://arxiv.org/abs/2609.35634v1
- Canonical: https://arxiv.org/abs/2609.35634v1
Trouble viewing inline? Open PDF directly â
Full Text
88,558 characters extracted from source content.
Expand or collapse full text
DR-net-Mamba: Selective State-Space Modeling for Long-Range ECG Time-Series Denoising Basile Morel Samuel RuipĂ©rez-Campillo Andreas P. Streich Julia E. Vogt Thomas Hofmann â thanks: B. Morel, S. RuipĂ©rez-Campillo, and A. P. Streich are co-first authors. J.E. Vogt and T. Hofmann as co-senior authors.â thanks: B. M., S. R.-C., A. P. S., J.E. V., and T. H. and are with the Department of Computer Science at ETH Zurich, UniversitĂ€tstrasse 6, 8092 ZĂŒrich, Switzerland. Abstract Electrocardiogram (ECG) recordings are corrupted by non-stationary noise sources that degrade diagnostic reliability, particularly in ambulatory and long-duration recordings. Deep learning denoisers exist, but convolutional architectures are limited by their receptive field, transformer-based models scale quadratically with sequence length, and diffusion-based approaches incur prohibitive inference cost. We propose a Mamba-augmented model that inserts selective state-space blocks at the convolutional bottleneck, combining local feature extraction with long-range temporal modeling at linear complexity. We comprehensively evaluate the proposed model with respect to reconstruction fidelity, noise robustness, recording-length scaling, and downstream diagnostic classification across over 40 pathology classes. On synthetic and real datasets, our model achieves the highest SNR and lowest RMSE, with the Mamba advantage increasing with sequence length and in low-SNR regimes. On classification with two independent classifiers, the proposed Mamba-based models achieve the best macro AUROC among all denoisers and improve over their convolutional base models. Calibration is more nuanced and classifier-dependent: denoising improves Binary Cross-Entropy and Brier score on Inception1D but often fails to beat the noisy input on ResNet1D-Wang, and the lead-specific Mamba variant is the only denoiser to improve both calibration metrics over the noisy baseline on both classifiers. Per-class analysis reveals a morphology-dependent benefit: Mamba substantially improves ST/T-change diagnoses, which depend on broad, context-sensitive waveforms. Index Terms: Electrocardiogram, selective state-space models, Mamba, deep learning, physiological time series, signal theory, long-range temporal modeling. I Introduction Cardiovascular diseases remain the leading cause of mortality worldwide [1], motivating the development of scalable, automated screening tools. The electrocardiogram (ECG) is non-invasive, inexpensive, and widely deployed across clinical and ambulatory settings [2]. Recent work has shown that deep learning (DL) applied to ECG signals can aid in the detection and risk assessment of multiple cardiovascular conditions [3, 4], including structural abnormalities [5], ventricular dysfunction in adult [6] and pediatric populations [7, 8], ischemic disease [9], cardiomyopathies [10], arrhythmias [11, 12], or primary prevention [13]. However, downstream analyses depend critically on signal quality, which is often degraded by non-stationary, unstructured noise sources that evolve unpredictably over long recordings. When multiple contaminations overlap, the signal-to-noise ratio (SNR) can drop to levels at which both human readers and automated classifiers fail. Traditional denoising methods based on filtering, wavelets, and signal decomposition can be effective in controlled settings but require expert-driven parameter tuning and degrade under realistic multi-source noise [14, 15]. DL has advanced the field substantially: convolutional autoencoders [16, 17], recurrent networks [18], GANs [19, 20], and diffusion models [21] all improve reconstruction fidelity over classical pipelines. Yet, supervised methods suffer from the scarcity of clean ground truth in clinical datasets [16], Transformer-based architectures face quadratic compute and memory scaling with sequence length [22, 23], and diffusion models incur high inference costs from iterative sampling [24]. These constraints are especially problematic for long ambulatory recordings, where denoising must operate over tens of seconds of continuous signal at low latency. Selective state-space models, and Mamba in particular [25], offer a compelling alternative. By making the state-transition parameters input-dependent, Mamba combines long-range temporal modeling with linear-time complexity and efficient recurrent-style inference. Mamba has been explored for ECG classification [26, 27] and short-segment enhancement [28], yet its potential for ECG denoising under diverse noise conditions and recording lengths remains unexplored. In this work, we propose DR-net-Mamba, a two-stage architecture that inserts selective state-space blocks at the bottleneck of a convolutional UNet encoderâdecoder, extending the effective receptive field to the full sequence length while adding only linear computational overhead, with a compact architecture suited for deployment. A learnable log-compression layer normalizes dynamic range. We evaluate DR-net-Mamba across four complementary axes: (i) reconstruction fidelity on synthetic, clinical, and ambulatory datasets under simultaneous four-source noise at clinically calibrated levels; (i) noise robustness across clinically representative SNR regimes and noise conditions; (i) recording-length scaling, characterizing how the selective state-space bottleneck leverages increasing temporal context to improve sequence-to-sequence modeling; and (iv) downstream diagnostic classification of 44 PTB-XL pathology classes through two independent classifiers, evaluating whether denoising gains preserve or improve diagnostic accuracy in a clinically actionable setting. To the best of our knowledge, this is the first evaluation framework spanning reconstruction, noise robustness, length scaling, and clinical utility within a single study for ECG denoising. Our open code is publicly available at https://github.com/.... I Related Work Traditional ECG denoising. Classical approaches to ECG denoising rely on frequency-domain filtering, adaptive and Kalman-based methods [29], empirical mode decomposition [30], independent component analysis [31], and wavelet transforms [32]. These methods require expert-driven parameter selection and degrade with non-stationary artifacts [33], motivating data-driven alternatives. Deep learning for ECG denoising. While DL has recently been applied to denoising across multiple cardiac signal domains [34, 35, 36, 37], the ECG is the most extensively studied, with data-driven methods learning denoising priors directly from examples rather than relying on hand-crafted filter design. Convolutional architectures range from fully convolutional autoencoders [16] to multi-scale UNet variants with channel attention and detail-restoration stages [17]. Recurrent approaches, including LSTM-based denoising autoencoders [18] and deeper recurrentâconvolutional hybrids [38], model temporal dependencies explicitly but scale poorly to long sequences. Multi-scale filtering designs [39] and transformer-based denoisers [40] further improve fidelity, though transformers incur quadratic complexity in sequence length [22]. On the generative side, GAN-based frameworks [19, 20] and score-based diffusion models [21] achieve strong reconstruction quality and can support unpaired training via cycle-consistency [41], but diffusion models face high inference costs from iterative sampling [24]. A persistent challenge across supervised methods is the scarcity of clean ground truth in clinical datasets, where residual artifacts survive preprocessing and become part of the reconstruction target [16, 17]. Synthetic ECG generation for evaluation. The absence of clean clinical references motivates the use of synthetic signals for controlled evaluation: we cannot access the true latent signal and its unknown generative process beneath observed noisy measurements. The dynamical model of [42] generates realistic PQRST morphology from a three-variable ODE, producing signals of arbitrary length without segment stitching and requiring no training data. Data-driven generators based on GANs [43, 44] and VAEs [45] can capture richer morphological distributions but inherit residual noise from their training corpora, limiting their utility as denoising benchmarks. We adopt the ODE-based generator for our synthetic experiments, as it provides verified clean ground truth and continuous-time integration. Selective state-space models and Mamba. Structured state-space models (SSMs) offer linear-time sequence modeling as an alternative to attention [25]. Mamba extends SSMs with input-dependent selectivity: the state-transition parameters (,,Î)(B,C, ) are computed from each input token, enabling the model to selectively propagate or forget information along the sequence. This yields time-varying dynamics with efficient hardware-aware implementations and recurrent-style inference, and can be interpreted through an implicit attention viewpoint [46]. Interest in Mamba for physiological signals has grown rapidly [47], and existing ECG applications fall into two groups. For classification, ECGMamba [26] replaces attention with stacked selective state-space blocks to categorize rhythms and morphologies, while MambaCapsule [27] couples a Mamba backbone with a capsule network for interpretable disease diagnosis; both target discrete labels rather than waveform reconstruction. For enhancement, MECGE [28] is, to our knowledge, the only prior Mamba-based ECG denoiser: it transforms the signal to the timeâfrequency domain via the STFT and applies bidirectional Mamba blocks along both the time and frequency axes to enhance the resulting spectrogram. This performs well on short segments, but its per-frame frequency sequences cause memory to scale with recording length, limiting use on long ambulatory data. Our work differs from these prior ECG applications of Mamba in three respects: (i) we operate directly in the time domain rather than on spectrograms, (i) we use Mamba as a bottleneck augmentation to a convolutional backbone rather than as a standalone architecture, and (i) we evaluate across reconstruction, robustness, length scaling, and downstream classification within a unified framework. I Methods Let ââTx ^T denote a clean single-lead ECG signal of T time steps. The observed signal ~=+ x=x+v is corrupted by zero-mean noise v comprising baseline wander, muscle artifact, electrode motion, and additive white Gaussian noise. An offline denoising model Ï produces the estimate ^=ÏâĄ(~)â x= ( x) from the full observed sequence. Fig. 1: Overall Pipeline: clean ECG records (a) are corrupted with noise (b), denoised (c), and classified (d) to assess whether reconstruction gains translate to diagnostic accuracy (e). I-A Architecture I-A1 Baseline architectures. We benchmark against six models spanning the major architectural families. UNet [17]: a three-stage convolutional encoderâdecoder adapted from the original 2D U-Net [48] for 1D signals, with decreasing kernel sizes to separate low- and high-frequency components. IMUNet [17]: extends UNet with deeper convolutional blocks, channel attention, additional skip connections, and a dilated context-contrast bottleneck. DR-net-UNet and DR-net-IMUNet [17]: two-stage pipelines that cascade either backbone with a multi-branch detail-restoration network operating at full resolution to recover fine waveform features. DRNN [18]: an LSTM-based denoising autoencoder that processes the signal sample-by-sample. DAE [16]: a fully convolutional autoencoder with 13 symmetric layers and stride-based downsampling. MECGE [28]: a Mamba-based enhancer operating in the STFT domain (described above). These baselines span convolutional, recurrent, and state-space paradigms, providing a comprehensive reference for evaluating the proposed architecture. I-A2 Convolutional Backbone and its Receptive-Field Limitation We adopt a 1D UNet encoderâdecoder [17, 48] as our backbone. The encoder consists of three stages with convolutional kernel sizes decreasing from 25 to 3, interleaved with pooling layers (factors 1/51/5, 1/21/2, 1/21/2) that progressively down-sample the input by a factor of 20. Skip connections link each encoder stage to the corresponding decoder stage, and bilinear upsampling restores the original resolution. While effective at extracting local features, the convolutional receptive field is bounded: a layer-by-layer analysis (Supplementary Material A-A) yields the receptive field r0=âl=1L((klâ1)ââi=1lâ1si)+1=542r_0= _l=1^L ((k_l-1) _i=1^l-1s_i )+1=542 time stepsâapproximately 1.5 s at 360 Hz. Fig. 2: Architecture of UNet-Mamba1-3B. Three Mamba blocks, each preceded by layer normalization, go into the convolutional bottleneck to capture temporal dependencies beyond the âŒ1.5 1.5 s receptive field of the encoder. The Mamba layer follows [25]. I-A3 Selective State-Space Bottleneck To extend the effective receptive field to the full sequence length, we insert three Mamba blocks [25] at the UNet bottleneck. At this stage, the signal has been down-sampled by 20Ă20Ă, so the blocks operate on a 1D sequence of length âT/20â T/20 with 48 channels. Each block applies, in sequence: (i) layer normalization over the 48-dimensional feature vector at each time step; (i) Mamba-1 layer [25], which (a) projects the input from dimension d=48d=48 to dE=192d_E=192 via two parallel linear maps (main and gate branches) with expansion factor E=4E=4, (b) applies a 1D depthwise convolution of width dconv=4d_conv=4 on the main branch for local context, (c) runs a selective state-space model with state dimension dstate=256d_state=256, whose transition parameters (,,Î)(B,C, ) are computed from each input token, enabling time-varying propagation or forgetting of information along the sequence, (d) element-wise multiplies the SSM output with the SiLU-activated gate branch, and (e) projects back to 48 dimensions; and (i) residual addition of the block input to the output. The optional MLP sub-layer (dintermediate=0d_intermediate=0) is omitted, as preliminary experiments showed no improvement in reconstruction while adding parameters. Similar experiments also showed that 3 Mamba blocks yield the best results; we denote the concrete models as UNet-Mamba1-3B. See Figure 2 for an overview over the architecture. I-A4 Two-Stage Detail Restoration Following [17], we optionally cascade the UNet-Mamba with a detail restoration network (DR-net). The DR-net receives a two-channel inputâthe concatenation of the noisy ECG ~ x and the first-stage estimate xâand produces a refined single-channel output. It comprises four parallel branches (kernel sizes 3, 5, 13, 15) with residual blocks and channel attention, operating at full resolution to preserve sharp features that may be attenuated by the bottleneck. We denote the full two-stage model as DR-net-Mamba, and the specific variant with 3 Mamba-Blocks (found to yield optimal performance in preliminary experiments) as DR-net-Mamba1-3B. I-A5 Learnable Signal Compression We apply a learnable log-compression to the network input: fαâ(x)=signâĄ(x)â logâĄ(1+αâ|x|),f_α(x)=sign(x)· (1+α\,|x|), where α>0α>0 is a trainable scalar. The inverse transform fαâ1f_α^-1 is applied to the network output to recover the original amplitude scale. By factoring out the dynamic range, the compression layer allows the model to devote capacity to morphological structure rather than amplitude variation. Further, compressing the input range may stabilize gradient flow through the recurrent Mamba layers since learning long-range dependencies is prone to exploding and vanishing gradients even with input-dependent recurrence matrices [49, 50]. See Supplementary Material A-B (Figure S1) for ablations exploring this benefit. I-A6 Parameter Count and Memory Scaling The three Mamba blocks add a total of 533,088 parameters to the 227K-parameter UNet backbone, yielding a total of 759,826 parameters, which is still smaller than our biggest baseline (MECGE, with 819K parameters). Critically, Mamba is applied only along the time axis after 20Ă20Ă down-sampling, keeping the effective batch size constant regardless of input length. By contrast, MECGEâs frequency-axis Mamba branch creates one sequence per time frame, causing effective batch size to scale linearly with signal length and making long-recording training prohibitively expensive (see Supplementary Material A-C, Figure S2). I-B Training All models are trained with MSE loss (batch size 32), normalized per lead using the median and interquartile range, with early stopping on validation loss. Details on training for baseline models are in Supplementary Material A-D (Table S2); convergence is confirmed in Supplementary Material A-F (Figure S3). For the 12-lead PTB-XL dataset, we deploy UNet-Mamba in two modes: a single lead-agnostic model trained across all leads, and 12 separate lead-specific (or LS, for short) instances, one per lead. The lead-agnostic variant enables direct comparison with prior work, which is overwhelmingly lead-agnostic by design [17, 18, 16]. The single lead is selected by retaining the channel with the fewest detected peaks, as leads with fewer peaks are less likely to be corrupted by noise [51]. The lead-specific variant allows each instance to specialize to the distinct morphological characteristics of its respective leadâe.g. the dominant R-wave often in V5 versus the predominantly negative QRS complex in aVR [52, 53]. IV Cohort IV-A Clinical Cohorts PTB-XL [54] is a large publicly available dataset of 21,799 clinical 12-lead ECGs from 18,869 patients, each 10 s long at a native sampling frequency of 500 Hz. Records flagged with baseline drift, static noise, burst noise, or electrode problems are excluded following [51], yielding 13,480 (from the original 17,418) training and 1,639 (from 2,183) test segments. Each record carries a subset of 44 diagnostic statements provided by up to two cardiologists, which can be aggregated into five superdiagnostic classes: NORM (normal), MI (myocardial infarction), STTC (ST/T change), CD (conduction disturbance), and HYP (hypertrophy). We leverage these annotations for downstream evaluation of diagnostic classification. Folds 1â8 are used for training, fold 9 for validation, and fold 10 for testing. Further cohort demographics and acquisition details are provided in [54] and Supplementary Material B-A. European ST-T Database [55] consists of 90 annotated excerpts of two-hour ambulatory ECG recordings from 79 subjects in whom myocardial ischemia was diagnosed or suspected. Each record contains two channels sampled at 250 Hz. The 90 records are split into 54 training, 18 test, and 18 evaluation records. Within each record, segments are extracted at evenly spaced positions using non-overlapping windows: 2,048 segments for training and 256 segments for testing and evaluation. IV-B Synthetic Cohort We generate single-channel synthetic ECGs segments using the dynamical ODE model of [42]. Heart rate is drawn uniformly from [60,80][60,80] bpm for each segment, and the PQRST morphology parameters (amplitudes aia_i and widths bib_i) are sampled uniformly around reference values (Supplementary Material B-B) to introduce inter-segment variability. Each segment is simulated for 45 s at 360 Hz; the first 5 s are discarded to eliminate transient warm-up artifacts, yielding 40 s effective signals. We generate 1,024 training, 256 test and 256 validation segments. Deterministic random seeds per split ensure reproducibility and non-overlapping populations. IV-C Data Extraction and Preprocessing All clinical recordings are resampled to 360 Hz via polyphase resampling to match the frequency expected by the denoising models, then bandpass-filtered (1â45 Hz), retaining the clinically relevant ECG frequency contentâthe bulk of QRS spectral energy lies below 40 Hz [56]âwhile attenuating baseline wander below 1 Hz and suppressing powerline interference and high-frequency noise above 45 Hz. Signals are then robustly normalized using the median and interquartile range computed on the training set. IV-D Noise Model Noise source. Realistic noise signals are sourced from the MIT-BIH Noise Stress Test Database (NSTDB) [57], which provides three half-hour, two-channel recordings of noise typical in ambulatory ECG settings: baseline wander (BW), muscle/EMG artifact (MA), and electrode motion artifact (EM). The first channel of each record is split as: 0â15 mins for training, 15â22.5 for testing, and 22.5â30 for evaluation. Online noise application. During training, all four noise types (BW, MA, EM, and additive white Gaussian noise) are applied simultaneously to each clean ECG segment. For each structured noise type, a random excerpt of the required length is extracted from the corresponding noise bank and scaled to a prescribed SNR. AWGN is generated independently and scaled likewise. Following the ranges recommended by [58], we set SNR levels to 2.5 dB for BW, 7.5 dB for MA, 12.5 dB for EM, and 22.5 dB for AWGN. The simultaneous application of all four noise sources ensures that the denoiser is trained under realistic multi-source contamination rather than idealized single-noise conditions. The noise pipeline is validated by comparing empirical SNR distributions against theoretical expectations (Supplementary Material B-C, Table S4, Figure S4). V Results V-A Experiments and Evaluation Evaluation Metrics. We quantify reconstruction fidelity using SNR as SNRâĄ(^,)=10âlog10âĄ(â22ââ^â22),SNR( x,x)=10 _10\! ( _2^2 - x _2^2 ), and RMSE as RMSEâĄ(^,)=1Tââ^ââ22,RMSE( x,x)= 1T x-x _2^2, where x is the clean signal, x the denoised estimate, and T the number of time steps. Each metric is computed per sequence and averaged across all test sequences. For downstream classification we report macro-averaged AUROC (ranking-based), BCE and Brier score (calibration-sensitive, after temperature scaling [59]), and macro sensitivity, specificity, and F1 (threshold 0.5). For each record and class, we compute a per-entry score (the BCE term, or the squared error for Brier) on temperature-scaled probabilities, then take the flat mean over all entries. These are per-element averages, not summed or prevalence-weighted (micro-averaging). All metrics use 95% bootstrap confidence intervals (1,000 resamples, percentile method) following [60]. Downstream Evaluation Pipeline. For reconstruction (SNR/RMSE), one lead per record is selected (fewest detected peaks [51]) and the denoiser is trained and evaluated on these single-lead signals. The lead-agnostic model pools all leads and is lead-blind, while the lead-specific variant trains 12 separate lead-aware instances. To assess clinical utility, clean 12-lead PTB-XL ECGs are separated into individual leads, independently normalized and corrupted with noise, denoised by each model under test, de-normalized, and reassembled into 12-lead signals. Two independent classifiersâInception1D [61] and ResNet1D-Wang [62] (Supplementary Material C-A)âtrained exclusively on clean data then classify the reconstructed signals across 44 diagnostic classes. We reuse the architectures, hyper-parameters, and training scripts from the PTB-XL benchmark of [60] (https://github.com/helme/ecg_ptbxl_benchmarking) without modification, including the standard fold split and multi-label BCE-with-logits objective. We add temperature scaling ([59]): a single global scalar T is fit by minimizing BCE on the clean-condition logits and labels of the validation fold and reused for noisy and denoised conditions. This pipeline is illustrated in Figure 1. Inference Cost. On a single 10 s ECG window at 360 Hz (batch=1, NVIDIA RTX A5000, PyTorch 2.9 + CUDA 12.8, mean of 50 forwards after 10 warmups), DR-net Mamba1-3B runs in 11.9 ms with 15.6 MB peak GPU memory, faster than DR-net-IMUNet (16.0 ms) at comparable memory (Table V). All evaluated models process 10 s of signal in under 50 ms, comfortably real-time for clinical deployment. V-B ECG Reconstruction Figures 3 and S8 report SNR and RMSE, respectively, across all three datasets under the medium noise setting (combined input SNR â 0.96 dB; see Supplementary Material B-C). DR-net-Mamba achieves the highest SNR and lowest RMSE on all three datasets. On the synthetic benchmark (Figure 3a), UNet-Mamba and DR-net-Mamba obtain approximately 2.5â3 dB higher SNR than their base models (UNet and DR-net-UNet), while DRNN, DAE, and MECGE consistently yield the weakest performance. Performance rankings on PTB-XL (Figure 3b) and European ST-T (Figure 3c) are largely consistent with the synthetic benchmark. On clinical data, the performance gap between Stage 1 and Stage 2 models is more pronounced. The relationship between training data volume and reconstruction performance is explored in Supplementary Material C-C. Fig. 3: Reconstruction SNR (dB) on synthetic (a), PTB-XL (b), and European ST-T (c) datasets. Empirical noisy SNR = 0.96 dB (medium noise setting, see Supplementary Material B-C). Analogous RMSE results are reported in Figure S8 in Supplementary Material C-D. To confirm the reported improvements are not artifacts of overlapping per-model CIs, we ran paired bootstrap tests of the mean difference Î=xÂŻAâxÂŻB = x_A- x_B between every baseline and our models for each of the three datasets (for MECGE, the 1800-sample windows were stitched back into the 14400-sample recordings before computing the metric). For each pair, recording indices were resampled with replacement B=1000B=1000 times, using the same indices for both models per iteration to preserve pairing, and 95% percentile confidence intervals of Î are reported. A CI excluding 0 indicates a significant difference at α=0.05α=0.05. We find that every comparison of our models against their respective baseline yields a significant difference (at α=0.05α=0.05) on each of the three datasets: For the synthetic test set (n=256n=256 source recordings), the smallest gain is +0.29+0.29 dB SNR over DR-net-IMUNet with a CI of [+0.15,+0.44][+0.15,+0.44]. On PTB-XL (n=1,639n=1,639 recordings, 10 s each at 360 Hz), DR-net Mamba1-3B outperforms every baseline (smallest gain +0.83+0.83 dB SNR over DR-net-IMUNet, CI [+0.78,+0.88][+0.78,+0.88]), while on the European ST-T database (n=256n=256 recordings, 40 s) the smallest gain of +0.34+0.34 dB SNR, CI [+0.20,+0.49][+0.20,+0.49] is achieved over DR-net-IMUNet. The individual results are given in Tables S7, S8 and S9 in Section C-E in the Supplementary Material. The compression layer is a potential confounder. We have therefore run ablation studies to separate the effects of Mamba, DR-net, and log compression. We isolated the three components by evaluating a 6-cell grid on European ST-T (UNet baseline, with/without DR-net, with/without Mamba, with/without learnable compression) on the same N=256N=256 test recordings. All pairwise SNR differences are computed with a paired bootstrap: recording indices are resampled with replacement B=1000B=1000 times using the same indices for both models per iteration, yielding the 95% CI of Î=xÂŻAâxÂŻB = x_A- x_B. Mamba and DR-net each contribute large, significant gains; learnable compression adds +0.9 dB SNR on top of single-stage Mamba (CI [+0.7, +1.0]) but its effect vanishes once DR-net is added (-0.0 dB, CI [-0.1, +0.1]), indicating that compression and the two-stage DR-net design capture overlapping benefits. The detailed numbers are tabulated in Table S10 in the Supplementary Material. V-C Noise Robustness Figure 4 reports reconstruction SNR as a function of input SNR for each noise type individually and for the combined condition on the European ST-T dataset, restricted to the best-performing models for clarity. Grey-shaded regions indicate input SNR values outside the plausible clinical operating ranges as reported by [58]. DR-net-Mamba achieves the highest output SNR across all noise types and clinically relevant input SNR levels. The advantage over purely convolutional models is most pronounced under heavy AWGN. MECGE shows notable robustness under heavy muscle artifact and AWGN. Under the combined noise condition, both DR-net-Mamba and MECGE degrade more gracefully than DR-net-UNet and DR-net-IMUNet. Fig. 4: Reconstruction SNR (dB) as a function of input SNR for each noise type (EM, BW, MA, AWGN) and the combined condition on European ST-T. Grey-shaded areas denote input SNR values outside clinically plausible ranges [58]. Shaded bands indicate 95% bootstrap CIs. V-D Impact of Recording Length Figure 5 compares UNet and UNet-Mamba (without log compression, to isolate the bottleneck contribution) as a function of recording length using a curriculum-based protocol. Models are trained in four stages of increasing sequence length (5 s â 10 s â 20 s â 40 s), with the original 40 s long records being cut into shorter windows of 7,200, 3,600, and 1,800 samples (20 s, 10 s, and 5 s), respectively, alongside the full 40 s. Each model is thus trained on the same total recording length, but a varying maximal length. In the training, each model is initialized using the weights from the previous stage, with compression disabled so the two architectures differ only by the presence of the Mamba bottleneck. On the synthetic dataset (Figure 5a), the two models achieve comparable SNR at 5 s, but UNet-Mamba consistently outperforms UNet for longer recordings, with the gain growing from approximately 1 dB at 10 s to roughly 2.5 dB at 40 s. On the European ST-T dataset (Figure 5b), UNet-Mamba already outperforms UNet by approximately 1 dB at 5 s. The improvement peaks around 10 s and then diminishes for longer sequences, in contrast to the monotonic growth observed on synthetic data. Training details for each curriculum stage are reported in Supplementary Material C-B (Tables S5âS6). Fig. 5: Reconstruction SNR (dB) as a function of recording length for UNet and UNet-Mamba (without signal compression), on synthetic (a) and European ST-T (b). Shaded bands indicate 95% bootstrap CIs. V-E Clinical Translation: Downstream Disease Prediction V-E1 Aggregated Evaluation Figure 6 summarizes downstream classification performance on PTB-XL under the strong noise setting (BW 0dâBdB; MA 5dâBdB; EM 10dâBdB; AWGN 20dâBdB) using the ResNet1D-Wang backboneâsee Figure S10 in Supplementary Material C-I for the Inception1D backbone. Results under a lower noise setting are reported in Supplementary Material C-G. Noise reduces AUROC by 0.0690.069 for Inception1D and 0.0550.055 for ResNet1D-Wang. The Mamba-based models achieve the best overall AUROC across both classifiers and consistently improve over their base models. The lead-specific UNet-Mamba (Section I-B) further improves AUROC on ResNet1D-Wang. The calibration picture is more nuanced and backbone-dependent. Among the denoisers, the Mamba-based models attain the best BCE and Brier scores on both classifiers, but whether denoising improves calibration over the noisy input depends on the classifier. On Inception1D, denoising broadly helps: every model that improves AUROC also lowers BCE and Brier relative to the noisy baseline, with the lead-specific UNet-Mamba best on both (BCE 6.896.89 and Brier 1.821.82 vs. noisy 7.857.85/2.022.02). On ResNet1D-Wang the effect is weaker: several denoisersâincluding some Mamba variantsâsit at or slightly above the noisy baseline on Brier even when they improve BCE, and only the lead-specific UNet-Mamba clearly improves both BCE and Brier over the noisy input (BCE 7.107.10 and Brier 1.891.89 vs. noisy 7.717.71/2.012.01). Thus the lead-specific variant is the only denoiser to improve calibration over the noisy baseline on both classifiers, while other models trade improved discrimination against degraded or unchanged calibration. We return to this discriminationâcalibration gap in Section VI-B. To understand the clinical relevance of these results, Table I reports macro-averaged metrics for Inception1D (strong noise, bold/underlined: best/second best). The noisy signal achieves higher sensitivity than the clean baseline (0.8520.852 vs. 0.8150.815) at the cost of substantially lower specificity (0.6970.697 vs. 0.8630.863). The three Mamba variants rank first through third on F1, combining specificity of 0.8390.839â0.8410.841 with sensitivity of 0.7890.789â0.8080.808. Similar trends hold for ResNet1D-Wang (Supplementary Material C-H, Table S14). V-E2 Evaluation by Superdiagnostic Class Table I additionally breaks down AUROC by superdiagnostic class. The Mamba-based models achieve the highest AUROC across all five classes. The lead-specific UNet-Mamba leads in HYP, MI, NORM, and STTC, while DR-net-Mamba scores second-best in CD, HYP, MI, and STTC. Results under a lower noise setting (Tables S12âS13) and per-class sensitivity, specificity, and F1 (Tables S15âS16) are reported in Appendices C-G and C-J. Fig. 6: Downstream diagnostic classification (macro and superdiagnostic AUROC) on PTB-XL using ResNet1D-Wang, comparing denoised signals against clean and noisy baselines (strong noise setting). V-E3 Evaluation by Diagnostic Class Figure 7a isolates the effect of adding a Mamba bottleneck to the UNet while keeping all other design choices fixed. UNet-Mamba consistently outperforms UNet on STTC (ST/T change) and its subclasses, whereas UNet achieves comparable or slightly better AUROC on CD (conduction disturbance) and most of its subclasses. Figure 7b shows the absolute AUROC of the lead-specific UNet-Mamba per diagnostic class, with color encoding improvement over the noisy baseline. For all diagnostic classes with more than 18 segments, denoising either improves or preserves classification performance. The corresponding breakdowns for ResNet1D-Wang are reported in Supplementary Material C-K (Figure S11) and show similar trends. A natural alternative to the denoise-plus-clean-classifier pipeline is to train the classifier directly on noise-corrupted ECGs. As shown in Table I (strong noise, SâNâRââ1.5âdâBSNRâ-1.5\,dB) , this noise-aware classifier provides a strong baseline, achieving an AUROC of 0.923 compared with 0.909 for the denoise-plus-clean-classifier pipeline, which therefore does not outperform direct noise-aware training in downstream discrimination. This comparison, however, favors the noise-aware classifier in an important respect: it is trained and evaluated using the same noise family and noise setting, such that the noisy test data remain in-distribution. Moreover, this strategy requires the classifier to be retrained for each noise condition and each downstream classification task. In contrast, our approach decouples signal restoration from downstream prediction: the denoiser is trained once for the target noise setting and can subsequently be reused with different off-the-shelf classifiers trained on clean ECGs and for different downstream tasks. Importantly, the denoiser also reconstructs the underlying ECG signal itself, rather than learning only a noise-robust decision boundary for a specific set of labels. TABLE I: Downstream classifier AUROC under strong noise. Classifier trained on Test input AUC Clean Clean 0.925â[0.916,0.932]0.925\ [0.916,0.932] Clean Noisy 0.879â[0.865,0.892]0.879\ [0.865,0.892] Noisy Noisy 0.923â[0.913,0.930]0.923\ [0.913,0.930] Clean Denoised (Mamba1-3B Lead Aware) 0.909â[0.901,0.918]0.909\ [0.901,0.918] VI Discussion The central finding of this work is that augmenting a convolutional encoderâdecoder with a selective state-space bottleneck consistently improves reconstruction fidelity and noise robustness, and improves downstream diagnostic discrimination (AUROC), while its effect on calibration (BCE, Brier) is smaller and classifier-dependentâand that the nature of these effects is informative about when and why long-range temporal context matters for physiological signal processing. VI-A Long-Range Context as an Inductive Bias for Physiological Denoising TABLE I: Per-superdiagnostic-class AUROC and overall macro-averaged sensitivity, specificity, and F1 on PTB-XL CD HYP MI NORM STTC Overall AUROC Sensitivity Specificity F1 UNet-Mamba1-3B .925 ± .01 .883 ± .02 .909 ± .02 .926 ± .01 .880 ± .02 .789 ± .02 .840 ± .01 .703 ± .02 DR-net-Mamba1-3B .921 ± .01 .887 ± .02 .909 ± .02 .926 ± .01 .881 ± .02 .794 ± .02 .841 ± .01 .706 ± .02 UNet-Mamba1-3B (LS) .920 ± .01 .887 ± .02 .910 ± .01 .928 ± .01 .887 ± .02 .808 ± .02 .839 ± .01 .715 ± .02 DRNN .900 ± .02 .885 ± .02 .895 ± .02 .910 ± .02 .824 ± .02 .783 ± .02 .780 ± .01 .651 ± .02 DAE .860 ± .02 .854 ± .03 .874 ± .01 .907 ± .01 .848 ± .02 .709 ± .02 .819 ± .01 .638 ± .02 UNet .914 ± .02 .864 ± .03 .904 ± .01 .921 ± .01 .865 ± .02 .764 ± .01 .822 ± .01 .672 ± .02 DR-net-UNet .914 ± .01 .875 ± .03 .904 ± .01 .921 ± .01 .866 ± .02 .784 ± .02 .828 ± .01 .690 ± .01 IMUNet .914 ± .01 .875 ± .02 .901 ± .01 .925 ± .01 .879 ± .02 .767 ± .02 .840 ± .01 .691 ± .02 DR-net-IMUNet .912 ± .01 .883 ± .03 .900 ± .02 .927 ± .01 .879 ± .02 .785 ± .02 .841 ± .01 .699 ± .02 MECGE .905 ± .01 .870 ± .03 .887 ± .02 .917 ± .01 .872 ± .02 .790 ± .02 .808 ± .01 .680 ± .02 clean .932 ± .01 .906 ± .02 .925 ± .02 .938 ± .01 .914 ± .02 .815 ± .02 .863 ± .01 .738 ± .01 noisy .903 ± .02 .872 ± .03 .875 ± .02 .911 ± .02 .863 ± .02 .852 ± .02 .697 ± .01 .632 ± .02 The recording-length experiment (Figure 5) provides a clear direct evidence of the above. On synthetic data, where every beat shares the same parametric PQRST morphology [42], the Mamba advantage grows monotonically with sequence length because the state of distant beats is genuinely predictive of the current one. The UNetâs convolutional receptive field saturates at âŒ1.5 1.5 s, so additional temporal context cannot be exploited by the bottleneck convolutions, whereas the Mamba blocks propagate information across the full downsampled sequence. On clinical data, the Mamba advantage peaks around 10 s and then diminishes, reflecting the lower temporal regularity of real ECGs: inter-beat variability, heart rate variability, and pathological waveform heterogeneity make distant beats less predictive than in the stationary synthetic case. This contrast offers a practical guideline: selective state-space bottlenecks are most beneficial when the signal exhibits structured temporal regularity beyond the convolutional receptive field, a condition that holds for many physiological recordings (e.g., respiratory signals, EEG rhythms, continuous glucose monitoring) but whose degree is application-specific. Fig. 7: Per-diagnostic-class downstream AUROC (Inception1D). (a) AUROC delta when adding a Mamba bottleneck to the UNet, all other design choices held constant. (b) Absolute AUROC of the lead-specific UNet-Mamba; color indicates improvement over the noisy baseline. In both panels, diagnostic classes with fewer than five segments are omitted. See Supplementary Material C-L for abbreviations. The noise robustness results (Figure 4) reinforce this interpretation. The Mamba advantage over purely convolutional models is most pronounced under heavy AWGN. Structured noise sources (BW, MA, EM) carry recognizable temporal patterns that convolutional models can learn to suppress within their receptive field [63]. AWGN is sample-wise independent and offers no such local cues; as its intensity grows, reconstruction must rely on temporal predictability across beatsâprecisely the form of context the Mamba bottleneck provides. Under the combined noise condition, both DR-net-Mamba and MECGE degrade more gracefully than purely convolutional models, suggesting that global contextâwhether temporal (Mamba) or spectral (MECGE; [28])âis beneficial when multiple noise sources interact simultaneously. VI-B Clinical Translation: When Long-Range Context Helps Most The downstream evaluation confirms that Mamba-based denoising improves diagnostic performance across both classifiers and nearly all pathology classes. Crucially, the per-class analysis (Figure 7a, Table S18) reveals that this benefit is morphology-dependent, offering actionable insight into which clinical scenarios gain most from long-range temporal modeling. The Mamba bottleneck consistently and substantially improves AUROC on STTC diagnosesâslow, broad waveforms (200â400 ms) whose interpretation depends on the surrounding baseline [64] and that are easily confounded with structured noise such as baseline wander. For conduction disturbances, diagnosed from QRS-internal intervals such as the R-wave peak time (45â60 ms) [65], performance matches the convolutional baseline: with 20Ă20Ă downsampling these span barely one bottleneck time step, leaving little room for improvement. Table S18 summarizes this resolution-versus-context trade-off. Importantly, for all diagnostic classes with more than 18 segments, the lead-specific Mamba model either improves or preserves AUROC relative to the noisy baseline (Figure 7b), confirming that denoising does not harm downstream classification at the individual-diagnosis level. The calibration results further complicate the reconstruction-to-utility mapping, and they differ sharply between the two classifiers. On Inception1D, denoising generally improves calibration: models that raise AUROC also lower BCE and Brier relative to the noisy baseline. On ResNet1D-Wang, however, this coupling breaks downâseveral denoisers improve AUROC yet sit at or above the noisy baseline on Brier, and some worsen both BCE and Brier. A plausible explanation is that on ResNet1D-Wang denoising helps the classifier on borderline cases (improving rankings and thus AUROC) but reduces confidence on non-borderline segments, where the denoised signal may differ subtly from what the classifier was trained on; because BCE and Brier directly penalize reduced confidence on every segment, this loss can outweigh the gains on the borderline subset. Across both classifiers, the lead-specific Mamba variant is the only denoiser that improves both BCE and Brier over the noisy baseline, likely because per-lead specialization yields denoised signals closer to the clean morphology on which the classifiers were trained. This contrast highlights the importance of evaluating denoising not only through discrimination metrics (AUROC) but also through calibration metrics (BCE, Brier)âand of doing so per classifierâwhen the downstream application involves clinical decision-making with probabilistic outputs. VI-C The SensitivityâSpecificity Shift Induced by Noise The observation that noisy signals yield higher sensitivity than clean baselines (0.8520.852 vs. 0.8150.815 for Inception1D) while substantially degrading specificity (0.6970.697 vs. 0.8630.863) reveals a clinically important operating-point shift. Noise-corrupted morphology makes many negative examples resemble positive ones, pushing the classifier toward a higher false-positive rate. Denoising partially reverses this shift: all models reduce sensitivity relative to the noisy input while recovering specificity. Mamba models achieve the best balance, with the highest F1 scores and specificity closest to the clean baseline. For clinical deployment, the specificity recovery offered by denoising may be more valuable than the raw AUROC improvement, particularly in screening settings where false positives trigger costly follow-up. VI-D DR-net-Mamba in the Broader Denoising Landscape Prior ECG denoising studies [17, 16, 18] each use different clean-signal sources, noise protocols, segment lengths, and metric definitions, making cross-study comparison of absolute values unreliable. Our noise pipeline differs fundamentally: each source is scaled to per-type SNR targets drawn from clinically calibrated ranges [58], and all four types are applied simultaneously, yielding evaluation conditions more challenging than those in the baseline studies. Rather than comparing absolute metric values across incompatible setups, we focus on within-study rankings using a unified noise protocol applied consistently to all models. The absence of a standardized ECG denoising benchmark remains an open problem for the field. Further Machine Learning in Healthcare Insights This work offers three insights that extend beyond ECG denoising. First, we demonstrate that inserting selective state-space blocks at the bottleneck of a convolutional encoderâdecoder is a parameter-efficient strategy for injecting long-range temporal context into physiological signal models, with the benefit growing with recording length. Second, we show that reconstruction gains do not automatically transfer to downstream clinical utility: the relationship between denoising quality and diagnostic accuracy is morphology-dependent, with context-sensitive waveforms (e.g., ST/T changes) benefiting most from long-range modeling while sharp features (e.g., QRS complexes) can be harmed by bottleneck over-smoothing. Third, we find that lead-specific denoisingâtraining separate models per ECG leadâcan preserve calibration where lead-agnostic models degrade it, highlighting that evaluation beyond discrimination is essential for clinical deployment. VI-E Limitations Various limitations arise in this work: (i) Ground-truth quality. Neither PTB-XL nor European ST-T provides truly clean references. Residual artifacts survive preprocessing and become part of the reconstruction target through the MSE loss. Reconstruction metrics therefore partially measure reproduction of these artifacts rather than genuine signal recovery, and Stage 2 improvements on clinical data should be interpreted with this caveat. (i) Single-lead pipeline. Each lead is denoised independently and reassembled for downstream classification. Inter-lead spatial correlations in the 12-lead ECG are not exploited. A multi-lead architecture could improve both reconstruction and diagnostic performance, and would avoid the 12Ă12Ă training cost of the lead-specific variant. (i) Noise model scope. All models are trained and evaluated with four noise types at prescribed SNR levels. Other clinically relevant artifact types (e.g., lead misplacement, pacemaker spikes, motion artifacts in wearable devices) and adaptive or non-stationary noise levels are not covered. (iv) Downstream evaluation scope. The downstream pipeline uses classifiers trained on clean data and evaluated on denoised data. In practice, classifiers may be trained on noisy data or jointly optimized with the denoiser. Our pipeline isolates the effect of denoising but does not capture potential benefits from end-to-end training. (v) Recording-length scaling on clinical data. The Mamba advantage peaks around 10 s on clinical recordings and then diminishes, unlike the monotonic growth on synthetic data. Whether this reflects intrinsic limits of long-range context in irregular clinical signals or artifacts of the training protocol (e.g., boundary effects [66]) warrants further investigation. Conflicts of Interest S. R.-C. reports equity, consulting, and intellectual property with Physcade Inc. Disclosures are unrelated to this work. All other authors have nothing to disclose. References [1] Bryan Chong et al. âGlobal burden of cardiovascular diseases: projections from 2025 to 2050â In European journal of preventive cardiology 32.11 Oxford University Press UK, 2025, p. 1001â1015 [2] Ethan Rowin et al. âExtended ambulatory ECG monitoring enhances identification of higher-risk ventricular tachyarrhythmias in patients with hypertrophic cardiomyopathyâ In Heart Rhythm 22.7 Elsevier, 2025, p. 1696â1704 [3] Yuanyuan Tian et al. âFoundation model of ECG diagnosis: Diagnostics and explanations of any form and rhythm on ECGâ In Cell Reports Medicine 5.12 Elsevier, 2024 [4] Jun Li et al. âAn Electrocardiogram Foundation Model Built on over 10 Million Recordingsâ In NEJM AI 2.7 Massachusetts Medical Society, 2025 [5] Timothy Poterucha et al. âDetecting structural heart disease from electrocardiograms using AIâ In Nature 644.8075 Nature Publishing Group UK London, 2025, p. 221â230 [6] Akhil Vaid et al. âUsing deep-learning algorithms to simultaneously identify right and left ventricular dysfunction from the electrocardiogramâ In Cardiovascular Imaging 15.3 American College of Cardiology Foundation Washington DC, 2022, p. 395â410 [7] Joshua Mayourian et al. âPediatric ECG-based deep learning to predict left ventricular dysfunction and remodelingâ In Circulation 149.12 Lippincott Williams & Wilkins Hagerstown, MD, 2024, p. 917â931 [8] Joshua Mayourian et al. âElectrocardiogram-based deep learning to predict left ventricular systolic dysfunction in paediatric and adult congenital heart disease in the USA: a multicentre modelling studyâ In The Lancet Digital Health 7.4 Elsevier, 2025, p. e264âe274 [9] Chih-Chieh Yu et al. âECG-based machine learning model for AF identification in patients with first ischemic strokeâ In International Journal of Stroke 20.4 SAGE Publications Sage UK: London, England, 2025, p. 411â418 [10] Veer Sangha et al. âIdentification of hypertrophic cardiomyopathy on electrocardiographic images with deep learningâ In Nature Cardiovascular Research 4.8 Nature Publishing Group UK London, 2025, p. 991â1000 [11] Maarten Kolk et al. âDynamic prediction of malignant ventricular arrhythmias using neural networks in patients with an implantable cardioverter-defibrillatorâ In EBioMedicine 99 Elsevier, 2024 [12] Samuel RuipĂ©rez-Campillo et al. âClustering and machine learning framework for medical time series classificationâ In Biocybernetics and Biomedical Engineering 44.3 Elsevier, 2024, p. 521â533 [13] Maarten Kolk et al. âOptimizing patient selection for primary prevention implantable cardioverter-defibrillator implantation: utilizing multimodal machine learning to assess risk of implantable cardioverter-defibrillator non-benefitâ In Europace 25.9 Oxford University Press US, 2023, p. euad271 [14] Shubhojeet Chatterjee et al. âReview of noise removal techniques in ECG signalsâ In IET Signal Processing 14.9 Wiley, 2020, p. 569â590 [15] Yifan Jia et al. âPreprocessing and Denoising Techniques for Electrocardiography and Magnetocardiography: A Reviewâ In Bioengineering 11.11 MDPI, 2024, p. 1109 [16] Hsin-Tien Chiang et al. âNoise Reduction in ECG Signals Using Fully Convolutional Denoising Autoencodersâ In IEEE Access 7, 2019, p. 60806â60813 [17] Lin Qiu et al. âTwo-stage ECG signal denoising based on deep convolutional networkâ In Physiological Measurement 42.11, 2021 [18] Karol Antczak âDeep Recurrent Neural Networks for ECG Signal Denoisingâ, 2019 arXiv:1807.11551 [cs.NE] [19] Xiaoyu Wang et al. âAn ECG signal denoising method using conditional generative adversarial netâ In IEEE Journal of Biomedical and Health Informatics 26.7 IEEE, 2022, p. 2929â2940 [20] P. Singh and G. Pradhan âA new ECG denoising framework using generative adversarial networkâ In IEEE/ACM Transactions on Computational Biology and Bioinformatics 18, 2021, p. 759â764 [21] Huayu Li, Gregory Ditzler, Janet Roveda and Ao Li âDeScoD-ECG: Deep Score-Based Diffusion Model for ECG Baseline Wander and Noise Removalâ In IEEE Journal of Biomedical and Health Informatics 28.9 Institute of ElectricalElectronics Engineers (IEEE), 2024, p. 5081â5091 [22] Ashish Vaswani et al. âAttention is all you needâ In Advances in neural information processing systems 30, 2017 [23] Yi Tay, Mostafa Dehghani, Dara Bahri and Donald Metzler âEfficient Transformers: A Surveyâ In ACM Computing Surveys 55.6 ACM, 2022, p. 1â28 [24] Jiaming Song, Chenlin Meng and Stefano Ermon âDenoising Diffusion Implicit Modelsâ, 2022 arXiv:2010.02502 [cs.LG] [25] Albert Gu and Tri Dao âMamba: Linear-time sequence modeling with selective state spacesâ In First conference on language modeling, 2024 [26] Yupeng Qiang et al. âEcgmamba: Towards ecg classification with state space modelsâ In 2024 IEEE International Conference on Bioinformatics and Biomedicine (BIBM), 2024, p. 6498â6505 IEEE [27] Yinlong Xu et al. âMambaCapsule: Towards Transparent Cardiac Disease Diagnosis with Electrocardiography Using Mamba Capsule Networkâ, 2024 arXiv:2407.20893 [eess.SP] [28] Kuo-Hsuan Hung et al. âMECG-E: Mamba-based ECG Enhancer for Baseline Wander Removalâ, 2024 arXiv:2409.18828 [eess.SP] [29] Rik Vullings, Bert De and Jan Bergmans âAn adaptive Kalman filter for ECG signal enhancementâ In IEEE transactions on biomedical engineering 58.4 IEEE, 2010, p. 1094â1103 [30] Manuel Blanco-Velasco, Binwei Weng and Kenneth Barner âECG signal denoising and baseline wander correction based on the empirical mode decompositionâ In Computers in biology and medicine 38.1 Elsevier, 2008 [31] Jae-Neung Lee and Keun-Chang Kwak âECG-based biometrics using a deep network based on independent component analysisâ In IEEE Access 10 IEEE, 2022 [32] Kaimin Yu et al. âAccurate wavelet thresholding method for ECG signalsâ In Computers in Biology and Medicine 169 Elsevier, 2024, p. 107835 [33] Roberto Holgado-Cuadrado, Carmen Plaza-Seco, Lisandro Lovisolo and Manuel Blanco-Velasco âCharacterization of noise in long-term ECG monitoring with machine learning based on clinical criteriaâ In Medical & Biological Engineering & Computing 61.9 Springer, 2023, p. 2227â2240 [34] Wangdong Yang, Buwen Cao and Jintao Wu âECGDeDRDNet: A deep learning-based method for Electrocardiogram noise removal using a double recurrent dense networkâ In arXiv preprint arXiv:2505.05477, 2025 [35] Itzel Avila et al. âGenerative adversarial networks with fully connected layers to denoise PPG signalsâ In Physiological measurement 46.2 IOP Publishing, 2025, p. 025008 [36] Samuel RuipĂ©rez-Campillo et al. âReducing diverse sources of noise in ventricular electrical signals using variational autoencodersâ In Expert Systems with Applications 300 Elsevier, 2026, p. 130185 [37] Samuel RuipĂ©rez-Campillo et al. âAntithetic Sampling Enhanced Probabilistic Diffusion for Denoising Cardiac Time Seriesâ In IEEE journal of biomedical and health informatics IEEE, 2026 [38] Yanrong Hou et al. âDeep neural network denoising model based on sparse representation algorithm for ECG signalâ In IEEE Transactions on Instrumentation and Measurement 72 IEEE, 2023, p. 1â11 [39] Francisco Romero, David Piñol and Carlos VĂĄzquez-Seisdedos âDeepFilter: An ECG baseline wander removal filter using deep learning techniquesâ In Biomedical Signal Processing and Control 70 Elsevier, 2021, p. 102992 [40] D. Zhu, V.. Chhabra and M.. Khalili âECG signal denoising using multi-scale patch embedding and transformersâ In ICML 2024 Next Generation of Sequence Modeling Architectures Workshop, 2024 [41] Serkan Kiranyaz et al. âBlind ECG Restoration by Operational Cycle-GANsâ, 2022 arXiv:2202.00589 [eess.SP] [42] Patrick McSharry, Gari Clifford, Lionel Tarassenko and Leonard Smith âA dynamical model for generating synthetic electrocardiogram signalsâ In IEEE transactions on biomedical engineering 50.3 IEEE, 2003 [43] Aidan. Delaney et al. âSynthesis of Realistic ECG using Generative Adversarial Networksâ In Proceedings of the 27th European Signal Processing Conference (EUSIPCO), 2019, p. 1â5 [44] Fei Zhu et al. âElectrocardiogram Generation with a Bidirectional LSTM-CNN Generative Adversarial Networkâ In Scientific Reports 9.1, 2019, p. 6734 [45] V.. Kuznetsov, V.. Moskalenko, D.. Gribanov and Nikolai. Zolotykh âInterpretable Feature Generation in ECG Using a Variational Autoencoderâ In Frontiers in Genetics 12, 2021 [46] Ameen Ali, Itamar Zimerman and Lior Wolf âThe hidden attention of mamba modelsâ In Proceedings of the 63rd Annual Meeting of the Association for Computational Linguistics, 2025, p. 1516â1534 [47] Abdellah Sellam et al. âMamba Adaptive Anomaly Transformer with association discrepancy for time seriesâ In Engineering Applications of Artificial Intelligence 160 Elsevier, 2025, p. 11685 [48] Olaf Ronneberger, Philipp Fischer and Thomas Brox âU-Net: Convolutional Networks for Biomedical Image Segmentationâ, 2015 arXiv:1505.04597 [cs.CV] [49] Yoshua Bengio, Patrice Simard and Paolo Frasconi âLearning long-term dependencies with gradient descent is difficultâ In IEEE transactions on neural networks 5.2 IEEE, 1994, p. 157â166 [50] Razvan Pascanu, Tomas Mikolov and Yoshua Bengio âOn the difficulty of training Recurrent Neural Networksâ, 2013 arXiv:1211.5063 [cs.LG] [51] Mariana Dias, Phillip Probst, LuĂs Silva and Hugo Gamboa âCleaning ECG with Deep Learning: A Denoiser Based on Gated Recurrent Unitsâ, 2023, p. 149â160 [52] Ary. Goldberger, Zachary. Goldberger and Alexei Shvilkin âGoldbergerâs Clinical Electrocardiography: A Simplified Approachâ Philadelphia: Elsevier, 2024 [53] Elisa Ramirez et al. âThe art of selecting the ECG input in neural networks to classify heart diseases: a dual focus on maximizing information and reducing redundancyâ In Frontiers in physiology 15 Frontiers Media SA, 2024, p. 1452829 [54] Patrick Wagner et al. âPTB-XL, a large publicly available electrocardiography datasetâ In Scientific data 7.1 Nature Publishing Group, 2020, p. 1â15 [55] Alessandro Taddei et al. âThe European ST-T database: standard for evaluating systems for the analysis of ST-T changes in ambulatory electrocardiographyâ In European heart journal 13.9 Oxford University Press, 1992, p. 1164â1172 [56] Nitish. Thakor, John. Webster and Willis. Tompkins âEstimation of QRS Complex Power Spectra for Design of a QRS Filterâ In IEEE Transactions on Biomedical Engineering BME-31.11, 1984, p. 702â706 [57] George. Moody, W.. Muldrow and Roger. Mark âA noise stress test for arrhythmia detectorsâ In Computers in Cardiology 11, 1984, p. 381â384 [58] Lei Hu, Wenjie Cai, Ziyang Chen and Mingjie Wang âA lightweight U-Net model for denoising and noise localization of ECG signalsâ In Biomedical Signal Processing and Control 88, 2024, p. 105504 [59] Chuan Guo, Geoff Pleiss, Yu Sun and Kilian. Weinberger âOn Calibration of Modern Neural Networksâ In Proceedings of the 34th International Conference on Machine Learning 70, Proceedings of Machine Learning Research PMLR, 2017, p. 1321â1330 [60] Nils Strodthoff, Patrick Wagner, Tobias Schaeffter and Wojciech Samek âDeep Learning for ECG Analysis: Benchmarks and Insights from PTB-XLâ In IEEE Journal of Biomedical and Health Informatics 25.5 Institute of ElectricalElectronics Engineers (IEEE), 2021, p. 1519â1528 [61] Hassan Ismail et al. âInceptionTime: Finding AlexNet for time series classificationâ In Data Mining and Knowledge Discovery 34.6 Springer ScienceBusiness Media LLC, 2020, p. 1936â1962 [62] Zhiguang Wang, Weizhong Yan and Tim Oates âTime Series Classification from Scratch with Deep Neural Networks: A Strong Baselineâ, 2016 arXiv:1611.06455 [cs.LG] [63] Pramendra Kumar and Vijay Sharma âDetection and classification of ECG noises using decomposition on mixed codebook for quality analysisâ In Healthcare Technology Letters 7.1, 2020, p. 18â24 [64] Borys Surawicz and Timothy. Knilans âChouâs Electrocardiography in Clinical Practice: Adult and Pediatricâ Philadelphia: Saunders/Elsevier, 2008 [65] Borys Surawicz et al. âAHA/ACCF/HRS Recommendations for the Standardization and Interpretation of the Electrocardiogram: Part I: Intraventricular Conduction Disturbancesâ In Journal of the American College of Cardiology 53.11, 2009, p. 976â981 [66] Nicolas Pielawski and Carolina WĂ€hlby âIntroducing Hann windows for reducing edge-effects in patch-based image segmentationâ In PLoS ONE 15.3, 2020, p. e0229839 Supplementary Material Overview Appendix A Supplementary Methods A-A Receptive Field Computation The receptive field of a chain of L convolutions is the number of input samples that can influence a single output sample. For a network where layer l has kernel size klk_l and stride sls_l: r0=âl=1L((klâ1)ââi=1lâ1si)+1.r_0= _l=1^L ((k_l-1) _i=1^l-1s_i )+1. (1) Pooling layers are treated identically, using their pool size as klk_l and pool stride as sls_l. Table S1 details the per-layer contribution for the UNet encoder. TABLE S1: Per-layer receptive field computation for the UNet encoder. l Layer Type sls_l klk_l âi=1lâ1si _i=1^l-1s_i (klâ1)ââi=1lâ1si (k_l-1) _i=1^l-1s_i 1 Conv 1 25 1 24 2 Conv 1 25 1 24 3 Conv 1 25 1 24 4 AvgPool 5 5 1 4 5 Conv 1 15 5 70 6 Conv 1 15 5 70 7 Conv 1 15 5 70 8 AvgPool 2 2 5 5 9 Conv 1 5 10 40 10 Conv 1 5 10 40 11 Conv 1 5 10 40 12 AvgPool 2 2 10 10 13 Conv 1 3 20 40 14 Conv 1 3 20 40 15 Conv 1 3 20 40 Sum: 541 Receptive Field (r0=Sum+1r_0=Sum+1): 542 A-B Signal Compression Ablation Figure S1 compares the training dynamics of UNet-Mamba with and without the learnable log-compression layer (Section I-A5). Without compression, the model converges faster initiallyâconsistent with easily fitting the dominant scale componentâbut plateaus at a higher error, indicating that capacity is spent on amplitude scale at the expense of morphological structure. Fig. S1: Test RMSE over training steps for UNet-Mamba with and without the learnable log-compression layer. Removing compression yields faster initial convergence but a worse final optimum. A-C Memory Scaling Comparison MECGE [28] applies bidirectional Mamba along both time and frequency axes in the STFT domain. Its Frequency Bi-Mamba branch creates one sequence per time frame, so the effective batch size scales as âĄ(Bâ T/h)O(B· T/h) where h is the STFT hop size. For a 40 s recording at 360 Hz with hop size h=8h=8, this yields an effective batch of BĂ1,800BĂ 1,800 in the frequency branch alone. By contrast, UNet-Mamba applies Mamba only along the time axis after 20Ă20Ă down-sampling, keeping the effective batch size at B and the sequence length at T/20T/20. Figure S2 compares peak GPU memory allocation. Fig. S2: Peak GPU memory allocation as a function of ECG signal length (1â5 s at 360 Hz, batch size 2). A: inference (forward pass). B: training (forward + backward). MECGE training requires substantially more memory than UNet-Mamba due to STFT-domain processing. A-D Training Details for Baseline Models For the baseline models (UNet, IMUNet, DAE, DRNN, DR-net variants), the optimizer and scheduler follow the respective original publications, using Adam with learning rate 10â310^-3 and ReduceLROnPlateau. MECGE uses AdamW with learning rate 10â410^-4 and exponential decay. For UNet-Mamba, we use Adam with ηmax=8Ă10â4 _ =8Ă 10^-4 and cosine annealing with 10-epoch linear warm-up from ηmaxĂ0.01 _ Ă 0.01 to ηmax _ , followed by cosine decay over 400 cycles to ηmin=10â6 _ =10^-6, following [25]. Full hyperparameters are listed in Supplementary Material A-E. A-E Training Hyperparameters Table S2 summarizes the training hyperparameters for all models. All models use MSE loss with batch size 32. TABLE S2: Training hyperparameters for baseline and proposed models. UNet / IMUNet / DAE / MECGE UNet-Mamba DRNN / DR-net-S2 (ours) Optimizer Adam AdamW Adam Learning rate 10â310^-3 10â410^-4 8Ă10â48Ă 10^-4 LR scheduler ReduceLROnPlateau Exp. decay Cosine + warmup Warmup epochs â â 10 TmaxT_ (cosine) â â 400 ηmin _ â â 10â610^-6 Max epochs 500 120 500 ES patience 120â240 15 120â240 A-F Training Convergence All models converge well before the maximum number of epochs, with test SNR curves reaching a stable plateau. Figure S3 shows the train loss and test SNR across all three datasets. Fig. S3: Training loss (top row) and test SNR (bottom row) over training steps across all three datasets: (A) European ST-T, (B) synthetic, (C) PTB-XL. Stage 1 models on the left of each panel; Stage 2 (DR-net) on the right. Appendix B Supplementary Materials B-A PTB-XL The waveform data underlying PTB-XL were collected with devices from Schiller AG at the Physikalisch-Technische Bundesanstalt over nearly seven years (October 1989âJune 1996). The cohort is 52% male and 48% female, with ages spanning 0â95 years (median 62, interquartile range 22). Signals are stored in WFDB format at 16-bit precision with a resolution of 1 ÎŒ /LSB. Each record was annotated with a free-text report converted into standardized SCP-ECG statements; a large fraction was additionally validated by a second cardiologist. The recommended 10-fold splits are stratified by patient. Records in folds 9 and 10 underwent at least one human evaluation and are therefore of particularly high label quality. For full details, see [54]. B-B Synthetic ECG Parameters Table S3 lists the morphology parameters used for synthetic ECG generation, following the notation of [42]. For each waveform event iâP,Q,R,S,Tiâ\P,Q,R,S,T\, the amplitude aia_i is sampled uniformly from [caiâÎŽai,cai+ÎŽai][c_a_i- _a_i,\,c_a_i+ _a_i] and the width bib_i from [cbiâÎŽbi,cbi+ÎŽbi][c_b_i- _b_i,\,c_b_i+ _b_i]. TABLE S3: Synthetic ECG simulation parameters for the PQRST morphology. P Q R S T caic_a_i 1.2 â5.0-5.0 30.0 â7.5-7.5 0.75 ÎŽai _a_i 0.6 0.2 0.0 1.0 0.35 cbic_b_i 0.25 0.1 0.1 0.1 0.4 ÎŽbi _b_i 0.1 0.1 0.0 0.0 0.0 B-C Noise Pipeline Validation We validated the noise injection pipeline by loading 1,000 preprocessed PTB-XL segments and applying the full noise pipeline under three configurations (light, medium, strong), corresponding to the upper bound, midpoint, and lower bound of the per-type SNR ranges recommended by [58]. The theoretical combined SNR when K independent noise sources are added simultaneously is: SNRcombined=10âlog10âĄ(1âk=1K10âSNRk/10).SNR_combined=10 _10 ( 1 _k=1^K10^-SNR_k/10 ). (2) Table S4 summarizes the per-type SNR values and predicted combined SNR for each configuration. Figure S4 shows that the empirical medians closely match the theoretical predictions and the ordering across configurations is preserved. TABLE S4: Noise configurations. Per-type SNR values (dB) are drawn from ranges recommended by [58]. Config BW MA EM AWGN Combined SNR Light 5.0 10.0 15.0 25.0 3.46 Medium 2.5 7.5 12.5 22.5 0.96 Strong 0.0 5.0 10.0 20.0 â1.54-1.54 Fig. S4: Empirical vs. theoretical SNR (left) and RMSE (right) across three noise configurations. Boxplots show per-segment distributions; dashed lines indicate theoretical expected values. Appendix C Supplementary Results C-A Downstream Classifier Architectures The two downstream classification models are: Inception1D: a 1D adaptation of InceptionTime [61], stacking six inception blocks with multi-scale parallel convolutions and residual shortcuts every three blocks, followed by adaptive concatenation pooling and a linear head. ResNet1D-Wang: a 1D residual network following [62], with three single-block residual stages using kernel sizes 5 and 3, stride-1 convolutions, and the same adaptive concatenation pooling and linear head as Inception1D. Both models are trained using binary cross-entropy loss on clean data from the PTB-XL training folds and accept 12-channel inputs with an independent binary prediction per diagnostic class. C-B Recording-Length Experiment: Training Details Tables S5 and S6 summarize the number of epochs and wall-clock training time per curriculum stage on the synthetic and European ST-T datasets, respectively. Figures S5 and S6 show the corresponding train loss curves. TABLE S5: Training details for the synthetic dataset across split lengths. Trained on a single NVIDIA RTX A5000. Method Split Length Epochs Runtime UNet-Mamba1-3B 14400 180 41m 45s UNet-Mamba1-3B 7200 256 1h 4m 52s UNet-Mamba1-3B 3600 250 1h 50m 39s UNet-Mamba1-3B 1800 286 7h 18m 38s UNet 14400 102 12m 33s UNet 7200 105 21m 22s UNet 3600 108 38m 26s UNet 1800 245 5h 42m 15s TABLE S6: Training details for the European ST-T dataset across split lengths. Trained on a single NVIDIA RTX A5000. Method Split Length Epochs Runtime UNet-Mamba1-3B 14400 263 32m 13s UNet-Mamba1-3B 7200 285 39m 44s UNet-Mamba1-3B 3600 274 1h 7m 7s UNet-Mamba1-3B 1800 113 1h 34m 27s UNet 14400 257 17m 13s UNet 7200 206 21m 56s UNet 3600 334 1h 4m UNet 1800 306 3h 32m 46s Fig. S5: Train loss curves for the recording-length experiment on the synthetic dataset. Fig. S6: Train loss curves for the recording-length experiment on the European ST-T dataset. C-C Effect of Training Data Volume Figure S7 shows reconstruction SNR and RMSE on PTB-XL as a function of the number of training folds. Mamba-based models improve monotonically up to 8 folds, whereas UNet and IMUNet peak at 6 folds and slightly degrade with additional data, suggesting that the higher capacity of the Mamba bottleneck allows it to continue benefiting from additional training data where purely convolutional models saturate earlier. Fig. S7: Reconstruction SNR (top) and RMSE (bottom) on PTB-XL as a function of the number of training folds. C-D Reconstruction RMSE Figure S8 reports reconstruction RMSE across all three datasets, supplementing the SNR results in Figure 3. Fig. S8: Reconstruction RMSE on synthetic (A), PTB-XL (B), and European ST-T (C) datasets. Empirical noisy SNR = 0.96 dB (medium noise setting, see Supplementary Material B-C). This figure supplements Figure 3. C-E Pairwise Tests for Reconstruction SNR Table S7 shows the pairwise comparison between the proposed models and each baseline model on the synthetic test set along with the 95% confidence intervals. Table S8 gives the results of the same evaluation on the PTB-XL dataset, and Table S9 on the ST-T dataset. On all three datasets, the confidence intervals do not contain 0, implying a significant difference (at α=0.05α=0.05 level) between the baseline models and the proposed models. TABLE S7: Pairwise comparison with 95% confidence intervals for the synthetic test set (n=256n=256 source recordings). DR-net Mamba1-3B outperforms every baseline (smallest gain +0.92+0.92 dB SNR over DR-net-IMUNet, CI [+0.79,+1.06][+0.79,+1.06]). See Figure 3a. Baseline UNet Mamba1-3B DR-net Mamba1-3B DRNN +11.922â[+11.761,+12.098]+11.922\ [+11.761,+12.098] +12.546â[+12.355,+12.720]+12.546\ [+12.355,+12.720] DAE +6.657â[+6.492,+6.811]+6.657\ [+6.492,+6.811] +7.281â[+7.116,+7.440]+7.281\ [+7.116,+7.440] UNet +2.551â[+2.414,+2.699]+2.551\ [+2.414,+2.699] +3.175â[+3.025,+3.332]+3.175\ [+3.025,+3.332] DR-net-UNet +2.538â[+2.386,+2.682]+2.538\ [+2.386,+2.682] +3.162â[+3.015,+3.316]+3.162\ [+3.015,+3.316] IMUNet +1.172â[+1.019,+1.309]+1.172\ [+1.019,+1.309] +1.796â[+1.646,+1.954]+1.796\ [+1.646,+1.954] DR-net-IMUNet +0.294â[+0.148,+0.440]+0.294\ [+0.148,+0.440] +0.918â[+0.785,+1.060]+0.918\ [+0.785,+1.060] MECGE +8.194â[+8.002,+8.400]+8.194\ [+8.002,+8.400] +8.818â[+8.623,+9.049]+8.818\ [+8.623,+9.049] UNet Mamba1-3B â +0.624â[+0.573,+0.674]+0.624\ [+0.573,+0.674] DR-net Mamba1-3B â0.624â[â0.674,â0.573]-0.624\ [-0.674,-0.573] â TABLE S8: Pairwise comparison with 95% confidence intervals for PTB-XL (n=1,639n=1,639 recordings, 10 s each at 360 Hz). DR-net Mamba1-3B outperforms every baseline (smallest gain +0.83+0.83 dB SNR over DR-net-IMUNet, CI [+0.78,+0.88][+0.78,+0.88]). See Figure 3b. Baseline UNet Mamba1-3B DR-net Mamba1-3B DRNN +3.955â[+3.889,+4.019]+3.955\ [+3.889,+4.019] +4.854â[+4.785,+4.926]+4.854\ [+4.785,+4.926] DAE +4.385â[+4.297,+4.473]+4.385\ [+4.297,+4.473] +5.284â[+5.193,+5.382]+5.284\ [+5.193,+5.382] UNet +2.409â[+2.359,+2.460]+2.409\ [+2.359,+2.460] +3.308â[+3.244,+3.366]+3.308\ [+3.244,+3.366] DR-net-UNet +0.206â[+0.162,+0.252]+0.206\ [+0.162,+0.252] +1.105â[+1.062,+1.148]+1.105\ [+1.062,+1.148] IMUNet +1.063â[+1.020,+1.104]+1.063\ [+1.020,+1.104] +1.962â[+1.911,+2.016]+1.962\ [+1.911,+2.016] DR-net-IMUNet â0.070â[â0.116,â0.022]-0.070\ [-0.116,-0.022] +0.828â[+0.778,+0.882]+0.828\ [+0.778,+0.882] MECGE +1.485â[+1.395,+1.579]+1.485\ [+1.395,+1.579] +2.384â[+2.299,+2.475]+2.384\ [+2.299,+2.475] UNet Mamba1-3B â +0.899â[+0.868,+0.930]+0.899\ [+0.868,+0.930] DR-net Mamba1-3B â0.899â[â0.930,â0.868]-0.899\ [-0.930,-0.868] â TABLE S9: Pairwise comparison with 95% confidence intervals for the ST-T database (n=256n=256 recordings, 40 s). DR-net Mamba1-3B outperforms every baseline (smallest gain +0.34+0.34 dB SNR over DR-net-IMUNet, CI [+0.20,+0.49][+0.20,+0.49]). See Figure 3c. Baseline UNet Mamba1-3B DR-net Mamba1-3B DRNN +3.650â[+3.489,+3.813]+3.650\ [+3.489,+3.813] +4.878â[+4.712,+5.055]+4.878\ [+4.712,+5.055] DAE +4.966â[+4.801,+5.113]+4.966\ [+4.801,+5.113] +6.194â[+6.014,+6.380]+6.194\ [+6.014,+6.380] UNet +2.078â[+1.940,+2.226]+2.078\ [+1.940,+2.226] +3.307â[+3.157,+3.453]+3.307\ [+3.157,+3.453] DR-net-UNet â0.784â[â0.930,â0.622]-0.784\ [-0.930,-0.622] +0.445â[+0.315,+0.592]+0.445\ [+0.315,+0.592] IMUNet +1.391â[+1.232,+1.550]+1.391\ [+1.232,+1.550] +2.619â[+2.428,+2.815]+2.619\ [+2.428,+2.815] DR-net-IMUNet â0.887â[â1.045,â0.713]-0.887\ [-1.045,-0.713] +0.342â[+0.198,+0.493]+0.342\ [+0.198,+0.493] MECGE +0.085â[â0.085,+0.261]+0.085\ [-0.085,+0.261] +1.313â[+1.138,+1.472]+1.313\ [+1.138,+1.472] UNet Mamba1-3B â +1.229â[+1.130,+1.331]+1.229\ [+1.130,+1.331] DR-net Mamba1-3B â1.229â[â1.331,â1.130]-1.229\ [-1.331,-1.130] â C-F Impact of Compression Layer in Reconstruction Accuracy TABLE S10: Ablation study separating the effects of Mamba, DR-net, and log compression. Mean differences and 95% confidence intervals are reported from paired bootstrap analysis with B=1000B=1000 resamples with replacement. Baseline UNet DR-net- UNet UNet Mamba1-3B (No Comp) DR-net Mamba1-3B (No Comp) UNet Mamba1-3B DR-net Mamba1-3B UNet â +2.9+2.9 [+2.7,+3.0][+2.7,+3.0] +1.2+1.2 [+1.1,+1.3][+1.1,+1.3] +3.3+3.3 [+3.2,+3.4][+3.2,+3.4] +2.1+2.1 [+1.9,+2.2][+1.9,+2.2] +3.3+3.3 [+3.2,+3.5][+3.2,+3.5] DR-net- UNet â â1.6-1.6 [â1.8,â1.5][-1.8,-1.5] +0.5+0.5 [+0.3,+0.6][+0.3,+0.6] â0.8-0.8 [â0.9,â0.6][-0.9,-0.6] +0.4+0.4 [+0.3,+0.6][+0.3,+0.6] UNet Mamba1-3B (No Comp) â +2.1+2.1 [+2.0,+2.2][+2.0,+2.2] +0.9+0.9 [+0.7,+1.0][+0.7,+1.0] +2.1+2.1 [+1.9,+2.2][+1.9,+2.2] DR-net Mamba1-3B (No Comp) â â1.2-1.2 [â1.4,â1.1][-1.4,-1.1] â0.0-0.0 [â0.1,+0.1][-0.1,+0.1] UNet Mamba1-3B â +1.2+1.2 [+1.1,+1.3][+1.1,+1.3] C-G Downstream Classification under Lower Noise Table S11 reports the per-type SNR used for the lower noise setting. Figure S9 shows the corresponding downstream classification results. Table S12 provides the per-superdiagnostic-class AUROC breakdown, and Table S13 reports macro sensitivity, specificity, and F1 for Inception1D. Relative model rankings are consistent with the strong noise setting. TABLE S11: Per-type SNR (dB) for the lower (medium) downstream noise setting. BW MA EM AWGN 2.5 7.5 12.5 22.5 Fig. S9: Downstream diagnostic classification (macro and superdiagnostic AUROC) on PTB-XL under the lower noise setting, using Inception1D and ResNet1D-Wang. TABLE S12: Per-superdiagnostic-class AUROC on PTB-XL (lower noise, Inception1D). Bold/underlined: best/second-best. CD HYP MI NORM STTC UNet Mamba1-3B .926 ± .02 .888 ± .02 .916 ± .01 .931 ± .01 .888 ± .02 DRNET Mamba1-3B .927 ± .02 .895 ± .02 .915 ± .02 .933 ± .01 .889 ± .02 UNet Mamba1-3B (LS) .924 ± .01 .894 ± .02 .918 ± .02 .935 ± .01 .899 ± .02 DRNN .911 ± .01 .887 ± .02 .903 ± .01 .919 ± .01 .857 ± .02 DAE .863 ± .02 .853 ± .02 .886 ± .02 .909 ± .01 .859 ± .02 UNet .919 ± .01 .877 ± .02 .913 ± .01 .926 ± .01 .881 ± .02 DRNET-UNet .917 ± .02 .886 ± .02 .909 ± .02 .927 ± .01 .881 ± .02 IMUNet .922 ± .02 .883 ± .02 .910 ± .01 .929 ± .01 .886 ± .02 DRNET-IMUNet .919 ± .01 .892 ± .02 .909 ± .02 .928 ± .01 .887 ± .02 MECGE .916 ± .02 .883 ± .03 .903 ± .01 .924 ± .01 .888 ± .02 clean .932 ± .01 .906 ± .02 .925 ± .02 .938 ± .01 .914 ± .02 noisy .919 ± .02 .881 ± .02 .887 ± .02 .923 ± .01 .896 ± .02 TABLE S13: Macro-averaged sensitivity, specificity, and F1 on PTB-XL (lower noise, Inception1D). Bold/underlined: best/second-best. Sensitivity Specificity F1 UNet Mamba1-3B (ours) .785 ± .02 .862 ± .01 .723 ± .01 DRNET Mamba1-3B (ours) .788 ± .02 .865 ± .01 .727 ± .01 UNet Mamba1-3B (Lead aware) (ours) .791 ± .02 .861 ± .01 .725 ± .01 DAE .698 ± .02 .846 ± .01 .653 ± .02 DRNN .784 ± .02 .819 ± .01 .682 ± .02 MECGE .760 ± .02 .846 ± .01 .693 ± .02 UNet .748 ± .02 .854 ± .01 .691 ± .02 DRNET-UNet .774 ± .02 .859 ± .01 .711 ± .02 IMUNet .753 ± .02 .864 ± .01 .703 ± .02 DRNET-IMUNet .777 ± .02 .864 ± .01 .717 ± .02 noisy .857 ± .01 .757 ± .01 .670 ± .02 clean .815 ± .02 .863 ± .01 .738 ± .01 C-H Downstream Macro Results for ResNet1D-Wang Table S14 reports macro-averaged sensitivity, specificity, and F1 for the ResNet1D-Wang classifier under the strong noise setting, complementing the Inception1D results in the main text. TABLE S14: Macro-averaged sensitivity, specificity, and F1 on PTB-XL (strong noise, ResNet1D-Wang). Bold/underlined: best/second-best. Sensitivity Specificity F1 UNet Mamba1-3B (ours) .797 ± .02 .853 ± .01 .722 ± .01 DRNET Mamba1-3B (ours) .800 ± .02 .858 ± .01 .727 ± .02 UNet Mamba1-3B (Lead Specific) (ours) .798 ± .02 .858 ± .01 .728 ± .02 DAE .733 ± .02 .831 ± .01 .668 ± .02 DRNN .787 ± .02 .808 ± .01 .679 ± .02 MECGE .786 ± .02 .826 ± .01 .691 ± .02 UNet .757 ± .02 .839 ± .01 .681 ± .02 DRNET-UNet .772 ± .02 .841 ± .01 .693 ± .02 IMUNet .771 ± .02 .852 ± .01 .707 ± .02 DRNET-IMUNet .781 ± .02 .856 ± .01 .713 ± .02 noisy .831 ± .02 .741 ± .01 .652 ± .02 clean .808 ± .02 .875 ± .01 .746 ± .02 C-I Downstream Macro Results for Inception1D Figure S10 summarizes downstream classification performance on PTB-XL under the strong noise setting (BW 0dâBdB; MA 5dâBdB; EM 10dâBdB; AWGN 20dâBdB) using the Inception1D backbone. Fig. S10: Downstream diagnostic classification (macro and superdiagnostic AUROC) on PTB-XL using Inception1D, comparing denoised signals against clean and noisy baselines (strong noise setting). C-J Superdiagnostic Sensitivity, Specificity, and F1 Tables S15 and S16 report per-superdiagnostic-class sensitivity, specificity, and F1 under the strong noise setting for Inception1D and ResNet1D-Wang, respectively. TABLE S15: Per-superdiagnostic-class sensitivity, specificity, and F1 on PTB-XL (strong noise, Inception1D). Bold/underlined: best/second-best. CD HYP MI NORM STTC Sensitivity UNet-Mamba1-3B .822 ± .03 .526 ± .05 .865 ± .03 .918 ± .02 .792 ± .03 DR-net-Mamba1-3B .834 ± .04 .534 ± .05 .854 ± .04 .917 ± .02 .801 ± .04 UNet-Mamba1-3B (LS) .816 ± .03 .556 ± .05 .815 ± .03 .943 ± .01 .824 ± .04 DAE .640 ± .05 .299 ± .07 .889 ± .03 .891 ± .02 .769 ± .04 DRNN .822 ± .03 .489 ± .06 .887 ± .03 .863 ± .03 .860 ± .03 MECGE .796 ± .03 .440 ± .05 .850 ± .03 .920 ± .02 .792 ± .04 UNet .778 ± .03 .351 ± .06 .872 ± .03 .920 ± .02 .818 ± .04 DR-net-UNet .816 ± .03 .496 ± .06 .835 ± .04 .887 ± .02 .833 ± .03 IMUNet .794 ± .03 .407 ± .05 .874 ± .03 .916 ± .02 .773 ± .04 DR-net-IMUNet .814 ± .03 .526 ± .05 .841 ± .04 .895 ± .03 .809 ± .04 noisy .871 ± .03 .642 ± .06 .891 ± .02 .939 ± .02 .941 ± .02 clean .846 ± .03 .627 ± .05 .807 ± .04 .946 ± .01 .847 ± .03 Specificity UNet-Mamba1-3B .902 ± .01 .964 ± .01 .803 ± .02 .783 ± .03 .860 ± .02 DR-net-Mamba1-3B .905 ± .01 .963 ± .01 .819 ± .02 .785 ± .03 .851 ± .02 UNet-Mamba1-3B (LS) .899 ± .01 .956 ± .01 .847 ± .02 .763 ± .03 .840 ± .02 DAE .945 ± .01 .990 ± .00 .728 ± .02 .757 ± .03 .809 ± .02 DRNN .873 ± .01 .969 ± .01 .730 ± .03 .825 ± .02 .697 ± .02 MECGE .889 ± .02 .972 ± .01 .778 ± .02 .767 ± .03 .824 ± .02 UNet .927 ± .01 .984 ± .01 .796 ± .02 .767 ± .02 .794 ± .02 DR-net-UNet .901 ± .01 .968 ± .01 .826 ± .02 .809 ± .02 .789 ± .02 IMUNet .916 ± .01 .972 ± .01 .790 ± .02 .774 ± .02 .869 ± .02 DR-net-IMUNet .898 ± .02 .965 ± .01 .814 ± .02 .815 ± .02 .829 ± .02 noisy .819 ± .02 .915 ± .02 .687 ± .02 .724 ± .03 .642 ± .02 clean .887 ± .02 .936 ± .01 .881 ± .01 .765 ± .03 .846 ± .02 F1 UNet-Mamba1-3B .765 ± .03 .591 ± .04 .705 ± .03 .839 ± .02 .713 ± .03 DR-net-Mamba1-3B .776 ± .03 .596 ± .04 .714 ± .03 .839 ± .02 .710 ± .03 UNet-Mamba1-3B (LS) .758 ± .03 .596 ± .05 .718 ± .03 .843 ± .02 .712 ± .04 DAE .703 ± .04 .436 ± .07 .659 ± .03 .812 ± .02 .653 ± .03 DRNN .733 ± .03 .572 ± .05 .659 ± .03 .829 ± .02 .617 ± .03 MECGE .735 ± .03 .539 ± .05 .677 ± .03 .833 ± .02 .680 ± .03 UNet .770 ± .03 .480 ± .06 .704 ± .03 .832 ± .02 .668 ± .03 DR-net-UNet .761 ± .03 .577 ± .05 .710 ± .03 .835 ± .02 .672 ± .03 IMUNet .765 ± .03 .508 ± .05 .699 ± .03 .834 ± .02 .711 ± .04 DR-net-IMUNet .755 ± .03 .594 ± .05 .703 ± .03 .842 ± .02 .693 ± .03 noisy .704 ± .04 .574 ± .05 .631 ± .03 .823 ± .02 .619 ± .03 clean .761 ± .03 .604 ± .05 .747 ± .03 .845 ± .02 .730 ± .03 TABLE S16: Per-superdiagnostic-class sensitivity, specificity, and F1 on PTB-XL (strong noise, ResNet1D-Wang). Bold/underlined: best/second-best. CD HYP MI NORM STTC Sensitivity UNet-Mamba1-3B .784 ± .03 .515 ± .06 .898 ± .02 .942 ± .02 .786 ± .03 DR-net-Mamba1-3B .784 ± .03 .522 ± .07 .870 ± .03 .931 ± .02 .794 ± .04 UNet-Mamba1-3B (LS) .780 ± .03 .541 ± .06 .841 ± .03 .961 ± .01 .803 ± .04 DAE .667 ± .04 .347 ± .06 .894 ± .03 .915 ± .02 .756 ± .04 DRNN .762 ± .03 .507 ± .06 .902 ± .02 .898 ± .03 .850 ± .03 MECGE .774 ± .03 .440 ± .05 .896 ± .03 .942 ± .02 .780 ± .04 UNet .760 ± .03 .362 ± .06 .906 ± .03 .931 ± .02 .822 ± .03 DR-net-UNet .766 ± .04 .451 ± .06 .887 ± .04 .907 ± .02 .807 ± .04 IMUNet .743 ± .03 .429 ± .06 .904 ± .02 .932 ± .02 .771 ± .04 DR-net-IMUNet .764 ± .03 .478 ± .06 .874 ± .04 .929 ± .02 .786 ± .04 noisy .808 ± .03 .627 ± .05 .896 ± .03 .939 ± .01 .915 ± .03 clean .820 ± .03 .604 ± .06 .807 ± .04 .959 ± .02 .848 ± .04 Specificity UNet-Mamba1-3B .924 ± .01 .968 ± .01 .794 ± .02 .788 ± .02 .885 ± .02 DR-net-Mamba1-3B .924 ± .01 .964 ± .01 .812 ± .02 .793 ± .03 .875 ± .02 UNet-Mamba1-3B (LS) .925 ± .01 .960 ± .01 .845 ± .02 .767 ± .03 .874 ± .02 DAE .938 ± .01 .988 ± .00 .699 ± .02 .766 ± .03 .855 ± .02 DRNN .925 ± .01 .970 ± .01 .751 ± .02 .824 ± .02 .756 ± .03 MECGE .905 ± .01 .974 ± .01 .757 ± .02 .768 ± .02 .869 ± .02 UNet .935 ± .01 .989 ± .01 .766 ± .02 .788 ± .02 .840 ± .02 DR-net-UNet .932 ± .01 .972 ± .01 .770 ± .02 .825 ± .02 .835 ± .02 IMUNet .930 ± .01 .978 ± .01 .763 ± .02 .800 ± .02 .890 ± .01 DR-net-IMUNet .921 ± .01 .971 ± .01 .792 ± .02 .821 ± .02 .872 ± .02 noisy .879 ± .02 .934 ± .01 .693 ± .02 .767 ± .02 .693 ± .02 clean .911 ± .01 .943 ± .01 .881 ± .01 .776 ± .02 .865 ± .02 F1 UNet-Mamba1-3B .769 ± .03 .591 ± .06 .715 ± .03 .854 ± .02 .735 ± .03 DR-net-Mamba1-3B .770 ± .03 .588 ± .06 .716 ± .03 .850 ± .02 .729 ± .03 UNet-Mamba1-3B (LS) .769 ± .03 .593 ± .05 .730 ± .03 .854 ± .02 .734 ± .03 DAE .712 ± .03 .486 ± .07 .641 ± .03 .829 ± .02 .687 ± .03 DRNN .758 ± .03 .591 ± .05 .683 ± .03 .848 ± .02 .655 ± .03 MECGE .740 ± .04 .544 ± .05 .684 ± .03 .845 ± .02 .715 ± .04 UNet .768 ± .04 .503 ± .05 .696 ± .03 .848 ± .02 .711 ± .03 DR-net-UNet .769 ± .03 .548 ± .06 .690 ± .03 .853 ± .02 .698 ± .04 IMUNet .753 ± .03 .542 ± .05 .693 ± .03 .855 ± .01 .731 ± .04 DR-net-IMUNet .754 ± .03 .568 ± .06 .701 ± .03 .863 ± .02 .722 ± .03 noisy .731 ± .03 .600 ± .05 .638 ± .03 .843 ± .02 .641 ± .04 clean .775 ± .03 .603 ± .05 .747 ± .03 .857 ± .02 .750 ± .04 C-K Per-Class Downstream Classification (ResNet1D-Wang) Figure S11 shows the per-diagnostic-class AUROC breakdown using ResNet1D-Wang, analogous to Figure 7 in the main text. Panel (A) shows the AUROC delta when adding a Mamba bottleneck; panel (B) shows absolute AUROC of the lead-specific UNet-Mamba. Fig. S11: Per-diagnostic-class downstream AUROC (ResNet1D-Wang). (A) AUROC delta when adding a Mamba bottleneck to the UNet, all other design choices held constant. (B) Absolute AUROC of the lead-specific UNet-Mamba; color indicates improvement over the noisy baseline. In both panels, diagnostic classes with fewer than five segments are omitted. See Table S17 for abbreviations. C-L Diagnostic Abbreviations The diagnostic class abbreviations used in Figures 7 and S11 are listed in Table S17. TABLE S17: ECG Form Statement Labels Abbreviation Description NDT non-diagnostic T abnormalities NST_ non-specific ST changes DIG digitalis-effect LNGQT long QT-interval NORM normal ECG IMI inferior myocardial infarction ASMI anteroseptal myocardial infarction LVH left ventricular hypertrophy LAFB left anterior fascicular block ISC_ non-specific ischemic IRBBB incomplete right bundle branch block 1AVB first degree AV block IVCD non-specific intraventricular conduction disturbance (block) ISCAL ischemic in anterolateral leads CRBBB complete right bundle branch block CLBBB complete left bundle branch block ILMI inferolateral myocardial infarction LAO/LAE left atrial overload/enlargement AMI anterior myocardial infarction ALMI anterolateral myocardial infarction ISCIN ischemic in inferior leads INJAS subendocardial injury in anteroseptal leads LMI lateral myocardial infarction ISCIL ischemic in inferolateral leads LPFB left posterior fascicular block ISCAS ischemic in anteroseptal leads INJAL subendocardial injury in anterolateral leads ISCLA ischemic in lateral leads RVH right ventricular hypertrophy ANEUR ST-T changes compatible with ventricular aneurysm RAO/RAE right atrial overload/enlargement EL electrolytic disturbance or drug (former EDIS) WPW Wolff-Parkinson-White syndrome ILBBB incomplete left bundle branch block IPLMI inferoposterolateral myocardial infarction ISCAN ischemic in anterior leads IPMI inferoposterior myocardial infarction SEHYP septal hypertrophy INJIN subendocardial injury in inferior leads INJLA subendocardial injury in lateral leads PMI posterior myocardial infarction 3AVB third degree AV block INJIL subendocardial injury in inferolateral leads 2AVB second degree AV block C-M STTC and CD diagnostic morphologies and The Mamba Bottleneck Table S18 shows a comparison of STTC and CD diagnostic morphologies and their interaction with the Mamba bottleneck. TABLE S18: Comparison of STTC and CD diagnostic morphologies and their interaction with the Mamba bottleneck. STTC CD Temporal scale Broad (200â400 ms) Narrow (R-peak time 45â60 ms) Bottleneck steps spanned âŒ4 4â7 âŒ1 1 Frequency content Low High Context needed Global (baseline-relative) Local (QRS-internal) Mamba effect on denoising Better noise/signal separation Over-smoothing of sharp features