SPIDER-skin-model / README.md
mgvz's picture
Update README.md
b594d42 verified
---
library_name: transformers
license: cc-by-nc-4.0
datasets:
- histai/SPIDER-skin
base_model:
- histai/hibou-L
pipeline_tag: image-classification
---
# SPIDER-Skin Model
### Model Description
SPIDER-skin model is a deep learning model trained for patch-level pathology classification, specifically for skin. It is part of the SPIDER dataset initiative, which provides a large, high-quality, multi-organ pathology dataset with expert-annotated labels.
If you would like to support, sponsor, or obtain a commercial license for the SPIDER data and models, please contact us at [email protected].
### Model Sources
- **Repository:** [https://github.com/HistAI/SPIDER](https://github.com/HistAI/SPIDER)
- **Paper:** [SPIDER: A Comprehensive Multi-Organ Supervised Pathology Dataset and Baseline Models](https://arxiv.org/abs/2503.02876)
## How to Get Started with the Model
Model works with **1120×1120** patches.
Use the following code snippet to load and use the model:
```python
from transformers import AutoModel, AutoProcessor
from PIL import Image
model = AutoModel.from_pretrained("histai/SPIDER-skin-model", trust_remote_code=True)
processor = AutoProcessor.from_pretrained("histai/SPIDER-skin-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)
```
### Training Data
The model is trained on the [SPIDER-skin](https://huggingface.co/datasets/histai/SPIDER-skin) dataset, a subset of the SPIDER dataset. The dataset includes:
| Class | Central Patches |
|--------------------------------|------------|
| Actinic keratosis | 4936 |
| Apocrine glands | 6739 |
| Basal cell carcinoma | 6446 |
| Carcinoma in situ | 5478 |
| Collagen | 6262 |
| Epidermis | 7449 |
| Fat | 6525 |
| Follicle | 8343 |
| Inflammation | 5856 |
| Invasive melanoma | 9101 |
| Kaposi’s sarcoma | 4778 |
| Keratin | 6418 |
| Melanoma in situ | 4545 |
| Mercel cell carcinoma | 5968 |
| Muscle | 6051 |
| Necrosis | 6842 |
| Nerves | 4735 |
| Nevus | 8937 |
| Sebaceous gland | 6639 |
| Seborrheic keratosis | 10311 |
| Solar elastosis | 7613 |
| Squamous cell carcinoma | 6051 |
| Vessels | 7673 |
| Wart | 6158 |
**Total Counts:**
- **159,854** central patches
- **2,696,987** total patches (including context patches)
- **3,784** total slides used for annotation
### Results
| Organ | Accuracy | Precision | F1 Score |
|---------|----------|------------|----------|
| Skin | 0.940 | 0.936 | 0.938 |
## 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:
```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},
}
```
## More Information
To explore other models and the SPIDER dataset you can visit the [Hugging Face HistAI page](https://huggingface.co/histai) or [GitHub](https://github.com/HistAI/SPIDER) of the project.
## Contacts
- **Authors:** Dmitry Nechaev, Alexey Pchelnikov, Ekaterina Ivanova
- **Email:** [email protected], [email protected], [email protected]