deku-0621/DrugCMF

Python

3

4 commits

updated May 30, 2026

See the code

README

🧬 DrugCMF: Confidence-aware Multimodal Fusion for Drug-Target Interaction Prediction

AAAI 2026 License: CC BY-NC 4.0 Read Paper

🚀 Official implementation of DrugCMF, accepted at AAAI 2026 🎉


📰 News

  • [2026-01] 🎉 DrugCMF accepted at AAAI 2026!
  • [2026-05] 🚀 Code and datasets released.

🔬 Overview

💊 Drug-target interaction (DTI) prediction is a fundamental task in drug discovery. 1D sequences 🧬 and 3D structures 🏗️ capture complementary information but vary in reliability across different drug–protein pairs 🧑‍🔬. DrugCMF addresses this modality reliability gap through a confidence-aware multimodal fusion 🔗 framework.

assets/image0.png

🏆 Key Contributions

  1. 🧩 Quadruple-Modal Representations — Each DTI pair is represented by four views: MolFormer (1D drug) + ProtT5 (1D protein) as the textual modality, and UniMol (3D drug) + SaProt (3D protein) as the structural modality.
  2. 🔄 Bidirectional Cross-Attention — Within each modality, drug and protein representations attend to each other before fusion, combined with residual connections and average/max pooling.
  3. 🎯 Trusted-Confidence Prediction (TCP) — A learned confidence score per modality that adaptively weights each modality's contribution. The TCP loss aligns confidence scores with softmax probabilities via MSE, mitigating the impact of unreliable representations.
  4. 🧠 Cross-Modal Transformer & Attentional Pooling — Modality features are stacked and refined through a Transformer encoder, then aggregated via a learnable multi-head attentional pooler before final classification.
DrugCMF Architecture

📊 Experimental Results

🏠 In-domain Performance

In-domain SOTA comparison

🌍 Cross-domain Performance

Cross-domain SOTA comparison

⚙️ Implementations

📦 Datasets

Datasets can be downloaded from:

Dataset#PairsDescription
🧑 Human~6.7KCurated human drug-target interactions
🔬 BindingDB~49.2KLarge-scale binding affinity database (49,189 pairs)
🌐 BioSNAP~27.4KBiomedical network interactions (27,380 pairs)

✂️ Splits:

  • 🎲 Random — Random train/val/test split
  • ❄️ Cold — Cold-start setting (novel drugs/proteins in test, Human only)
  • 🔷 Cluster — Cluster-based split for domain generalization (BindingDB / BioSNAP only)

Each split CSV contains 6 columns (SMILES, Protein, Y, Structure, SMILES_id, Protein_id). Cluster splits additionally include drug_cluster and target_cluster columns.


🤖 Pre-trained Models

Model weights are downloaded automatically from HuggingFace 🤗:

ModelHuggingFace IDDim
🧬 ProtT5Rostlab/prot_t5_xl_half_uniref50-enc1024
🔬 SaProtWestlake-R/SaProt_650M_AF21280
💊 MolFormeribm/MoLFormer-XL-both-10p1024768
🧪 UniMoldptech/Uni-Mol-Models512

⏳ Preprocessing

Generate all four embeddings offline before training 🏗️:

python preprocess/get_embedding.py \
    --dataset bindingdb \
    --data_path datasets/bindingdb/processed_full.csv \
    --save_path embeddings/bindingdb \
    --device cuda:0 \
    --seed 42

Or generate for all three datasets at once ⚡:

bash preprocess/run_embedding.sh

This produces .pt files in embeddings/{dataset}/{type}_embeddings/ containing seq_emb and mask tensors 📁.


📋 Requirements

All dependencies are listed in requirements.txt 📄. Key packages:

PackageVersion
🐍 Python3.10+
🔥 PyTorch2.6.0
🤗 Transformers4.47.0
🧪 RDKit2024.3.2
📈 scikit-learn1.5.2
🐼 pandas2.2.3
⚙️ yacs0.1.8

🚂 Training

Train on the Human dataset with a cold-start split:

python main.py --dataset human --split cold --device cuda:0

Run with multiple random seeds 🌱:

bash train.sh

📁 Repository Structure

