Abstract
The rapid growth of electronic health record (EHR) datasets opens up promising opportunities to understand human diseases in a systematic way. However, effective extraction of clinical knowledge from the EHR data has been hindered by its sparsity and noisy information. We present GAT-ETM, an end-to-end knowledge graph-based multimodal embedded topic model. GAT-ETM distills latent disease topics from EHR data by learning the embedding from a constructed medical knowledge graph. We applied GAT-ETM to a large-scale EHR dataset consisting of over 1 million patients. We evaluated its performance based on EHR reconstruction and drug imputation. GAT-ETM demonstrated superior performance over the alternative methods on both tasks. Moreover, our model learned clinically meaningful graph-informed embedding of the EHR codes. In addition, our model is also able to discover interpretable and accurate patient representations for patient stratification and drug recommendations.
Introduction
Electronic Health Records (EHRs) represent a critical resource for longitudinal clinical research. However, modeling this data presents significant challenges due to its inherent sparsity and noise. Most patients interact with only a tiny fraction of the thousands of available medical codes, leading to a "cold start" problem for rare diseases. Traditional machine learning approaches, such as standard topic models, often treat medical codes as independent units, failing to capture the rich semantic relationships between diagnoses and treatments.
To address these limitations, we propose GAT-ETM, a framework that integrates structured medical knowledge from external Knowledge Graphs (KGs) into the learning process. By leveraging hierarchies and known drug-disease relationships, GAT-ETM can infer clinical context even when data for specific codes is limited.
Methodology
The GAT-ETM architecture combines Graph Attention Networks (GAT) with Embedded Topic Models (ETM) in an end-to-end framework. The process involves four primary components:
- Knowledge Graph Construction: A graph is constructed where nodes represent medical codes (ICD-9 for diagnoses and ATC for drugs). Edges are defined based on hierarchical taxonomies (e.g., sub-diagnoses) and drug-disease associations.
- Graph Attention Network (GAT): This module learns vector embeddings for each code. The attention mechanism allows the model to dynamically weigh the importance of neighboring nodes in the KG.
- Embedded Topic Model (ETM): Patient histories are treated as "documents" composed of medical "words" (codes). The ETM discovers latent "topics" representing clusters of related clinical conditions and interventions.
- End-to-End Training: Unlike modular approaches, GAT-ETM trains the graph embeddings and the topic model simultaneously. This allows the actual patient data to refine the graph-informed representations.
The mathematical notations used throughout the model are summarized in the table below:
Data and Experiments
The model was evaluated using the Population Health Record (PopHR) database, which includes longitudinal data for 1.2 million patients in Quebec, Canada, spanning up to 20 years. The vocabulary consisted of 5,107 ICD-9 codes and 1,057 ATC codes. External knowledge was sourced from the WHO, ICD-9 databases, and the MIA database for drug-disease relations.
The performance was measured across two primary tasks: EHR reconstruction (predicting the full clinical profile) and drug imputation (predicting medications based on diagnoses).
Key Insights
- Knowledge as a Prior: By using "graph augmentation" to connect nodes to their ancestors in the medical hierarchy, the model ensures that rare sub-diagnoses benefit from the information available for broader categories.
- Cross-Modal Information Sharing: Linking drug and disease graphs allows the model to share information across data types. Understanding a drug's mechanism helps refine the representation of the disease it treats.
- Addressing Rarity: The model's most significant gains were observed in predicting rare drugs. By understanding the medical context through the KG, GAT-ETM avoids the pitfalls of frequency-based models that ignore low-occurrence codes.
Results
GAT-ETM demonstrated substantial improvements over baseline models:
- Reconstruction Accuracy: The model achieved a lower Negative Log-Likelihood (172.69) compared to the standard ETM (198.26).
- Topic Quality: Topic coherence and diversity scores were significantly higher (0.1920 vs. 0.0704).
- Rare Drug Imputation: GAT-ETM was approximately 9 times more accurate than the baseline ETM for drugs in the 20-40% rarity percentile.
- Interpretability: Qualitative analysis confirmed that the model successfully grouped related clinical concepts, such as circulatory diseases and cardiovascular medications, in the embedding space.
Conclusion and Future Work
While GAT-ETM provides a robust framework for EHR modeling, several avenues for future research remain. Currently, the model utilizes a "bag of words" approach that does not account for the temporal sequence of medical events. Incorporating temporal dynamics is a key next step. Additionally, moving toward heterogeneous graphs to distinguish between different types of relationships (e.g., "is-a" vs. "treats") and expanding the knowledge graph to include the full Universal Medical Language System (UMLS) will further enhance the model's clinical utility.
Summary updated