Abstract
Electronic Health Records (EHRs) are a rich source of clinical data, yet their heterogeneous and longitudinal nature makes them difficult to analyze. Traditional methods often treat medical events as simple sequences, overlooking the complex relationships between patients, doctors, and services. We propose ME2Vec, a hierarchical graph-based framework designed to learn low-dimensional embeddings of these medical entities. By modeling the "patient journey" as a complex network and utilizing Graph Attention Networks (GATs), ME2Vec captures nuanced clinical patterns. Our evaluation on a Chronic Lymphocytic Leukemia (CLL) dataset demonstrates that ME2Vec significantly outperforms standard embedding methods in disease diagnosis prediction, achieving superior Micro-F1 and Macro-F1 scores.
Introduction
Analyzing EHR data is complicated by its heterogeneity (diagnoses, prescriptions, profiles), longitudinal nature, and irregular visit intervals. Standard approaches often treat medical services like words in a document (Word2Vec). However, these "medical sentences" fail to account for the specific influence of the healthcare provider or the varying time gaps between visits. ME2Vec addresses these limitations by integrating the "who" (doctor), the "what" (service), and the "whom" (patient) into a single, cohesive mathematical space.
Methods
ME2Vec constructs embeddings through a three-level hierarchy:
- Service Embedding: Medical services are nodes in a graph where edges represent co-occurrence within a temporal window. Biased random walks are used to ensure that rare, highly informative services are spatially isolated from routine ones.
- Doctor Embedding: A doctor’s embedding is derived from the services they provide. A Graph Attention Network (GAT) learns these representations by predicting a doctor’s primary specialty based on their clinical history.
- Patient Embedding: The relationship is modeled as a bipartite multigraph connecting patients to services, with doctors as edge attributes. A "duplication & annotation" technique converts this into a simple graph optimized via second-order proximity, allowing the model to distinguish between different providers for the same service.
Results and Discussion
The framework was evaluated using a proprietary clinical dataset focused on Chronic Lymphocytic Leukemia (CLL), with patient embeddings used to predict diagnoses via a logistic regression classifier.
Quantitative Performance
ME2Vec consistently outperformed baselines such as node2vec, LINE, and Spectral Clustering. As shown in the performance table below, ME2Vec achieved a Macro-F1 score of 0.676 at an 80% training ratio, surpassing the best-performing baseline.
Qualitative Analysis
Visualization of the learned embeddings provides further insight into the model's effectiveness. Using t-SNE, doctor embeddings were found to cluster clearly by medical specialty, such as Nephrology and Cardiology. This confirms that the action-based identity approach successfully captures the professional profile of healthcare providers.
Conclusion
ME2Vec offers a robust framework for representing complex EHR data. By leveraging hierarchical graph structures, it captures the interplay between various medical entities more effectively than sequential models. Future work will explore dynamic temporal decay functions and the inclusion of additional entities like hospital facilities to further enrich the embedding space.
Summary updated