Source-linked AI summary

SafeDrug: Dual Molecular Graph Encoders for Recommending Effective and Safe Drug Combinations

Chaoqi Yang, Cao Xiao, Fenglong Ma, Lucas Glass, Jimeng Sun

arXiv:2105.02711v2cs.LG

TL;DR

Medication recommendation must use more than longitudinal EHR data because drug molecular structure and explicit DDI modeling are limited in prior work. SafeDrug combines global and local molecular encoders with a controllable loss, reporting lower DDI, better recommendation similarity, and faster computation on benchmark data.

  • Problem

    Prior medication recommendation methods rely on EHR data while omitting drug molecular structures and modeling DDIs implicitly.

  • Method

    SafeDrug uses global MPNN and local bipartite molecular encoders plus a controllable loss to represent drugs and regulate DDI levels.

  • Results

    19.43% relative DDI reduction and 2.88% higher Jaccard similarity were reported over previous approaches on a benchmark dataset.

  • Takeaways & Limitations

    SafeDrug provides recommendations with adjustable DDI requirements while improving reported accuracy and computational efficiency.

Abstract

from arXiv · show

Medication recommendation is an essential task of AI for healthcare. Existing works focused on recommending drug combinations for patients with complex health conditions solely based on their electronic health records. Thus, they have the following limitations: (1) some important data such as drug molecule structures have not been utilized in the recommendation process. (2) drug-drug interactions (DDI) are modeled implicitly, which can lead to sub-optimal results. To address these limitations, we propose a DDI-controllable drug recommendation model named SafeDrug to leverage drugs' molecule structures and model DDIs explicitly. SafeDrug is equipped with a global message passing neural network (MPNN) module and a local bipartite learning module to fully encode the connectivity and functionality of drug molecules. SafeDrug also has a controllable loss function to control DDI levels in the recommended drug combinations effectively. On a benchmark dataset, our SafeDrug is relatively shown to reduce DDI by 19.43% and improves 2.88% on Jaccard similarity between recommended and actually prescribed drug combinations over previous approaches. Moreover, SafeDrug also requires much fewer parameters than previous deep learning-based approaches, leading to faster training by about 14% and around 2x speed-up in inference.

1 Introduction

SafeDrug addresses limitations in longitudinal medication recommendation by incorporating molecular structure and explicitly controlling drug–drug interactions. Its dual molecular encoders and controllable loss improve recommendation quality, safety, and efficiency on benchmark data.

  • Motivation: Existing medication recommendation methods may use one-hot drug representations, ignoring molecular properties and functional substructures relevant to efficacy and safety.Molecular graphs can encode drug properties and substructure functionality that one-hot representations omit.
  • Motivation: Implicit DDI modeling can produce non-controllable interaction rates or sub-optimal recommendation accuracy.
  • Method: SafeDrug combines a global MPNN encoder with a local bipartite encoder to capture whole-molecule connectivity and local substructural patterns.The global encoder passes messages across molecular layers, while the local encoder models molecule–substructure relations.
  • Method: SafeDrug uses an adaptive loss that emphasizes negative DDI signals when a sample exceeds a target, enabling control over DDI requirements.The loss combines supervised objectives with unsupervised DDI constraints.
  • Results: 19.43% relative DDI reduction, 2.88% higher Jaccard similarity, 2.14% higher F1, 14% shorter training time, and around 2× faster inference were reported against previous approaches.

2 Related Works

Prior medication recommendation methods use current or longitudinal clinical information, while SafeDrug adds explicit molecular structure modeling to recommendation. It captures both global and local molecular information to represent drugs more richly.

  • Medication Recommendation: Medication recommendation methods include instance-based approaches using current encounters and longitudinal approaches using temporal dependencies in clinical history.
  • Medication Recommendation: Existing medication recommendation work models DDI inadequately through soft or indirect constraints.
  • Molecule Representation: Molecule representation methods exploit the association between molecular structure and properties such as efficacy and safety.Prior approaches include molecular descriptors, fingerprints, sequential SMILES patterns, and graph-based neural networks.
  • Molecule Representation: SafeDrug captures both global and local molecular information during medication recommendation.

