Patient-Aware Contrastive Learning Preserves Per-Patient Structure in RR-Interval Representations
2026-06-22 • Machine Learning
Machine Learning
AI summaryⓘ
The authors study a challenge in detecting a heart condition called Paroxysmal Atrial Fibrillation using heartbeat interval data. They show that common learning methods mix up individual patient differences, which harms detection for new patients. To fix this, they propose a new learning approach that keeps each patient's unique normal heartbeat pattern separate while still distinguishing the condition. Their method leads to better, more consistent patterns per patient and improves detection performance on unseen patients. They also find that focusing on preserving individual patient patterns is more important than just separating disease classes globally.
Contrastive representation learningParoxysmal Atrial FibrillationRR-intervalSupervised contrastive learningBinary cross-entropyPatient-aware learningEmbedding cohesionAUROCCross-patient generalization
Authors
Yasantha Niroshana, Weijith Wimalasiri, Chathuranga Hettiarachchi
Abstract
Contrastive representation learning struggles on physiological signals when each subject contributes a distinct baseline pattern. If class differences overlap with subject differences,class-level objectives such as supervised contrastive learning tend to merge per-subject structure into a single per-class cluster,removing the individual variation that a model needs to generalize to unseen patients. We study this problem in the setting of Paroxysmal Atrial Fibrillation(PAF) detection from RR-interval(RRI) sequences and propose a patient-aware contrastive objective that forms positive pairs only from same-patient, same-class segments, preserving each patient's own sinus rhythm(SR) baseline while still pushing the two classes apart. Examining the learned embeddings directly, our objective achieves the most consistent per-patient SR structure (cohesion $0.850$ vs. $0.800$ for supervised contrastive loss (SupCon) and $0.772$ for binary cross-entropy (BCE)). We also identify that BCE produces the cleanest global class separation yet the most disordered per-patient structure. This is precisely why a linear probe trained on its features breaks down on unseen patients. On the IRIDIA-AF dataset, the resulting representation reaches a patient-independent Area Under the Receiver Operating Characteristic Curve (AUROC) of $0.989 \pm 0.003$ with $2.6\times$ lower seed variance than supervised contrastive baselines.These results highlight that per-subject geometric consistency, rather than global class separability, is key to robust cross-patient generalization.