đ SPIDER-Thorax Model
The SPIDER-thorax model is a deep - learning model designed for patch - level pathology classification of the thorax. It is part of the SPIDER dataset initiative, which offers a large - scale, high - quality, multi - organ pathology dataset with expert - annotated labels. If you're interested in supporting, sponsoring, or obtaining a commercial license for the SPIDER data and models, reach out to us at models@hist.ai.
đ Quick Start
The model operates on 1120Ã1120 patches. Use the following code to load and utilize the model:
Basic Usage
from transformers import AutoModel, AutoProcessor
from PIL import Image
model = AutoModel.from_pretrained("histai/SPIDER-thorax-model", trust_remote_code=True)
processor = AutoProcessor.from_pretrained("histai/SPIDER-thorax-model", trust_remote_code=True)
image = Image.open("path_to_image.png")
inputs = processor(images=image, return_tensors="pt")
outputs = model(**inputs)
print(outputs.predicted_class_names)
⨠Features
- Specialized for patch - level pathology classification of the thorax.
- Part of the comprehensive SPIDER dataset initiative.
đĻ Installation
The installation is mainly about using the transformers
library. If you haven't installed it yet, you can use the following command:
pip install transformers
đ Documentation
Model Sources
Training Data
The model is trained on the [SPIDER - thorax](https://huggingface.co/datasets/histai/SPIDER - thorax) dataset, a subset of the SPIDER dataset. The dataset details are as follows:
Property |
Details |
Model Type |
Deep learning model for patch - level pathology classification of the thorax |
Training Data |
[SPIDER - thorax](https://huggingface.co/datasets/histai/SPIDER - thorax) dataset |
The dataset includes:
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
Results
Organ |
Accuracy |
Precision |
F1 Score |
Thorax |
0.962 |
0.958 |
0.960 |
đ§ Technical Details
The model is designed for patch - level pathology classification of the thorax. It is trained on a specific subset of the SPIDER dataset, which provides a rich set of expert - annotated data for different classes related to the thorax. The model works with a specific patch size of 1120Ã1120 and uses the transformers
library for loading and processing.
đ License
The model is licensed under CC BY - NC 4.0 and is for research use only.
Citation
If you use this model, please cite the following:
@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},
}
More Information
To explore other models and the SPIDER dataset, you can visit the Hugging Face HistAI page or GitHub of the project.
Contacts
- Authors: Dmitry Nechaev, Alexey Pchelnikov, Ekaterina Ivanova
- Email: dmitry@hist.ai, alex@hist.ai, kate@hist.ai