--- language: - en tags: - histopathology - computational-pathology - survival-analysis - multiple-instance-learning - hypergraph-learning - graph-learning - tcga pretty_name: 'HyperMIL: Whole-Slide Histopathology Features and Graph Representations for Survival Analysis' --- # HyperMIL: Whole-Slide Histopathology Features and Graph Representations for Survival Analysis **[GitHub: code and evaluation](https://github.com/shannonchen37/HyperMIL) · [Pretrained models](https://github.com/shannonchen37/HyperMIL/releases/tag/v1.1.0) · [Feature extraction and graph construction](https://github.com/shannonchen37/HyperMIL/blob/main/docs/preprocessing.md)** ## Overview This dataset provides **pre-extracted patch features, aligned patch coordinates, and precomputed graph and group representations** for 1,344 diagnostic whole-slide images (WSIs) from four TCGA cancer cohorts. It supports survival prediction with multiple-instance learning, graph neural networks, and hypergraph neural networks. The data accompany the [HyperMIL code repository](https://github.com/shannonchen37/HyperMIL). The supplied feature and graph files can be loaded directly by its training and evaluation scripts, without rerunning preprocessing. ## Cohorts | TCGA cohort | Cancer type | Patients | WSIs | Data size (GB) | | --- | --- | ---: | ---: | ---: | | STAD | Stomach adenocarcinoma | 387 | 413 | 35.05 | | THCA | Thyroid carcinoma | 505 | 518 | 58.40 | | CHOL | Cholangiocarcinoma | 39 | 39 | 6.43 | | LIHC | Liver hepatocellular carcinoma | 360 | 374 | 42.99 | | **Total** | | **1,291** | **1,344** | **142.87** | Sizes use decimal GB. The release contains **12,096 NumPy files**. Overall-survival times, event indicators, patient-level five-fold splits, slide mappings, and fixed patch-selection indices are supplied in the companion GitHub repository under [splits/](https://github.com/shannonchen37/HyperMIL/tree/main/splits) and [manifests/](https://github.com/shannonchen37/HyperMIL/tree/main/manifests). All slides belonging to a patient remain in the same fold. ## Files and representations | Directory | Contents | Files | Size (GB) | Used by | | --- | --- | ---: | ---: | --- | | `data/WSI_data/TCGA-/patch_ft/` | Frozen ResNet-34 patch features: one float32 `.npy` array of shape `[N, 512]` per WSI | 1,344 | 137.014 | Shared feature inputs for all methods | | `data/WSI_data/TCGA-/patch_coor/` | Patch coordinates: one `.npy` array of shape `[N, 2]` per WSI, aligned row-for-row with its feature array | 1,344 | 0.535 | Spatial graph construction and spatial methods | | `data/hypergraphs/` | Sparse structural (MGAS) and semantic (PASG) incidence matrices: two `.npz` files per WSI | 2,688 | 0.874 | HyperMIL and its hypergraph ablations | | `data/patchgcn_graphs/` | PatchGCN graph connectivity in `.npz` format | 1,344 | 0.894 | PatchGCN | | `data/KNN/` | Spatial and feature-space nearest-neighbor graph connectivity in `.npz` format | 2,688 | 3.491 | DualGCN-MIL | | `data/kmeans_groups/` | Spatial and semantic K-means patch-group inputs in `.npz` format | 2,688 | 0.058 | Spatial/Semantic-KMeans-GroupPool | `N` is the number of retained patches in a WSI and varies between slides. Features are stored once and shared across methods; graph files refer to that same patch ordering. PatchGCN graph files store connectivity without duplicating the feature arrays. Both MGAS and PASG graph files are provided for **all four cohorts**. ### Directory layout The following example uses STAD; the same layout applies to THCA, CHOL, and LIHC. ```text data/ WSI_data/ TCGA-STAD/ patch_ft/_fts.npy patch_coor/_coors.npy hypergraphs/ STAD_MGAS_V2/.npz STAD_PASG_V2_FINAL/.npz patchgcn_graphs/ TCGA-STAD/.npz KNN/ TCGA-STAD/ spatial/_knn_spatial_k8.npz feature/_knn_feature_k6.npz kmeans_groups/ Spatial-KMeans-GroupPool/cache/STAD/.npz Semantic-KMeans-GroupPool/cache/STAD/.npz ``` - `data_manifest.csv` lists every data file's relative path, representation category, byte size, and SHA256. - `dataset_info.json` records the cohort list, total size, file count, and identities of the data manifest and patient splits. - `release.json` identifies the complete, verified data revision used by the companion downloader. The directory names are retained for compatibility with the released loaders. For graph-array schemas and preprocessing parameters, see the [construction documentation](https://github.com/shannonchen37/HyperMIL/blob/main/docs/preprocessing.md) and [model interfaces](https://github.com/shannonchen37/HyperMIL/blob/main/hypermil/interfaces.py). ## Download and evaluate Run the supplied downloader from the code repository so files are installed directly into the expected relative paths: ```bash git clone https://github.com/shannonchen37/HyperMIL.git cd HyperMIL python -m pip install -r requirements.txt # Download the prepared data and pretrained models for STAD. python scripts/download_data.py --cohort STAD python scripts/download_models.py --cohort STAD # Evaluate HyperMIL across all five patient folds. python scripts/evaluate.py --config configs/hypermil.yaml --cohort STAD ``` Use `STAD`, `THCA`, `CHOL`, or `LIHC` to select a cohort. Omit `--cohort` from both download commands to obtain all four cohorts. Downloads resume when the same command is rerun. The supplied layout requires no manual path edits or Hugging Face login. Methods are selected through YAML configurations within the same training and evaluation framework. Keep feature ordering, graph inputs, patient splits, and method configurations together when using the released checkpoints. See the [GitHub README](https://github.com/shannonchen37/HyperMIL#quick-start) for installation and evaluation details. ## Source and accompanying resources The underlying histopathology slides originate from [TCGA through the NCI Genomic Data Commons](https://portal.gdc.cancer.gov/). This repository distributes derived feature and graph representations; it does not include raw WSI images. The companion [GitHub repository](https://github.com/shannonchen37/HyperMIL) provides preprocessing code, patient splits, method configurations, training and evaluation code, and links to pretrained models.