SPIDER-thorax
收藏魔搭社区2025-11-27 更新2025-05-17 收录
下载链接:
https://modelscope.cn/datasets/histai/SPIDER-thorax
下载链接
链接失效反馈官方服务:
资源简介:
# SPIDER-THORAX Dataset
SPIDER is a collection of supervised pathological datasets covering multiple organs, each with comprehensive class coverage. These datasets are professionally annotated by pathologists.
If you would like to support, sponsor, or obtain a commercial license for the SPIDER data and models, please contact us at models@hist.ai.
For a detailed description of SPIDER, methodology, and benchmark results, refer to our research paper:
📄 **SPIDER: A Comprehensive Multi-Organ Supervised Pathology Dataset and Baseline Models**
[View on arXiv](https://arxiv.org/abs/2503.02876)
This repository contains the **SPIDER-thorax** dataset. To explore datasets for other organs, visit the [Hugging Face HistAI page](https://huggingface.co/histai) or [GitHub](https://github.com/HistAI/SPIDER). SPIDER is regularly updated with new organs and data, so follow us on Hugging Face to stay updated.
---
### Overview
SPIDER-thorax is a supervised dataset of image-class pairs for the thorax organ. Each data point consists of:
- A **central 224×224 patch** with a class label
- **24 surrounding context patches** of the same size, forming a **composite 1120×1120 region**
- Patches are extracted at **20X magnification**
We provide a **train-test split** for consistent benchmarking. The split is done at the **slide level**, ensuring that patches from the same whole slide image (WSI) do not appear in both training and test sets. Users can also merge and re-split the data as needed.
## How to Use
### Downloading the Dataset
#### Option 1: Using `huggingface_hub`
```python
from huggingface_hub import snapshot_download
snapshot_download(repo_id="histai/SPIDER-thorax", repo_type="dataset", local_dir="/local_path")
```
#### Option 2: Using `git`
```bash
# Ensure you have Git LFS installed (https://git-lfs.com)
git lfs install
git clone https://huggingface.co/datasets/histai/SPIDER-thorax
```
### Extracting the Dataset
The dataset is provided in multiple tar archives. Unpack them using:
```bash
cat spider-thorax.tar.* | tar -xvf -
```
### Using the Dataset
Once extracted, you will find:
- An `images/` folder
- A `metadata.json` file
You can process and use the dataset in two ways:
#### 1. Directly in Code (Recommended for PyTorch Training)
Use the dataset class provided in `scripts/spider_dataset.py`. This class takes:
- Path to the dataset (folder containing `metadata.json` and `images/` folder)
- Context size: `5`, `3`, or `1`
- `5`: Full **1120×1120** patches (default)
- `3`: **672×672** patches
- `1`: Only central patches
The dataset class dynamically returns stitched images, making it suitable for direct use in PyTorch training pipelines.
#### 2. Convert to ImageNet Format
To structure the dataset for easy use with standard tools, convert it using `scripts/convert_to_imagenet.py`.
The script also supports different context sizes.
This will generate:
```
<output_dir>/<split>/<class>/<slide>/<image>
```
You can then use it with:
```python
from datasets import load_dataset
dataset = load_dataset("imagefolder", data_dir="/path/to/folder")
```
or
`torchvision.datasets.ImageFolder` class
---
### Dataset Composition
The SPIDER-thorax dataset consists of the following classes:
| Class | Central Patches |
|--------------------------------|------------|
| Alveoli | 6652 |
| Bronchial cartilage | 5685 |
| Bronchial glands | 4412 |
| Chronic inflammation + fibrosis | 6070 |
| Detritus | 5146 |
| Fibrosis | 6494 |
| Hemorrhage | 5247 |
| Lymph node | 6088 |
| Pigment | 5177 |
| Pleura | 4560 |
| Tumor non-small cell | 6445 |
| Tumor small cell | 5061 |
| Tumor soft | 5894 |
| Vessel | 5376 |
**Total Counts:**
- **78,307** central patches
- **599,459** total patches (including context patches)
- **411** total slides used for annotation
---
## License
The dataset is licensed under **CC BY-NC 4.0** and is for **research use only**.
## Citation
If you use this dataset in your work, please cite:
```bibtex
@misc{nechaev2025spidercomprehensivemultiorgansupervised,
title={SPIDER: A Comprehensive Multi-Organ Supervised Pathology Dataset and Baseline Models},
author={Dmitry Nechaev and Alexey Pchelnikov and Ekaterina Ivanova},
year={2025},
eprint={2503.02876},
archivePrefix={arXiv},
primaryClass={eess.IV},
url={https://arxiv.org/abs/2503.02876},
}
```
## Contacts
- **Authors:** Dmitry Nechaev, Alexey Pchelnikov, Ekaterina Ivanova
- **Email:** dmitry@hist.ai, alex@hist.ai, kate@hist.ai
# SPIDER-THORAX 数据集
SPIDER 是一组覆盖多器官的监督式病理数据集,具备全面的类别覆盖范围,所有数据均由病理学家进行专业标注。
若您希望为SPIDER数据与模型提供支持、赞助,或获取商业授权,请发送邮件至models@hist.ai与我们联系。
如需了解SPIDER的详细描述、研究方法与基准测试结果,请参阅我们的学术论文:
📄 **SPIDER:一款全面的多器官监督式病理数据集与基准模型**
[在arXiv上查看](https://arxiv.org/abs/2503.02876)
本仓库包含**SPIDER-thorax**数据集。如需探索其他器官的病理数据集,请访问[Hugging Face HistAI页面](https://huggingface.co/histai)或[GitHub仓库](https://github.com/HistAI/SPIDER)。SPIDER数据集会定期更新新增器官与数据,您可关注Hugging Face账号以获取最新动态。
---
### 数据集概览
SPIDER-thorax 是针对胸部器官的图像-标签对监督式数据集,每条数据包含以下内容:
- 带类别标签的**中心224×224图像块**
- 24张相同尺寸的**周边上下文图像块**,共同组成**1120×1120的复合区域**
- 所有图像块均以**20倍放大倍率**提取
我们提供了**训练-测试划分方案**以保障基准测试的一致性。该划分基于**切片级别**进行,确保来自同一张完整切片图像(Whole Slide Image,简称WSI)的图像块不会同时出现在训练集与测试集中。用户也可根据需求自行合并或重新划分数据。
## 使用方法
### 数据集下载
#### 方案1:使用`huggingface_hub`工具
python
from huggingface_hub import snapshot_download
snapshot_download(repo_id="histai/SPIDER-thorax", repo_type="dataset", local_dir="/local_path")
#### 方案2:使用`git`工具
bash
# 请确保已安装Git LFS(https://git-lfs.com)
git lfs install
git clone https://huggingface.co/datasets/histai/SPIDER-thorax
### 数据集解压
本数据集以多份tar归档文件形式提供,可通过以下命令解压:
bash
cat spider-thorax.tar.* | tar -xvf -
### 数据集使用
解压完成后,您将获得以下内容:
- `images/` 文件夹
- `metadata.json` 元数据文件
您可通过两种方式处理并使用该数据集:
#### 1. 直接在代码中调用(推荐用于PyTorch训练)
可使用`scripts/spider_dataset.py`中提供的数据集类。该类支持以下参数:
- 数据集路径(包含`metadata.json`与`images/`文件夹的根目录)
- 上下文块数量:`5`、`3`或`1`
- `5`:完整**1120×1120**复合图像块(默认选项)
- `3`:**672×672**复合图像块
- `1`:仅使用中心图像块
该数据集类会动态返回拼接后的图像,可直接适配PyTorch训练流程。
#### 2. 转换为ImageNet格式
如需将数据集整理为适配标准工具的格式,可使用`scripts/convert_to_imagenet.py`脚本进行转换。该脚本同样支持不同的上下文块数量配置。
转换后将生成如下目录结构:
<output_dir>/<split>/<class>/<slide>/<image>
之后即可通过以下方式加载数据集:
python
from datasets import load_dataset
dataset = load_dataset("imagefolder", data_dir="/path/to/folder")
或使用`torchvision.datasets.ImageFolder`类
---
### 数据集构成
SPIDER-thorax 数据集包含以下类别:
| 类别名称 | 中心图像块数量 |
|------------------------------|----------------|
| 肺泡 | 6652 |
| 支气管软骨 | 5685 |
| 支气管腺 | 4412 |
| 慢性炎症伴纤维化 | 6070 |
| 碎屑 | 5146 |
| 纤维化 | 6494 |
| 出血 | 5247 |
| 淋巴结 | 6088 |
| 色素沉着 | 5177 |
| 胸膜 | 4560 |
| 非小细胞肿瘤 | 6445 |
| 小细胞肿瘤 | 5061 |
| 软组织肿瘤 | 5894 |
| 血管 | 5376 |
**总样本量:**
- **78,307** 张中心图像块
- **599,459** 张总图像块(含上下文图像块)
- 共使用**411**张标注切片
---
## 授权协议
本数据集采用**CC BY-NC 4.0**授权协议,仅可用于**非商业性研究用途**。
## 引用声明
若您在研究工作中使用本数据集,请引用以下文献:
bibtex
@misc{nechaev2025spidercomprehensivemultiorgansupervised,
title={SPIDER: A Comprehensive Multi-Organ Supervised Pathology Dataset and Baseline Models},
author={Dmitry Nechaev and Alexey Pchelnikov and Ekaterina Ivanova},
year={2025},
eprint={2503.02876},
archivePrefix={arXiv},
primaryClass={eess.IV},
url={https://arxiv.org/abs/2503.02876},
}
## 联系方式
- **作者团队:** Dmitry Nechaev、Alexey Pchelnikov、Ekaterina Ivanova
- **邮箱:** dmitry@hist.ai、alex@hist.ai、kate@hist.ai
提供机构:
maas
创建时间:
2025-05-15



