# Contrastive Learning of Temporal Distinctiveness for Survival Analysis in Electronic Health Records

arXiv: https://arxiv.org/abs/2308.13104 · HTML: https://mlsanity.com/paper/2308.13104/

## Key facts

- Cited by 5 papers in the map (data through 14 Oct 2026).
- Builds on 14 of its 38 references that are in the map.
- First posted on arXiv 24 Aug 2023.

## Builds on (most cited first, 14 of 14)

- [A Simple Framework for Contrastive Learning of Visual Representations](https://mlsanity.com/paper/2002.05709/) (2020)
- [Supervised Contrastive Learning](https://mlsanity.com/paper/2004.11362/) (2020)
- [DeepSurv: Personalized Treatment Recommender System Using A Cox Proportional Hazards Deep Neural Network](https://mlsanity.com/paper/1606.00931/) (2016)
- [Scalable and accurate deep learning for electronic health records](https://mlsanity.com/paper/1801.07860/) (2018)
- [Time-to-Event Prediction with Neural Networks and Cox Regression](https://mlsanity.com/paper/1907.00825/) (2019)
- [GRAM: Graph-based Attention Model for Healthcare Representation Learning](https://mlsanity.com/paper/1611.07012/) (2016)
- [A Scalable Discrete-Time Survival Model for Neural Networks](https://mlsanity.com/paper/1805.00917/) (2018)
- [Deep Survival Analysis](https://mlsanity.com/paper/1608.02158/) (2016)
- [Deep Recurrent Survival Analysis](https://mlsanity.com/paper/1809.02403/) (2018)
- [Deep Neural Networks for Survival Analysis Based on a Multi-Task Framework](https://mlsanity.com/paper/1801.05512/) (2018)
- [SurvTRACE: Transformers for Survival Analysis with Competing Events](https://mlsanity.com/paper/2110.00855/) (2021)
- [Semi-supervised Contrastive Learning with Similarity Co-calibration](https://mlsanity.com/paper/2105.07387/) (2021)
- [Gaussian Processes for Survival Analysis](https://mlsanity.com/paper/1611.00817/) (2016)
- [Deep Exponential Families](https://mlsanity.com/paper/1411.2581/) (2014)

## Built on by (most cited first, 5 of 5)

- [Contrastive Learning on Medical Intents for Sequential Prescription Recommendation](https://mlsanity.com/paper/2408.10259/) (2024)
- [FairEHR-CLP: Towards Fairness-Aware Clinical Predictions with Contrastive Learning in Multimodal Electronic Health Records](https://mlsanity.com/paper/2402.00955/) (2024)
- [Toward a Well-Calibrated Discrimination via Survival Outcome-Aware Contrastive Learning](https://mlsanity.com/paper/2410.11340/) (2024)
- [Multi-Ontology Integration with Dual-Axis Propagation for Medical Concept Representation](https://mlsanity.com/paper/2508.21320/) (2025)
- [User-Adaptive Meta-Learning for Cold-Start Medication Recommendation with Uncertainty Filtering](https://mlsanity.com/paper/2601.22820/) (2026)

## Abstract (arXiv)

Survival analysis plays a crucial role in many healthcare decisions, where the risk prediction for the events of interest can support an informative outlook for a patient's medical journey. Given the existence of data censoring, an effective way of survival analysis is to enforce the pairwise temporal concordance between censored and observed data, aiming to utilize the time interval before censoring as partially observed time-to-event labels for supervised learning. Although existing studies mostly employed ranking methods to pursue an ordering objective, contrastive methods which learn a discriminative embedding by having data contrast against each other, have not been explored thoroughly for survival analysis. Therefore, in this paper, we propose a novel Ontology-aware Temporality-based Contrastive Survival (OTCSurv) analysis framework that utilizes survival durations from both censored and observed data to define temporal distinctiveness and construct negative sample pairs with adjustable hardness for contrastive learning. Specifically, we first use an ontological encoder and a sequential self-attention encoder to represent the longitudinal EHR data with rich contexts. Second, we design a temporal contrastive loss to capture varying survival durations in a supervised setting through a hardness-aware negative sampling mechanism. Last, we incorporate the contrastive task into the time-to-event predictive task with multiple loss components. We conduct extensive experiments using a large EHR dataset to forecast the risk of hospitalized patients who are in danger of developing acute kidney injury (AKI), a critical and urgent medical condition. The effectiveness and explainability of the proposed model are validated through comprehensive quantitative and qualitative studies.
