Publishing neural networks in drug discovery might compromise training data privacy

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

TL;DR

This study reveals that sharing trained neural networks for drug discovery can inadvertently leak confidential chemical structures through membership inference attacks. The researchers found that while open-sourcing models fosters innovation, it poses significant privacy risks—especially for rare, high-value molecules—though certain architectures like graph neural networks may offer better protection.

What Problem Does This Paper Address?

Pharmaceutical companies invest millions in generating proprietary datasets of chemical structures. While sharing models trained on this data can advance the field, it raises a critical security question: can an outsider determine if a specific, secret molecule was part of the training set?

This is known as a membership inference attack (MIA). In the high-stakes world of drug discovery, knowing that a competitor is researching a specific chemical structure provides a massive strategic advantage. This paper provides the first comprehensive analysis of how vulnerable molecular property prediction models are to these privacy-leaking attacks.

Methods

The researchers focused on a "black-box" scenario, where an adversary only has access to the model's final predictions (logits), not its internal weights. They evaluated two state-of-the-art attack methods:

  • Likelihood Ratio Attack (LiRA): A sophisticated method that compares the target model's output to "shadow models" trained with and without specific samples.
  • Robust Membership Inference Attack (RMIA): A more computationally efficient attack that also leverages shadow models to estimate the probability of a sample being in the training set.

The team tested these attacks across various molecular representations, including traditional fingerprints (ECFP, MACCS) and modern graph-based representations.

Overview of the workflow to evaluate privacy risks of neural networks for molecular property prediction.

Datasets

The study utilized four benchmark datasets representing common drug discovery tasks, varying in size and class balance:

  • BBB: Blood-Brain Barrier crossing (859 molecules) - Small and relatively balanced.
  • Ames: Mutagenicity prediction (3,264 molecules) - Medium size.
  • DEL: DNA-Encoded Library enrichment (48,837 molecules) - Large and highly imbalanced.
  • hERG: Cardiac toxicity risk (137,853 molecules) - Very large and highly imbalanced.

Key Insights and Ideas

  • Small Datasets are High Risk: Models trained on smaller datasets (like BBB) showed much higher information leakage. Smaller datasets often lead to more "memorization" by the model, making training samples easier to spot.
  • The "Valuable" Molecules are Most Vulnerable: Molecules from the minority class—such as the rare successful binders in a massive screen—were significantly easier to identify. This is a major concern because these "hits" are exactly the proprietary secrets companies want to protect most.
  • Graphs are Safer: Interestingly, representing molecules as graphs and using Message-Passing Neural Networks (MPNNs) consistently resulted in the lowest privacy risk. This suggests that graph-based architectures may be inherently more "privacy-preserving" than fingerprint-based ones without necessarily sacrificing accuracy.
  • Attacks are Complementary: Using LiRA and RMIA together identified more training molecules than either attack alone, proving that an adversary using multiple techniques is significantly more dangerous.

Key Results

  • In the small BBB dataset, attacks could identify up to 3% of the training molecules with zero false positives. While 3% sounds low, it is orders of magnitude higher than what would be found by random guessing.
  • For the massive hERG dataset, RMIA consistently outperformed LiRA at very low false-positive thresholds.
  • Graph representations reduced information leakage by an average of 66% compared to other representations when measured at a false positive rate of zero.
True positive rates for identifying training data molecules at a false positive rate of 0 for the BBB dataset.

Limitations and Future Work

The authors acknowledge several areas for further exploration:

  • Regression Tasks: This study focused on classification (yes/no properties). The privacy risks for models predicting continuous values (like binding affinity) are still unknown.
  • Adversary Knowledge: These attacks assume the adversary has access to data similar to the training set to build their shadow models. While common in drug discovery, it is a specific requirement for the attack to succeed.
  • Reconstruction Attacks: The next frontier is determining if an adversary can not only confirm membership but actually reconstruct the secret chemical structures from the model itself.

To help the community, the researchers have released a Python package called molprivacy to allow others to assess the privacy risks of their own molecular models.

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