├── main.py                  # Training & evaluation entry point
├── model.py                 # DrugCMF model architecture
├── modules.py               # Building blocks (ModalityInteractionLearner, Classifier, MultiModalAttentionalPooler)
├── attention.py             # BidirectionalCrossAttention, AttentionalPooler
├── dataloader.py            # DTIDataset & DataLoader (loads pre-computed embeddings)
├── train_util.py            # Training & evaluation loops (AdamW, ReduceLROnPlateau, early stopping)
├── utils.py                 # Reproducibility seed, collate function, checkpoint I/O, logger
├── requirements.txt         # Full Python dependencies
├── train.sh                 # Multi-seed training script (11 seeds)
│
├── preprocess/              # Offline embedding generation
│   ├── get_embedding.py     # Generate all 4 embeddings for a dataset
│   └── run_embedding.sh     # SLURM batch script for all datasets
│
├── unimol/                  # UniMol implementation (based on DP Technology)
│   ├── unimol.py
│   ├── unimol_utils.py
│   └── transformers.py
│
└── datasets/                # Preprocessed CSV splits
    ├── README.md
    ├── human/
    │   ├── processed_full.csv
    │   ├── cold/   {train,val,test}.csv
    │   └── random/ {train,val,test}.csv
    ├── bindingdb/
    │   ├── processed_full.csv
    │   ├── random/ ...csv
    │   └── cluster/ {source_train,target_test}.csv
    └── biosnap/
        ├── processed_full.csv
        ├── random/ ...csv
        └── cluster/ {source_train,target_test}.csv

📖 Citation

If you find DrugCMF useful, please cite our paper 🙏:

@inproceedings{yang2026bridging,
  title={Bridging the Modality Reliability Gap in Drug-Target Interaction Prediction via a Confidence-aware Multimodal Fusion Framework},
  author={Yang, Jie and Zhang, Junxiong and Qian, Kun and Yang, Qingyu and Li, Weikai and Cheng, Zhen},
  booktitle={Proceedings of the AAAI Conference on Artificial Intelligence},
  volume={40},
  number={32},
  pages={27529--27537},
  year={2026}
}

⚖️ License

  • 🧑‍💻 All code except unimol/: CC BY-NC 4.0 — Creative Commons Attribution-NonCommercial 4.0 International. Sharing and adaptation for non-commercial purposes only, with attribution.
  • 🧪 unimol/ (from DP Technology / Uni-Core): MIT License, as originally licensed.

deku-0621/DrugCMF

Python

3

4 commits

updated May 30, 2026

See the code

README

🧬 DrugCMF: Confidence-aware Multimodal Fusion for Drug-Target Interaction Prediction

AAAI 2026 License: CC BY-NC 4.0 Read Paper

🚀 Official implementation of DrugCMF, accepted at AAAI 2026 🎉


📰 News

  • [2026-01] 🎉 DrugCMF accepted at AAAI 2026!
  • [2026-05] 🚀 Code and datasets released.

🔬 Overview

💊 Drug-target interaction (DTI) prediction is a fundamental task in drug discovery. 1D sequences 🧬 and 3D structures 🏗️ capture complementary information but vary in reliability across different drug–protein pairs 🧑‍🔬. DrugCMF addresses this modality reliability gap through a confidence-aware multimodal fusion 🔗 framework.

assets/image0.png

🏆 Key Contributions

  1. 🧩 Quadruple-Modal Representations — Each DTI pair is represented by four views: MolFormer (1D drug) + ProtT5 (1D protein) as the textual modality, and UniMol (3D drug) + SaProt (3D protein) as the structural modality.
  2. 🔄 Bidirectional Cross-Attention — Within each modality, drug and protein representations attend to each other before fusion, combined with residual connections and average/max pooling.
  3. 🎯 Trusted-Confidence Prediction (TCP) — A learned confidence score per modality that adaptively weights each modality's contribution. The TCP loss aligns confidence scores with softmax probabilities via MSE, mitigating the impact of unreliable representations.
  4. 🧠 Cross-Modal Transformer & Attentional Pooling — Modality features are stacked and refined through a Transformer encoder, then aggregated via a learnable multi-head attentional pooler before final classification.
DrugCMF Architecture

📊 Experimental Results

🏠 In-domain Performance

In-domain SOTA comparison

🌍 Cross-domain Performance

Cross-domain SOTA comparison

⚙️ Implementations

📦 Datasets

Datasets can be downloaded from:

Dataset#PairsDescription
🧑 Human~6.7KCurated human drug-target interactions
🔬 BindingDB~49.2KLarge-scale binding affinity database (49,189 pairs)
🌐 BioSNAP~27.4KBiomedical network interactions (27,380 pairs)

