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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: cc-by-4.0
|
3 |
+
task_categories:
|
4 |
+
- image-segmentation
|
5 |
+
- image-classification
|
6 |
+
tags:
|
7 |
+
- H&E
|
8 |
+
- WholeSlideImages
|
9 |
+
- CellTypeAnnotation
|
10 |
+
- Segmentation
|
11 |
+
- SpatialTranscriptomics
|
12 |
+
- Cancer
|
13 |
+
modalities: Image
|
14 |
+
pretty_name: STHELAR_20x
|
15 |
+
size_categories:
|
16 |
+
- 100K<n<1M
|
17 |
+
arxiv: https://doi.org/10.1101/2025.07.11.664123
|
18 |
+
libraries: Datasets
|
19 |
+
---
|
20 |
+
|
21 |
+
# STHELAR dataset (20x)
|
22 |
+
|
23 |
+
**STHELAR** (*Spatial Transcriptomics and H&E histology for Large-scale Annotation Resource*) is a multi-tissue dataset designed for developing models capable of **predicting cell types directly from histological Hematoxylin & Eosin (H&E) whole slide images**. It integrates high-resolution spatial transcriptomics data with histology, to provide detailed segmentation masks and cell-type annotations.
|
24 |
+
|
25 |
+
---
|
26 |
+
|
27 |
+
## Available dataset versions
|
28 |
+
|
29 |
+
* **[`STHELAR_40x`](https://huggingface.co/datasets/FelicieGS/STHELAR_40x)** — 587,555 image patches at **40x** magnification
|
30 |
+
* **[`STHELAR_20x`](https://huggingface.co/datasets/FelicieGS/STHELAR_20x)** — 154,814 image patches at **20x** magnification
|
31 |
+
|
32 |
+
Both datasets share identical structures and metadata, differing only in image magnification levels.
|
33 |
+
|
34 |
+
---
|
35 |
+
|
36 |
+
## Detailed background
|
37 |
+
|
38 |
+
The STHELAR dataset is built from spatial transcriptomics (ST) data combined with Hematoxylin and Eosin (H&E) images, specifically sourced from the 10X Genomics platform using Xenium technology. The dataset comprises 27 human tissue FFPE slides, representing 13 distinct tissue types, including samples from 20 cancerous patients. Both modalities were aligned. Cell-type annotations were generated using the Tangram method, aligning the ST data with single-cell RNA reference atlases, and were subsequently refined via Leiden clustering combined with differential gene expression analysis. The aligned H&E images were divided into H&E patches, each accompanied by masks for nuclei segmentation and cell-type classification. Quality control steps were conducted, notably by comparing STHELAR segmentation masks with predictions from the pretrained CellViT model on the PanNuke dataset.
|
39 |
+
|
40 |
+
---
|
41 |
+
|
42 |
+
## Dataset description
|
43 |
+
|
44 |
+
Each dataset (**STHELAR_40x** or **STHELAR_20x**) consists of:
|
45 |
+
|
46 |
+
* **file_name**: Filename of the H&E image patch (e.g., breast_s0_10.png).
|
47 |
+
* **slide_id**: Identifier of the slide from which the patch was extracted (e.g., breast_s0).
|
48 |
+
* **tissue**: Tissue type, provided as categorical labels (e.g., Breast, Lung, Colon).
|
49 |
+
* **image**: RGB color images of size 256×256 pixels, extracted from H&E-stained whole-slide images at 40x or 20x magnification, with a 64-pixel overlap between adjacent patches.
|
50 |
+
* **instance_map**: Grayscale (16-bit) segmentation mask corresponding exactly to the H&E patch, with each nucleus uniquely labeled by a positive integer (0 represents background).
|
51 |
+
* **type_map**: Grayscale (8-bit) classification mask corresponding exactly to the H&E patch, where each nucleus is labeled according to its annotated cell type using the labels provided below (0 represents background).
|
52 |
+
* **cell_counts**: List of integers indicating the number of cells per cell type within the patch, ordered according to the cell type labels provided.
|
53 |
+
* **Dice**: Dice similarity coefficient measuring the overlap between the provided segmentation masks and segmentation predicted by a pre-trained CellViT model (SAM-H encoder).
|
54 |
+
* **Jaccard**: Jaccard index measuring segmentation accuracy relative to predictions made by a pre-trained CellViT model (SAM-H encoder).
|
55 |
+
* **bPQ**: Binary Panoptic Quality score, evaluating segmentation and instance-detection accuracy simultaneously, computed relative to predictions made by a pre-trained CellViT model (SAM-H encoder).
|
56 |
+
|
57 |
+
---
|
58 |
+
|
59 |
+
## Cell type labels
|
60 |
+
|
61 |
+
Cell type annotations are provided using the following consistent labels:
|
62 |
+
|
63 |
+
|
64 |
+
| **Label ID** | **Cell type** | **Description** |
|
65 |
+
|--------------|----------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
66 |
+
| 1 | T_NK | Includes T lymphocytes and natural killer (NK) cells. |
|
67 |
+
| 2 | B_Plasma | Combines B lymphocytes and plasma cells. |
|
68 |
+
| 3 | Myeloid | Comprises macrophages, monocytes, dendritic cells, neutrophils, mast cells, and plasmacytoid dendritic cells (pDCs). Due to their dual myeloid/lymphoid characteristics and rarity, pDCs were grouped here, with minimal impact expected. |
|
69 |
+
| 4 | Blood_vessel | Covers endothelial cells, pericytes, and smooth muscle cells. |
|
70 |
+
| 5 | Fibroblast_Myofibroblast | Contains fibroblasts, myofibroblasts, and mesenchymal stromal cells. |
|
71 |
+
| 6 | Epithelial | Includes various epithelial cells often specific to individual tissues. For instance, in pancreatic tissue, it includes pancreatic acinar, ductal, and islet cells. |
|
72 |
+
| 7 | Specialized | Captures tissue-specific cells such as cardiomyocytes, osteoblasts, osteoclasts, and some endocrine cells. |
|
73 |
+
| 8 | Melanocyte | Represents melanocytes or melanoma cells specifically found in skin tissue. |
|
74 |
+
| 9 | Other | Encompasses cells without marker genes or those with fewer than 10 RNAs. |
|
75 |
+
|
76 |
+
---
|
77 |
+
|
78 |
+
## Tissue types and associated slides
|
79 |
+
|
80 |
+
The dataset covers a variety of normal and cancerous human tissues:
|
81 |
+
|
82 |
+
| Tissue type | Included slides (WSIs) |
|
83 |
+
| ----------- | ---------------------------------------------- |
|
84 |
+
| Breast | breast_s0, breast_s1, breast_s3, breast_s6 |
|
85 |
+
| Cervix | cervix_s0 |
|
86 |
+
| Colon | colon_s1, colon_s2 |
|
87 |
+
| Heart | heart_s0 |
|
88 |
+
| Kidney | kidney_s0, kidney_s1 |
|
89 |
+
| Liver | liver_s0, liver_s1 |
|
90 |
+
| Lung | lung_s1, lung_s3 |
|
91 |
+
| LymphNode | lymph_node_s0 |
|
92 |
+
| Ovarian | ovary_s0, ovary_s1 |
|
93 |
+
| Pancreatic | pancreatic_s0, pancreatic_s1, pancreatic_s2 |
|
94 |
+
| Prostate | prostate_s0 |
|
95 |
+
| Skin | skin_s1, skin_s2, skin_s3, skin_s4 |
|
96 |
+
| Tonsil | tonsil_s0, tonsil_s1 |
|
97 |
+
|
98 |
+
Slides with cancerous tissue are: 'breast_s0', 'breast_s1', 'breast_s3', 'breast_s6', 'cervix_s0', 'colon_s1', 'colon_s2', 'kidney_s1', 'liver_s1', 'lung_s1', 'lung_s3', 'ovary_s0', 'ovary_s1', 'pancreatic_s0', 'pancreatic_s1', 'pancreatic_s2', 'prostate_s0', 'skin_s2', 'skin_s3', 'skin_s4'.
|
99 |
+
|
100 |
+
---
|
101 |
+
|
102 |
+
## Quality control
|
103 |
+
|
104 |
+
Segmentation and alignment quality were assessed using metrics from comparisons to segmentation predictions by pre-trained [CellViT](https://github.com/TIO-IKIM/CellViT) (SAM-H) model. Metrics included:
|
105 |
+
|
106 |
+
* **Dice coefficient**: Measures overlap accuracy.
|
107 |
+
* **Jaccard index**: Intersection-over-union metric.
|
108 |
+
* **Binary Panoptic Quality (bPQ)**: Evaluates segmentation and detection quality simultaneously.
|
109 |
+
|
110 |
+
These metrics facilitate dynamic filtering based on required accuracy thresholds (e.g., retaining patches with Jaccard index ≥ 0.45).
|
111 |
+
A high score generally reflects good alignment and segmentation quality for our dataset. Conversely, a low score does not always indicate poor quality—it may result from actual data issues or from inaccurate predictions by CellViT (see article for details).
|
112 |
+
|
113 |
+
---
|
114 |
+
|
115 |
+
## Dataset format
|
116 |
+
|
117 |
+
```
|
118 |
+
license: cc-by-4.0
|
119 |
+
data_files:
|
120 |
+
- split: train
|
121 |
+
path: data/train-*
|
122 |
+
dataset_info:
|
123 |
+
features:
|
124 |
+
- name: file_name
|
125 |
+
dtype: string
|
126 |
+
- name: image
|
127 |
+
dtype: image
|
128 |
+
- name: slide_id
|
129 |
+
dtype: string
|
130 |
+
- name: tissue
|
131 |
+
dtype:
|
132 |
+
class_label:
|
133 |
+
names:
|
134 |
+
'0': Breast
|
135 |
+
'1': Cervix
|
136 |
+
'2': Colon
|
137 |
+
'3': Heart
|
138 |
+
'4': Kidney
|
139 |
+
'5': Liver
|
140 |
+
'6': Lung
|
141 |
+
'7': LymphNode
|
142 |
+
'8': Ovarian
|
143 |
+
'9': Pancreatic
|
144 |
+
'10': Prostate
|
145 |
+
'11': Skin
|
146 |
+
'12': Tonsil
|
147 |
+
- name: cell_counts
|
148 |
+
list: uint16
|
149 |
+
- name: instance_map
|
150 |
+
dtype: image
|
151 |
+
- name: type_map
|
152 |
+
dtype: image
|
153 |
+
- name: Dice
|
154 |
+
dtype: float16
|
155 |
+
- name: Jaccard
|
156 |
+
dtype: float16
|
157 |
+
- name: bPQ
|
158 |
+
dtype: float16
|
159 |
+
splits:
|
160 |
+
- name: train
|
161 |
+
num_bytes: 37412008441.54
|
162 |
+
num_examples: 154814
|
163 |
+
download_size: 19071310668
|
164 |
+
dataset_size: 37412008441.54
|
165 |
+
```
|
166 |
+
|
167 |
+
---
|
168 |
+
|
169 |
+
## Loading the dataset
|
170 |
+
|
171 |
+
- To load the full dataset:
|
172 |
+
```python
|
173 |
+
from datasets import load_dataset
|
174 |
+
|
175 |
+
ds = load_dataset("FelicieGS/STHELAR_20x") # (replace 'STHELAR_20x' with 'STHELAR_40x' as needed)
|
176 |
+
```
|
177 |
+
|
178 |
+
- Or to see how it looks, you can stream, using for instance:
|
179 |
+
```python
|
180 |
+
from datasets import load_dataset, Image
|
181 |
+
import matplotlib.pyplot as plt
|
182 |
+
import numpy as np
|
183 |
+
|
184 |
+
def to_numpy(ex):
|
185 |
+
ex["instance_map"] = np.asarray(ex["instance_map"], dtype=np.uint16)
|
186 |
+
ex["type_map"] = np.asarray(ex["type_map"], dtype=np.uint8)
|
187 |
+
return ex
|
188 |
+
|
189 |
+
def decode_sample(ex):
|
190 |
+
rgb = np.array(ex["image"])
|
191 |
+
inst = ex["instance_map"].astype(np.uint16)
|
192 |
+
ctype = ex["type_map"].astype(np.uint8)
|
193 |
+
return rgb, inst, ctype
|
194 |
+
|
195 |
+
def plot_sample(ex, rgb, inst, ctype):
|
196 |
+
fig, ax = plt.subplots(1, 3, figsize=(10, 3))
|
197 |
+
|
198 |
+
ax[0].imshow(rgb)
|
199 |
+
ax[0].set_title("RGB patch"); ax[0].axis("off")
|
200 |
+
|
201 |
+
ax[1].imshow(inst, cmap="viridis")
|
202 |
+
ax[1].set_title("Instance map"); ax[1].axis("off")
|
203 |
+
|
204 |
+
ax[2].imshow(ctype, cmap="tab10")
|
205 |
+
ax[2].set_title("Cell-type map"); ax[2].axis("off")
|
206 |
+
|
207 |
+
plt.tight_layout()
|
208 |
+
plt.show()
|
209 |
+
|
210 |
+
print("Slide:", ex["slide_id"])
|
211 |
+
print("Tissue class:", tissue_label.int2str(ex["tissue"]))
|
212 |
+
print("Cell counts:", ex["cell_counts"])
|
213 |
+
print("Dice/Jaccard/bPQ:", ex["Dice"], ex["Jaccard"], ex["bPQ"])
|
214 |
+
print("Unique instances:", np.unique(inst))
|
215 |
+
print("Unique cell types:", np.unique(ctype))
|
216 |
+
|
217 |
+
|
218 |
+
ds = load_dataset("FelicieGS/STHELAR_20x", split="train", streaming=True)
|
219 |
+
print("Features: ", ds.features)
|
220 |
+
tissue_label = ds.features["tissue"]
|
221 |
+
ds = ds.cast_column("image", Image(decode=True))
|
222 |
+
ds = ds.map(to_numpy)
|
223 |
+
stream = iter(ds)
|
224 |
+
|
225 |
+
ex1 = next(stream)
|
226 |
+
rgb1, inst1, ctype1 = decode_sample(ex1)
|
227 |
+
plot_sample(ex1, rgb1, inst1, ctype1)
|
228 |
+
```
|
229 |
+
|
230 |
+
---
|
231 |
+
|
232 |
+
## Associated publication and data resources
|
233 |
+
|
234 |
+
* **Main publication:** [STHELAR bioRxiv](https://doi.org/10.1101/2025.07.11.664123)
|
235 |
+
* **All data mentionned in the publication (BioStudies):** [S-BIAD2146](https://www.ebi.ac.uk/biostudies/bioimages/studies/S-BIAD2146)
|
236 |
+
* **Code repositories:**
|
237 |
+
|
238 |
+
* [STHELAR pipeline](https://github.com/MICS-Lab/STHELAR)
|
239 |
+
* [CellViT for STHELAR](https://github.com/MICS-Lab/CellViT_for_STHELAR)
|
240 |
+
|
241 |
+
---
|
242 |
+
|
243 |
+
## Citation
|
244 |
+
|
245 |
+
Giraud-Sauveur, F. et al. STHELAR, a multi-tissue dataset linking spatial transcriptomics and histology for cell type annotation. bioRxiv (2025) doi:10.1101/2025.07.11.664123.
|
246 |
+
|
247 |
+
|
248 |
+
---
|
249 |
+
|
250 |
+
## License
|
251 |
+
|
252 |
+
Released under the **CC-BY 4.0 License**.
|