NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Neighborhood Contrastive Learning Applied to Online Patient Monitoring

Hugo Yèche, Gideon Dresdner, Francesco Locatello, Matthias Hüser, Gunnar Rätsch

TL;DR

This paper introduces Neighborhood Contrastive Learning (NCL), a novel objective for unsupervised representation learning on time-series data, specifically for online patient monitoring. NCL addresses the challenge of patient-specific data heterogeneity by incorporating neighborhood information, leading to improved performance over existing methods, even outperforming supervised approaches in low-label scenarios.

What Problem Does This Paper Address?

Online patient monitoring in intensive care units (ICUs) is a critical area where machine learning can offer significant benefits. While supervised learning has seen success, unsupervised methods, particularly contrastive learning, have shown great promise in other domains like computer vision. However, applying contrastive learning to medical time-series data is challenging due to:

  • Data Augmentation Limitations: Standard image-based data augmentation techniques don't directly translate to time-series data, making it difficult to create semantically preserving views.
  • Domain Heterogeneity: Patient data exhibits significant variations (between-patient heterogeneity) and also changes over time within a single patient's stay (within-patient variance). This makes it hard for models to learn generalizable representations.
  • Temporal Dependencies: Unlike static data, time-series data has inherent temporal dependencies, and large overlaps in historical data between segments from the same patient can complicate standard contrastive learning approaches.

The paper aims to bridge this gap by developing a contrastive learning framework that can effectively handle these challenges for online patient monitoring.

Methods

The core contribution is the Neighborhood Contrastive Learning (NCL) objective. NCL builds upon existing contrastive learning frameworks but introduces a novel way to define positive and negative pairs by considering "neighborhoods."

  • Neighborhood Functions: The paper defines neighborhood functions that capture relationships between data points. Two key functions are proposed:
  • Time-preserving neighborhood ($n_w$): Samples are considered neighbors if they are from the same patient and within a specified time window ($w$). This leverages temporal proximity.
  • Label-preserving neighborhood ($n_Y$): Samples are considered neighbors if they share the same downstream task label. This is similar to supervised contrastive learning but integrated into the NCL framework.
  • NCL Objective: NCL is a weighted average of two sub-objectives:
  • Neighbors Alignment (LNA): Encourages representations from the same neighborhood to be closer.
  • Neighbor Discriminative (LND): Encourages representations from the same neighborhood to be distinct from other samples, while still allowing diversity within the neighborhood. The trade-off parameter $\alpha$ controls the balance between these two objectives.

  • Architecture: The authors utilize a Temporal Convolutional Network (TCN) as the encoder for time-series data, augmented with a dense layer to incorporate static patient features. This is a standard approach for time-series representation learning.

  • Data Augmentations: For creating positive pairs, they employ a combination of standard augmentations like channel dropout and Gaussian noise, along with novel temporal augmentations (History Crop and History Cutout) designed to preserve the singularity of time-series segments in the context of online monitoring.

Datasets

The paper uses two well-known Electronic Health Record (EHR) datasets for evaluation:

  • MIMIC-III Benchmark: A widely used dataset for EHR tasks. The authors use a pre-processed version by Harutyunyan et al. (2019), focusing on hourly labeled tasks: Decompensation (binary classification) and Length-of-stay (binned regression).
  • Physionet 2019: A dataset from a challenge on early sepsis detection. The task is hourly prediction of sepsis onset.

Key Insights and Ideas

  • Neighborhoods are Key for Heterogeneity: The core insight is that explicitly defining "neighborhoods" based on temporal proximity or labels is crucial for handling the inherent heterogeneity in patient data. This allows the model to learn representations that are both patient-specific and generalize across patients.
  • Balancing Alignment and Discrimination: The NCL objective's strength lies in its ability to balance bringing similar (neighboring) samples together (LNA) while also encouraging diversity within those neighborhoods (LND). This prevents collapsing to trivial solutions and allows for richer representations.
  • Temporal Augmentations Matter: Standard image augmentations are insufficient for time-series. The proposed History Crop and History Cutout are vital for creating meaningful positive pairs without destroying temporal context.
  • Unsupervised Learning Can Rival Supervised: The results demonstrate that unsupervised NCL can achieve performance comparable to, and in some cases superior to, supervised methods, especially in low-label regimes. This is significant for medical applications where labeled data is scarce.

Key Results

  • Improved Performance: NCL(nw) (using time-preserving neighborhoods) achieved competitive results on MIMIC-III, outperforming other unsupervised methods and even end-to-end supervised training on the Decompensation task with an MLP head.
  • Superiority in Low-Label Settings: In limited-labeled data scenarios for Decompensation, NCL(nw) significantly outperformed end-to-end training and other patient-designed methods on both AUROC and AUPRC.
  • NCL(ny) Outperforms SCL: The label-preserving neighborhood version, NCL(ny), significantly improved upon Supervised Contrastive Learning (SCL), which was found to be unstable and perform poorly.
  • Transfer Learning Benefits: NCL features learned from one task (e.g., Length-of-stay) transferred well to another (Decompensation), outperforming end-to-end training.
  • Visualizations Confirm Aggregation: T-SNE plots showed that increasing the $\alpha$ parameter in NCL(nw) leads to greater aggregation of neighbors, confirming the trade-off between neighborhood alignment and representation diversity.

Limitations and Future Work

  • Neighborhood Definition: The paper acknowledges that the binary neighborhood functions are a first step. Relaxing this to categorical or continuous definitions is a promising direction for future work.
  • Hyperparameter Sensitivity: While grid searches were performed, the performance can still be sensitive to hyperparameter choices, particularly for the Physionet 2019 dataset where the Utility metric showed significant variation.
  • Fine-tuning vs. Frozen Evaluation: The paper highlights that fine-tuning can sometimes mask differences between representation learning methods, and frozen evaluation is generally preferred for comparison.
  • Future Work: The authors suggest exploring more sophisticated neighborhood definitions and further investigating the trade-offs between different aggregation strategies. They also propose applying NCL to other domains with similar data characteristics.

Summary updated

BibTeX
@inproceedings{yeche2021neighborhood,
  author = {Hugo Yèche and Gideon Dresdner and Francesco Locatello and Matthias Hüser and Gunnar Rätsch},
  title = {{Neighborhood Contrastive Learning Applied to Online Patient Monitoring}},
  booktitle = {International Conference on Machine Learning},
  year = {2021},
  url = {https://openreview.net/forum?id=rCxP4jvecqG},
}
Figure