Dataset Viewer (First 5GB)
Auto-converted to Parquet Duplicate
Search is not available for this dataset
The dataset viewer is not available for this split.
Parquet error: Scan size limit exceeded: attempted to read 1027857866 bytes, limit is 300000000 bytes Make sure that 1. the Parquet files contain a page index to enable random access without loading entire row groups2. otherwise use smaller row-group sizes when serializing the Parquet files
Error code:   TooBigContentError

Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.

TCGA WSI UNI2H Features

QC example

Dataset Summary

This dataset provides tile-level UNI2-h embeddings extracted from TCGA whole-slide images (WSIs) using a reproducible, auditable pipeline designed for computational pathology research.

Data is organized by project (for example TCGA-HNSC) and currently exposes:

  • features/ containing H5 feature files with tile-level embeddings

  • vis/ containing overlay images for quality inspection and pipeline verification

[!IMPORTANT] Unlike the official UNI feature release, which only samples a subset of tissue tiles from each slide, this dataset processes all detected tissue tiles after background filtering, see this post. As a result, the feature sets represent the complete set of tissue tiles from each WSI, enabling full-slide analysis and more flexible downstream use.

Additionally, users can download features for a single slide individually, rather than downloading a compressed archive of an entire TCGA project.

The public layout is optimized for incremental project-by-project releases and fast downstream integration in MIL, retrieval, and representation-learning workflows.

This dataset contains derived features from TCGA data. Users must comply with TCGA data usage policies.

Current Public Layout

TCGA-HNSC/
  features/
    TCGA-....h5
  vis/
    TCGA-....__overlay.png

Notes:

  • Coordinate CSV files and run summary logs are retained locally for pipeline bookkeeping, but are not uploaded.
  • Coordinates are still stored inside each H5 file (coords dataset).
  • Source WSIs are not redistributed in this dataset; this release contains derived features and QC visualizations only.

How to Download

You can download either individual slide features or entire TCGA projects using the Hugging Face Hub.

Download a Single Slide (Recommended)

The dataset supports per-slide downloads, allowing you to retrieve only the slides needed for your experiment.

Example: Download everything

from huggingface_hub import hf_hub_download

DATASET_ID="W8Yi/tcga-wsi-uni2h-features"
OUT_DIR="/path/to/tcga_features_hf"

hf download "$DATASET_ID" \
  --repo-type dataset \
  --local-dir "$OUT_DIR"

Download one project only (example: TCGA-GBM)

hf download "$DATASET_ID" \
  --repo-type dataset \
  --include "TCGA-GBM/features/*" \
  --include "TCGA-GBM/vis/*" \
  --local-dir "$OUT_DIR"

Download only H5 features (no overlays)

hf download "$DATASET_ID" \
  --repo-type dataset \
  --include "TCGA-GBM/features/*.h5" \
  --local-dir "$OUT_DIR"