3 Problem Formulation

The problem formulation defines medication recommendation from a patient’s longitudinal EHR history while reducing or controlling DDIs using an interaction matrix. The objective combines supervision from real drug combinations with unsupervised DDI constraints.

  • EHR Representation: A patient’s EHR is represented as a sequence of visits containing diagnosis, procedure, and medication vectors.
  • Recommendation Objective: SafeDrug aims to generate a drug recommendation from up-to-now diagnosis and procedure sequences together with a DDI adjacency matrix.
  • Recommendation Objective: In the DDI matrix, D_ij = 1 denotes a reported interaction between drugs i and j, whereas D_ij = 0 denotes a safe co-prescription.
  • Recommendation Objective: The objective uses real drug combinations as supervision to penalize predicted combinations and the DDI matrix to impose unsupervised constraints.

4 The SafeDrug Model

SafeDrug combines longitudinal patient representations with parallel global and local molecular encoders to recommend drug combinations while accounting for molecular structure and DDI-related functionality.

  • 4 The SafeDrug Model: Global drug matching signals are combined with local functionality representations, then thresholded to obtain the recommended multi-hot drug combination.The global representation acts as an attention signal for adjusting local drug functionality before thresholding.
  • 4.1 Longitudinal Patient Representation: SafeDrug uses longitudinal diagnosis and procedure information to construct a patient health representation before generating recommendations.Diagnosis and procedure embeddings are processed with separate RNNs and combined into a compact representation.
  • (I) Global MPNN Encoder: The global encoder applies message passing across molecular graphs to capture drug connectivity and produce molecule-level representations.Learnable atom embeddings are updated through neighbor message passing and pooled across atoms.
  • (II) Local Bipartite Encoder: The local encoder decomposes molecules into functional substructures and uses a masked bipartite network to map patient functionality to local drug representations.The mask encodes drug–substructure relations and sparsifies the network.
  • 4.4 Model Training and Inference: The training objective supports DDI control, with γ functioning as an experimentally observed upper bound on the output DDI rate.Presetting γ allows SafeDrug to meet different DDI requirements.

5 Experiments

SafeDrug is evaluated on MIMIC-III against conventional, sequence-based, longitudinal, and molecular-encoder variants using efficacy, DDI, and complexity measures. It achieves lower DDI and stronger recommendation performance while allowing threshold-based control of the accuracy–DDI trade-off.

  • Experimental setup: SafeDrug is compared with LR, ECC, RETAIN, LEAP, DMNC, and GAMENet, plus local-only and global-only variants.The evaluation uses MIMIC-III and includes five efficacy metrics and three complexity metrics.
  • Performance comparison: SafeDrug outperforms the baselines with significantly lower DDI rate and better accuracy, while both molecular encoder variants improve prediction.The reported comparison is based on 10 rounds of bootstrapping and significance testing.
  • Model efficiency: SafeDrug has lower space and time complexity than the compared deep-learning baselines and is more efficient during inference.Sequential drug generation and large memory banks are identified as sources of inefficiency in competing models.
  • DDI controllability: The acceptance threshold γ controls the DDI–accuracy trade-off: larger values permit more drugs and improve accuracy, whereas γ < 0.02 sharply reduces accuracy.Output DDI rates are upper-bounded by γ in most cases.

6 Conclusion

The paper concludes that SafeDrug supports accurate and safe drug recommendation by encoding molecule structure and adaptively controlling the loss. Benchmark evaluation shows better accuracy and efficiency.

  • Conclusion: SafeDrug combines rich molecule-structure encoding with an adaptive loss controller for accurate and safe drug recommendation.The conclusion presents these as the model’s central design elements.
  • Conclusion: Benchmark experiments show that SafeDrug achieves better accuracy and efficiency.The conclusion summarizes the reported evaluation without specifying individual metrics.

