Cell Morphology-Guided Small Molecule Generation with GFlowNets

Stephen Zhewen Lu, Ziqing Lu, Ehsan Hajiramezanali, Tommaso Biancalani, Yoshua Bengio, Gabriele Scalia, Michał Koziarski

TL;DR

This paper introduces a novel framework for designing small molecules guided directly by high-content cell imaging data, bypassing the need for scarce, pre-annotated phenotypic labels. By combining unsupervised multimodal contrastive learning with Generative Flow Networks (GFlowNets), the model successfully generates diverse candidate molecules that exhibit high morphological and structural similarity to a specified biological target.

What Problem Does This Paper Address?

Phenotypic drug discovery focuses on finding molecules based on their observable biological effects—such as changes in cell shape, size, or structure captured via high-content imaging (HCI)—rather than their interaction with a specific protein target. While powerful, using these complex, high-dimensional images to guide the generation of entirely new molecules is incredibly difficult.

Traditional approaches rely on supervised machine learning models to link molecules to specific phenotypic labels. However, training these models requires massive amounts of labeled data, which is rare and expensive to collect. Furthermore, conventional virtual screening is limited to searching existing chemical libraries, missing out on the vast universe of potential drug-like molecules. This paper addresses the inverse problem: How can we generate entirely new, diverse molecules that induce a specific cellular phenotype using only a raw target image as guidance?

Methods

The authors propose a two-stage pipeline that eliminates the need for supervised annotations:

  1. Multimodal Contrastive Learning: They leverage a Geometric Multimodal Contrastive (GMC) learning model to align two completely different data types—molecular graphs and cell morphology images—into a shared latent embedding space. This unsupervised step ensures that a molecule and its corresponding cellular image are mapped close to one another.
  2. GFlowNet Generation: They train a Generative Flow Network (GFlowNet) to construct new molecules piece-by-piece. The reward function is defined as the normalized cosine similarity between the latent embedding of the target morphology image and the embedding of the generated molecule.
Overview of the proposed approach: aligning molecules and images via contrastive learning (top) and using the joint space to reward a GFlowNet molecular generator (bottom).

Crucially, GFlowNets are designed to sample candidates proportionally to their reward. This prevents the model from collapsing onto a single "optimal" molecular structure, forcing it instead to discover a highly diverse set of molecular candidates. The framework can also be conditioned on a joint representation of both a target morphology and a starting molecular structure, which is ideal for "scaffold hopping" (finding structurally distinct molecules with identical biological effects).

Datasets

  • Cell Painting Dataset: A standard benchmark containing 16,170 small molecules paired with high-content cell morphology images across five color channels (imaging different cellular compartments like the nucleus, nucleolus, actin cytoskeleton, endoplasmic reticulum, and mitochondria).
  • Broad Institute Assays: Data from multiple independent biological assays used to train "oracle" models. The authors selected 37 assays that could be predicted with high accuracy (AUROC > 0.9) to validate whether the generated molecules actually possess the expected downstream biological activity.

Key Insights and Ideas

  • Unsupervised Rewards are Viable: Bypassing supervised classification entirely by using a cross-modal contrastive embedding space provides a sufficiently strong and accurate reward signal to guide generative chemistry.
  • The Power of Diversity: In drug discovery, finding multiple distinct chemical structures that achieve the same biological effect is vital to mitigate downstream failures like toxicity. GFlowNets vastly outperform standard reinforcement learning (RL) baselines by discovering a significantly higher number of unique molecular "modes."
  • The Structure Bias Paradox: When conditioning the model on a joint target (morphology + structure), the generator successfully produces molecules with higher structural similarity to the target. However, this does not increase the proportion of molecules with high predicted biological activity compared to a morphology-only target. The authors hypothesize that the joint embedding space inherently prioritizes structural signals over morphological ones, occasionally distracting the generator from the pure phenotypic goal.
Figure 2: Correlation between the similarity in morphological feature space and latent similarity between target structure and a) morphology (left) or b) joint morphology and structure (right).

Key Results

  • Superior Mode Discovery: GFlowNet discovered significantly more unique molecular modes (molecules with high reward but low structural similarity to each other) compared to standard RL baselines like Soft Actor-Critic (SAC) and Soft Q-Learning (SQL).
  • Target Recovery: GFlowNet achieved the highest maximum Tanimoto structural similarity to the ground-truth target molecules (0.337 for morphology-only and 0.451 for joint targets), proving its ability to reverse-engineer the chemical structures behind specific cellular changes.
  • Biological Validity: Independent oracle models confirmed that the generated molecules had a significantly higher probability ($\ge 0.7$) of showing positive assay activity compared to random screening.
Distribution of rewards for generated samples across different methods.

Limitations and Future Work

  • Latent Space Noise: The correlation between the latent similarity and actual morphological similarity is moderate ($r \approx 0.47$). Improving the robustness of the underlying cross-modal representations will be crucial for reducing variance.
  • Single-Target Training: Currently, a separate GFlowNet must be trained for each specific target morphology. Developing a fully conditional GFlowNet that can take any arbitrary image as an input vector is a key next step to reduce computational overhead.
  • Multi-Objective Optimization: The current model does not explicitly optimize for other critical drug properties like synthesizability, toxicity, or drug-likeness, though these could theoretically be integrated as additional reward terms.

Summary updated

BibTeX
@misc{lu2024cell,
  author = {Stephen Zhewen Lu and Ziqing Lu and Ehsan Hajiramezanali and Tommaso Biancalani and Yoshua Bengio and Gabriele Scalia and Michał Koziarski},
  title = {{Cell Morphology-Guided Small Molecule Generation with GFlowNets}},
  year = {2024},
  eprint = {2408.05196},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2408.05196},
}
Figure