Datasets:
The full dataset viewer is not available (click to read why). Only showing a preview of the rows.
Error code: DatasetGenerationError
Exception: IndexError
Message: list index out of range
Traceback: Traceback (most recent call last):
File "/usr/local/lib/python3.12/site-packages/datasets/builder.py", line 1811, in _prepare_split_single
original_shard_lengths[original_shard_id] += len(table)
~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^
IndexError: list index out of range
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 1342, in compute_config_parquet_and_info_response
parquet_operations, partial, estimated_dataset_info = stream_convert_to_parquet(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 907, in stream_convert_to_parquet
builder._prepare_split(split_generator=splits_generators[split], file_format="parquet")
File "/usr/local/lib/python3.12/site-packages/datasets/builder.py", line 1646, in _prepare_split
for job_id, done, content in self._prepare_split_single(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/datasets/builder.py", line 1832, in _prepare_split_single
raise DatasetGenerationError("An error occurred while generating the dataset") from e
datasets.exceptions.DatasetGenerationError: An error occurred while generating the datasetNeed help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.
cell_class_id int64 | cell_coords list | cell_embedding list |
|---|---|---|
3 | [
22335,
6960
] | [
3.9441184997558594,
2.8969902992248535,
-5.3300676345825195,
1.4746917486190796,
2.2278707027435303,
-0.6092265248298645,
1.313358187675476,
-2.0684213638305664,
-0.17673829197883606,
0.8596915006637573,
-2.6959991455078125,
-1.741748332977295,
2.1557021141052246,
1.5237480401992798,
3.7... |
3 | [
22405,
7093
] | [
3.458117723464966,
2.428992509841919,
-6.797715663909912,
2.114663600921631,
0.13184623420238495,
1.9326262474060059,
-1.899916648864746,
-7.16638708114624,
-1.0591219663619995,
-5.206018447875977,
-3.5858232975006104,
-1.2992392778396606,
0.07637179642915726,
-1.3063300848007202,
4.7156... |
3 | [
22802,
7094
] | [
3.570449113845825,
1.6771069765090942,
-6.774248123168945,
-0.4720554053783417,
0.9697058796882629,
-3.269192934036255,
1.7706495523452759,
-0.10992252826690674,
1.2238452434539795,
-3.4218833446502686,
-5.223791599273682,
-1.2684017419815063,
0.22152620553970337,
2.793031930923462,
2.39... |
3 | [
22150,
7160
] | [
1.7953486442565918,
4.776991844177246,
8.192831039428711,
6.042363166809082,
0.0786307156085968,
4.789680004119873,
-1.8309777975082397,
0.399497926235199,
3.5531880855560303,
1.9016791582107544,
-5.880942344665527,
-5.276106834411621,
4.236425399780273,
1.3854151964187622,
7.64727354049... |
3 | [
22491,
7399
] | [
4.090304374694824,
2.227595806121826,
-5.638125896453857,
4.464151382446289,
0.9869996309280396,
1.678959846496582,
-3.4043281078338623,
-3.7055299282073975,
3.814467430114746,
-2.4620766639709473,
-1.7197239398956299,
1.539848804473877,
-0.20025473833084106,
0.8153513669967651,
3.857367... |
3 | [
22621,
7683
] | [
2.9878158569335938,
-0.5659703612327576,
7.603355884552002,
3.578477144241333,
1.0767496824264526,
1.6226619482040405,
-1.9110244512557983,
0.878487765789032,
0.1821979284286499,
-0.22771596908569336,
-2.4416844844818115,
0.14141716063022614,
1.2861062288284302,
1.6605437994003296,
10.67... |
1 | [
23068,
7785
] | [
-0.23242402076721191,
1.0487192869186401,
11.07599925994873,
3.0935866832733154,
0.5610189437866211,
0.039751846343278885,
-9.369189262390137,
-19.28546142578125,
-0.53565913438797,
-1.4085206985473633,
-2.182084083557129,
1.9485243558883667,
1.6888947486877441,
1.6507644653320312,
9.555... |
1 | [
22599,
8004
] | [
0.7315030097961426,
-2.0811855792999268,
6.298504829406738,
2.4997873306274414,
-1.2241122722625732,
2.4065239429473877,
-10.304506301879883,
4.3371758460998535,
-3.2745895385742188,
3.4553513526916504,
-4.412590503692627,
-1.246469259262085,
-0.5557995438575745,
8.392938613891602,
-3.92... |
1 | [
22346,
8094
] | [0.036856215447187424,-2.8919565677642822,-3.030285596847534,1.166811466217041,-0.904724657535553,-0(...TRUNCATED) |
1 | [
22319,
8126
] | [-0.8987029194831848,-3.361377716064453,-1.7751058340072632,-0.17341016232967377,-1.92527437210083,-(...TRUNCATED) |
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:
/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:
/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:
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:
TENX62_seg.parquet
TENX62.h5
The *_seg.parquet file is a DataFrame containing cell-level segmentation information. Typical columns include:
['geometry', 'class', 'cell_id']
The corresponding .h5 file stores cell-level information. Typical keys include:
['cell_coords', 'cell_embedding', 'cell_class_id']
where:
cell_coordsstores cell coordinates;cell_embeddingstores cell-level image embeddings;cell_class_idstores predicted cell class IDs.
patches/
This folder stores metadata for spot-centered patches.
Each .h5 file contains:
['barcode', 'coords']
where:
barcodeis the spatial transcriptomics spot barcode;coordsrecords 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:
{
"barcode": {
"cell_index": [99],
"in_spot": [1]
}
}
where:
cell_indexindicates the indices of cells located in the patch;in_spotindicates whether each cell is located inside the spatial spot region.
Each patch corresponds to a local image region of:
224 Γ 224 pixels
st_spot_label/
This folder stores spot-level gene expression labels.
Each .h5ad file contains a spot-level gene expression matrix:
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:
/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:
['st_cell_index', 'cell_id']
where:
st_cell_indexis the cell index in the spatial transcriptomics data;cell_idis 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:
num_cells Γ num_genes
The row index corresponds to:
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:
Spot-level spatial gene expression prediction
Given a spot-centered histology patch, predict the corresponding spot-level gene expression vector.
Single-cell-level gene expression prediction
Given image-derived cell information and local histological context, predict the gene expression profile of individual cells.
Weakly supervised spatial gene expression inference
Evaluate whether weakly supervised models can infer molecular profiles from histopathology images.
Cell-aware representation learning
Use cell segmentation, cell embeddings, and patch-cell relationships to learn cell-aware histology representations.
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
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
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
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
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
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
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:
spot-centered histology patch
Output:
spot-level gene expression vector
Label file:
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:
cell-level image features and local patch context
Output:
single-cell gene expression vector
Label file:
st_cell_label/*.h5ad
Mapping file:
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:
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.
- Downloads last month
- 24