DrugCLIP (Contrastive Graph-Text Drug Discovery Model) π§¬
DrugCLIP is a dual-encoder multimodal model (SchNet 3D Graph Neural Network + DistilBERT Text Encoder) mapped to a shared 128-dimensional latent space. It is designed to evaluate and retrieve novel 3D molecular structures by aligning them with natural language therapeutic intents and clinical failure modes (like toxicity).
This model is the foundational scoring backend for the BioTarget end-to-end drug discovery pipeline.
π― Model Architecture
- Graph Encoder: SchNet (3D Message Passing Neural Network). Processes atomic coordinates
posand atomic numbersz. - Text Encoder:
distilbert-base-uncased - Latent Dimension: 128
- Objective: InfoNCE (Contrastive Loss)
π» Usage
To use this checkpoint, you will need the drugclip python package.
import torch
from drugclip.models.align_model import DrugCLIP
# 1. Initialize the architecture
model = DrugCLIP(hidden_channels=64, out_dim=128, text_model='distilbert-base-uncased')
# 2. Load the downloaded checkpoint
state_dict = torch.load('best.ckpt', map_location='cpu')
model.load_state_dict(state_dict)
model.eval()
# 3. Embed natural language clinical intent
text_emb = model.text_encoder(['This molecule failed clinical trials due to severe toxicity and side effects.'])
text_emb = torch.nn.functional.normalize(text_emb, p=2, dim=1)
# (Molecular processing requires RDKit and PyTorch Geometric Data Batches)
π Training Data
The model's contrastive space was constructed using:
- MolTextNet: Translating SMILES into structural graph geometries and natural language textual descriptions.
- TDC Tox21: Mapping binary experimental toxicity assays to standardized string prompts.
- TDC ClinTox: Aligning FDA clinical failure records with therapeutic penalty embeddings.