Snarcy commited on
Commit
9adf01f
·
verified ·
1 Parent(s): d12c5a7

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +134 -9
README.md CHANGED
@@ -1,9 +1,134 @@
1
- ---
2
- tags:
3
- - image-classification
4
- - timm
5
- - transformers
6
- library_name: timm
7
- license: apache-2.0
8
- ---
9
- # Model card for RedDino-small
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ - Elsafty
15
+ - Chula
16
+ - DSE
17
+ pipeline_tag: feature-extraction
18
+ model-index:
19
+ - name: RedDino-small
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: 86.0
30
+ - type: Balanced Accuracy
31
+ value: 87.2
32
+ - type: Accuracy
33
+ value: 86.2
34
+ - task:
35
+ type: image-classification
36
+ name: RBC Shape Classification
37
+ dataset:
38
+ name: Chula
39
+ type: Classification
40
+ metrics:
41
+ - type: Weighted F1
42
+ value: 84.3
43
+ - type: Balanced Accuracy
44
+ value: 78.5
45
+ - type: Accuracy
46
+ value: 84.4
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: 84.9
56
+ - type: Balanced Accuracy
57
+ value: 56.5
58
+ - type: Accuracy
59
+ value: 84.9
60
+ ---
61
+
62
+ # RedDino-small
63
+
64
+ **RedDino** is a self-supervised Vision Transformer foundation model specifically designed for **red blood cell (RBC)** image analysis.
65
+ This variant is the compact model in the family, delivering strong performance with lighter computational cost.
66
+
67
+ It leverages a tailored version of the **DINOv2** framework, trained on a meticulously curated dataset of RBC images from diverse acquisition modalities and sources.
68
+ The model excels at extracting robust features for downstream hematology tasks such as **shape classification**, **morphological subtype recognition**, and **batch-effect–robust analysis**.
69
+
70
+ > 🧠 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)
71
+ > 🏥 University of Cagliari & Helmholtz Munich
72
+ > 📄 Preprint: [arXiv:2508.08180](https://arxiv.org/abs/2508.08180)
73
+
74
+ ---
75
+
76
+ ## Model Details
77
+
78
+ - **Architecture:** ViT-small, patch size 16 (`s16`)
79
+ - **SSL framework:** DINOv2 (customized for RBC morphology)
80
+ - **Pretraining dataset:** Curated RBC images from 18 datasets (multiple modalities and sources)
81
+ - **Embedding size:** 384
82
+ - **Intended use:** RBC morphology classification, feature extraction, batch-effect–robust analysis
83
+
84
+ Notes:
85
+ - Trained with RBC-specific augmentations and DINOv2 customizations (e.g., removal of KoLeo regularizer; Sinkhorn-Knopp centering).
86
+ - Optimized using smear patches rather than only single-cell crops to improve generalization across sources.
87
+
88
+ ## Example Usage
89
+
90
+ ```python
91
+ from PIL import Image
92
+ from torchvision import transforms
93
+ import timm
94
+ import torch
95
+
96
+ # Load model from Hugging Face Hub
97
+ model = timm.create_model("hf_hub:Snarcy/RedDino-small", pretrained=True)
98
+ model.eval()
99
+ device = "cuda" if torch.cuda.is_available() else "cpu"
100
+ model.to(device)
101
+
102
+ # Load and preprocess image
103
+ image = Image.open("path/to/rbc_image.jpg").convert("RGB")
104
+ transform = transforms.Compose([
105
+ transforms.Resize((224, 224)),
106
+ transforms.ToTensor(),
107
+ transforms.Normalize(mean=[0.485, 0.456, 0.406],
108
+ std=[0.229, 0.224, 0.225]),
109
+ ])
110
+ input_tensor = transform(image).unsqueeze(0).to(device)
111
+
112
+ # Extract features
113
+ with torch.no_grad():
114
+ embedding = model(input_tensor)
115
+ ```
116
+ ## 📝 Citation
117
+
118
+ If you use this model, please cite the following paper:
119
+
120
+ **RedDino: A foundation model for red blood cell analysis**
121
+ Luca Zedda, Andrea Loddo, Cecilia Di Ruberto, Carsten Marr — 2025
122
+ Preprint: arXiv:2508.08180. https://arxiv.org/abs/2508.08180
123
+
124
+ ```bibtex
125
+ @misc{zedda2025reddinofoundationmodelred,
126
+ title={RedDino: A foundation model for red blood cell analysis},
127
+ author={Luca Zedda and Andrea Loddo and Cecilia Di Ruberto and Carsten Marr},
128
+ year={2025},
129
+ eprint={2508.08180},
130
+ archivePrefix={arXiv},
131
+ primaryClass={cs.CV},
132
+ url={https://arxiv.org/abs/2508.08180},
133
+ }
134
+ ```