Run this model with HF Jobs

Run 1aurent/vit_base_patch16_224.pathoduet_ihc on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.

Paste one of these prompts into your coding agent:

Fine-tune on my dataset

Use HF Jobs to fine-tune https://huggingface.co/1aurent/vit_base_patch16_224.pathoduet_ihc. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.

Run batch inference

Use HF Jobs to run batch inference with https://huggingface.co/1aurent/vit_base_patch16_224.pathoduet_ihc on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.

Model card for vit_base_patch16_224.pathoduet_ihc

A Vision Transformer (ViT-Base/16, MoCo v3 with pretext token) histopathology foundation model for IHC images (PathoDuet).
Cross-scale position / cross-stain transfer pre-training on TCGA.

Model Details

Model Usage

Image Embeddings

from urllib.request import urlopen
from PIL import Image
import timm

# get example image
img = Image.open(
  urlopen("https://github.com/owkin/HistoSSLscaling/raw/main/assets/example.tif")
).convert('RGB')

# load model from the hub
model = timm.create_model(
  model_name="hf-hub:1aurent/vit_base_patch16_224.pathoduet_ihc",
  pretrained=True,
).eval()

# get model specific transforms (normalization, resize)
data_config = timm.data.resolve_model_data_config(model)
transforms = timm.data.create_transform(**data_config, is_training=False)

data = transforms(img).unsqueeze(0) # input is a (batch_size, num_channels, img_size, img_size) shaped tensor
output = model(data)  # output is a (batch_size, num_features) shaped tensor

Citation

@article{hua2024pathoduet,
  title  = {PathoDuet: Foundation models for pathological slide analysis of H&E and IHC stains},
  author = {Hua, Shengyi and Yan, Fang and Shen, Tianle and Ma, Lei and Zhang, Xiaofan},
  journal = {Medical Image Analysis},
  volume = {97},
  pages  = {103289},
  year   = {2024},
  doi    = {10.1016/j.media.2024.103289}
}
Downloads last month
58
Safetensors
Model size
85.8M params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Collection including 1aurent/vit_base_patch16_224.pathoduet_ihc

Paper for 1aurent/vit_base_patch16_224.pathoduet_ihc