MaskMol: Knowledge-guided Molecular Image Pre-Training Framework for Activity Cliffs

Zhixiang Cheng, Hongxin Xiang, Pengsen Ma, Li Zeng, Xin Jin, Xixi Yang, Jianxin Lin, Yang Deng, Bosheng Song, Xinxin Feng, Changhui Deng, Xiangxiang Zeng · DOI

Introduction

In the field of drug discovery, the "Activity Cliff" (AC) represents one of the most significant challenges for predictive modeling. An activity cliff occurs when two molecules with nearly identical chemical structures exhibit drastically different biological potencies. Traditional computational approaches, particularly those utilizing Graph Neural Networks (GNNs), often struggle to distinguish these pairs. This failure is primarily attributed to "representation collapse," where the aggregation of neighboring atom information in a graph structure over-smooths subtle differences, causing the model to map distinct molecules to the same point in its internal feature space.

To address this, we present MaskMol, a novel self-supervised pre-training framework that shifts the paradigm from graph-based representations to an image-based Vision Transformer (ViT) approach. By treating molecules as images and employing domain-specific masking, MaskMol effectively amplifies the minute structural variations necessary to navigate activity cliffs.

Methodology

The Image-Based Advantage

MaskMol utilizes a Vision Transformer (ViT) architecture to process molecular images. Unlike graph-based models that aggregate local connectivity, the ViT processes the global visual field, allowing it to better capture fine-grained visual differences. This prevents the over-smoothing inherent in GNNs and ensures that even a single atom substitution is reflected in the resulting representation.

Knowledge-Guided Pre-training

Standard self-supervised vision models, such as Masked Autoencoders (MAE), typically mask random pixels. However, molecular images are sparse, containing significant white space. To make pre-training more effective, MaskMol introduces "Knowledge-Guided" masking at three distinct chemical levels:

  1. Atom-level (AMPP): Masking individual atoms (e.g., Carbon, Nitrogen, Chlorine) to force the model to identify elements based on their surrounding context.
  2. Bond-level (BMPP): Masking specific bond types (single, double, triple, or aromatic) to teach the model the underlying connectivity of the molecule.
  3. Motif-level (MMPP): Masking larger functional groups or rings (e.g., benzene rings) to encourage the model to recognize complex chemical substructures.

By reconstructing these masked components, the model learns a deep, chemically-aware representation of molecular structure.

Experimental Results

Performance Benchmarks

MaskMol was pre-trained on 2 million unlabeled drug-like molecules from the PubChem database. Its performance was evaluated against 25 state-of-the-art baselines using the MoleculeACE benchmark, which consists of 10 diverse macromolecular target datasets.

  • Accuracy Gains: MaskMol achieved a relative improvement of 11.4% in Root Mean Square Error (RMSE) over the second-best model (InstructBio). In specific datasets, such as ABL11, the improvement reached as high as 22.4%.
  • Data Efficiency: Notably, MaskMol achieved these results using significantly less data than competitors; while models like ImageMol require 10 million or more molecules, MaskMol reached superior performance with only 2 million.

Virtual Screening and Interpretability

In a real-world application, MaskMol was used for virtual screening against the EP4 receptor. In a "blind" test using a patent-derived validation set, the model successfully identified 9 known inhibitors. Furthermore, interpretability analysis using Grad-CAM demonstrated that the model focuses its attention on the specific substructures responsible for activity cliffs, such as chlorine substitutions on aromatic rings.

Discussion and Future Work

The success of MaskMol suggests that the modality of molecular representation—image versus graph—plays a crucial role in solving the representation collapse problem. By utilizing a ViT and domain-specific masking, the model creates a clear boundary between active and inactive molecules in its feature space.

Despite these gains, some limitations remain. Currently, MaskMol operates on 2D images, which limits its ability to distinguish "chiral" molecules (mirror images with different biological effects). Future iterations of the framework will explore:

  • 3D Spatial Information: Incorporating 3D conformations to address chiral cliffs.
  • Multi-Modal Alignment: Integrating images with SMILES strings and graph data to create a more holistic molecular representation.
  • Expanded Tasks: Extending the model’s predictive capabilities to pharmacokinetic parameters and broader toxicity profiles.

Conclusion

MaskMol represents a significant step forward in drug discovery AI. By leveraging the strengths of computer vision and chemical domain knowledge, it provides a robust solution to the activity cliff problem, offering a more precise tool for identifying potent drug candidates in the early stages of development.

Summary updated

BibTeX
@inproceedings{cheng2025maskmol,
  author = {Zhixiang Cheng and Hongxin Xiang and Pengsen Ma and Li Zeng and Xin Jin and Xixi Yang and Jianxin Lin and Yang Deng and Bosheng Song and Xinxin Feng and Changhui Deng and Xiangxiang Zeng},
  title = {{MaskMol: Knowledge-guided Molecular Image Pre-Training Framework for Activity Cliffs}},
  booktitle = {BMC},
  year = {2025},
  doi = {10.1186/s12915-025-02389-3},
}
Figure