Snarcy commited on
Commit
7687627
·
verified ·
1 Parent(s): fa7c38b

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +129 -9
README.md CHANGED
@@ -1,9 +1,129 @@
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-base
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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-base
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.1
30
+ - type: Balanced Accuracy
31
+ value: 89.3
32
+ - type: Accuracy
33
+ value: 88.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: 83.8
43
+ - type: Balanced Accuracy
44
+ value: 78.6
45
+ - type: Accuracy
46
+ value: 83.8
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: 85.9
56
+ - type: Balanced Accuracy
57
+ value: 57.9
58
+ - type: Accuracy
59
+ value: 86.0
60
+ ---
61
+ # RedDino-base
62
+
63
+ **RedDino** is a self-supervised Vision Transformer foundation model specifically designed for **red blood cell (RBC)** image analysis.
64
+ 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.
65
+ 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**.
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
+ - **Architecture:** ViT-base, patch size 16 (`b16`)
78
+ - **SSL framework:** DINOv2 (customized for RBC morphology)
79
+ - **Pretraining dataset:** 1.25M RBC images from 18 datasets
80
+ - **Embedding size:** 768
81
+ - **Applications:** RBC morphology classification, feature extraction, batch-effect–robust analysis
82
+
83
+ ## Example Usage
84
+
85
+ ```python
86
+ from PIL import Image
87
+ from torchvision import transforms
88
+ import timm
89
+ import torch
90
+
91
+ # Load model from Hugging Face Hub
92
+ model = timm.create_model("hf_hub:Snarcy/RedDino-base", pretrained=True)
93
+ model.eval()
94
+ device = "cuda" if torch.cuda.is_available() else "cpu"
95
+ model.to(device)
96
+
97
+ # Load and preprocess image
98
+ image = Image.open("path/to/rbc_image.jpg").convert("RGB")
99
+ transform = transforms.Compose([
100
+ transforms.Resize((224, 224)),
101
+ transforms.ToTensor(),
102
+ transforms.Normalize(mean=[0.485, 0.456, 0.406],
103
+ std=[0.229, 0.224, 0.225]),
104
+ ])
105
+ input_tensor = transform(image).unsqueeze(0).to(device)
106
+
107
+ # Extract features
108
+ with torch.no_grad():
109
+ embedding = model(input_tensor)
110
+ ```
111
+ ## 📝 Citation
112
+
113
+ If you use this model, please cite the following paper:
114
+
115
+ **RedDino: A foundation model for red blood cell analysis**
116
+ Luca Zedda, Andrea Loddo, Cecilia Di Ruberto, Carsten Marr — 2025
117
+ Preprint: arXiv:2508.08180. https://arxiv.org/abs/2508.08180
118
+
119
+ ```bibtex
120
+ @misc{zedda2025reddinofoundationmodelred,
121
+ title={RedDino: A foundation model for red blood cell analysis},
122
+ author={Luca Zedda and Andrea Loddo and Cecilia Di Ruberto and Carsten Marr},
123
+ year={2025},
124
+ eprint={2508.08180},
125
+ archivePrefix={arXiv},
126
+ primaryClass={cs.CV},
127
+ url={https://arxiv.org/abs/2508.08180},
128
+ }
129
+ ```