Source-linked AI summary

AF-Mamba: Efficient Long-Term Signal Modeling for Early Prediction of Atrial Fibrillation Onset

Yongbin Lee, Ki H. Chon

arXiv:2609.06984v1cs.LG

TL;DR

AF prediction before onset could provide lead time for assessment, but ambulatory monitoring mainly detects AF after onset. AF-Mamba combines TCN local feature extraction with Mamba long-range sequence modeling for one-hour-ahead prediction from RRI inputs. It achieved strong subject-wise performance and retained discrimination across held-out AF and NSR datasets.

  • Problem

    Ambulatory monitoring approaches primarily detect AF after onset, while prediction before onset could provide lead time for closer monitoring and timely assessment.

    Source: §I · p. 1
  • Method

    AF-Mamba combines TCN-based local feature extraction with Mamba-based long-range modeling to predict AF one hour in advance from long-duration RRI inputs.

    Source: §VIII · p. 10
  • Results

    0.974 AUROC was achieved under subject-wise evaluation, and meaningful discrimination was retained when both AF and NSR source datasets were unseen during model development.

    Source: §VI · p. 9, §VIII · p. 10
  • Takeaways & Limitations

    AF-Mamba provides a favorable balance among predictive performance, parameter count, computational complexity, and inference latency for long RRI sequences.

    Source: §VI · p. 9

    AF and NSR windows came from different source databases, so residual dataset-specific confounding cannot be fully excluded; prospective validation and possible recalibration are needed before clinical deployment.

    Source: §VII · pp. 9–10

Abstract

from arXiv · show

Atrial fibrillation (AF) is the most common cardiac arrhythmia and is associated with increased risks of stroke and heart failure. The growing availability of wearable and portable ECG monitoring enables continuous assessment of cardiac rhythm outside clinical settings. Predicting AF before its onset could provide additional lead time for timely clinical assessment and potentially improve the management of patients at risk of AF-related complications. This study focuses on predicting AF onset one hour in advance using long-term RR intervals (RRIs). To address this challenge, we propose a deep learning architecture that integrates temporal convolutional networks (TCNs) for local features encoding with Mamba, a selective state-space model capable of long-range sequence modeling. This hybrid TCN-Mamba design enables efficient training and inference on one-hour input windows, overcoming limitations of Transformers' quadratic scaling and recurrent networks' vanishing gradients. In subject-wise 5-fold testing, the proposed model achieved a sensitivity of 0.889, specificity of 0.943, F1-score of 0.813, AUROC of 0.974, and AUPRC of 0.933. In paired cross-dataset holdout evaluation, AF-Mamba maintained discriminative performance across unseen AF and NSR datasets, achieving a mean AUROC of 0.897. Compared against state-of-the-art AF prediction models and general time-series models, AF-Mamba achieved competitive predictive performance while providing a favorable performance-efficiency trade-off for long RRI sequences. These findings demonstrate the potential of AF-Mamba for accurate AF prediction one hour in advance and real-time continuous ambulatory monitoring.

I. INTRODUCTION

AF’s health risks and the prevalence of asymptomatic cases motivate prediction before onset, while existing ambulatory monitoring largely detects AF after it begins. AF-Mamba combines TCN-based local feature extraction with Mamba-based long-range modeling for one-hour-ahead prediction from long-duration RRI inputs.

I. INTRODUCTION

  • AF is associated with increased risks of stroke, heart failure, and other cardiovascular complications.It is also identified as a risk factor for cognitive decline and dementia.Source: §I · p. 1
  • Up to 40% of diagnosed AF cases are asymptomatic, and asymptomatic patients may be less likely to receive timely therapy.They have also been shown to exhibit a higher risk of progression to permanent AF than symptomatic patients.Source: §I · p. 1
  • Existing ambulatory monitoring primarily detects AF after onset, motivating approaches that predict impending AF from long-duration signals.Prediction could provide lead time for closer monitoring and timely assessment.Source: §I · p. 1
  • TCN causal dilated convolutions expand the receptive field while preventing future-information leakage, whereas Mamba is presented as enabling efficient long-range sequence modeling.The approach addresses limitations described for RNNs and Transformers: vanishing gradients and quadratic computational time, respectively.Source: §I · pp. 1–2
  • AF-Mamba combines TCN local feature extraction and Mamba long-range modeling to predict AF one hour in advance from long-duration RRI inputs.The study evaluates it on five public Holter/ambulatory RRI datasets against AF-prediction and time-series classification models.Source: §I · p. 2

II. PROBLEM DESCRIPTION

The problem is to distinguish pre-AF RRI patterns from NSR patterns that can also be irregular; the selected input is the hour from two to one hours before AF onset. The study’s AF and NSR cohorts were drawn from five long-term Holter or ambulatory datasets and selected using eligibility criteria.

