--- library_name: transformers license: cc-by-nc-4.0 datasets: - histai/SPIDER-thorax base_model: - histai/hibou-L pipeline_tag: image-classification --- # SPIDER-Thorax Model ### Model Description SPIDER-thorax model is a deep learning model trained for patch-level pathology classification, specifically for thorax. 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 - **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-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) ``` ### 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 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 | ## 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:** dmitry@hist.ai, alex@hist.ai, kate@hist.ai