Current Coverage

  • TCGA-ACC/features & vis : 227 H5 files and PNG overlay files
  • TCGA-BLCA/features & vis: 457 H5 files and PNG overlay files
  • TCGA-BLCA_IDC/features & vis: 838 H5 files and PNG overlay files
  • TCGA-BRCA_OTHERS/features & vis: 288 H5 files and PNG overlay files
  • TCGA-CESC/features & vis: 279 H5 files and PNG overlay files
  • TCGA-CHOL/features & vis: 39 H5 files and PNG overlay files
  • TCGA-COAD/features & vis: 442 H5 files and PNG overlay files
  • TCGA-DLBC/features & vis: 44 H5 files and PNG overlay files
  • TCGA-ESCA/features & vis: 158 H5 files and PNG overlay files
  • TCGA-GBM/features & vis: 858 H5 files and PNG overlay files
  • TCGA-HNSC/features & vis: 472 H5 files and PNG overlay files
  • TCGA-KICH/features & vis: 109 H5 files and PNG overlay files
  • TCGA-KIRC/features & vis: 519 H5 files and PNG overlay files
  • TCGA-KIRP/features & vis: 296 H5 files and PNG overlay files
  • TCGA-LGG/features & vis: 833 H5 files and PNG overlay files
  • TCGA-LIHC/features & vis: 372 H5 files and PNG overlay files
  • TCGA-LUAD/features & vis: 531 H5 files and PNG overlay files
  • TCGA-LUSC/features & vis: 512 H5 files and PNG overlay files
  • TCGA-MESO/features & vis: 87 H5 files and PNG overlay files
  • TCGA-OV/features & vis: 107 H5 files and PNG overlay files
  • TCGA-PAAD/features & vis: 203 H5 files and PNG overlay files
  • TCGA-PCPG/features & vis: 196 H5 files and PNG overlay files
  • TCGA-PRAD/features & vis: 449 H5 files and PNG overlay files
  • TCGA-READ/features & vis: 158 H5 files and PNG overlay files
  • TCGA-SARC/features & vis: 579 H5 files and PNG overlay files
  • TCGA-SKCM/features & vis: 475 H5 files and PNG overlay files
  • TCGA-STAD/features & vis: 400 H5 files and PNG overlay files
  • TCGA-TGCT/features & vis: 248 H5 files and PNG overlay files
  • TCGA-THCA/features & vis: 518 H5 files and PNG overlay files
  • TCGA-THYM/features & vis: 166 H5 files and PNG overlay files
  • TCGA-UCEC/features & vis: 566 H5 files and PNG overlay files
  • TCGA-UCS/features & vis: 87 H5 files and PNG overlay files
  • TCGA-UVM/features & vis: 80 H5 files and PNG overlay files

Extraction Specification

Magnification and tile geometry

  • Extraction is defined in 20x-equivalent units with:
  • tile_size_20x = 256
  • step_size_20x = 256 (non-overlapping 20x-equivalent grid)

Level-0 tile size is automatically adjusted by slide objective power:

  • tile_size_level0 = round(tile_size_20x * objective_power / 20)
  • step_size_level0 = round(step_size_20x * objective_power / 20)

Examples:

  • 20x WSI -> 256 px crops at level 0
  • 40x WSI -> 512 px crops at level 0 (same physical field of view as 256 px at 20x)

Tissue filtering pipeline

The filtering stage is intentionally simple and inspectable:

  • Build a low-resolution tissue mask from a slide level chosen by mask_max_dim = 2048
  • Convert to HSV and keep pixels where:
  • saturation >= 20
  • value <= 245 (remove bright background)
  • Apply optional denoising / morphology:
  • median filter size 3
  • max/min filter size 5
  • For each candidate tile, compute tissue overlap and keep tile if:
  • tissue_fraction >= 0.15

UNI2-h encoding pipeline

  • Read kept tiles from WSI at level-0 coordinates
  • Resize to 20x-equivalent tile size (256x256)
  • Center-crop (or resize fallback) to UNI input size (224x224)
  • Normalize with ImageNet mean/std
  • Encode with UNI2-h to 1536-D embedding per tile

H5 Schema

Each .h5 file contains:

  • features: UNI2-h tile embeddings, shape [1, N, 1536]
  • coords: tile coordinates aligned to features, shape [1, N, 2]
  • coords_patching: tile coordinates, shape [N, 2]
  • annots: placeholder annotations, shape [1, N, 1]

Shape compatibility:

  • Many existing pathology consumers support either [1, N, D] or [N, D]; if needed, squeeze axis 0.
  • coords and coords_patching represent level-0 top-left pixel coordinates.

QC Overlays (vis/)

For each slide, vis/<slide_key>__overlay.png provides a transparent overlay of kept tiles on a thumbnail.

How to interpret:

  • Covered regions show where filtering accepted tissue tiles and features were eligible for encoding.
  • Uncovered regions are usually background, artifact, pen marks, blur, or other low-quality areas rejected by thresholds.
  • These overlays are QC artifacts, not pathology annotations.

Artifact Handling Philosophy

The tissue filtering stage is intentionally conservative and does not attempt to remove all possible artifacts (e.g., pen marks, blur regions, scanner noise, or staining anomalies).

