|
Download README.md from SchuefflerLab/Pathryoshka-B: direct link, hf CLI and curl.
- Browser
- Download file 2.4 kB
-
https://huggingface.co/SchuefflerLab/Pathryoshka-B/resolve/main/README.md
- Command line
-
hf download hf://SchuefflerLab/Pathryoshka-B/README.md
-
curl -L -H "Authorization: Bearer $HF_TOKEN" -o README.md https://huggingface.co/SchuefflerLab/Pathryoshka-B/resolve/main/README.md
2.4 kB
| license: cc-by-nc-nd-4.0 | |
| # Model card for Pathryoshka-B | |
| Pathryoshka-B is a pathology foundation model distilled from three teacher models: UNI2-h, H-Optimus-1, and Virchow2. It is trained on a internal dataset consisting of 243M tiles extracted from H&E whole slide images. The outputs of the model are nested embeddings that can be adapted to computational contraints for downstream tasks. Nested embeddings are explicitly trained until dim/16. | |
| ## Model Details | |
| - **Developed by:** Technical University of Munich | |
| - **Model Type:** Image feature backbone | |
| - **Model Stats:** | |
| - Params (M): 86 | |
| - Image size: 224 x 224 | |
| - **Model Architecture:** | |
| - Architecture: ViT-B/14 | |
| - Patch size: 14 | |
| - Layers: 12 | |
| - Embedding dimension: 768 | |
| - Register tokens: 4 | |
| - **Training Details:** | |
| - Precision: Mixed precision (`fp16`) | |
| - **Paper:** | |
| - Pathryoshka: Compressing Pathology Foundation Models via Multi-Teacher Knowledge Distillation with Nested Embeddings https://arxiv.org/abs/2511.23204 | |
| - **Pretraining Dataset:** Internal dataset of 243M tiles sampled from H&E whole slide images. | |
| - **License:** CC-BY-NC-4.0 | |
| ### Model Usage | |
| ```python | |
| import timm | |
| import torch | |
| from timm.data import resolve_data_config | |
| from timm.data.transforms_factory import create_transform | |
| from PIL import Image | |
| model = timm.create_model("hf-hub:SchuefflerLab/pathryoshka-b", pretrained=True) | |
| model = model.eval() | |
| transforms = create_transform(**resolve_data_config(model.pretrained_cfg, model=model)) | |
| image = Image.open("/path/to/image.jpg") | |
| # Image must be of size: 1 x 3 x 224 x 224 | |
| image = transforms(image).unsqueeze(0) | |
| output = model(image) # CLS token size: 1 x 768 | |
| # To make use of nested embeddings the outputs can simply be sliced beginning at index 0 | |
| # Nested embedding at dim/16: | |
| output = output[:48] | |
| ``` | |
| **Repositories used in this work** | |
| - AM-RADIO: https://github.com/nvlabs/radio | |
| - UNI2-h: https://huggingface.co/MahmoodLab/UNI2-h | |
| - Virchow2: https://huggingface.co/paige-ai/Virchow2 | |
| - H-Optimus-1: https://huggingface.co/bioptimus/H-optimus-1 | |
| **License** | |
| The model in this repository is released under CC-BY-NC-ND-4.0 — see LICENSE. | |
| Licenses permits academic / research use only; commercial use is not allowed. By downloading and using the model you also agree to the license agreements of the respective teacher models. The links to the respective models can be found above. |