03Clinical signalsSubmitted
What atrial fibrillation detectors rely on in 12-lead ECGs
A cross-hospital test of whether a deep AF detector uses atrial activity or only irregular beat timing, measured against a model that sees RR intervals alone.
Manuscript submitted · code archived on Zenodo · 2026
- PTB-XL ECGs, 7.0% AF
- 21,742
- Chapman-Shaoxing ECGs, 18.2% AF
- 9,794
- attribution methods compared
- 6
- seeds per network
- 5
Problem
Deep learning detects atrial fibrillation on the ECG very accurately, but it is not clear what the models rely on: the atrial signs of AF, such as missing P-waves and fibrillatory waves, or the simpler cue of irregular beat timing.
If timing alone explains the score, a logistic regression on RR-interval features already captures it, and the deep model has learnt nothing about the atrium.
Approach
01
Train once, test elsewhere
A 1D ResNet, with an InceptionTime network as a check, trains on PTB-XL and is tested without retraining on Chapman-Shaoxing and Georgia. The external sets are never used for training or tuning.
02
A baseline that sees only timing
A logistic regression on RR-interval features is trained on the same split. Every deep model is compared with it on the same ECGs.
03
Where the evidence falls
Integrated Gradients, DeepLIFT, GradientSHAP, Input × Gradient, Grad-CAM and sliding-window occlusion each report the share of evidence in the atrial, QRS and ST-T windows of every beat.
04
What the model needs
Controlled edits remove atrial activity, regularise the rhythm, or apply a matched control. AF with a regular ventricular response and paced rhythms are analysed separately, because the timing cue is weak there.
05
Held-out data, used once
Every evaluation is recorded with a SHA-256 fingerprint of each model file. The script refuses to score a model whose file changed after it was tested.
Results
The manuscript on this study, “Deep ECG Atrial Fibrillation Detectors Rely on Absent P-Waves Rather Than RR Irregularity: Evidence From Beat-Preserving Counterfactual Edits”, has been submitted and is not yet peer reviewed. The repository ships its results folder empty, because the reports are regenerated from datasets that cannot be redistributed, so no figure is quoted here.
| Dataset | Role | ECGs kept | AF share |
|---|---|---|---|
| PTB-XL | Training, validation, internal test | 21,742 | 7.0% |
| Chapman-Shaoxing | External test only | 9,794 | 18.2% |
| Georgia | External test only | In the repo report | In the repo report |
All three are 12-lead recordings at 500 Hz.
01
Remove atrial activity
Does the AF probability fall?
02
Regularise the rhythm
Does it fall further?
03
Compare with a matched control
Which edit matters more?
If removing atrial activity lowers the AF probability more than regularising the rhythm, the model depends on atrial morphology. The reverse means it depends on timing.
Limits
What this work did not show.
- The manuscript is submitted and not yet peer reviewed. No performance figure is quoted on this page, because the reports are regenerated by the pipeline and are not committed to the repository.
- The challenge copies of the external sets carry no patient IDs, so each Georgia record is treated as its own patient in the bootstrap.
- A removed segment is a flat line with no P-wave, which the model may itself read as evidence of AF. The deletion test is reported with that caveat.
- Some counterfactual tests were added after the first occlusion results and are labelled as such.
Stack
- PyTorch
- 1D ResNet
- Integrated Gradients
- Grad-CAM
- DeepLIFT