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-network
|
| 10 |
+
- esm2
|
| 11 |
+
- drug-repurposing
|
| 12 |
+
- multimodal
|
| 13 |
+
- transfer-learning
|
| 14 |
+
datasets:
|
| 15 |
+
- pdbbind-v2020
|
| 16 |
+
metrics:
|
| 17 |
+
- rmse
|
| 18 |
+
- pearsonr
|
| 19 |
+
pipeline_tag: other
|
| 20 |
+
---
|
| 21 |
+
|
| 22 |
+
# DeepPharm: Multi-Modal Transfer Learning for Drug-Target Affinity Prediction
|
| 23 |
+
|
| 24 |
+
## Model Description
|
| 25 |
+
|
| 26 |
+
**DeepPharm** is a multi-modal deep learning framework for predicting protein–ligand binding affinity ($pK$). It combines:
|
| 27 |
+
|
| 28 |
+
- **GATv2** molecular graph encoder (3 layers, 4 heads)
|
| 29 |
+
- **ECFP4** fingerprint MLP encoder (2048→128)
|
| 30 |
+
- **Gated Fusion** mechanism for adaptive ligand representation
|
| 31 |
+
- **ESM-2** protein language model (150M params, fine-tuned)
|
| 32 |
+
- **Stacked Cross-Attention** (2 layers, 4 heads) for drug-protein interaction
|
| 33 |
+
- **Residual Prediction Head** with SiLU activation
|
| 34 |
+
|
| 35 |
+
### Two Modes of Operation
|
| 36 |
+
|
| 37 |
+
| Mode | Task | Input | Output |
|
| 38 |
+
|------|------|-------|--------|
|
| 39 |
+
| **Mode A** | Supervised affinity prediction | Drug SMILES + Protein sequence | pK value |
|
| 40 |
+
| **Mode B** | Weakly supervised drug repurposing | Drug + Disease signature | Ranked candidates |
|
| 41 |
+
|
| 42 |
+
## Performance
|
| 43 |
+
|
| 44 |
+
### Systematic Ablation (PDBbind v2020, $N_{test}=3{,}775$)
|
| 45 |
+
|
| 46 |
+
| Config | RMSE ↓ | Pearson ↑ | Spearman ↑ |
|
| 47 |
+
|--------|--------|-----------|------------|
|
| 48 |
+
| V1 Baseline (ESM-35M) | 1.266 | 0.743 | 0.743 |
|
| 49 |
+
| V2 Architecture | 1.258 | 0.748 | 0.746 |
|
| 50 |
+
| V2 + CosineWR | 1.244 | 0.753 | 0.750 |
|
| 51 |
+
| **V2 + ESM-150M (Best)** | **1.229** | **0.762** | **0.760** |
|
| 52 |
+
| V2 + EMA | 1.247 | 0.753 | 0.753 |
|
| 53 |
+
|
| 54 |
+
### Five-Seed Ensemble (Best Configuration)
|
| 55 |
+
|
| 56 |
+
| Metric | Mean ± Std |
|
| 57 |
+
|--------|-----------|
|
| 58 |
+
| RMSE | 1.246 ± 0.005 |
|
| 59 |
+
| Pearson r | 0.751 ± 0.002 |
|
| 60 |
+
| Spearman ρ | 0.750 ± 0.002 |
|
| 61 |
+
|
| 62 |
+
CV < 0.4% confirms high reproducibility.
|
| 63 |
+
|
| 64 |
+
### Baselines (all re-implemented on same split)
|
| 65 |
+
|
| 66 |
+
| Model | RMSE ↓ | Pearson ↑ |
|
| 67 |
+
|-------|--------|-----------|
|
| 68 |
+
| DeepDTA (CNN) | 1.48 | 0.61 |
|
| 69 |
+
| GraphDTA (GCN) | 1.39 | 0.67 |
|
| 70 |
+
| MolCLR* | 1.30 | 0.74 |
|
| 71 |
+
| DrugBAN | 1.28 | 0.76 |
|
| 72 |
+
| **DeepPharm V2** | **1.23** | **0.76** |
|
| 73 |
+
|
| 74 |
+
## Intended Use
|
| 75 |
+
|
| 76 |
+
- High-throughput virtual screening of drug candidates
|
| 77 |
+
- Binding affinity prediction for drug-target pairs
|
| 78 |
+
- Hypothesis generation for drug repurposing in orphan diseases
|
| 79 |
+
- Research and academic purposes
|
| 80 |
+
|
| 81 |
+
## Limitations
|
| 82 |
+
|
| 83 |
+
- 2D topological encoder; cannot distinguish stereoisomers
|
| 84 |
+
- Trained on PDBbind v2020, which overrepresents kinases
|
| 85 |
+
- Mode B uses drug priors (guilt-by-association), not zero-shot inference
|
| 86 |
+
- Predictions require experimental validation
|
| 87 |
+
|
| 88 |
+
## Training Details
|
| 89 |
+
|
| 90 |
+
- **Dataset:** PDBbind v2020 General Set (15,100 train / 3,775 test, seed=42)
|
| 91 |
+
- **Hardware:** 1× NVIDIA H100 80 GB
|
| 92 |
+
- **Optimizer:** AdamW (backbone LR: 5e-6, head LR: 8e-4)
|
| 93 |
+
- **Scheduler:** CosineAnnealing with Warm Restarts ($T_0$=10, $T_{mult}$=2)
|
| 94 |
+
- **Loss:** MSE + 0.3·RankingLoss + 0.2·HuberLoss
|
| 95 |
+
- **Training time:** ~11 min/epoch (ESM-2 150M), best checkpoint at epoch 18
|
| 96 |
+
|
| 97 |
+
## Available Checkpoints
|
| 98 |
+
|
| 99 |
+
| File | Description | RMSE |
|
| 100 |
+
|------|-------------|------|
|
| 101 |
+
| `best_v2_esm150m.pt` | Best V2 model (ESM-2 150M) | 1.229 |
|
| 102 |
+
| `best_v1_esm35m.pt` | V1 Baseline (ESM-2 35M) | 1.266 |
|
| 103 |
+
|
| 104 |
+
## How to Use
|
| 105 |
+
|
| 106 |
+
```python
|
| 107 |
+
from huggingface_hub import hf_hub_download
|
| 108 |
+
|
| 109 |
+
# Download the best model
|
| 110 |
+
path = hf_hub_download("chamoso/DeepPharm", "best_v2_esm150m.pt")
|
| 111 |
+
|
| 112 |
+
# Load in PyTorch
|
| 113 |
+
import torch
|
| 114 |
+
checkpoint = torch.load(path, map_location="cpu")
|
| 115 |
+
```
|
| 116 |
+
|
| 117 |
+
For full inference with data preprocessing:
|
| 118 |
+
|
| 119 |
+
```bash
|
| 120 |
+
git clone https://github.com/chamoso/DeepPharm.git
|
| 121 |
+
cd DeepPharm
|
| 122 |
+
python scripts/predict.py \
|
| 123 |
+
--checkpoint weights/best_v2_esm150m.pt \
|
| 124 |
+
--smiles "CC(=O)Oc1ccccc1C(=O)O" \
|
| 125 |
+
--sequence "MKTAYIAKQRQISFVKSHFSRQLE..."
|
| 126 |
+
```
|
| 127 |
+
|
| 128 |
+
## Links
|
| 129 |
+
|
| 130 |
+
- **GitHub:** [chamoso/DeepPharm](https://github.com/chamoso/DeepPharm)
|
| 131 |
+
- **Live Demo:** [HuggingFace Spaces](https://huggingface.co/spaces/chamoso/DeepPharm)
|
| 132 |
+
|
| 133 |
+
## Citation
|
| 134 |
+
|
| 135 |
+
*Preprint coming soon.*
|
| 136 |
+
|
| 137 |
+
## License
|
| 138 |
+
|
| 139 |
+
MIT License
|