Run this model with HF Jobs

Run 1aurent/vit_base_patch16_224.owkin_pancancer_ft_lc25000_lung 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.owkin_pancancer_ft_lc25000_lung. 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.owkin_pancancer_ft_lc25000_lung 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.owkin_pancancer_ft_lc25000_lung

A Vision Transformer (ViT) image classification model.
Trained by Owkin on 40M pan-cancer histology tiles from TCGA.
Fine-tuned on LC25000's lung subset.

Model Details

Model Usage

Image Classification

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

# get example histology image
img = Image.open(
  urlopen(
    "https://huggingface.co/static-proxy/datasets-server.huggingface.co/assets/1aurent/LC25000/--/default/train/0/image/image.jpg"
  )
)

# load model from the hub
model = timm.create_model(
  model_name="hf-hub:1aurent/vit_base_patch16_224.owkin_pancancer_ft_lc25000_lung",
  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)

output = model(transforms(img).unsqueeze(0))  # unsqueeze single image into batch of 1

Image Embeddings

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

# get example histology image
img = Image.open(
  urlopen(
    "https://huggingface.co/static-proxy/datasets-server.huggingface.co/assets/1aurent/LC25000/--/default/train/0/image/image.jpg"
  )
)

# load model from the hub
model = timm.create_model(
  model_name="hf-hub:1aurent/vit_base_patch16_224.owkin_pancancer_ft_lc25000_lung",
  pretrained=True,
  num_classes=0,
).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)

output = model(transforms(img).unsqueeze(0))  # output is (batch_size, num_features) shaped tensor

Citation

@article {Filiot2023.07.21.23292757,
  author = {Alexandre Filiot and Ridouane Ghermi and Antoine Olivier and Paul Jacob and Lucas Fidon and Alice Mac Kain and Charlie Saillard and Jean-Baptiste Schiratti},
  title = {Scaling Self-Supervised Learning for Histopathology with Masked Image Modeling},
  elocation-id = {2023.07.21.23292757},
  year = {2023},
  doi = {10.1101/2023.07.21.23292757},
  publisher = {Cold Spring Harbor Laboratory Press},
  URL = {https://www.medrxiv.org/content/early/2023/09/14/2023.07.21.23292757},
  eprint = {https://www.medrxiv.org/content/early/2023/09/14/2023.07.21.23292757.full.pdf},
  journal = {medRxiv}
}
Downloads last month
156
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

Model tree for 1aurent/vit_base_patch16_224.owkin_pancancer_ft_lc25000_lung

Finetuned
(3)
this model

Dataset used to train 1aurent/vit_base_patch16_224.owkin_pancancer_ft_lc25000_lung

Evaluation results