II. PROBLEM DESCRIPTION

  • Irregular RRI patterns can appear in NSR, resembling pre-AF activity, while the earlier pre-AF segment has fewer ectopic beats than the NSR segment.This illustrates why ectopic activity alone may not distinguish pre-AF from NSR.Source: §II · p. 2, Figure 1 · p. 2
  • The model uses 1-hour RRI segments from 2 hours to 1 hour before AF onset, defining a 1-hour prediction horizon.RRI represents the time between consecutive ECG R-peaks and provides a compact representation of cardiac dynamics.Source: §II · p. 2

A. Dataset Sources and Cohort Selection

  • The study used five long-term Holter or ambulatory RRI datasets, with 160 eligible AF subjects and 72 NSR subjects in the final cohorts.AF subjects required an identifiable onset preceded by eligible NSR rhythm and at least 2 hours of continuous pre-AF RRI data.Source: A. Dataset Sources and Cohort Selection · pp. 2–3

B. Window Extraction and Data Splitting

The study formed non-overlapping one-hour RRI windows and separated subjects—not just windows—across training, validation, and test sets. AF inputs came from the hour two to one hours before onset; NSR recordings were segmented and filtered to form eligible windows.

B. Window Extraction and Data Splitting

  • AF inputs were 1-hour segments from 2 to 1 hours before onset; NSR recordings were split at RR intervals over 10 s, short segments excluded, and remaining data divided into non-overlapping 1-hour windows.RR intervals outside 0.2–5 s were removed, and signals were interpolated at 1 Hz using cubic spline interpolation.Source: B. Window Extraction and Data Splitting · p. 3
  • The resulting dataset contained 256 pre-AF windows from 160 AF subjects and 1,326 NSR windows from 72 NSR subjects.The pre-AF windows came from IRIDIA-AF, LTAF, and MIT-BIH AF; NSR windows came from MIT-BIH NSR and NSR-RR.Source: B. Window Extraction and Data Splitting · p. 3
  • Subject-wise 5-fold cross-validation assigned subjects to mutually exclusive training, validation, and test splits, preventing windows from one subject appearing in multiple splits.Each fold used three groups for training, one for validation, and one for testing.Source: B. Window Extraction and Data Splitting · p. 3

A. Pre-processing

AF-Mamba preprocesses long RRI inputs, extracts local features with residual dilated causal TCN blocks, models long-range dependencies with Mamba, and classifies pooled features as pre-AF or NSR.

A. Pre-processing

  • Preprocessing splits signals at RR intervals over 10 s, discards segments shorter than 1 hour, removes intervals outside 0.2–5 s, and interpolates remaining RRI at 1 Hz.Non-NSR and non-AF rhythm annotations are removed from LTAF and MIT-BIH AF data; only NSR segments before AF onset are used for development.Source: A. Pre-processing · pp. 3–4

B. Local Feature Extraction with Residual TCN Blocks

  • Three residual TCN blocks process the 1 × 3600 RRI input using causal dilated convolutions with dilation rates 1, 2, and 4.The blocks use two kernel-size-3 convolutions each; dilation widens temporal dependencies while causal masking prevents future information from entering.Source: B. Local Feature Extraction with… · p. 4

C. Long-range Modeling with Mamba

  • The Mamba module models long-range dependencies in the TCN feature map, followed by a convolutional FFN and residual normalization stages.Its output retains the 32 × 3600 dimensionality; the FFN uses two 1×3 Conv1D layers.Source: C. Long-range Modeling with Mamba · p. 4

D. Pre-AF Prediction Head

  • Parallel global average and max pooling aggregate encoded temporal patterns into a 64-dimensional vector, which fully connected layers classify as pre-AF or NSR.The first fully connected block reduces the vector to 32 dimensions, and the final layer produces two class outputs followed by softmax.Source: D. Pre-AF Prediction Head · pp. 4–5

E. Training and Evaluation Protocol

The protocol used subject-wise five-fold splits, selected the model using validation loss, and evaluated both predictive performance and deployment-related efficiency. Operating thresholds were set from validation data and additional thresholds characterized the sensitivity–false-alert trade-off.

E. Training and Evaluation Protocol

  • Subjects were assigned to mutually exclusive training, validation, and test groups in five-fold cross-validation, with all windows from each subject kept in one split.The reported metrics are means across the five folds.Source: E. Training and Evaluation Protocol · p. 5
  • Sensitivity, specificity, F1-score, AUROC, and AUPRC assessed classification, while PPV and NPV characterized clinically relevant operating points.F1-score and AUPRC were included to assess minority-class pre-AF classification under dataset imbalance.Source: E. Training and Evaluation Protocol · p. 5
  • Random search explored model and sampling hyperparameters, and the selected model used three TCN blocks, one Mamba block, and 1-Hz RRI sampling.AdamW and Kaiming/He uniform initialization were fixed; the best configuration was selected using validation performance.Source: E. Training and Evaluation Protocol · p. 5, Table II · p. 5
  • The model was selected by lowest validation loss with 10-epoch early stopping; the primary threshold targeted 0.9 validation sensitivity and was held fixed for testing.Efficiency profiling measured parameters, FLOPs, and batch-one inference latency on an A100 GPU.Source: E. Training and Evaluation Protocol · p. 5

