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)
- Precision: Mixed precision (
- 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
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.
- Downloads last month
- 12
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support
Paper for SchuefflerLab/Pathryoshka-B
Paper • 2511.23204 • Published • 2