Improve model card: Update pipeline tag, license, and add comprehensive details from GitHub
Browse filesThis pull request significantly enhances the RedDino model card by:
- **Updating Metadata**:
* Correcting the `pipeline_tag` from `feature-extraction` to `image-feature-extraction` to more accurately reflect the model's functionality and improve discoverability on the Hugging Face Hub.
* Updating the `license` from `cc-by-4.0` to `cc-by-nc-4.0`, as specified in the model's `config.json`, ensuring the stated license is precise for the artifact.
- **Enriching Content**:
* Adding a prominent link to the [official GitHub repository](https://github.com/Snarci/RedDino) for easy access to the source code and additional resources.
* Integrating detailed sections from the GitHub README, including **Model Variants**, **Benchmark Results**, and **Highlights**, providing a much richer overview of RedDino's architecture, performance, and key innovations.
* Updating the main title of the model card to align with the paper's title for better clarity and context.
These updates aim to provide a more complete, accurate, and user-friendly resource for researchers and developers interested in RedDino.
|
@@ -1,87 +1,76 @@
|
|
| 1 |
---
|
| 2 |
-
license: cc-by-4.0
|
| 3 |
-
tags:
|
| 4 |
-
- red-blood-cells
|
| 5 |
-
- hematology
|
| 6 |
-
- medical-imaging
|
| 7 |
-
- vision-transformer
|
| 8 |
-
- dino
|
| 9 |
-
- dinov2
|
| 10 |
-
- feature-extraction
|
| 11 |
-
- foundation-model
|
| 12 |
-
library_name: timm
|
| 13 |
datasets:
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
model-index:
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
value: 85.0
|
| 47 |
-
- task:
|
| 48 |
-
type: image-classification
|
| 49 |
-
name: RBC Shape Classification
|
| 50 |
-
dataset:
|
| 51 |
-
name: DSE
|
| 52 |
-
type: Classification
|
| 53 |
-
metrics:
|
| 54 |
-
- type: Weighted F1
|
| 55 |
-
value: 86.6
|
| 56 |
-
- type: Balanced Accuracy
|
| 57 |
-
value: 60.1
|
| 58 |
-
- type: Accuracy
|
| 59 |
-
value: 86.6
|
| 60 |
---
|
| 61 |
-
# RedDino-large
|
| 62 |
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
|
|
|
|
|
|
| 66 |
|
| 67 |
Unlike general-purpose models pretrained on natural images, RedDino incorporates hematology-specific augmentations, architectural tweaks, and RBC-tailored data preprocessing, enabling **state-of-the-art performance** on multiple RBC benchmarks.
|
| 68 |
|
| 69 |
> 🧠 Developed by [Luca Zedda](https://orcid.org/0009-0001-8488-1612), [Andrea Loddo](https://orcid.org/0000-0002-6571-3816), [Cecilia Di Ruberto](https://orcid.org/0000-0003-4641-0307), and [Carsten Marr](https://orcid.org/0000-0003-2154-4552)
|
| 70 |
> 🏥 University of Cagliari & Helmholtz Munich
|
| 71 |
-
> 📄 Preprint: [arXiv:2508.08180](https://arxiv.org/abs/2508.08180)
|
|
|
|
| 72 |
|
| 73 |
---
|
| 74 |
|
| 75 |
## Model Details
|
| 76 |
|
| 77 |
-
-
|
| 78 |
-
-
|
| 79 |
-
-
|
| 80 |
-
-
|
| 81 |
-
-
|
| 82 |
Notes:
|
| 83 |
-
-
|
| 84 |
-
-
|
|
|
|
| 85 |
## Example Usage
|
| 86 |
```python
|
| 87 |
from PIL import Image
|
|
@@ -106,6 +95,53 @@ input_tensor = transform(image).unsqueeze(0).to(device)
|
|
| 106 |
with torch.no_grad():
|
| 107 |
embedding = model(input_tensor)
|
| 108 |
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 109 |
## 📝 Citation
|
| 110 |
|
| 111 |
If you use this model, please cite the following paper:
|
|
@@ -125,3 +161,9 @@ Preprint: arXiv:2508.08180. https://arxiv.org/abs/2508.08180
|
|
| 125 |
url={https://arxiv.org/abs/2508.08180},
|
| 126 |
}
|
| 127 |
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
datasets:
|
| 3 |
+
- Elsafty
|
| 4 |
+
- Chula
|
| 5 |
+
- DSE
|
| 6 |
+
library_name: timm
|
| 7 |
+
license: cc-by-nc-4.0
|
| 8 |
+
pipeline_tag: image-feature-extraction
|
| 9 |
+
tags:
|
| 10 |
+
- red-blood-cells
|
| 11 |
+
- hematology
|
| 12 |
+
- medical-imaging
|
| 13 |
+
- vision-transformer
|
| 14 |
+
- dino
|
| 15 |
+
- dinov2
|
| 16 |
+
- feature-extraction
|
| 17 |
+
- foundation-model
|
| 18 |
model-index:
|
| 19 |
+
- name: RedDino-large
|
| 20 |
+
results:
|
| 21 |
+
- task:
|
| 22 |
+
type: image-classification
|
| 23 |
+
name: RBC Shape Classification
|
| 24 |
+
dataset:
|
| 25 |
+
name: Elsafty
|
| 26 |
+
type: Classification
|
| 27 |
+
metrics:
|
| 28 |
+
- type: Weighted F1
|
| 29 |
+
value: 88.5
|
| 30 |
+
- type: Balanced Accuracy
|
| 31 |
+
value: 89.1
|
| 32 |
+
- type: Accuracy
|
| 33 |
+
value: 88.4
|
| 34 |
+
- type: Weighted F1
|
| 35 |
+
value: 83.9
|
| 36 |
+
- type: Balanced Accuracy
|
| 37 |
+
value: 79.0
|
| 38 |
+
- type: Accuracy
|
| 39 |
+
value: 85.0
|
| 40 |
+
- type: Weighted F1
|
| 41 |
+
value: 86.6
|
| 42 |
+
- type: Balanced Accuracy
|
| 43 |
+
value: 60.1
|
| 44 |
+
- type: Accuracy
|
| 45 |
+
value: 86.6
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 46 |
---
|
|
|
|
| 47 |
|
| 48 |
+
# RedDino: A Foundation Model for Red Blood Cell Analysis
|
| 49 |
+
|
| 50 |
+
**RedDino** is a self-supervised Vision Transformer foundation model specifically designed for **red blood cell (RBC)** image analysis, as presented in the paper [RedDino: A foundation model for red blood cell analysis](https://arxiv.org/abs/2508.08180).
|
| 51 |
+
|
| 52 |
+
It leverages a tailored version of the **DINOv2** framework, trained on a meticulously curated dataset of **1.25 million RBC images** from diverse acquisition modalities and sources. This model excels at extracting robust, general-purpose features for downstream hematology tasks such as **shape classification**, **morphological subtype recognition**, and **batch-effect–robust analysis**.
|
| 53 |
|
| 54 |
Unlike general-purpose models pretrained on natural images, RedDino incorporates hematology-specific augmentations, architectural tweaks, and RBC-tailored data preprocessing, enabling **state-of-the-art performance** on multiple RBC benchmarks.
|
| 55 |
|
| 56 |
> 🧠 Developed by [Luca Zedda](https://orcid.org/0009-0001-8488-1612), [Andrea Loddo](https://orcid.org/0000-0002-6571-3816), [Cecilia Di Ruberto](https://orcid.org/0000-0003-4641-0307), and [Carsten Marr](https://orcid.org/0000-0003-2154-4552)
|
| 57 |
> 🏥 University of Cagliari & Helmholtz Munich
|
| 58 |
+
> 📄 Preprint: [arXiv:2508.08180](https://arxiv.org/abs/2508.08180)
|
| 59 |
+
> 💻 Code: [https://github.com/Snarci/RedDino](https://github.com/Snarci/RedDino)
|
| 60 |
|
| 61 |
---
|
| 62 |
|
| 63 |
## Model Details
|
| 64 |
|
| 65 |
+
- **Architecture:** ViT-large, patch size 14
|
| 66 |
+
- **SSL framework:** DINOv2 (customized for RBC morphology)
|
| 67 |
+
- **Pretraining dataset:** Curated RBC images from 18 datasets (multiple modalities and sources)
|
| 68 |
+
- **Embedding size:** 1024
|
| 69 |
+
- **Intended use:** RBC morphology classification, feature extraction, batch-effect–robust analysis
|
| 70 |
Notes:
|
| 71 |
+
- RBC-specific training strategy including removal of KoLeo regularizer and Sinkhorn-Knopp centering.
|
| 72 |
+
- Training on smear patches (not only single cells) to enhance cross-source generalization.
|
| 73 |
+
|
| 74 |
## Example Usage
|
| 75 |
```python
|
| 76 |
from PIL import Image
|
|
|
|
| 95 |
with torch.no_grad():
|
| 96 |
embedding = model(input_tensor)
|
| 97 |
```
|
| 98 |
+
|
| 99 |
+
## Model Variants
|
| 100 |
+
|
| 101 |
+
RedDino comes in three sizes to suit different computational requirements and performance needs:
|
| 102 |
+
|
| 103 |
+
| Model Variant | Embedding Size | Parameters | Usage |
|
| 104 |
+
|---------------|----------------|------------|--------|
|
| 105 |
+
| **RedDino-small** | 384 | 22M | `timm.create_model("hf_hub:Snarcy/RedDino-small", pretrained=True)` |
|
| 106 |
+
| **RedDino-base** | 768 | 86M | `timm.create_model("hf_hub:Snarcy/RedDino-base", pretrained=True)` |
|
| 107 |
+
| **RedDino-large** | 1024 | 304M | `timm.create_model("hf_hub:Snarcy/RedDino-large", pretrained=True)` |
|
| 108 |
+
|
| 109 |
+
Choose the variant that best fits your computational budget and performance requirements. Larger models generally provide richer feature representations at the cost of increased computational overhead.
|
| 110 |
+
|
| 111 |
+
---
|
| 112 |
+
|
| 113 |
+
## Benchmark Results
|
| 114 |
+
|
| 115 |
+
RedDino was benchmarked on major RBC classification datasets—including Elsafty, Chula, and DSE—outperforming state-of-the-art baselines such as ResNet50, DinoBloom, and DINOv2.
|
| 116 |
+
|
| 117 |
+
| Model | Dataset | Metric | Linear Probing (wF1) | 1-NN (wF1) | 20-NN (wF1) |
|
| 118 |
+
|-------------------|-----------|-------------|----------------------|------------|-------------|
|
| 119 |
+
| ResNet50 | Elsafty | Weighted F1 | 77.6 ± 8.1 | 64.3 ± 4.8 | 66.2 ± 4.9 |
|
| 120 |
+
| DinoBloom-S | Elsafty | Weighted F1 | 83.2 ± 8.2 | 73.1 ± 5.1 | 76.5 ± 4.2 |
|
| 121 |
+
| DINOv2 (small) | Elsafty | Weighted F1 | 82.1 ± 8.2 | 73.5 ± 4.8 | 77.2 ± 4.6 |
|
| 122 |
+
| RedDino small | Elsafty | Weighted F1 | 86.0 ± 7.0 | 76.8 ± 4.9 | 80.0 ± 4.5 |
|
| 123 |
+
| RedDino base | Elsafty | Weighted F1 | 88.1 ± 4.9 | 78.8 ± 3.6 | 82.6 ± 2.8 |
|
| 124 |
+
| RedDino large | Elsafty | Weighted F1 | 88.5 ± 5.5 | 78.5 ± 4.6 | 81.6 ± 4.7 |
|
| 125 |
+
|
| 126 |
+
On Chula and DSE datasets, RedDino consistently surpassed all other models in feature quality (linear probing) with average improvements of 2–4% over prior approaches in key metrics.
|
| 127 |
+
|
| 128 |
+
---
|
| 129 |
+
|
| 130 |
+
## Highlights
|
| 131 |
+
|
| 132 |
+
- **Foundation model** for RBC analysis trained on the largest available multi-source RBC image set: 1.25M+ images, using advanced CellPose-based instance segmentation and patch extraction.
|
| 133 |
+
- **DINOv2-based self-supervised learning** for label-efficient pretraining and robust, transferable features.
|
| 134 |
+
- **Model architecture and key innovations**:
|
| 135 |
+
- Patch-based training (224×224 px) shown to outperform single-cell training.
|
| 136 |
+
- Novel data augmentation via Albumentations (32 pixel-level strategies).
|
| 137 |
+
- Removal of the Koleo regularizer and adoption of Sinkhorn-Knopp centering for improved representation in RBC-specific domains.
|
| 138 |
+
- Suite of models (small, base, large) covering 22M–304M parameters.
|
| 139 |
+
- **Generalization**: Strong adaptation across varied protocols, microscopes, and imaging sites. Demonstrated resistance to batch effects and out-of-domain variance.
|
| 140 |
+
- **Interpretability tools**: PCA/UMAP visualizations reveal clustering by phenotype and batch, distinguishing abnormal cells (e.g., malaria, echinocytes).
|
| 141 |
+
- **Easy deployment**: Models and code are available on [GitHub](https://github.com/Snarci/RedDino) and [Hugging Face](https://huggingface.co/collections/Snarcy/reddino-689a13e29241d2e5690202fc).
|
| 142 |
+
|
| 143 |
+
---
|
| 144 |
+
|
| 145 |
## 📝 Citation
|
| 146 |
|
| 147 |
If you use this model, please cite the following paper:
|
|
|
|
| 161 |
url={https://arxiv.org/abs/2508.08180},
|
| 162 |
}
|
| 163 |
```
|
| 164 |
+
|
| 165 |
+
---
|
| 166 |
+
|
| 167 |
+
## Summary
|
| 168 |
+
|
| 169 |
+
RedDino is the first family of foundation models tailored for comprehensive red blood cell image analysis, using large-scale self-supervised learning to set new performance benchmarks and generalization standards for computational hematology. Models and pretrained weights are available for research and practical deployment.
|