Virchow2 Patch Features for TCGA and CPTAC
Pre-extracted patch-level embeddings from the Virchow2 pathology foundation model for 11,760 whole-slide images (WSIs): 9,838 from TCGA (32 projects) and 1,922 from CPTAC (9 cohorts).
Features were extracted with TRIDENT. They are meant for weakly supervised slide-level tasks, such as multiple-instance learning (MIL) for classification, survival or biomarker prediction, without having to download or process the raw WSIs.
These features were produced for the study From Patches to Patients: A study of the tile-to-slide performance transferability in Digital Pathology. If you use them, please cite it (see Citation).
Extraction settings
| Setting | Value |
|---|---|
| Pipeline | TRIDENT (run_batch_of_slides.py --task all: tissue segmentation, patching, feature extraction) |
| Patch encoder | virchow2 (paige-ai/Virchow2) |
| Embedding dimension | 2560 (class token concatenated with mean of patch tokens) |
| Patch size | 224 x 224 px |
| Magnification | 20X |
| Patch overlap | none |
| Unit | one .h5 file per WSI |
Slides that failed during processing were skipped (--skip_errors), so a small number of slides from the original cohorts may be missing.
Repository structure
TCGA/
TCGA-ACC/
TCGA-XX-XXXX-01Z-00-DX1.<uuid>.h5
...
TCGA-BLCA/
...
CPTAC/
CPTAC_BRCA/
...
Each file is named after the source slide, so TCGA files keep the full slide barcode and UUID.
Cohorts
TCGA (9,838 slides)
| Project | Slides | Project | Slides | Project | Slides |
|---|---|---|---|---|---|
| TCGA-ACC | 227 | TCGA-BLCA | 457 | TCGA-BRCA | 1,133 |
| TCGA-CESC | 279 | TCGA-CHOL | 38 | TCGA-COAD | 458 |
| TCGA-DLBC | 44 | TCGA-ESCA | 158 | TCGA-GBM | 195 |
| TCGA-HNSC | 443 | TCGA-KICH | 77 | TCGA-KIRC | 519 |
| TCGA-KIRP | 298 | TCGA-LGG | 491 | TCGA-LIHC | 359 |
| TCGA-LUAD | 541 | TCGA-LUSC | 512 | TCGA-MESO | 75 |
| TCGA-OV | 83 | TCGA-PAAD | 176 | TCGA-PCPG | 176 |
| TCGA-PRAD | 401 | TCGA-READ | 166 | TCGA-SARC | 253 |
| TCGA-SKCM | 432 | TCGA-STAD | 438 | TCGA-TGCT | 149 |
| TCGA-THCA | 504 | TCGA-THYM | 117 | TCGA-UCEC | 502 |
| TCGA-UCS | 57 | TCGA-UVM | 80 |
CPTAC (1,922 slides)
The CPTAC slides were selected to match those available in the Patho-Bench library, so these features can be used directly with its task splits.
| Cohort | Slides | Cohort | Slides | Cohort | Slides |
|---|---|---|---|---|---|
| CPTAC_BRCA | 112 | CPTAC_CCRCC | 245 | CPTAC_COAD | 98 |
| CPTAC_GBM | 243 | CPTAC_HNSCC | 259 | CPTAC_LSCC | 304 |
| CPTAC_LUAD | 326 | CPTAC_PDA | 242 | CPTAC_UCEC | 93 |
File format
Each .h5 file contains:
features: float array of shape(N, 2560), one Virchow2 embedding per tissue patchcoords: int array of shape(N, 2), the (x, y) top-left coordinate of each patch in level-0 pixel space of the original WSI
Extraction metadata, such as patch size and magnification, is stored as HDF5 attributes.
Download
The dataset is public, so no login is needed. Install the client (hf_transfer is optional but makes downloads faster):
pip install -U huggingface_hub hf_transfer
export HF_HUB_ENABLE_HF_TRANSFER=1 # optional, faster downloads
You can download a single cohort, several cohorts, a whole source, a single slide, or everything. Pick the folder(s) you need with --include (CLI) or allow_patterns (Python).
Command line
# One cohort (e.g. TCGA-BRCA)
hf download sofieneb/virchow2_features --repo-type dataset \
--include "TCGA/TCGA-BRCA/*" --local-dir ./virchow2_features
# Several cohorts (e.g. NSCLC = LUAD + LUSC)
hf download sofieneb/virchow2_features --repo-type dataset \
--include "TCGA/TCGA-LUAD/*" "TCGA/TCGA-LUSC/*" --local-dir ./virchow2_features
# One CPTAC cohort
hf download sofieneb/virchow2_features --repo-type dataset \
--include "CPTAC/CPTAC_GBM/*" --local-dir ./virchow2_features
# All of CPTAC
hf download sofieneb/virchow2_features --repo-type dataset \
--include "CPTAC/*" --local-dir ./virchow2_features
# Everything
hf download sofieneb/virchow2_features --repo-type dataset \
--local-dir ./virchow2_features
With older versions of huggingface_hub, replace hf download with huggingface-cli download.
Python
from huggingface_hub import snapshot_download, hf_hub_download
REPO = "sofieneb/virchow2_features"
# One cohort
snapshot_download(REPO, repo_type="dataset",
allow_patterns=["TCGA/TCGA-BRCA/*"],
local_dir="./virchow2_features")
# Several cohorts, e.g. RCC subtypes (KIRC + KIRP + KICH)
snapshot_download(REPO, repo_type="dataset",
allow_patterns=["TCGA/TCGA-KIRC/*", "TCGA/TCGA-KIRP/*", "TCGA/TCGA-KICH/*"],
local_dir="./virchow2_features")
# A single slide
hf_hub_download(REPO, repo_type="dataset",
filename="TCGA/TCGA-BRCA/<slide_id>.h5",
local_dir="./virchow2_features")
To see which cohorts and files are available before downloading:
from huggingface_hub import HfApi
from collections import Counter
files = HfApi().list_repo_files("sofieneb/virchow2_features", repo_type="dataset")
print(Counter("/".join(f.split("/")[:2]) for f in files if f.endswith(".h5")))
Downloads resume automatically if interrupted. Just rerun the same command.
Usage
Load a slide's features:
import h5py
import torch
with h5py.File("virchow2_features/TCGA/TCGA-BRCA/<slide_id>.h5", "r") as f:
feats = torch.from_numpy(f["features"][:]) # (N, 2560)
coords = f["coords"][:] # (N, 2)
Build a slide table for one cohort:
from pathlib import Path
import pandas as pd
root = Path("virchow2_features/TCGA/TCGA-BRCA")
df = pd.DataFrame({"path": sorted(root.glob("*.h5"))})
df["slide_id"] = df["path"].map(lambda p: p.stem)
df["case_id"] = df["slide_id"].str.slice(0, 12) # TCGA-XX-XXXX, for patient-level splits
Important notes
- Features are per slide, not per patient. Some patients have several slides. Split train and test sets by patient (the TCGA case ID) to avoid data leakage.
- No labels are included. Clinical, molecular and survival labels must be taken from the GDC (TCGA) and PDC/TCIA (CPTAC), or from Patho-Bench for the CPTAC tasks.
- Features depend on the preprocessing. Tissue segmentation, patch size and magnification all affect the embeddings. Features from a different pipeline or encoder are not interchangeable with these.
Source data and licensing
- TCGA slides: NCI Genomic Data Commons
- CPTAC slides: The Cancer Imaging Archive (TCIA)
- Virchow2 weights are released by Paige under CC BY-NC-ND 4.0, for non-commercial research only. These features are derived from that model, and this dataset uses the same license. Use of the features must also follow the TCGA and CPTAC/TCIA data use policies.
Citation
If you use these features, please cite:
@article{boutaj2026patches,
title = {From Patches to Patients: A study of the tile-to-slide performance transferability in Digital Pathology},
author = {Boutaj, Sofi{\`e}ne and Fillioux, Leo and Christodoulidis, Stergios and Marza, Pierre and others},
journal = {arXiv preprint arXiv:2606.10778},
year = {2026}
}
Please also cite the encoder, the extraction pipeline and the source datasets:
- Virchow2: Zimmermann, E. et al. Virchow2: Scaling Self-Supervised Mixed Magnification Models in Pathology. arXiv:2408.00738 (2024).
- TRIDENT: Zhang, A. et al. Accelerating Data Processing and Benchmarking of AI Models for Pathology. arXiv:2502.06750 (2025).
- TCGA: The Cancer Genome Atlas Research Network, https://www.cancer.gov/tcga
- CPTAC: National Cancer Institute Clinical Proteomic Tumor Analysis Consortium, https://proteomics.cancer.gov/programs/cptac
- Downloads last month
- 141