✂️ Splits:

  • 🎲 Random — Random train/val/test split
  • ❄️ Cold — Cold-start setting (novel drugs/proteins in test, Human only)
  • 🔷 Cluster — Cluster-based split for domain generalization (BindingDB / BioSNAP only)

Each split CSV contains 6 columns (SMILES, Protein, Y, Structure, SMILES_id, Protein_id). Cluster splits additionally include drug_cluster and target_cluster columns.


🤖 Pre-trained Models

Model weights are downloaded automatically from HuggingFace 🤗:

ModelHuggingFace IDDim
🧬 ProtT5Rostlab/prot_t5_xl_half_uniref50-enc1024
🔬 SaProtWestlake-R/SaProt_650M_AF21280
💊 MolFormeribm/MoLFormer-XL-both-10p1024768
🧪 UniMoldptech/Uni-Mol-Models512

⏳ Preprocessing

Generate all four embeddings offline before training 🏗️:

python preprocess/get_embedding.py \
    --dataset bindingdb \
    --data_path datasets/bindingdb/processed_full.csv \
    --save_path embeddings/bindingdb \
    --device cuda:0 \
    --seed 42

Or generate for all three datasets at once ⚡:

bash preprocess/run_embedding.sh

This produces .pt files in embeddings/{dataset}/{type}_embeddings/ containing seq_emb and mask tensors 📁.


📋 Requirements

All dependencies are listed in requirements.txt 📄. Key packages:

PackageVersion
🐍 Python3.10+
🔥 PyTorch2.6.0
🤗 Transformers4.47.0
🧪 RDKit2024.3.2
📈 scikit-learn1.5.2
🐼 pandas2.2.3
⚙️ yacs0.1.8

🚂 Training

Train on the Human dataset with a cold-start split:

python main.py --dataset human --split cold --device cuda:0

Run with multiple random seeds 🌱:

bash train.sh

📁 Repository Structure

├── main.py                  # Training & evaluation entry point
├── model.py                 # DrugCMF model architecture
├── modules.py               # Building blocks (ModalityInteractionLearner, Classifier, MultiModalAttentionalPooler)
├── attention.py             # BidirectionalCrossAttention, AttentionalPooler
├── dataloader.py            # DTIDataset & DataLoader (loads pre-computed embeddings)
├── train_util.py            # Training & evaluation loops (AdamW, ReduceLROnPlateau, early stopping)
├── utils.py                 # Reproducibility seed, collate function, checkpoint I/O, logger
├── requirements.txt         # Full Python dependencies
├── train.sh                 # Multi-seed training script (11 seeds)
│
├── preprocess/              # Offline embedding generation
│   ├── get_embedding.py     # Generate all 4 embeddings for a dataset
│   └── run_embedding.sh     # SLURM batch script for all datasets
│
├── unimol/                  # UniMol implementation (based on DP Technology)
│   ├── unimol.py
│   ├── unimol_utils.py
│   └── transformers.py
│
└── datasets/                # Preprocessed CSV splits
    ├── README.md
    ├── human/
    │   ├── processed_full.csv
    │   ├── cold/   {train,val,test}.csv
    │   └── random/ {train,val,test}.csv
    ├── bindingdb/
    │   ├── processed_full.csv
    │   ├── random/ ...csv
    │   └── cluster/ {source_train,target_test}.csv
    └── biosnap/
        ├── processed_full.csv
        ├── random/ ...csv
        └── cluster/ {source_train,target_test}.csv

📖 Citation

If you find DrugCMF useful, please cite our paper 🙏:

@inproceedings{yang2026bridging,
  title={Bridging the Modality Reliability Gap in Drug-Target Interaction Prediction via a Confidence-aware Multimodal Fusion Framework},
  author={Yang, Jie and Zhang, Junxiong and Qian, Kun and Yang, Qingyu and Li, Weikai and Cheng, Zhen},
  booktitle={Proceedings of the AAAI Conference on Artificial Intelligence},
  volume={40},
  number={32},
  pages={27529--27537},
  year={2026}
}

⚖️ License

  • 🧑‍💻 All code except unimol/: CC BY-NC 4.0 — Creative Commons Attribution-NonCommercial 4.0 International. Sharing and adaptation for non-commercial purposes only, with attribution.
  • 🧪 unimol/ (from DP Technology / Uni-Core): MIT License, as originally licensed.