Robust and generalizable atrial fibrillation detection from ECG using time-frequency fusion and supervised contrastive learning
- 1Information Center, The People’s Hospital of Baoan Shenzhen
- 2School of Computer Science and Engineering, South China University of Technology
Abstract
Atrial fibrillation (AF) is a common cardiac arrhythmia that significantly increases the risk of stroke and heart failure, necessitating reliable and generalizable detection methods from electrocardiogram (ECG) recordings. Although deep learning has advanced automated AF diagnosis, existing approaches often struggle to exploit complementary time–frequency information effectively, limiting both robustness under intra-dataset and generalization across diverse clinical datasets. To address these challenges, we propose a cross-modal deep learning framework comprising two key components: a Bidirectional Gating Module (BGM) and a Cross-modal Supervised Contrastive Learning (CSCL) strategy. The BGM facilitates dynamic, reciprocal refinement between time- and frequency-domain features, enhancing model robustness to signal variations within a dataset. Meanwhile, CSCL explicitly structures the joint embedding space by pulling together label-consistent samples and pushing apart different ones, thereby improving inter-class separability and enabling strong cross-dataset generalization. We evaluate our method using five-fold cross-validation on the AFDB and CPSC2021 datasets. Furthermore, to assess cross-dataset generalization, we conduct bidirectional cross-dataset experiments across AFDB, CPSC2021, LTAF, and SHDBAF by training on one dataset and testing on another. Results show consistent improvements over state-of-the-art methods across multiple metrics, demonstrating that our approach achieves both high intra-dataset robustness and excellent cross-dataset generalization. We further demonstrate that our method achieves high computational efficiency and anti-interference capability, making it suitable for edge deployment. The source code is publicly available at https://github.com/Ou-Young-1999/MGCNet .
Related
- A multi-class fundus disease classification framework based on self-supervised contrastive learning and dual-branch network
- MULTIMODAL EEG WORLD MODEL: SELF-SUPERVISED LATENT TRANSITION LEARNING FOR WEARABLE EEG SEIZURE DETECTION
- Single-view echocardiography-based deep learning for pulmonary hypertension detection: a multi-level supervised and explainable approach
- Neighborhood Disadvantage and Unequal Detection of Atrial Fibrillation
- A multicenter randomized controlled study to evaluate the efficacy of an artificial intelligence–based electrocardiography for the detection of atrial fibrillation in patients with suspected symptoms (DEEP-AF)
BibTeX
@article{li2026robust,
title = {{Robust and generalizable atrial fibrillation detection from ECG using time-frequency fusion and supervised contrastive learning}},
author = {Hongtao Li and Jia Wei and Jia Xiao and Yuanjun Lai and Mingyang Liu and Shuzhen Lv and Xueqiang Ouyang},
journal = {Scientific Reports},
year = {2026},
month = jul,
doi = {10.1038/s41598-026-64715-1},
url = {https://doi.org/10.1038/s41598-026-64715-1},
note = {CC BY},
}
RIS
TY - JOUR
TI - Robust and generalizable atrial fibrillation detection from ECG using time-frequency fusion and supervised contrastive learning
AU - Hongtao Li
AU - Jia Wei
AU - Jia Xiao
AU - Yuanjun Lai
AU - Mingyang Liu
AU - Shuzhen Lv
AU - Xueqiang Ouyang
PY - 2026
DA - 2026/07/01
JO - Scientific Reports
DO - 10.1038/s41598-026-64715-1
UR - https://doi.org/10.1038/s41598-026-64715-1
AB - Atrial fibrillation (AF) is a common cardiac arrhythmia that significantly increases the risk of stroke and heart failure, necessitating reliable and generalizable detection methods from electrocardiogram (ECG) recordings. Although deep learning has advanced automated AF diagnosis, existing approaches often struggle to exploit complementary time–frequency information effectively, limiting both robustness under intra-dataset and generalization across diverse clinical datasets. To address these challenges, we propose a cross-modal deep learning framework comprising two key components: a Bidirectional Gating Module (BGM) and a Cross-modal Supervised Contrastive Learning (CSCL) strategy. The BGM facilitates dynamic, reciprocal refinement between time- and frequency-domain features, enhancing model robustness to signal variations within a dataset. Meanwhile, CSCL explicitly structures the joint embedding space by pulling together label-consistent samples and pushing apart different ones, thereby improving inter-class separability and enabling strong cross-dataset generalization. We evaluate our method using five-fold cross-validation on the AFDB and CPSC2021 datasets. Furthermore, to assess cross-dataset generalization, we conduct bidirectional cross-dataset experiments across AFDB, CPSC2021, LTAF, and SHDBAF by training on one dataset and testing on another. Results show consistent improvements over state-of-the-art methods across multiple metrics, demonstrating that our approach achieves both high intra-dataset robustness and excellent cross-dataset generalization. We further demonstrate that our method achieves high computational efficiency and anti-interference capability, making it suitable for edge deployment. The source code is publicly available at https://github.com/Ou-Young-1999/MGCNet .
SN - 2045-2322
ER -