Introduction
Medication recommendation is a critical task in clinical decision support systems. While deep learning models trained on Electronic Health Records (EHR) have shown promise, they often suffer from "brittleness" when encountering rare diseases (the long-tail problem) or incomplete patient histories. Most existing models rely heavily on observed co-occurrence patterns, making them susceptible to spurious correlations and poor generalization to unseen or infrequent medical codes.
To address these challenges, we present HiRef (Hierarchical ontology and network Refinement), a framework designed to enhance the robustness of medication recommendations by integrating structured medical knowledge with data-driven insights.
Methodology
HiRef employs a multi-faceted approach to encode medical entities and patient histories effectively, combining the structural strengths of medical ontologies with the empirical patterns found in EHR data.
1. Hyperbolic Ontology Encoding
Medical codes are inherently hierarchical (e.g., ICD-9 for diagnoses). HiRef embeds these ontologies in hyperbolic space, specifically the Poincaré ball. Unlike Euclidean space, hyperbolic space expands exponentially, allowing it to represent tree-like structures with minimal distortion. Using Möbius operations, the model aggregates information from a code’s ancestors. This enables rare "leaf" nodes to inherit semantic features from more frequent "parent" categories, facilitating better representation of rare conditions.
2. Sparse Graph Refinement
The model constructs a global co-occurrence graph of medical entities. To mitigate noise and spurious correlations, HiRef implements a prior-guided sparse regularization scheme. This process "prunes" edges that do not contribute to accurate clinical predictions, resulting in a cleaner, more interpretable network of associations.
3. Adaptive Fusion and Temporal Modeling
An adaptive "convex gating" module determines the optimal balance between hierarchical ontology embeddings and refined co-occurrence patterns for each entity. Finally, the patient's longitudinal history is processed using Gated Recurrent Units (GRUs) to capture temporal dependencies across multiple hospital visits.
Experimental Evaluation
HiRef was evaluated on the MIMIC-III and MIMIC-IV datasets. A key focus was the "simulated unseen-code" setting, where critical inputs were masked during training to test the model's ability to generalize using hierarchical relationships.
Key Results
- Superior Performance: HiRef consistently outperformed state-of-the-art baselines, including GAMENet, SafeDrug, and MoleRec, across metrics such as Jaccard similarity and F1 score.
- Robustness to Rare Scenarios: In tests involving "unseen" target medications, HiRef maintained high accuracy (e.g., 0.9768 tF1 for specific drug classes), whereas baseline models showed significant performance degradation.
- Interpretability: Qualitative analysis confirmed that the pruned graph retained clinically relevant connections (e.g., between septic arterial embolism and antibacterials) while discarding uninformative statistical noise.
Conclusion and Future Work
HiRef demonstrates that combining hierarchical medical ontologies with refined graph structures significantly improves the robustness and generalizability of medication recommendation systems. Future research will focus on incorporating additional data modalities, such as patient demographics and clinical notes, and addressing temporal gaps between patient visits to further enhance clinical utility.
Summary updated