Upload README.md with huggingface_hub
Browse files
README.md
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
tags:
|
| 4 |
+
- pathology
|
| 5 |
+
- histopathology
|
| 6 |
+
- foundation-model
|
| 7 |
+
- self-supervised
|
| 8 |
+
- dinov2
|
| 9 |
+
- vision-transformer
|
| 10 |
+
- digital-pathology
|
| 11 |
+
library_name: pytorch
|
| 12 |
+
pipeline_tag: image-feature-extraction
|
| 13 |
+
extra_gated_prompt: >-
|
| 14 |
+
Access is granted for research use. By requesting access you agree to cite the OpenPath paper.
|
| 15 |
+
extra_gated_fields:
|
| 16 |
+
Name: text
|
| 17 |
+
Affiliation: text
|
| 18 |
+
Intended use: text
|
| 19 |
+
---
|
| 20 |
+
|
| 21 |
+
# OpenPath — Checkpoints
|
| 22 |
+
|
| 23 |
+
Teacher checkpoints of **[OpenPath](https://huggingface.co/taejoon89/openpath)**, a **ViT-g/14**
|
| 24 |
+
pathology foundation model pre-trained with self-supervision (**DINOv2** + gram anchoring) on
|
| 25 |
+
**public-only** whole-slide histopathology tiles ([OpenPath corpus](https://huggingface.co/datasets/taejoon89/openpath-corpus)).
|
| 26 |
+
|
| 27 |
+
> **Headline result.** On **AMC-HCC-ST** — a contamination-free in-house Asan Medical Center
|
| 28 |
+
> hepatocellular-carcinoma spatial-transcriptomics cohort, the least leakage-prone benchmark since no
|
| 29 |
+
> public foundation model was trained on it — OpenPath **ranks #1 among seven foundation models**.
|
| 30 |
+
|
| 31 |
+
## Checkpoints
|
| 32 |
+
|
| 33 |
+
- **61 teacher checkpoints**: `training_0` … `training_345000`, every **5,750 iters** (≈ 1 native epoch total).
|
| 34 |
+
- Each is `training_<iter>/teacher_checkpoint.pth` (ViT-g/14 reg4, 1536-dim CLS embedding).
|
| 35 |
+
- **Released model = `training_316250`** — selected by the clean AMC-HCC-ST benchmark. (OpenPath's
|
| 36 |
+
HEST-1K peaks earlier, ~`training_23000` at ~0.38; pick a checkpoint to match your task.)
|
| 37 |
+
|
| 38 |
+
## Load & extract embeddings
|
| 39 |
+
|
| 40 |
+
Requires the OpenPath / DINOv2 code (`taejoon89/openpath`).
|
| 41 |
+
|
| 42 |
+
```python
|
| 43 |
+
import torch, dinov2.models.vision_transformer as vits
|
| 44 |
+
ck = torch.load("training_316250/teacher_checkpoint.pth", map_location="cpu", weights_only=False)
|
| 45 |
+
sd = {k[len("backbone."):]: v for k, v in ck["teacher"].items() if k.startswith("backbone.")}
|
| 46 |
+
m = vits.vit_giant2(patch_size=14, img_size=224, block_chunks=4, num_register_tokens=4,
|
| 47 |
+
ffn_layer="swiglufused", init_values=1e-5,
|
| 48 |
+
interpolate_antialias=True, interpolate_offset=0.0)
|
| 49 |
+
m.load_state_dict(sd, strict=True); m.eval()
|
| 50 |
+
cls = m.forward_features(x)["x_norm_clstoken"] # (B, 1536), ImageNet-normalized 224x224 input
|
| 51 |
+
```
|
| 52 |
+
|
| 53 |
+
## Evaluation
|
| 54 |
+
|
| 55 |
+
Frozen-encoder linear/ridge probing, all models under one protocol (sorted by the clean AMC-HCC-ST
|
| 56 |
+
cohort). AMC-HCC-ST is our headline because public benchmarks (HEST-1K, CRC, BACH) derive from
|
| 57 |
+
repositories these FMs were pre-trained on and are confounded by **train/test leakage**.
|
| 58 |
+
|
| 59 |
+
| Model | AMC-HCC-ST (clean) ↓ | HEST-1K (public) | NCT-CRC-HE (9-cls acc) | BACH (4-cls acc) |
|
| 60 |
+
|---|---|---|---|---|
|
| 61 |
+
| **OpenPath (`training_316250`)** | **0.323** | 0.372 | 0.954 | 0.761 |
|
| 62 |
+
| UNI2-h | 0.301 | 0.414 | 0.966 | 0.908 |
|
| 63 |
+
| OpenMidnight | 0.300 | 0.390 | 0.967 | 0.906 |
|
| 64 |
+
| Virchow2 | 0.292 | 0.398 | 0.964 | 0.875 |
|
| 65 |
+
| prov-gigapath | 0.286 | 0.393 | 0.953 | 0.752 |
|
| 66 |
+
| Phikon-v2 | 0.274 | 0.375 | 0.937 | 0.708 |
|
| 67 |
+
| UNI | 0.257 | 0.386 | 0.946 | 0.777 |
|
| 68 |
+
|
| 69 |
+
## Intended use & limitations
|
| 70 |
+
|
| 71 |
+
Frozen feature extractor for **H&E** histopathology tiles (native ~40× / 0.5 µm-per-pixel, ImageNet
|
| 72 |
+
normalization) → 1536-dim CLS embedding for linear/ridge probing, k-NN, MIL, retrieval. **Not a
|
| 73 |
+
medical device**; not for diagnosis. Public-benchmark numbers are leakage-confounded; it is a
|
| 74 |
+
patch-level encoder (slide-level context needs a separate aggregator). See the
|
| 75 |
+
[model / code card](https://huggingface.co/taejoon89/openpath) for details.
|
| 76 |
+
|
| 77 |
+
## Related artifacts
|
| 78 |
+
|
| 79 |
+
| Artifact | Hugging Face repo | Notes |
|
| 80 |
+
|---|---|---|
|
| 81 |
+
| **Corpus** | `taejoon89/openpath-corpus` | Native 40× pathology tiles, 33,991 WebDataset shards / ~17 TB |
|
| 82 |
+
| **Checkpoints** | `taejoon89/openpath-checkpoints` | This repository |
|
| 83 |
+
| **Code** | `taejoon89/openpath` | training & evaluation code (also on [GitHub](https://github.com/taejoon89/openpath)) |
|
| 84 |
+
|
| 85 |
+
## Citation
|
| 86 |
+
|
| 87 |
+
```bibtex
|
| 88 |
+
@misc{openpath2026,
|
| 89 |
+
title = {OpenPath: Public-Data Pathology Foundation Models and Leakage-Free Evaluation},
|
| 90 |
+
author = {OpenPath authors},
|
| 91 |
+
year = {2026},
|
| 92 |
+
note = {https://huggingface.co/taejoon89/openpath}
|
| 93 |
+
}
|
| 94 |
+
```
|
| 95 |
+
|
| 96 |
+
## Acknowledgements
|
| 97 |
+
|
| 98 |
+
This research was supported by a grant of the Korea Health Technology R&D Project through the Korea
|
| 99 |
+
Health Industry Development Institute (KHIDI), funded by the Ministry of Health & Welfare, Republic of
|
| 100 |
+
Korea (grant number: HR21C0198); the Advanced GPU Utilization Support Program funded by the Government
|
| 101 |
+
of the Republic of Korea, Ministry of Science and ICT; and the National Research Foundation of Korea
|
| 102 |
+
(NRF) grant funded by the Korean government (MSIT) (grant number: RS-2026-25522634).
|
| 103 |
+
|
| 104 |
+
## License
|
| 105 |
+
|
| 106 |
+
**Weights — Apache-2.0** (warm-started from Meta DINOv2 ViT-g/14-reg, itself Apache-2.0). Training
|
| 107 |
+
data: public pathology datasets under CC-BY / CC0 / NIH-open terms.
|