🚀 SPIDER-Skin Model
The SPIDER-skin model is a deep learning model designed for patch-level skin pathology classification. It's part of the SPIDER dataset initiative, which offers a large, high - quality, multi - organ pathology dataset with expert - annotated labels.
🚀 Quick Start
The model works with 1120×1120 patches. Use the following code snippet to load and use the model:
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)
✨ Features
- Trained for patch - level skin pathology classification.
- Part of the SPIDER dataset initiative with expert - annotated labels.
📦 Installation
The code example above assumes you have the transformers
library installed. You can install it using the following command:
pip install transformers
💻 Usage Examples
Basic Usage
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)
📚 Documentation
Model Description
The 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 models@hist.ai.
Model Sources
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:
Property |
Details |
Model Type |
Deep learning model for patch - level skin pathology classification |
Training Data |
[SPIDER - skin](https://huggingface.co/datasets/histai/SPIDER - skin) dataset |
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:
@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