F. Additional Validation and Physiological Analyses

AF-Mamba achieved strong subject-wise predictive performance and a favorable efficiency balance for long RRI inputs. Additional evaluations examined input duration, unseen data sources, ectopic activity, RR-irregularity measures, and pre-onset score trajectories.

F. Additional Validation and Physiological Analyses

  • Additional analyses paired unseen AF and NSR datasets for holdout testing, examined ectopy and five RR-irregularity measures, and tracked pre-onset scores in IRIDIA-AF.The paired holdout procedure was repeated across all six AF–NSR dataset pairs.Source: F. Additional Validation and… · pp. 5–6

A. Prediction Performance and Model Comparison

  • AF-Mamba achieved sensitivity 0.889, specificity 0.943, F1-score 0.813, AUROC 0.974, and AUPRC 0.933, with the highest specificity, F1-score, AUROC, and AUPRC among compared models.ResNet1D had AUROC 0.972 and AUPRC 0.905; CNN-BiLSTM had AUROC 0.965 and AUPRC 0.911.Source: A. Prediction Performance and Model… · p. 6, Table III · p. 6
  • For 1-h inputs, AF-Mamba achieved AUPRC 0.933 and AUROC 0.974, and its performance improved progressively from 5 to 60 minutes.It had the highest AUROC and AUPRC at each tested duration, although TCN-Transformer had slightly higher sensitivity at 1 h.Source: A. Prediction Performance and Model… · p. 6
  • AF-Mamba used 34.6 K parameters, 127.0 M FLOPs, and 2.75 ms per inference, balancing model size, computation, and latency.TCN-Transformer and vanilla Transformer required 955.3 M and 1780.5 M FLOPs, respectively; recurrent models had higher reported inference latency.Source: A. Prediction Performance and Model… · pp. 6–7, Table IV · p. 6

B. Cross-Dataset Generalization and Subject-Level Robustness

AF-Mamba retained discrimination across paired unseen AF–NSR dataset combinations, while subject-level averaging produced performance comparable to window-level evaluation. Threshold-dependent metrics varied across held-out sources.

B. Cross-Dataset Generalization and Subject-Level Robustness

  • Across six paired, completely unseen AF–NSR dataset combinations, mean AUROC was 0.897 ± 0.070, ranging from 0.797 to 0.991.Sensitivity ranged from 0.250 to 0.938 and specificity from 0.606 to 1.000; the authors note threshold re-calibration may be needed across data sources or populations.Source: Table V · p. 7, B. Cross-Dataset Generalization and… · p. 7
  • Subject-level averaging yielded AUROC 0.976 versus 0.974 at the window level, with subject-level sensitivity 0.900, specificity 0.986, F1-score 0.944, and AUPRC 0.991.AF subjects contributed an average of 1.60 windows each, compared with 18.42 for NSR subjects.Source: B. Cross-Dataset Generalization and… · p. 7

C. Ectopy and RR-Irregularity Analyses

AF-Mamba discrimination persisted across ectopic-burden strata and after adjustment for measured RR-irregularity. Calibration and operating-point analyses characterize probability agreement and the trade-off between sensitivity and false alerts.

C. Ectopy and RR-Irregularity Analyses

  • Median total ectopic burden was 0.119% in pre-AF windows, compared with 0.041% in NSR-RR and 0.000% in MIT-BIH NSR windows.SDNN and RMSSD were not elevated in the pre-AF windows.Source: C. Ectopy and RR-Irregularity Analyses · p. 7
  • Each 0.1 increase in AF-Mamba score was associated with 2.20-fold higher odds of pre-AF status after adjustment for five RR-irregularity measures.The adjusted OR was 2.20 (95% CI, 1.92–2.52; p < 0.001); the authors report information beyond those measures and ectopic activity.Source: C. Ectopy and RR-Irregularity Analyses · pp. 7–8
  • AUROC was 0.842, 0.854, and 0.933 in low-, moderate-, and high-ectopy groups, respectively, versus 0.887 overall.Discrimination remained substantial in the low-ectopy group.Source: Table VI · p. 7, C. Ectopy and RR-Irregularity Analyses · p. 7