A Algorithm

One training epoch first prepares molecular and patient representations, then generates global and local drug vectors, combines them, computes losses, and updates the model.

  • Training setup: The algorithm initializes parameters, constructs a bipartite molecular mask, and iterates over patients and their clinical visits.The mask is obtained from BRICS molecular fragmentation.
  • Patient representation: For each visit, diagnosis and procedure information is embedded into a longitudinal patient representation.The procedure generates visit embeddings, hidden representations, and h^(t).
  • Molecular encoding: The MPNN encoder generates global drug vectors, while the bipartite encoder generates local functional and drug vectors.The two encoders represent complementary molecular information.
  • Drug prediction and losses: The model combines the encoder outputs into a drug representation and multi-hot drug vector before accumulating binary-cross-entropy, multilabel, and DDI losses.The combined outputs are produced before optimization.
  • Optimization: Losses are accumulated across visits and optimized after selecting the controller parameter β.The training epoch performs gradient descent after the loss terms are computed.

B Additional Experiment Information

Additional experiment information defines the processed MIMIC-III data, molecular preprocessing, evaluation metrics, implementation settings, and bootstrap-based reporting procedure.

  • Dataset and preprocessing: The experiments use processed MIMIC-III data and convert NDC drug codes to corresponding ATC third-level codes.Molecule connectivity is obtained from SMILES strings using RDKit, with atoms as nodes and bonds as edges.
  • Implementation: Baseline implementations use matched 64-dimensional hidden units or embedding tables, while SafeDrug uses specified GRU, MPNN, dropout, and convolution settings.The implementation details standardize baseline capacity for comparison.
  • Metrics: DDI rate, Jaccard coefficient, F1, and PRAUC quantify recommendation performance using predicted and ground-truth drug combinations.The metric definitions aggregate results across patient visits.
  • Metrics: Jaccard measures set overlap, F1 is the harmonic mean of precision and recall, and PRAUC treats recommendation as information retrieval.PRAUC uses ranked retrieval precision and changes in recall.
  • Evaluation procedure: The dataset is split into training, validation, and test sets, and evaluation uses 10 bootstrap samples of 80% of the test data.Models are trained on fixed training data and tuned on fixed validation data before bootstrap evaluation.

B.1 Additional Experiment 1: Error Analysis

SafeDrug’s performance varies with test-set DDI and medication-count thresholds: it performs better for visits with lower actual DDI or more medications, while stricter scenarios reduce overall performance.

  • SafeDrug performs better when visits have lower actual DDI rates or involve more medications.
  • When the DDI threshold increases or the medication threshold decreases, overall performance drops.
  • Higher ground-truth DDI leads SafeDrug to recommend fewer drugs for lower-DDI combinations, sacrificing accuracy.
  • A smaller medication-count threshold yields less data and more noise in the multi-label prediction task, undermining the model.

B.2 Additional Experiment 2: Effectiveness of Mask Matrix to avoid Interacted Drugs

The mask matrix makes SafeDrug less likely to co-prescribe interacted drugs by encoding negative relationships between their learned representations. Without the mask, the network cannot distinguish interacted pairs, although controllable loss can still lower DDI.

  • The mask’s effect is evaluated using Cosinteracted, Cosall, and output DDI, including an ablation without H.
  • With mask H, Cosinteracted < 0 < Cosall indicates that interacted drugs are less likely to be co-prescribed.
  • Without mask H, low DDI may still result from the proposed controllable loss function.
  • The mask enables negatively correlated signals for interacted drugs, decreasing output DDIs in the final combination.
  • Without mask H, the fully connected network cannot distinguish interacted drug pairs, producing Cosinteracted larger than Cosall.
Loading 2105.02711v2…