Generative recurrence analysis and metric learning for detection of atrial fibrillation from short ECG data
Chunyu Wu, Suwetha Jahan Maheswary, Rakesh Srivastava, Pon Harshavardhanan, Swagat Samantaray, Zimo Wang, Changqing ChengElectrocardiogram (ECG) signals exhibit complex, nonlinear, and nonstationary dynamics that are not fully captured by conventional time series analysis methods. In this study, we propose a novel framework for atrial fibrillation (AF) detection that integrates a beat-level recurrence representation with supervised metric learning. ECG recordings are first segmented into beat-centered waveforms that serve as effective dynamical states, avoiding the inaccurate estimation of time delay and embedding dimension from short recordings. Rather than constructing conventional recurrence plots from delay-embedded trajectories, the proposed method forms a beat-to-beat dissimilarity matrix using the Jensen–Shannon distance between normalized ECG beat segments. This representation captures variations in beat morphology and rhythm irregularity and provides information complementary to heart rate variability descriptors and recurrence quantification features. A contrastive Gaussian-mixture variational autoencoder learns an eight-component latent distribution with two components assigned to each of the four rhythm classes. Reconstruction, Gaussian-mixture regularization, supervised classification, clustering, and contrastive objectives jointly promote informative, compact, and class-discriminative latent representations. Class-conditional samples drawn from the learned mixture provide balanced synthetic latent representations for classifier training. Evaluated on the four-class PhysioNet/CinC 2017 dataset, the proposed framework achieves an overall accuracy of approximately 94%, with F1 scores of 0.97, 0.95, 0.92, and 0.86 for normal sinus rhythm, AF, other rhythm, and noise, respectively. These results demonstrate the potential of combining beat-level nonlinear dynamics, structured generative modeling, and metric learning for AF detection from short ECG recordings.