D. Calibration and Operating Point Analysis

  • At the primary operating point, sensitivity was 0.889 ± 0.023 and false-positive burden was 1.369 ± 0.998 alerts per 24 h; stricter false-alert targets reduced sensitivity.Targeting ≤ 0.10 alerts/day yielded sensitivity 0.767 ± 0.070 and specificity 0.994 ± 0.005; targeting ≥0.95 sensitivity yielded 4.272 ± 3.492 alerts/day.Source: D. Calibration and Operating Point… · p. 8
  • The pooled out-of-fold Brier score was 0.041; Fig. 4 plots the reliability curve against a perfect-calibration diagonal.The figure caption identifies the dashed diagonal as perfect calibration.Source: Figure 4 · p. 8

E. Risk Trajectory Analysis

AF-Mamba scores were elevated hours before AF onset and rose modestly as onset approached. The group trajectory was sustained rather than sharply timed, with substantial variation across subjects.

E. Risk Trajectory Analysis

  • Mean AF-Mamba scores were elevated about 8 h before onset and rose from approximately 0.70 to 0.80 as onset approached.The analysis covered 39 eligible episodes from 37 IRIDIA-AF subjects, using each episode’s corresponding held-out fold model.Source: E. Risk Trajectory Analysis · p. 8
  • Scores remained elevated through much of the 8-h pre-AF period rather than increasing sharply immediately before onset.Individual trajectories varied substantially and were sometimes non-monotonic.Source: E. Risk Trajectory Analysis · pp. 8–9
  • The authors interpret the score as sustained pre-AF susceptibility, not a precise estimate that AF will occur exactly 1 h later.Source: E. Risk Trajectory Analysis · p. 9

VI. DISCUSSION

The discussion emphasizes AF-Mamba’s balance of predictive performance and efficiency on long RRI sequences, alongside robustness analyses and limits on interpreting thresholds and risk scores. Its prediction scores may reflect sustained pre-AF susceptibility rather than precise one-hour timing.

VI. DISCUSSION

  • AF-Mamba provides a favorable balance among predictive performance, parameter count, computational complexity, and inference latency, though it is not lowest-cost on every measure.Transformer-based models had substantially greater computational complexity for the 1-h input; deep convolutional models were larger, while recurrent models had relatively high inference latency.Source: §VI · p. 9
  • AF-Mamba processes the entire 1-h RRI sequence end to end, unlike prior approaches using short segments or aggregation across shorter windows.It combines local feature extraction with long-range temporal modeling without intermediate short-window prediction or multi-stage aggregation.Source: §VI · p. 9
  • Meaningful discrimination remained when both AF and NSR source datasets were unseen, while threshold-dependent performance varied and subject-level discrimination was maintained.A threshold from one dataset or population may not transfer directly to another and may require recalibration.Source: §VI · p. 9
  • AF-Mamba retained discrimination among low-ectopy windows and its score remained associated with pre-AF status after adjustment for multiple RR-irregularity measures.The findings suggest the predictions are not fully explained by ectopic burden or the evaluated RR-irregularity features alone.Source: §VI · p. 9
  • Sensitivity and false-alert burden trade off across operating points, while scores may be better read as sustained susceptibility than exact 1-h onset forecasts.Individual risk trajectories showed substantial heterogeneity and non-monotonic variation.Source: §VI · p. 9

VII. LIMITATION

The study reports strong subject-wise AF prediction performance and an efficiency trade-off, but identifies data-source, setting, selection, input, and validation boundaries. Prospective validation is needed before broader clinical application.

VII. LIMITATION

  • Retrospective public datasets with AF and NSR windows from different databases leave residual confounding; thresholds may not transfer, and prospective validation is required before deployment.Recalibration may also be needed across populations or recording environments.Source: §VII · pp. 9–10
  • Evidence primarily concerns ambulatory AF monitoring from Holter or portable recordings; generalizability to other clinical environments remains unestablished.Prospective cohort validation will be important before broader clinical application.Source: §VII · p. 10
  • Strict eligibility criteria may introduce selection bias, and direct ectopy analysis covered only 12 episodes from 9 LTAF subjects because beat-level annotations were unavailable elsewhere.Further validation in larger ectopy-annotated cohorts is needed.Source: §VII · p. 10
  • AF-Mamba uses only RRI inputs and quality-controlled segments, leaving ECG morphology, clinical information, and robustness under noisier real-world conditions unassessed.The authors propose evaluating added ECG or clinical inputs and noisier recordings in future work.Source: §VII · p. 10

VIII. CONCLUSION

  • Sensitivity was 0.889, specificity 0.943, F1-score 0.813, AUROC 0.974, and AUPRC 0.933; inference used 34.6 K parameters, 127.0 M FLOPs, and 2.75 ms.The results were obtained under subject-wise evaluation using strictly non-overlapping 1-h windows.Source: §VIII · p. 10
Loading 2609.06984v1…