Patient-Aware Contrastive Learning Preserves Per-Patient Structure in RR-Interval Representations

Yasantha Niroshana, Weijith Wimalasiri, Chathuranga Hettiarachchi
6/22/2026
cs.LG

No official code found. Best implementation: EML-Labs/pacl-rri-af (0 stars, MIT, last commit 2026-06-06).

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.

View on arXivView PDF

Code Implementations(1)

MIT

[GlobalSouthML - ICML Workshop 2026] - Patient-Aware Contrastive Learning Preserves Per-Patient Structure in RR-Interval Representations

00May 21, 20264 months agoMIT

Cite this paper

@article{niroshana2026patientaware,
  title  = {Patient-Aware Contrastive Learning Preserves Per-Patient Structure in RR-Interval Representations},
  author = {Yasantha Niroshana and Weijith Wimalasiri and Chathuranga Hettiarachchi},
  year   = {2026},
  eprint = {2606.23570},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2606.23570v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2606.23570.svg)](https://codeofpaper.com/paper/2606.23570)

Discussion