| --- |
| pretty_name: CellHIST-Bench |
| license: cc-by-nc-4.0 |
| language: |
| - en |
| tags: |
| - spatial-transcriptomics |
| - single-cell |
| - histopathology |
| - whole-slide-image |
| - gene-expression |
| - computational-pathology |
| - weakly-supervised-learning |
| - image-to-gene-expression |
| - spatial-gene-expression |
| size_categories: |
| - 100K<n<1M |
|
|
| --- |
| |
| # CellHIST-Bench |
|
|
| ## Dataset Summary |
|
|
| CellHIST-Bench is a benchmark dataset for histology-based spatial gene expression inference. It provides paired whole-slide histopathology images, spatial transcriptomics labels, cell segmentation results, spot-centered patch metadata, and cell-to-patch correspondence information. |
|
|
| The dataset supports two levels of spatial transcriptomics annotations: |
|
|
| - **Spot-resolution spatial transcriptomics**, where each spot is associated with a local histology patch and a spot-level gene expression vector. |
| - **Single-cell-resolution spatial transcriptomics**, where each cell is associated with a single-cell gene expression vector and can be linked to image-detected cells. |
|
|
| CellHIST-Bench is designed to support benchmarking of weakly supervised learning methods for predicting spatial gene expression from histopathology images. |
|
|
| --- |
|
|
| ## Dataset Organization |
|
|
| The dataset is organized by tissue or cancer type. Each folder contains whole-slide images, cell segmentation files, patch metadata, patch-cell relationship files, and gene expression labels. |
|
|
| A typical directory structure is shown below: |
|
|
| ```text |
| /data/west_bench |
| ├── LUNG |
| │ ├── wsis |
| │ ├── cellvit++_seg |
| │ ├── patches |
| │ ├── patches_cell |
| │ ├── st_spot_label |
| │ └── st_cell_label |
| ├── IDC |
| ├── SKCM |
| └── ... |
| ``` |
|
|
| --- |
|
|
| ## Spot-Resolution Samples |
|
|
| For spot-resolution spatial transcriptomics samples, the dataset contains the following files: |
|
|
| ```text |
| /data/west_bench |
| ├── LUNG |
| │ ├── wsis |
| │ │ ├── TENX62.tif |
| │ │ └── ... |
| │ │ |
| │ ├── cellvit++_seg |
| │ │ ├── TENX62_seg.parquet |
| │ │ ├── TENX62.h5 |
| │ │ └── ... |
| │ │ |
| │ ├── patches |
| │ │ ├── TENX62.h5 |
| │ │ └── ... |
| │ │ |
| │ ├── patches_cell |
| │ │ ├── TENX62.json |
| │ │ └── ... |
| │ │ |
| │ └── st_spot_label |
| │ ├── TENX62.h5ad |
| │ └── ... |
| ``` |
|
|
| ### `wsis/` |
|
|
| This folder stores whole-slide images. |
|
|
| Each file is a `.tif` image: |
|
|
| ```text |
| TENX62.tif |
| ``` |
|
|
| The WSI file contains the original histopathology image. These files are usually very large and may require specialized tools such as OpenSlide or tifffile for reading. |
|
|
| ### `cellvit++_seg/` |
| |
| This folder stores cell segmentation results generated by CellViT++. |
| |
| Each sample may contain: |
| |
| ```text |
| TENX62_seg.parquet |
| TENX62.h5 |
| ``` |
| |
| The `*_seg.parquet` file is a DataFrame containing cell-level segmentation information. Typical columns include: |
| |
| ```text |
| ['geometry', 'class', 'cell_id'] |
| ``` |
| |
| The corresponding `.h5` file stores cell-level information. Typical keys include: |
| |
| ```text |
| ['cell_coords', 'cell_embedding', 'cell_class_id'] |
| ``` |
| |
| where: |
| |
| - `cell_coords` stores cell coordinates; |
| - `cell_embedding` stores cell-level image embeddings; |
| - `cell_class_id` stores predicted cell class IDs. |
|
|
| ### `patches/` |
|
|
| This folder stores metadata for spot-centered patches. |
|
|
| Each `.h5` file contains: |
|
|
| ```text |
| ['barcode', 'coords'] |
| ``` |
|
|
| where: |
|
|
| - `barcode` is the spatial transcriptomics spot barcode; |
| - `coords` records the patch coordinates in the WSI. |
|
|
| Note that the raw patch image array is not stored in this file. Users need to crop the patch from the corresponding WSI according to the provided coordinates. |
|
|
| ### `patches_cell/` |
| |
| This folder describes the cells contained in each spot-centered patch. |
| |
| Each `.json` file stores a dictionary indexed by spot barcode. A typical entry is: |
| |
| ```json |
| { |
| "barcode": { |
| "cell_index": [99], |
| "in_spot": [1] |
| } |
| } |
| ``` |
| |
| where: |
|
|
| - `cell_index` indicates the indices of cells located in the patch; |
| - `in_spot` indicates whether each cell is located inside the spatial spot region. |
|
|
| Each patch corresponds to a local image region of: |
|
|
| ```text |
| 224 × 224 pixels |
| ``` |
|
|
| ### `st_spot_label/` |
|
|
| This folder stores spot-level gene expression labels. |
|
|
| Each `.h5ad` file contains a spot-level gene expression matrix: |
|
|
| ```text |
| num_spots × num_genes |
| ``` |
|
|
| The row index corresponds to the spot barcode. |
|
|
| --- |
|
|
| ## Single-Cell-Resolution Samples |
|
|
| For single-cell-resolution spatial transcriptomics samples, the dataset contains all files used in spot-resolution samples, with additional files for single-cell gene expression labels and spot-cell mapping. |
|
|
| A typical structure is shown below: |
|
|
| ```text |
| /data/west_bench |
| ├── LUNG |
| │ ├── wsis |
| │ │ ├── TENX141.tif |
| │ │ └── ... |
| │ │ |
| │ ├── cellvit++_seg |
| │ │ ├── TENX141_seg.parquet |
| │ │ ├── TENX141.h5 |
| │ │ ├── TENX141_st_cell_idx.parquet |
| │ │ └── ... |
| │ │ |
| │ ├── patches |
| │ │ ├── TENX141.h5 |
| │ │ └── ... |
| │ │ |
| │ ├── patches_cell |
| │ │ ├── TENX141.json |
| │ │ └── ... |
| │ │ |
| │ ├── st_spot_label |
| │ │ ├── TENX141.h5ad |
| │ │ └── ... |
| │ │ |
| │ └── st_cell_label |
| │ ├── TENX141.h5ad |
| │ └── ... |
| ``` |
|
|
| ### `*_st_cell_idx.parquet` |
| |
| This file stores the mapping between spatial transcriptomics cell indices and image-detected cell IDs. |
| |
| Typical columns include: |
| |
| ```text |
| ['st_cell_index', 'cell_id'] |
| ``` |
| |
| where: |
| |
| - `st_cell_index` is the cell index in the spatial transcriptomics data; |
| - `cell_id` is the cell ID detected from the WSI by CellViT++. |
| |
| ### `st_cell_label/` |
| |
| This folder stores single-cell-level gene expression labels. |
| |
| Each `.h5ad` file contains a single-cell gene expression matrix: |
| |
| ```text |
| num_cells × num_genes |
| ``` |
| |
| The row index corresponds to: |
| |
| ```text |
| st_cell_index |
| ``` |
| |
| --- |
| |
| ## Data Fields |
| |
| ### Whole-Slide Images |
| |
| | File | Description | |
| | ------- | -------------------------------- | |
| | `*.tif` | Whole-slide histopathology image | |
|
|
| ### Cell Segmentation Files |
|
|
| | Field | Description | |
| | ---------------- | ------------------------------------ | |
| | `geometry` | Cell geometry or polygon information | |
| | `class` | Predicted cell category | |
| | `cell_id` | Unique cell identifier in the WSI | |
| | `cell_coords` | Cell coordinates | |
| | `cell_embedding` | Cell-level image embedding | |
| | `cell_class_id` | Numeric cell class ID | |
|
|
| ### Patch Metadata Files |
|
|
| | Field | Description | |
| | --------- | ------------------------------------ | |
| | `barcode` | Spatial transcriptomics spot barcode | |
| | `coords` | Patch coordinates in the WSI | |
|
|
| ### Patch-Cell Relationship Files |
|
|
| | Field | Description | |
| | ------------ | ------------------------------------------------------------ | |
| | `cell_index` | Indices of cells located in the patch | |
| | `in_spot` | Binary indicator showing whether the cell is inside the spot region | |
|
|
| ### Spot-Level Gene Expression Labels |
|
|
| | Field | Description | |
| | ------ | --------------------------------- | |
| | `.X` | Spot-level gene expression matrix | |
| | `.obs` | Spot metadata | |
| | `.var` | Gene metadata | |
| | index | Spot barcode | |
|
|
| ### Single-Cell-Level Gene Expression Labels |
|
|
| | Field | Description | |
| | ------ | ---------------------------------------- | |
| | `.X` | Single-cell-level gene expression matrix | |
| | `.obs` | Cell metadata | |
| | `.var` | Gene metadata | |
| | index | `st_cell_index` | |
|
|
| --- |
|
|
| ## Supported Tasks |
|
|
| CellHIST-Bench can be used for the following tasks: |
|
|
| 1. **Spot-level spatial gene expression prediction** |
|
|
| Given a spot-centered histology patch, predict the corresponding spot-level gene expression vector. |
|
|
| 2. **Single-cell-level gene expression prediction** |
|
|
| Given image-derived cell information and local histological context, predict the gene expression profile of individual cells. |
|
|
| 3. **Weakly supervised spatial gene expression inference** |
|
|
| Evaluate whether weakly supervised models can infer molecular profiles from histopathology images. |
|
|
| 4. **Cell-aware representation learning** |
|
|
| Use cell segmentation, cell embeddings, and patch-cell relationships to learn cell-aware histology representations. |
|
|
| 5. **Cross-resolution spatial transcriptomics analysis** |
|
|
| Compare spot-level and single-cell-level spatial gene expression prediction under a unified data organization. |
|
|
| --- |
|
|
| ## Loading Examples |
|
|
| ### Load Spot-Level Gene Expression Labels |
|
|
| ```python |
| import scanpy as sc |
| |
| adata = sc.read_h5ad("LUNG/st_spot_label/TENX62.h5ad") |
| |
| print(adata) |
| print(adata.X.shape) # num_spots × num_genes |
| print(adata.obs.head()) |
| print(adata.var.head()) |
| ``` |
|
|
| ### Load Single-Cell-Level Gene Expression Labels |
|
|
| ```python |
| import scanpy as sc |
| |
| adata = sc.read_h5ad("LUNG/st_cell_label/TENX141.h5ad") |
| |
| print(adata) |
| print(adata.X.shape) # num_cells × num_genes |
| print(adata.obs.head()) |
| print(adata.var.head()) |
| ``` |
|
|
| ### Load Patch Metadata |
|
|
| ```python |
| import h5py |
| |
| with h5py.File("LUNG/patches/TENX62.h5", "r") as f: |
| print(list(f.keys())) |
| barcodes = f["barcode"][:] |
| coords = f["coords"][:] |
| |
| print(barcodes.shape) |
| print(coords.shape) |
| ``` |
|
|
| ### Load Cell Segmentation Results |
|
|
| ```python |
| import h5py |
| import pandas as pd |
| |
| seg_df = pd.read_parquet("LUNG/cellvit++_seg/TENX62_seg.parquet") |
| print(seg_df.head()) |
| |
| with h5py.File("LUNG/cellvit++_seg/TENX62.h5", "r") as f: |
| print(list(f.keys())) |
| cell_coords = f["cell_coords"][:] |
| cell_embedding = f["cell_embedding"][:] |
| cell_class_id = f["cell_class_id"][:] |
| |
| print(cell_coords.shape) |
| print(cell_embedding.shape) |
| print(cell_class_id.shape) |
| ``` |
|
|
| ### Load Patch-Cell Relationship Files |
|
|
| ```python |
| import json |
| |
| with open("LUNG/patches_cell/TENX62.json", "r") as f: |
| patch_cells = json.load(f) |
| |
| first_barcode = list(patch_cells.keys())[0] |
| |
| print(first_barcode) |
| print(patch_cells[first_barcode]) |
| ``` |
|
|
| ### Load Spot-Cell Mapping for Single-Cell-Resolution Samples |
|
|
| ```python |
| import pandas as pd |
| |
| mapping = pd.read_parquet("LUNG/cellvit++_seg/TENX141_st_cell_idx.parquet") |
| |
| print(mapping.head()) |
| print(mapping.columns) |
| ``` |
|
|
| --- |
|
|
| ## Recommended Evaluation Settings |
|
|
| CellHIST-Bench supports evaluation under different task settings. |
|
|
| ### Spot-Level Prediction |
|
|
| The model takes a spot-centered histology patch as input and predicts the corresponding spot-level gene expression vector. |
|
|
| Input: |
|
|
| ```text |
| spot-centered histology patch |
| ``` |
|
|
| Output: |
|
|
| ```text |
| spot-level gene expression vector |
| ``` |
|
|
| Label file: |
|
|
| ```text |
| st_spot_label/*.h5ad |
| ``` |
|
|
| ### Single-Cell-Level Prediction |
|
|
| The model takes cell-level visual information and local histological context as input and predicts single-cell gene expression. |
|
|
| Input: |
|
|
| ```text |
| cell-level image features and local patch context |
| ``` |
|
|
| Output: |
|
|
| ```text |
| single-cell gene expression vector |
| ``` |
|
|
| Label file: |
|
|
| ```text |
| st_cell_label/*.h5ad |
| ``` |
|
|
| Mapping file: |
|
|
| ```text |
| cellvit++_seg/*_st_cell_idx.parquet |
| ``` |
|
|
| --- |
|
|
| ## Dataset Splits |
|
|
| The dataset can be split by tissue type, sample ID, or task setting depending on the evaluation protocol. |
|
|
| A typical split may include: |
|
|
| ```text |
| train |
| validation |
| test |
| ``` |
|
|
| When evaluating generalization, users should ensure that slides from the same biological sample are not shared across training and test sets. |
|
|
| If official split files are provided, users should follow the official split protocol. |
|
|
| --- |
|
|
| ## Intended Use |
|
|
| This dataset is intended for research on: |
|
|
| - histology-based spatial gene expression prediction; |
| - weakly supervised learning for spatial transcriptomics; |
| - computational pathology; |
| - cell-aware histology representation learning; |
| - integration of histology images and spatial omics data; |
| - single-cell and spatial transcriptomics analysis. |
|
|
| This dataset is intended for research use only. |
|
|
| --- |
|
|
| ## Out-of-Scope Use |
|
|
| This dataset should not be used for: |
|
|
| - clinical diagnosis; |
| - treatment recommendation; |
| - patient identification; |
| - direct medical decision-making; |
| - commercial use without proper permission. |
|
|
| --- |
|
|
| ## Limitations |
|
|
| ### Large WSI Files |
|
|
| Whole-slide images are large and may require specialized tools and sufficient storage capacity. |
|
|
| ### Patch Images Are Not Directly Stored |
|
|
| The `patches/*.h5` files provide patch coordinates and barcodes, but do not directly store raw patch image arrays. Users need to crop patches from the corresponding WSI. |
|
|
| ### Cell Segmentation Depends on CellViT++ |
|
|
| Cell-level information is derived from CellViT++ segmentation. Downstream analysis may therefore be affected by the accuracy and bias of the segmentation model. |
|
|
| ### Resolution Differences |
|
|
| Spot-resolution and single-cell-resolution samples have different label granularities. Results across these two settings should be interpreted carefully. |
|
|
| ### Gene Expression Sparsity |
|
|
| Spatial transcriptomics and single-cell transcriptomics data are sparse and noisy. Prediction performance should be interpreted with appropriate biological and technical considerations. |
|
|
| --- |
|
|
| ## Ethical Considerations |
|
|
| The dataset contains histopathology images and molecular profiles derived from biomedical samples. Users are responsible for ensuring that their use of the dataset complies with applicable ethical, institutional, and legal requirements. |
|
|
| The dataset should only be used for research purposes and should not be used for patient identification, clinical diagnosis, or treatment recommendation. |
|
|
| ## Contact |
|
|
| For questions about the dataset, please open an issue in this Hugging Face dataset repository. |