File size: 2,042 Bytes
09959a5
 
 
d49cfee
 
09959a5
 
 
d49cfee
09959a5
d49cfee
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
---
tags:
- timm
- feature-extraction
- image-classification
library_name: timm
license: apache-2.0
---

# Model card for vit_giant_patch14_224.dinobloom

![](https://github.com/marrlab/DinoBloom/blob/9ea2f950e1f016cd7f899b3ed025d12b6a355d9f/media/overview.png?raw=true)

## Model Details

- **Model Type:** Feature backbone
- **Model Stats:**
    - Params: 1136M (giant)
  - Image size: 224 x 224 x 3
  - Patch size: 14 x 14 x 3
- **Repository:** [github.com:marrlab/DinoBloom](https://github.com/marrlab/DinoBloom)
- **Original Weights:** [Zenodo](https://zenodo.org/records/10908163)
- **License:** [Apache License 2.0](https://github.com/marrlab/DinoBloom/blob/main/LICENSE)
- **Papers:**
  - [DinoBloom: A Foundation Model for Generalizable Cell Embeddings in Hematology](https://arxiv.org/abs/2404.05022)

## Model Usage

### Image Embeddings

```python
from urllib.request import urlopen
from PIL import Image
import timm

# get example histology image
img = Image.open(
  urlopen(
    "https://raw.githubusercontent.com/zxaoyou/segmentation_WBC/master/Dataset%201/001.bmp"
  )
)

# load model from the hub
model = timm.create_model(
  model_name="hf-hub:1aurent/vit_giant_patch14_224.dinobloom",
  pretrained=True,
).eval()

# get model specific transforms (normalization, resize)
data_config = timm.data.resolve_model_data_config(model)
transforms = timm.data.create_transform(**data_config, is_training=False)

data = transforms(img).unsqueeze(0) # input is a (batch_size, num_channels, img_size, img_size) shaped tensor
output = model(data)  # output is a (batch_size, num_features) shaped tensor
```


## Citation

```bibtex
@misc{koch2024dinobloom,
  title         = {DinoBloom: A Foundation Model for Generalizable Cell Embeddings in Hematology}, 
  author        = {Valentin Koch and Sophia J. Wagner and Salome Kazeminia and Ece Sancar and Matthias Hehr and Julia Schnabel and Tingying Peng and Carsten Marr},
  year          = {2024},
  eprint        = {2404.05022},
  archivePrefix = {arXiv},
  primaryClass  = {cs.CV}
}
```