Skip to main content
QUICK REVIEW

[Paper Review] Bootstrapping Your Own Positive Sample: Contrastive Learning With Electronic Health Record Data

Tingyi Wanyan, Jing Zhang|arXiv (Cornell University)|Apr 7, 2021
Machine Learning in HealthcareComputer Science37 references8 citations
TL;DR

This paper proposes a contrastive learning framework with novel positive sampling strategies—feature-based and attribute-based—for electronic health record (EHR) data to improve mortality prediction in COVID-19 patients. By leveraging patient similarity in feature space and precomputed similarity metrics, the method enhances inter-class separation and preserves intra-class heterogeneity, achieving an AUROC of 0.959, outperforming cross-entropy (0.873) and focal loss (0.931).

ABSTRACT

Electronic Health Record (EHR) data has been of tremendous utility in Artificial Intelligence (AI) for healthcare such as predicting future clinical events. These tasks, however, often come with many challenges when using classical machine learning models due to a myriad of factors including class imbalance and data heterogeneity (i.e., the complex intra-class variances). To address some of these research gaps, this paper leverages the exciting contrastive learning framework and proposes a novel contrastive regularized clinical classification model. The contrastive loss is found to substantially augment EHR-based prediction: it effectively characterizes the similar/dissimilar patterns (by its "push-and-pull" form), meanwhile mitigating the highly skewed class distribution by learning more balanced feature spaces (as also echoed by recent findings). In particular, when naively exporting the contrastive learning to the EHR data, one hurdle is in generating positive samples, since EHR data is not as amendable to data augmentation as image data. To this end, we have introduced two unique positive sampling strategies specifically tailored for EHR data: a feature-based positive sampling that exploits the feature space neighborhood structure to reinforce the feature learning; and an attribute-based positive sampling that incorporates pre-generated patient similarity metrics to define the sample proximity. Both sampling approaches are designed with an awareness of unique high intra-class variance in EHR data. Our overall framework yields highly competitive experimental results in predicting the mortality risk on real-world COVID-19 EHR data with a total of 5,712 patients admitted to a large, urban health system. Specifically, our method reaches a high AUROC prediction score of 0.959, which outperforms other baselines and alternatives: cross-entropy(0.873) and focal loss(0.931).

Motivation & Objective

  • Address the challenges of class imbalance and high intra-class variance in EHR data for clinical prediction tasks.
  • Overcome the limitation of traditional contrastive learning in EHRs, where data augmentation is less feasible than in vision tasks.
  • Develop positive sampling strategies tailored to EHR data that capture semantic similarity while preserving patient diversity within the same outcome class.
  • Improve predictive performance of clinical models on imbalanced EHR data using contrastive regularization with minimal supervision.
  • Demonstrate that contrastive learning with informed positive sampling leads to better generalization and robustness in real-world EHR applications.

Proposed method

  • Introduce a contrastive regularized classification model that combines focal loss with contrastive loss to handle class imbalance and improve feature learning.
  • Propose a feature-based positive sampling strategy that selects neighbors in the learned feature space to form positive pairs, enhancing local neighborhood learning.
  • Develop an attribute-based positive sampling strategy using precomputed patient similarity metrics (e.g., based on clinical features) to define semantically meaningful positive pairs.
  • Apply a contrastive loss function with a 'push-and-pull' mechanism: pull positive samples (similar patients) closer in embedding space and push negative samples (dissimilar patients) apart.
  • Use UMAP visualization and embedding separation score (ESS) to evaluate inter-class and intra-class clustering quality in the learned representation space.
  • Train a linear classifier on the contrastive embeddings to assess downstream predictive performance and validate the quality of learned representations.

Experimental results

Research questions

  • RQ1Can contrastive learning with custom positive sampling strategies improve predictive performance on imbalanced EHR data compared to standard supervised losses?
  • RQ2How do feature-based and attribute-based positive sampling strategies compare to random sampling in capturing intra-class heterogeneity in EHR data?
  • RQ3To what extent do the proposed sampling strategies enhance inter-class separation in the learned embedding space?
  • RQ4Does contrastive regularization lead to more robust and generalizable representations in the presence of high data heterogeneity and class imbalance in EHRs?
  • RQ5Can the proposed method achieve superior performance on real-world clinical prediction tasks such as in-hospital mortality prediction for COVID-19 patients?

Key findings

  • The proposed contrastive regularized model achieved an AUROC of 0.959 on real-world COVID-19 EHR data, significantly outperforming cross-entropy (0.873) and focal loss (0.931).
  • The attribute-based positive sampling strategy yielded the highest performance, with a 4.5% improvement in linear classifier accuracy over random sampling.
  • Feature- and attribute-based sampling strategies achieved higher embedding separation scores (ESS) than random sampling, indicating better inter-class separation.
  • Both novel sampling strategies preserved higher intra-class variance (standard deviation of distances to cluster centers) than random sampling, reflecting better modeling of patient heterogeneity.
  • UMAP visualizations confirmed that the proposed methods created more distinct and well-separated clusters for death and non-death patients compared to random sampling.
  • The contrastive regularizer mitigated the collapsing of embedding space, which commonly occurs with random positive sampling, by maintaining diverse subgroup representations within each class.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.