Medical Concept Representation Learning from Electronic Health Records and its Application on Heart Failure Prediction

Edward Choi, Andy Schuetz, Walter F. Stewart, Jimeng SunarXiv 2016

Abstract

Objective: To transform heterogeneous clinical data from electronic health records into clinically meaningful constructed features using data driven method that rely, in part, on temporal relations among data. Materials and Methods: The clinically meaningful representations of medical concepts and patients are the key for health analytic applications. Most of existing approaches directly construct features mapped to raw data (e.g., ICD or CPT codes), or utilize some ontology mapping such as SNOMED codes. However, none of the existing approaches leverage EHR data directly for learning such concept representation. We propose a new way to represent heterogeneous medical concepts (e.g., diagnoses, medications and procedures) based on co-occurrence patterns in longitudinal electronic health records. The intuition behind the method is to map medical concepts that are co-occuring closely in time to similar concept vectors so that their distance will be small. We also derive a simple method to construct patient vectors from the related medical concept vectors. Results: For qualitative evaluation, we study similar medical concepts across diagnosis, medication and procedure. In quantitative evaluation, our proposed representation significantly improves the predictive modeling performance for onset of heart failure (HF), where classification methods (e.g. logistic regression, neural network, support vector machine and K-nearest neighbors) achieve up to 23% improvement in area under the ROC curve (AUC) using this proposed representation. Conclusion: We proposed an effective method for patient and medical concept representation learning. The resulting representation can map relevant concepts together and also improves predictive modeling performance.

Introduction

Electronic Health Records (EHR) are a goldmine for predictive analytics, but they are notoriously difficult to work with due to their high dimensionality and heterogeneity. Traditionally, researchers use "one-hot encoding," where every unique medical code—such as an ICD-9 diagnosis or a CPT procedure—is treated as an independent dimension.

This approach suffers from two major flaws: extreme data sparsity, which hinders machine learning convergence, and a lack of inherent relationships between codes. One-hot encoding treats "Bronchitis" and "Pneumonia" as being just as different from each other as "Bronchitis" and a "Broken Arm." While medical ontologies like SNOMED provide some structure, they are static and do not capture the actual temporal co-occurrence patterns found in real-world clinical practice. This paper proposes a framework to learn dense, low-dimensional representations of medical concepts directly from longitudinal EHR data.

Methods

The authors propose a framework that treats a patient’s longitudinal medical history as a "sentence" where the "words" are medical codes. The core of this approach is the adaptation of the Skip-gram algorithm (the engine behind word2vec) to the clinical domain.

Overall framework for medical concept representation learning and heart failure prediction.

The model learns 100-dimensional embeddings for each code by predicting neighboring codes in a patient's timeline given a target code. This forces codes that frequently appear together in time—such as a diabetes diagnosis and a metformin prescription—to be positioned close to each other in the vector space.

The Skip-gram model adapted for medical concepts, predicting neighboring events on a patient timeline.

To create a representation for an entire patient, the vectors of every medical concept in that patient's history are summed. These dense patient vectors are then fed into standard classifiers, including Logistic Regression, Support Vector Machines (SVM), Multi-layer Perceptrons (MLP), and K-Nearest Neighbors (KNN), to predict the onset of heart failure. The study utilized a massive dataset from the Sutter Palo Alto Medical Foundation (Sutter-PAMF), encompassing 265,336 patients and 38,599 unique medical concepts.

Results and Key Insights

The quantitative results were striking across all tested models. The Area Under the ROC Curve (AUC) for heart failure prediction improved significantly, with the KNN model seeing the most dramatic boost, increasing from 0.637 to 0.785. The MLP reached the highest overall AUC at 0.814. Beyond accuracy, the dimensionality reduction led to massive speedups in training; KNN classification time was reduced by a factor of 79x, and Logistic Regression was 15x faster.

Qualitatively, the model demonstrated that clinical knowledge emerges automatically from the data:

  • Clustering: Visualization via t-SNE showed that the model naturally grouped related concepts, such as successfully separating malignant skin neoplasms from benign ones.
  • Medical Vector Arithmetic: Much like NLP analogies, medical vectors support clinical logic. Adding the vectors for "Hypertension" and "Obesity" resulted in a vector whose nearest neighbors included "Hyperlipidemia" and "Diabetes"—the classic components of metabolic syndrome.
  • Sparsity Alleviation: By moving to a dense 100-dimensional space, the model overcame the limitations of sparse, high-dimensional data that typically cause distance-based models like KNN to fail.

Conclusion

This research presents an effective method for patient and medical concept representation learning. By leveraging temporal co-occurrence patterns in EHRs, the resulting representations map relevant concepts together and significantly improve the performance and efficiency of predictive modeling for heart failure. Future work may involve incorporating numerical lab results and unstructured clinical notes to further enhance the model's predictive power.

Summary updated

BibTeX
@misc{choi2016medical,
  author = {Edward Choi and Andy Schuetz and Walter F. Stewart and Jimeng Sun},
  title = {{Medical Concept Representation Learning from Electronic Health Records and its Application on Heart Failure Prediction}},
  year = {2016},
  eprint = {1602.03686},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1602.03686},
}
Figure