CoolFace
Modelpublic

homerquan/DrugClip

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes
Model Card

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 pos and atomic numbers z.
  • โ€”Text Encoder: distilbert-base-uncased
  • โ€”Latent Dimension: 128
  • โ€”Objective: InfoNCE (Contrastive Loss)

๐Ÿ’ป Usage

To use this checkpoint, you will need the drugclip python package.

python
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:

  1. 1.MolTextNet: Translating SMILES into structural graph geometries and natural language textual descriptions.
  2. 2.TDC Tox21: Mapping binary experimental toxicity assays to standardized string prompts.
  3. 3.TDC ClinTox: Aligning FDA clinical failure records with therapeutic penalty embeddings.