Publishing Neural Networks in Drug Discovery Might Compromise Training Data Privacy

Fabian Krüger, Johan Östman, Lewis H. Mervin, Igor V. Tetko, Ola Engkvist · DOI

Abstract

Sharing trained neural networks is a cornerstone of open science in drug discovery, yet it may inadvertently expose proprietary chemical structures. This study evaluates the vulnerability of molecular property prediction models to membership inference attacks (MIAs). Our findings indicate that while modern architectures like graph neural networks offer improved privacy, models trained on small or imbalanced datasets remain highly susceptible to data leakage, potentially revealing high-value "hit" molecules to competitors.

Introduction

Pharmaceutical research relies heavily on proprietary datasets of chemical structures. While open-sourcing models trained on these datasets can accelerate innovation, it introduces a significant security risk: membership inference attacks (MIAs). In an MIA, an adversary attempts to determine if a specific molecule was part of a model's training set. In the competitive landscape of drug discovery, confirming that a rival is investigating a specific chemical scaffold can provide an immense strategic advantage. This paper presents the first systematic analysis of privacy leakage in molecular property prediction models.

Methodology

The study focuses on a "black-box" scenario where an adversary only has access to a model's final prediction logits. Two state-of-the-art attack methods were evaluated:

  1. Likelihood Ratio Attack (LiRA): A high-precision method comparing target model outputs against "shadow models" trained with and without specific samples.
  2. Robust Membership Inference Attack (RMIA): A computationally efficient alternative that estimates membership probability using shadow models.

The researchers evaluated these attacks across various molecular representations, including traditional fingerprints (ECFP, MACCS) and modern graph-based Message-Passing Neural Networks (MPNNs).

Experimental workflow for evaluating membership inference risks in molecular property prediction.

Datasets

The evaluation spanned four benchmark datasets of varying scales and class distributions:

  • BBB (Blood-Brain Barrier): 859 molecules (small, balanced).
  • Ames (Mutagenicity): 3,264 molecules (medium).
  • DEL (DNA-Encoded Library): 48,837 molecules (large, highly imbalanced).
  • hERG (Cardiac Toxicity): 137,853 molecules (very large, highly imbalanced).

Results and Discussion

The analysis revealed several critical factors influencing privacy risk in drug discovery models.

Dataset Size and Memorization

Models trained on smaller datasets, such as BBB, exhibited the highest levels of information leakage. Small sample sizes often lead to model "memorization," making training samples significantly easier for an adversary to identify. In the BBB dataset, attacks identified up to 3% of training molecules with zero false positives—a rate orders of magnitude higher than random chance.

Vulnerability of Rare Molecules

A particularly concerning finding is that molecules from the minority class (e.g., rare active binders in a massive screen) are the most vulnerable. These "hits" are often the most valuable proprietary secrets, yet they are the easiest for MIAs to detect due to their distinctiveness in the training distribution.

Graph Neural Networks as a Privacy Safeguard

Interestingly, graph-based representations using MPNNs consistently showed the lowest privacy risk across all datasets. On average, graph representations reduced information leakage by 66% compared to fingerprint-based methods at a zero false-positive rate, suggesting that graph architectures may be inherently more privacy-preserving.

True Positive Rates (TPR) at a fixed False Positive Rate (FPR) across different datasets, attacks, and molecular representations.

Conclusion

While sharing models is vital for scientific progress, the risk of leaking proprietary chemical structures is real and measurable. The study suggests that using graph-based architectures and being cautious with small or highly imbalanced datasets can mitigate some risks. To support the community, the authors have released molprivacy, a Python package for assessing these vulnerabilities. Future research will need to address privacy in regression tasks and the potential for full structural reconstruction from model weights.

Summary updated

BibTeX
@article{kruger2025publishing,
  author = {Fabian Krüger and Johan Östman and Lewis H. Mervin and Igor V. Tetko and Ola Engkvist},
  title = {{Publishing Neural Networks in Drug Discovery Might Compromise Training Data Privacy}},
  journal = {J. Cheminformatics},
  year = {2025},
  doi = {10.1186/s13321-025-00982-w},
}
Figure