Source-linked AI summary
Patient2Vec: A Personalized Interpretable Deep Representation of the Longitudinal Electronic Health Record
Jinghe Zhang, Kamran Kowsari, James H. Harrison, Jennifer M. Lobo, Laura E. Barnes
TL;DR
Longitudinal EHR data are rich but heterogeneous, sparse, noisy, and biased, making them difficult to use for knowledge discovery and outcome prediction. Patient2Vec learns personalized, interpretable deep representations with recurrent networks and attention, achieving about 0.799 AUC for future hospitalization prediction while exposing feature importance at individual and population levels.
Problem
Heterogeneous, sparse, noisy, and biased longitudinal EHR data remain difficult to translate into machine-learning representations for understanding disease correlations and predicting health outcomes.
Method
Patient2Vec uses recurrent neural networks and hierarchical attention to learn personalized representations of longitudinal EHR data and weight clinical events for interpretation.
Results
Patient2Vec achieves an AUC around 0.799 and outperforms baseline methods for predicting future hospitalization using real EHR data.
Takeaways & Limitations
Learned feature importance can be visualized and interpreted at both individual and population levels to provide clinical insights.
Takeaways & Limitations
The evaluation targets early detection of long-term hospitalization at least 6 months after a previous hospitalization, rather than 30-day readmission.
Abstract
from arXiv · showhide
The wide implementation of electronic health record (EHR) systems facilitates the collection of large-scale health data from real clinical settings. Despite the significant increase in adoption of EHR systems, this data remains largely unexplored, but presents a rich data source for knowledge discovery from patient health histories in tasks such as understanding disease correlations and predicting health outcomes. However, the heterogeneity, sparsity, noise, and bias in this data present many complex challenges. This complexity makes it difficult to translate potentially relevant information into machine learning algorithms. In this paper, we propose a computational framework, Patient2Vec, to learn an interpretable deep representation of longitudinal EHR data which is personalized for each patient. To evaluate this approach, we apply it to the prediction of future hospitalizations using real EHR data and compare its predictive performance with baseline methods. Patient2Vec produces a vector space with meaningful structure and it achieves an AUC around 0.799 outperforming baseline methods. In the end, the learned feature importance can be visualized and interpreted at both the individual and population levels to bring clinical insights.
I. INTRODUCTION
Longitudinal EHR records offer sequential clinical histories for representation learning, but their heterogeneity and sparse structure complicate analysis. Patient2Vec combines recurrent networks with attention to learn personalized, interpretable patient representations.
- I. INTRODUCTION: Longitudinal EHR data resemble text documents because patient histories form sequences of visits containing clinical-event codes.This analogy motivates applying NLP representation-learning methods to EHR data.
- I. INTRODUCTION: RNNs capture sequential information by combining the current input with memory from previous computations, unlike traditional networks that assume independent inputs.RNN variants address the difficulty of modeling long-term dependencies in vanilla RNNs.
- I. INTRODUCTION: Attention mechanisms improve interpretability by weighting influential clinical events rather than treating all events equally.The weights indicate the relative importance and roles of events in learned representations.
- I. INTRODUCTION: Healthcare personalization can use patient phenotypes and documented care experiences to tailor healthcare processes.The paper frames personalized representation learning as a way to capture heterogeneity in patients’ medical histories.
- I. INTRODUCTION: Patient2Vec uses recurrent neural networks and attention to learn personalized, interpretable representations from sequences of clinical events.The framework assigns personalized weights to hospital visits and their procedures, supporting interpretation at individual and population levels.
- I. INTRODUCTION: GRUs use reset and update gates to regulate how previous states and current information contribute to each hidden activation.The gating structure carries important features forward, drops irrelevant information, and supports backpropagation without rapid gradient vanishing.
2) Long Short-Term Memory (LSTM)
LSTM units regulate information through multiple gates and preserve long-term dependencies, while GRUs provide a simpler gated alternative with fewer parameters.
- 2) Long Short-Term Memory (LSTM): LSTM uses multiple gates to regulate information entering each node state and preserve long-term dependencies more effectively than a basic RNN.The described gates include input, cell-memory, forget, and output functions.
- 2) Long Short-Term Memory (LSTM): An LSTM unit resembles a GRU but contains one additional gate for more careful information regulation.Both architectures address long-term dependency learning, but LSTM uses a chain-like gated structure.
- 2) Long Short-Term Memory (LSTM): At each time step, the LSTM memory cell receives the input x_t and uses weight matrices and bias vectors in its gate computations.The notation identifies i, c, f, and o as input, cell-memory, forget, and output gates.
- 2) Long Short-Term Memory (LSTM): LSTM and GRU achieve comparable performance in many tasks, while GRUs use fewer parameters and can learn faster with less data.The paper presents this as an empirical comparison between the two recurrent architectures.
B. ATTENTION MECHANISM
The attention mechanism learns weights over hidden states so the network can focus on important sequence regions. These weights also make learned feature importance more interpretable.
- B. ATTENTION MECHANISM: The attention mechanism focuses computation on selected data regions while assigning lower resolution to other regions.This mechanism is inspired by the human visual attention system.
- B. ATTENTION MECHANISM: Attention learns a variable-length weight vector from hidden states and uses it to construct a global context vector for the final output.The sequence length determines the number of learned attention weights.
- B. ATTENTION MECHANISM: Attention weights can indicate feature importance, making neural-network representations more interpretable.The paper connects this interpretive benefit to the use of attention in recurrent networks.
- B. ATTENTION MECHANISM: The learned weights emphasize important features for final prediction and can improve model performance.The attention model therefore supports both predictive modeling and interpretation.
C. DEEP LEARNING IN EHR DATA
Deep learning methods are increasingly applied to sequential and longitudinal EHR data, but interpreting their behavior remains difficult. Patient2Vec addresses this challenge with hierarchical attention over medical codes, visits, and time windows.
- C. DEEP LEARNING IN EHR DATA: Deep learning has been adapted to EHR notes, ICU laboratory time series, and longitudinal patient data, but model behavior remains difficult to interpret.Prior work includes statistical, traditional machine-learning, and newer deep-learning approaches.
- C. DEEP LEARNING IN EHR DATA: Sequential clinical measurements can be multivariate, irregular, and affected by missing values, creating challenges for traditional machine-learning methods.The reviewed work includes GRU-based modeling of missing patterns in MIMIC-III data.
- C. DEEP LEARNING IN EHR DATA: Patient2Vec uses deep recurrent networks and attention to capture clinical-event relationships, learn personalized representations, and estimate relative feature importance.The framework is organized as a four-step representation-learning process.
- C. DEEP LEARNING IN EHR DATA: EHR visits contain unordered sets of codes for diagnoses, symptoms, procedures, therapies, and other clinical events.The framework treats each visit’s codes like words in a sentence and represents codes with word2vec vectors.
- C. DEEP LEARNING IN EHR DATA: Irregular visit sequences are divided into equal-length time-window subsequences, which may contain multiple visits or no visits.This transformation preserves temporal grouping while accommodating irregularly spaced encounters.
- C. DEEP LEARNING IN EHR DATA: Self-attention learns unequal weights for medical events because events within a subsequence may contribute differently to the prediction target.Equal-weight aggregation is therefore avoided.
C. LEARNING SUBSEQUENCE-LEVEL SELF-ATTENTION
Patient2Vec represents medical-code visits as embedded subsequences and applies within-subsequence attention to weight codes by their contribution to prediction. These weighted vectors form a sequence representing each patient’s medical history.
- A. LEARNING VECTOR REPRESENTATIONS OF MEDICAL CODES: Patient2Vec embeds medical codes and organizes each visit or time window as a matrix of code vectors, padding variable-length subsequences for consistent network input.Medical codes are represented using relationships among codes occurring in the same visit.
- B. LEARNING WITHIN-SUBSEQUENCE SELF-ATTENTION: Within-subsequence attention learns code weights according to their contribution to the prediction target and aggregates them into a vector representing each subsequence.The attention weights are generated with a one-side convolution using a nonlinear activation function.
- C. LEARNING SUBSEQUENCE-LEVEL SELF-ATTENTION: The aggregated subsequence vectors are ordered into a sequence that represents the patient’s medical history for subsequent longitudinal modeling.This sequence is denoted x = {x1, x2, · · ·, xt, · · ·, xT}.
C. LEARNING SUBSEQUENCE-LEVEL SELF-ATTENTION
Patient2Vec uses a bidirectional GRU to capture longitudinal dependencies and applies subsequence-level attention to construct multi-hop representations of a patient’s visit history.
- C. LEARNING SUBSEQUENCE-LEVEL SELF-ATTENTION: A bidirectional GRU processes the sequence of aggregated subsequence vectors to capture longitudinal dependencies across the patient’s medical history.The GRU produces hidden outputs h1 through hT for the subsequences.
- C. LEARNING SUBSEQUENCE-LEVEL SELF-ATTENTION: Subsequence-level attention generates multiple hops of weights and combines them with GRU hidden outputs to represent the patient’s medical visit history.The resulting context vector concatenates the representations from the different attention hops.
D. CONSTRUCTING AGGREGATED DEEP
The framework constructs a complete patient representation by combining attention-derived visit-history features with demographic and static medical characteristics, then predicts outcomes from that vector.
- D. CONSTRUCTING AGGREGATED DEEP: Patient2Vec appends demographic information and static medical conditions, including age, gender, and previous hospitalization, to the attention-based context vector.The resulting aggregated vector c′ provides a complete representation of the patient’s EHR data.
- E. PREDICTING OUTCOME: A linear and softmax layer uses the complete patient vector for final outcome prediction.The network is trained with cross-entropy loss, while an additional penalty discourages redundant attention across hops.
- E. PREDICTING OUTCOME: The redundancy penalty encourages different attention hops to focus on diverse areas rather than similar subsequence weights.This design makes each attention hop focus on a small area.
V. EVALUATION
The evaluation applies Patient2Vec to all-cause hospitalization risk prediction using longitudinal EHR data from a large health-system dataset. The design uses a defined observation and hold-off period and compares the framework with baseline approaches.
- V. EVALUATION: The study predicts future all-cause hospitalization risk in the general population from longitudinal EHR data, addressing a broader target than population-specific admission tasks.The authors distinguish this objective from prior work on 30-day readmission and particular patient populations.
- V. EVALUATION: The dataset contains 2,343,651 inpatient and outpatient visits from 473,915 distinct patients over 75 months of University of Virginia Health System EHR data.Extracted records include diagnosis, medication, and procedure codes.
- V. EVALUATION: The experimental design uses the first year as the observation window and the following 6 months as a hold-off period for early detection.Patients with hospitalization after the first 1.5 years form the positive class, while those without hospitalization form the negative class.
- V. EVALUATION: The data are split into training, validation, and testing sets at a 7:1:2 ratio after excluding patients above the 95% quantile of codes within a subsequence.The target and control groups contain 8,841 and 89,101 patients, respectively.
- V. EVALUATION: The proposed representation learning framework is evaluated by comparing its prediction performance with baseline approaches.The supplied evaluation passage states the comparison setup but does not provide the baseline results.
1) Logistic regression (LR)
The baselines use aggregated clinical-code inputs or medical-code embeddings with recurrent architectures, while logistic regression provides a simpler comparison model.
- The baseline inputs use aggregated counts of grouped diagnoses, procedures, medications, demographics, and previous inpatient visits.
- Logistic regression, MLP, forward and bidirectional RNNs, and attention-based RNNs provide comparison architectures.The recurrent models use one hidden layer with 256 units; attention-based variants generate interpretable weights.
8) Patient2Vec
Patient2Vec combines recurrent modeling and attention to predict hospitalization while exposing personalized and population-level feature importance. It generally outperforms the baselines, with visualizations showing patient-specific and diagnosis-group patterns.
- 8) Patient2Vec: Patient2Vec generally outperforms baseline methods, especially in sensitivity and F2 score, while RNN-based models generally achieve higher sensitivity, AUC, and F2 score.The reported RNN comparisons use 90-day subsequences, and Patient2Vec and baselines are evaluated with AUC, sensitivity, specificity, and F2-score.
- 8) Patient2Vec: Patient2Vec learns personalized feature importance across clinical events and interprets relative importance at individual and population levels.The framework uses attention weights over visits and clinical events, with visualizations for example patients and high-weight clinical groups.
- 8) Patient2Vec: Patient A has a predicted hospitalization risk of 96.4%, with the last subsequence t4 receiving the greatest attention.The profile concerns a patient later hospitalized for congestive heart failure; darker heat-map colors indicate stronger association with the outcome.
- 8) Patient2Vec: Patient B has a predicted hospitalization risk of 74.6%, and the second subsequence is more predictive than the last.The patient was later hospitalized for occlusion of cerebral arteries; high-attention events included heart procedures, genitourinary symptoms, and musculoskeletal diagnoses.
- 8) Patient2Vec: Population-level analyses identify chronic diagnoses, procedures, and laboratory tests as highly weighted groups associated with future hospitalization.Diagnosis groups overlap across some hospitalization causes, including coronary atherosclerosis and other heart diseases for myocardial infarction and heart failure.
VI. DISCUSSION
Patient2Vec demonstrates accurate, interpretable hospitalization prediction from longitudinal EHR data while supporting personalized clinical-event interpretation. Its current evaluation is limited to specific hospitalization settings, with broader applications and additional follow-up information left for future work.
- Hierarchical attention makes clinical-event weights directly interpretable in the hospitalization-prediction framework.The authors identify interpretability of clinical-event weights as a central property of Patient2Vec.
- Further work should incorporate follow-up information for negative patients and demographic information to improve outcome assessment and interpretation.The authors propose checking whether apparently negative patients improve or are hospitalized elsewhere, and extending attention with demographic information.
- The evaluation targets early detection of long-term hospitalization at least 6 months after a previous hospitalization, rather than 30-day readmission.The authors note that the framework could also be used for 30-day readmission-risk prediction.
- Patient2Vec achieves more accurate hospitalization-risk prediction than baseline approaches while supporting feature-importance interpretation at individual and population levels.The framework is evaluated on real EHR data and is intended to facilitate clinical insights.
- The current framework is evaluated for all-cause hospitalization, leaving specific populations, other health predictions, and non-health domains for future application.The paper presents these as possible extensions beyond the reported evaluation scope.