Safetensors

You need to agree to share your contact information to access this model

This repository is publicly accessible, but you have to accept the conditions to access its files and content.

Log in or Sign Up to review the conditions and access this model content.

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:
  • 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

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
Safetensors
Model size
85.7M params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Paper for SchuefflerLab/Pathryoshka-B