Upload README.md with huggingface_hub
Browse files
README.md
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
library_name: pytorch
|
| 4 |
+
tags:
|
| 5 |
+
- biology
|
| 6 |
+
- protein-localization
|
| 7 |
+
- diffusion-model
|
| 8 |
+
- 3d
|
| 9 |
+
- cell-imaging
|
| 10 |
+
pipeline_tag: sequence-to-image
|
| 11 |
+
---
|
| 12 |
+
|
| 13 |
+
# DeepGPS-3D — baseline model weights
|
| 14 |
+
|
| 15 |
+
Pretrained weights for the **baseline DeepGPS-3D** model: a conditional 3D
|
| 16 |
+
denoising diffusion model that predicts a protein's 3D subcellular localization
|
| 17 |
+
volume from a matched nuclear 3D volume and the protein's ESM2 sequence
|
| 18 |
+
embedding.
|
| 19 |
+
|
| 20 |
+
- **Code / usage:** <https://github.com/royal-dargon/DeepGPS_3D>
|
| 21 |
+
- **File:** `best_model.pth` (~185 MB)
|
| 22 |
+
|
| 23 |
+
## Architecture
|
| 24 |
+
|
| 25 |
+
- **Diffusion:** DDPM, 1000 linear noise steps (β 1e-4 → 0.02).
|
| 26 |
+
- **Backbone:** conditional 3D U-Net, channel widths 32/64/128/256, two residual
|
| 27 |
+
blocks per level, 8-head attention at the bottleneck. Input is two spatial
|
| 28 |
+
channels (noisy protein volume + nucleus condition); output is the predicted
|
| 29 |
+
noise for a single protein channel.
|
| 30 |
+
- **Sequence conditioning:** precomputed ESM2-650M
|
| 31 |
+
(`facebook/esm2_t33_650M_UR50D`) 1,280-d embedding injected at every U-Net
|
| 32 |
+
scale.
|
| 33 |
+
- **Volume size:** 64 × 144 × 144 voxels.
|
| 34 |
+
- **Sampling:** classifier-free guided reverse diffusion (default guidance 3.0),
|
| 35 |
+
retaining nucleus and sequence conditions throughout.
|
| 36 |
+
|
| 37 |
+
## Training data
|
| 38 |
+
|
| 39 |
+
OpenCell confocal volumes, protein-disjoint split: 114,855 train images
|
| 40 |
+
(1,048 proteins) / 14,280 val (131) / 14,282 test (131). Trained with AdamW
|
| 41 |
+
(lr 1e-4), effective batch size 12 (batch 6 × grad-accum 2), up to 50 epochs,
|
| 42 |
+
seed 42.
|
| 43 |
+
|
| 44 |
+
## Usage
|
| 45 |
+
|
| 46 |
+
```bash
|
| 47 |
+
git clone https://github.com/royal-dargon/DeepGPS_3D
|
| 48 |
+
cd DeepGPS_3D
|
| 49 |
+
pip install -r requirements.txt
|
| 50 |
+
python scripts/download_weights.py --output weights/best_model.pth
|
| 51 |
+
|
| 52 |
+
python -m src.demo_infer \
|
| 53 |
+
--checkpoint weights/best_model.pth \
|
| 54 |
+
--nuclei example/WASL/WASL_nuclei.npy \
|
| 55 |
+
--embedding example/WASL/WASL_esm_650M_embedding.npz \
|
| 56 |
+
--reference example/WASL/WASL_reference.npz \
|
| 57 |
+
--output outputs/WASL_pred --device cuda
|
| 58 |
+
```
|
| 59 |
+
|
| 60 |
+
Or load directly:
|
| 61 |
+
|
| 62 |
+
```python
|
| 63 |
+
import torch
|
| 64 |
+
from src.model.diffusion import get_diffusion_model
|
| 65 |
+
from src.config import MODEL_CONFIG
|
| 66 |
+
|
| 67 |
+
model = get_diffusion_model(MODEL_CONFIG)
|
| 68 |
+
ckpt = torch.load("best_model.pth", map_location="cpu", weights_only=False)
|
| 69 |
+
state = ckpt["models"]["diffusion"] if isinstance(ckpt, dict) and "models" in ckpt else ckpt
|
| 70 |
+
model.load_state_dict(state.state_dict() if hasattr(state, "state_dict") else state)
|
| 71 |
+
model.eval()
|
| 72 |
+
# pred = model.sample_given_nuclei(nuclei[B,1,64,144,144], seq_emb[B,1280], guidance_scale=3.0)
|
| 73 |
+
```
|
| 74 |
+
|
| 75 |
+
## Intended use & limitations
|
| 76 |
+
|
| 77 |
+
Intended for research on protein subcellular localization and as the generative
|
| 78 |
+
backbone for the downstream mutation-localization and image-based PPI tasks in
|
| 79 |
+
the repository. The model reproduces coarse axial organization well and moderate
|
| 80 |
+
voxel/radial structure; it captures localization signal rather than exact
|
| 81 |
+
single-cell reconstruction. It is trained on one OpenCell split and reports
|
| 82 |
+
point estimates without confidence intervals. Not for clinical use.
|
| 83 |
+
|
| 84 |
+
## License
|
| 85 |
+
|
| 86 |
+
MIT. See the repository for details.
|