This design choice is deliberate. In many computational pathology workflows, these regions can be useful for:

  • Robustness studies (evaluating model behavior on imperfect data)
  • Outlier detection
  • Domain shift / artifact sensitivity analysis
  • Training models that learn to ignore artifacts

Over-aggressive filtering can remove potentially informative edge cases and introduce hidden dataset bias.
Therefore, this dataset prioritizes high recall of tissue regions rather than aggressive artifact removal.

Researchers who require stricter filtering are encouraged to apply additional preprocessing or artifact detection tailored to their specific study.

Minimal Usage Example

import h5py

h5_file = "TCGA-HNSC/features/TCGA-XXXX-...-DX1.h5"
with h5py.File(h5_file, "r") as f:
    features = f["features"][:]          # [1, N, 1536]
    coords = f["coords"][:]              # [1, N, 2]
    coords_patching = f["coords_patching"][:]  # [N, 2]

if features.ndim == 3 and features.shape[0] == 1:
    features = features[0]
if coords.ndim == 3 and coords.shape[0] == 1:
    coords = coords[0]

assert features.shape[0] == coords.shape[0]
assert features.shape[1] == 1536
assert coords.shape[1] == 2
assert coords_patching.shape[1] == 2

Intended Use

  • Research use only (representation learning, weak supervision, interpretability, retrieval, and slide-level modeling).
  • Not intended for clinical care or diagnostic decision-making.

Data Governance and Privacy

  • Users are responsible for complying with TCGA usage terms, DUAs, and institutional requirements.
  • Do not attempt patient re-identification.

License and Attribution

This dataset is a derived work based on TCGA data and UNI2-h features.

  • TCGA data is not owned by the authors and is subject to TCGA usage policies.
  • UNI2-h model is subject to its original license.

We release only derived feature representations.

If you use this dataset, please cite:

  • This dataset
  • TCGA
  • UNI2-h

Citation and Attribution

This dataset is a derived feature release produced by our pipeline.

If you use this dataset, please cite:

1. Our pipeline and dataset release:

   @software{computational_pathology_tutorial,
     title        = {Computational Pathology Tutorial},
     author       = {{Weiyi Qin}},
     year         = {2026},
     url          = {https://github.com/W8Yi/Computational-Pathology-Tutorial}
   }

2. The TCGA program:

    @article{weinstein2013cancer,
    title={The cancer genome atlas pan-cancer analysis project},
    author={Weinstein, John N and Collisson, Eric A and Mills, Gordon B and Shaw, Kenna R and Ozenberger, Brad A and Ellrott, Kyle and Shmulevich, Ilya and Sander, Chris and Stuart, Joshua M},
    journal={Nature genetics},
    volume={45},
    number={10},
    pages={1113--1120},
    year={2013},
    publisher={Nature Publishing Group}
  }

3. The UNI / UNI2-h encoder:

    @article{chen2024uni,
    title={Towards a General-Purpose Foundation Model for Computational Pathology},
    author={Chen, Richard J and Ding, Tong and Lu, Ming Y and Williamson, Drew FK and Jaume, Guillaume and Chen, Bowen and Zhang, Andrew and Shao, Daniel and Song, Andrew H and Shaban, Muhammad and others},
    journal={Nature Medicine},
    publisher={Nature Publishing Group},
    year={2024}
  }

Limitations

  • Current public release contains only HNSC.
  • Feature behavior is encoder-dependent (UNI2-h).
  • Overlay images are QC artifacts and are not ground-truth annotations.
  • Tissue-mask thresholds are global defaults and may under- or over-select tiles for specific stain/scanner domains.

Planned Extensions

  • Additional TCGA projects will be added incrementally under:
    • TCGA-<PROJECT>/features
    • TCGA-<PROJECT>/vis
  • Existing project paths are intended to remain stable.

Changelog

  • 2026-03-07: Updated dataset card to project-level layout (TCGA-<PROJECT>/{features,vis}), H5+vis public release policy.
  • 2026-03-24: Completed all feature extraction work and uploaded.
Downloads last month
8,930

Models trained or fine-tuned on W8Yi/tcga-wsi-uni2h-features

Collection including W8Yi/tcga-wsi-uni2h-features