CleanSlide-features / README.md
eric-1w's picture
Drop non-functional modality tags, keep vision-language and multimodal
c2410c8 verified
|
Raw
History Blame Contribute Delete
7.8 kB
metadata
license: cc-by-nc-4.0
task_categories:
  - image-feature-extraction
  - visual-question-answering
tags:
  - pathology
  - histology
  - whole-slide-image
  - TCGA
  - foundation-model-features
  - H-optimus-0
  - vision-language
  - multimodal
size_categories:
  - 100B<n<1T
configs:
  - config_name: tier1
    data_files:
      - split: train
        path: questions/tier1/train.jsonl
      - split: validation
        path: questions/tier1/val.jsonl
      - split: test
        path: questions/tier1/test.jsonl
  - config_name: tier2
    data_files:
      - split: train
        path: questions/tier2/train.jsonl
      - split: validation
        path: questions/tier2/val.jsonl
      - split: test
        path: questions/tier2/test.jsonl
pretty_name: CleanSlide  pan-cancer whole-slide vision–language benchmark
extra_gated_prompt: >-
  Please read and agree to the following terms before accessing CleanSlide: (1)
  This resource will be used for scientific research only, and not for any
  commercial or clinical purpose. (2) CleanSlide will be cited in any
  publication that uses this data.
extra_gated_fields:
  Full name: text
  Affiliation / Institution: text
  Country: country
  Intended use of CleanSlide (please describe): text
  I agree to use this dataset for non-commercial research only and to cite CleanSlide: checkbox
extra_gated_button_content: Request access

CleanSlide — pan-cancer whole-slide vision–language benchmark

Official dataset for CleanSlide, the largest public and cleanest whole-slide-image (WSI) vision–language multiple-choice benchmark on TCGA. This repository is self-contained: pre-computed features, the questions, the splits, and a slide-download manifest are all here. Full method, code, and figures live in the CleanSlide GitHub repository.

CleanSlide is the largest public whole-slide set that is also the cleanest

Abstract

Pathology vision–language models are typically evaluated on TCGA whole-slide VQA, but those benchmarks leak information at two levels — patient (slides from one case split across train and test) and tissue-source-site (staining/scanner batch shared across cases) — and their questions are often answerable without ever looking at the slide. CleanSlide is a contamination-controlled benchmark of 148,654 four-option questions over 9,985 TCGA diagnostic (FFPE) WSIs spanning 32 solid cancer types. Its train / val / test folds are patient- and site (TSS)-disjoint (0 overlap), every question is audited on four cleanliness dimensions with the blind (image-free) baseline published rather than hidden, and slide features come from H-optimus-0 (Apache-2.0) — an encoder not trained on TCGA — so the released features are redistributable and encoder-uncontaminated.

Dataset structure

features/
├── train/<slide_id>.h5        # H-optimus-0 patch features, one HDF5 file per slide
├── val/<slide_id>.h5
└── test/<slide_id>.h5
questions/
├── tier1/{train,val,test}.jsonl   # Tier 1 — reused & cleaned public TCGA-WSI MCQ
└── tier2/{train,val,test}.jsonl   # Tier 2 — self-generated, text-only MCQ
slides/
├── slides_splits.csv          # slide_id, patient, tss, tumor, fold, split
└── slide_gdc_manifest.csv     # GDC manifest to download the raw diagnostic WSIs
  • ~480 GB of features (fp16), one .h5 per slide, already partitioned by split.
  • 148,654 questions total, separated by tier (reuse-and-clean vs self-generated) and by split.
  • slides/ provides the slide → fold/split table and a ready-to-use GDC download manifest for the raw WSIs.

Feature file format (.h5)

dataset shape dtype meaning
features [N, 1536] float16 H-optimus-0 embedding per kept patch
coords [N, 2] int32 level-0 (x, y) pixel coordinate of each patch — the encoder-agnostic canonical layer: any future encoder can be re-run from these coordinates without re-segmenting/re-tiling

Per-file attributes: encoder, mpp_x, target_mpp (0.5 µm/px = 20×), patch_size (224), patch_size_lvl0, level_used, n_patches, tissue_frac_thresh (0.10), mpp_source. Extraction follows the H-optimus-0 recipe with CLAM tissue detection and the Prov-GigaPath valid-patch rule (no stain normalization — the site signature is controlled by the split, not the pixels). Details on GitHub.

Usage

Step 1 — download

from huggingface_hub import snapshot_download

# Everything (the features are ~480 GB):
snapshot_download("eric-1w/CleanSlide-features", repo_type="dataset", local_dir="cleanslide")

# Or just the questions + splits (small), skipping the large feature files:
snapshot_download("eric-1w/CleanSlide-features", repo_type="dataset", local_dir="cleanslide",
                  allow_patterns=["questions/*", "slides/*"])

Step 2 — pair a question with its slide features

The slide and split fields of each question point to features/<split>/<slide_id>.h5.

import json, h5py

q = [json.loads(l) for l in open("cleanslide/questions/tier1/test.jsonl")][0]
print(q["question"])
print(q["options"], "->", q["answer"])

with h5py.File(f"cleanslide/features/{q['split']}/{q['slide']}.h5", "r") as f:
    feats  = f["features"][:]   # (N, 1536) float16
    coords = f["coords"][:]     # (N, 2) int32, level-0 pixels

Step 3 — (optional) get the raw slides

The raw WSIs are not redistributed here. To download them, use the included GDC manifest with the GDC Data Transfer Tool:

gdc-client download -m slides/slide_gdc_manifest.csv

You can then re-extract features with the CleanSlide pipeline (code/extract/extract_features.py on GitHub).

A question record

Each line of a questions/*/*.jsonl file is one four-option question:

{
  "source": "SlideBench",
  "slide": "TCGA-08-0244-01Z-00-DX1",
  "patient": "TCGA-08-0244",
  "tss": "08",
  "tumor": "GBM",
  "question": "Examine the cellular morphology in the provided whole slide image of glioblastoma. Which cytoplasmic feature is typically observed?",
  "options": ["Mucin production", "Clear cytoplasm", "Fibrillary background", "Granulomatous changes"],
  "answer": "C",
  "answer_type": "mcq",
  "task": "Microscopy",
  "fold": 3,
  "split": "test"
}
field meaning
source origin set — WSI-Bench, SlideBench, WSI-VQA, CleanSlide-labels, or CleanSlide-reports
slide / patient / tss TCGA slide barcode, patient, and tissue-source-site
tumor TCGA study (cancer-type) code, e.g. GBM
question / options / answer stem, four options, correct letter (AD)
task question category (Diagnosis, Microscopy, Subtype, Grading, …)
fold / split disjoint fold id and train / val / test

Citation

If you use CleanSlide, please cite:

@misc{zhang2026cleanslide,
  title        = {CleanSlide: A Leakage-Audited and Shortcut-Controlled Benchmark for Whole-Slide Vision–Language Models},
  author       = {Zhang, Wenhao and others},
  year         = {2026},
  note         = {Manuscript in preparation},
  howpublished = {\url{https://github.com/wenhaozhang0066/CleanSlide}}
}

License & provenance

Questions and derived features: CC-BY-NC 4.0 (research / non-commercial use only). Underlying TCGA slides follow the NIH/GDC data policy — raw slides are not redistributed here. Encoder: H-optimus-0 (Apache-2.0), not trained on TCGA.