Downloads · 30 days
111
3% of all-time downloads
1aurent/vit_small_patch16_256.tcga_brca_dino
vit_small_patch16_256.tcga_brca_dino is a feature extraction model from 1aurent. Use it when you need embeddings to search or compare text. It is set up for timm. The card lists the license as gpl-3.0.
A Vision Transformer (ViT) image classification model. \ Trained on 2M histology patches from TCGA-BRCA.
Downloads · 30 days
111
3% of all-time downloads
All-time downloads
3.8K
Public
Parameters
21.7M
86.7 MB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors86.7 MB · 100%
From the Hugging Face model README
A Vision Transformer (ViT) image classification model.
Trained on 2M histology patches from TCGA-BRCA.

from urllib.request import urlopen
from PIL import Image
import timm
# get example histology image
img = Image.open(
urlopen(
"https://github.com/owkin/HistoSSLscaling/raw/main/assets/example.tif"
)
)
# load model from the hub
model = timm.create_model(
model_name="hf-hub:1aurent/vit_small_patch16_256.tcga_brca_dino",
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)) # output is (batch_size, num_features) shaped tensor
@misc{chen2022selfsupervised,
title = {Self-Supervised Vision Transformers Learn Visual Concepts in Histopathology},
author = {Richard J. Chen and Rahul G. Krishnan},
year = {2022},
eprint = {2203.00585},
archiveprefix = {arXiv},
primaryclass = {cs.CV}
}