marrlab/DinoBloom

Blood Cell Foundation Model based on DINOv2

75

stars

278

commits

Python

primary language

Jan 29, 2026

updated

README

DinoBloom: A Foundation Model for Generalizable Cell Embeddings in Hematology

Repository of DinoBloom: A Foundation Model for Generalizable Cell Embeddings in Hematology which was accepted at MICCAI 2024. It uses DINOv2 and is adapted from their original Github repository. DinoBloom is a model family (ViTs) trained on a large cohort of 13 diverse publicly available datasets of single cells in peripheral blood and bone marrow. The trained models in the can be downloaded on zenodo in the variants DinoBloom-S, DinoBloom-B, DinoBloom-L and DinoBloom-G. We show that our models outperforms existing medical and non-medical vision models in (i) linear probing and k-nearest neighbor evaluations for cell-type classification on peripheral blood and bone marrow smears and (ii) weakly supervised multiple instance learning for acute myeloid leukemia subtyping by a large margin.

Data and pipeline overview

Model farm

ModelFeature dim#paramsWeights
DinoBloom-S38422MDownload
DinoBloom-B76886MDownload
DinoBloom-L1024304MDownload
DinoBloom-G15361136MDownload

To train the model you need to specify the folder with .txt files holding the paths of the images you want to use to train in dinov2/configs/train/custom.yaml for training on a single GPU run:

python dinov2/train/train.py --config-file dinov2/configs/train/custom.yaml

for multiple GPUs on one node run

torchrun --nproc_per_node=#num_gpus dinov2/train/train.py --config-file dinov2/configs/train/custom.yaml

Sample Notebook

We provide a sample google colab notebook that shows feature extraction and how to do PCA visualization.

Citing DinoBloom

If you find this repository useful, please consider citing our work:

@inproceedings{koch2024dinobloom,
  title={DinoBloom: a foundation model for generalizable cell embeddings in hematology},
  author={Koch, Valentin and Wagner, Sophia J and Kazeminia, Salome and Sancar, Ece and Hehr, Matthias and Schnabel, Julia A and Peng, Tingying and Marr, Carsten},
  booktitle={International Conference on Medical Image Computing and Computer-Assisted Intervention},
  pages={520--530},
  year={2024},
  organization={Springer}
}

Overview of publicly available Blood Cell Datasets

DatasetModality#imagesPatient LabelsCell/Image LabelsCommentSource LinkPublication Link
BMCBone marrow171,373-21: ABE (Abnormal eosinophils), ART (Artefacts), BAS (Basophils), BLA (Blasts), EBO (Erythroblasts), EOS (Eosinophils), FGC (Faggot cells), HAC (Hairy cells), KSC (Smudge cells), LYI (Immature lymphocytes), LYT (Lymphocytes), MMZ (Metamyelocytes), MON (Monocytes), MYB (Myelocytes), NGB (Band neutrophils), NGS (Segmented neutrophils), NIF (Not identifiable), OTH (Other cells), PEB (Proerythoblasts), PLM (Plasma cells), PMO (Promyelocytes)-LinkLink
AML HehrBlood101,9494: PML::RARA, NPM1, CBFB::MYH11, RUNX1::RUNX1T1--LinkLink
AML MatekBlood18,365-15: BAS (Basophil), EBO (Erythroblast), EOS (Eosinophil), KSC (Smudge cell), LYA (Lymphocyte (atypical)), LYT (Lymphocyte (typical)), MMZ (Metamyelocyte), MOB (Monoblast), MON (Monocyte), MYB (Myelocyte), MYO (Myeloblast), NGB (Neutrophil (band)), NGS (Neutrophil (segmented)), PMB (Promyelocyte (bilobed)), PMO (Promyelocyte)-LinkLink
AcevedoBlood17,092-10: basophil, eosinophil, erythroblast, lymphocyte_typical, metamyelocyte, monocyte, myelocyte, neutrophil_band, neutrophil_segmented, promyelocyte-LinkLink
Raabin WBCBlood10,175-5: Eosinophil, Lymphocyte, Monocyte, Neutrophil, Basophil-LinkLink
NuClickBlood2,933--SegmentationLinkLink
Warty pigBlood2,871-4: Basophil, Eosinophil, Monocyte, Neutrophil667 raw images, 1464 augmented images, and 1408 cropped, classified imagesLinkLink
LISCBlood2,263-5: Basophil, Eosinophil, Monocyte, Neutrophil, LymphocytesegmentationLinkRezatofighi, S. H. & Soltanian-Zadeh, H. Automatic recognition of five types of white blood cells in peripheral blood. Comput. Med. Imaging Graph 35, 333–343 (2011).
KRD-WBCBlood601-5: Eosinophil, Lymphocyte, Monocyte, Neutrophil, BasophilSegmentationLinkTaha, Haval; Alizadeh, Fattah ; Mohammad, Nawsherwan (2023), “Creating a white blood cell dataset for segmentation”, Mendeley Data, V2, doi: 10.17632/jzdj6h7gms.2
SSL SegBlood400--SegmentationLinkZheng, X., Wang, Y., Wang, G. & Liu, J. Fast and robust segmentation of white blood cell images by self-supervised learning. Micron 107, 55–71 (2018).
BCCDBlood364-3: WBC, RBC, PlateletdetectionLinkMohamed, M., Far, B. & Guaily, A. An efficient technique for white blood cells nuclei automatic segmentation. in 2012 IEEE International Conference on Systems, Man, and Cybernetics (SMC) 220–225 (2012).
AslanBlood100-2: WBC, RBCdetectionLink-
Raabin LeukemiaBlood?4: Acute Lymphoblastic Leukemia, Acute Myeloblastic Leukemia, Chronic Lymphocytic Leukemia, Chronic Myelogenous Leukemia--Link-
APL_AMLBlood25,9152: APL / AML non APLArtifact, Band neutrophils, Basophil, Blast (no lineage spec), Eosinophils, Erythroblast, Giant thrombocyte, Lymphocyte, Lymphocyte (variant), Metamyelocyte, Monocyte, Myelocyte, Plasma cells, Prolymphocyte, Promonocyte, Promyelocyte, Segmented neutrophils, Smudge cells, Thrombocyte aggregation, Unidentified, Young Unidentified-LinkLink
White-Blood-Cell-datasetBlood376--SegmentationLinkMohamed, M.M.A., Far, B.H.: An enhanced threshold based technique for white blood cells nuclei automatic segmentation. In: Healthcom, pp. 202–207. IEEE (2012)

Contributors

ValentinKoch

148 commits

sophiajw

98 commits

patricklabatut

26 commits

qasfb

2 commits

marrlab/DinoBloom

Blood Cell Foundation Model based on DINOv2

75

stars

278

commits

Python

primary language

Jan 29, 2026

updated

README

DinoBloom: A Foundation Model for Generalizable Cell Embeddings in Hematology

Repository of DinoBloom: A Foundation Model for Generalizable Cell Embeddings in Hematology which was accepted at MICCAI 2024. It uses DINOv2 and is adapted from their original Github repository. DinoBloom is a model family (ViTs) trained on a large cohort of 13 diverse publicly available datasets of single cells in peripheral blood and bone marrow. The trained models in the can be downloaded on zenodo in the variants DinoBloom-S, DinoBloom-B, DinoBloom-L and DinoBloom-G. We show that our models outperforms existing medical and non-medical vision models in (i) linear probing and k-nearest neighbor evaluations for cell-type classification on peripheral blood and bone marrow smears and (ii) weakly supervised multiple instance learning for acute myeloid leukemia subtyping by a large margin.

Data and pipeline overview

Model farm

ModelFeature dim#paramsWeights
DinoBloom-S38422MDownload
DinoBloom-B76886MDownload
DinoBloom-L1024304MDownload
DinoBloom-G15361136MDownload

To train the model you need to specify the folder with .txt files holding the paths of the images you want to use to train in dinov2/configs/train/custom.yaml for training on a single GPU run:

python dinov2/train/train.py --config-file dinov2/configs/train/custom.yaml

for multiple GPUs on one node run

torchrun --nproc_per_node=#num_gpus dinov2/train/train.py --config-file dinov2/configs/train/custom.yaml

Sample Notebook

We provide a sample google colab notebook that shows feature extraction and how to do PCA visualization.

Citing DinoBloom

If you find this repository useful, please consider citing our work:

@inproceedings{koch2024dinobloom,
  title={DinoBloom: a foundation model for generalizable cell embeddings in hematology},
  author={Koch, Valentin and Wagner, Sophia J and Kazeminia, Salome and Sancar, Ece and Hehr, Matthias and Schnabel, Julia A and Peng, Tingying and Marr, Carsten},
  booktitle={International Conference on Medical Image Computing and Computer-Assisted Intervention},
  pages={520--530},
  year={2024},
  organization={Springer}
}

Overview of publicly available Blood Cell Datasets

DatasetModality#imagesPatient LabelsCell/Image LabelsCommentSource LinkPublication Link
BMCBone marrow171,373-21: ABE (Abnormal eosinophils), ART (Artefacts), BAS (Basophils), BLA (Blasts), EBO (Erythroblasts), EOS (Eosinophils), FGC (Faggot cells), HAC (Hairy cells), KSC (Smudge cells), LYI (Immature lymphocytes), LYT (Lymphocytes), MMZ (Metamyelocytes), MON (Monocytes), MYB (Myelocytes), NGB (Band neutrophils), NGS (Segmented neutrophils), NIF (Not identifiable), OTH (Other cells), PEB (Proerythoblasts), PLM (Plasma cells), PMO (Promyelocytes)-LinkLink
AML HehrBlood101,9494: PML::RARA, NPM1, CBFB::MYH11, RUNX1::RUNX1T1--LinkLink
AML MatekBlood18,365-15: BAS (Basophil), EBO (Erythroblast), EOS (Eosinophil), KSC (Smudge cell), LYA (Lymphocyte (atypical)), LYT (Lymphocyte (typical)), MMZ (Metamyelocyte), MOB (Monoblast), MON (Monocyte), MYB (Myelocyte), MYO (Myeloblast), NGB (Neutrophil (band)), NGS (Neutrophil (segmented)), PMB (Promyelocyte (bilobed)), PMO (Promyelocyte)-LinkLink
AcevedoBlood17,092-10: basophil, eosinophil, erythroblast, lymphocyte_typical, metamyelocyte, monocyte, myelocyte, neutrophil_band, neutrophil_segmented, promyelocyte-LinkLink
Raabin WBCBlood10,175-5: Eosinophil, Lymphocyte, Monocyte, Neutrophil, Basophil-LinkLink
NuClickBlood2,933--SegmentationLinkLink
Warty pigBlood2,871-4: Basophil, Eosinophil, Monocyte, Neutrophil667 raw images, 1464 augmented images, and 1408 cropped, classified imagesLinkLink
LISCBlood2,263-5: Basophil, Eosinophil, Monocyte, Neutrophil, LymphocytesegmentationLinkRezatofighi, S. H. & Soltanian-Zadeh, H. Automatic recognition of five types of white blood cells in peripheral blood. Comput. Med. Imaging Graph 35, 333–343 (2011).
KRD-WBCBlood601-5: Eosinophil, Lymphocyte, Monocyte, Neutrophil, BasophilSegmentationLinkTaha, Haval; Alizadeh, Fattah ; Mohammad, Nawsherwan (2023), “Creating a white blood cell dataset for segmentation”, Mendeley Data, V2, doi: 10.17632/jzdj6h7gms.2
SSL SegBlood400--SegmentationLinkZheng, X., Wang, Y., Wang, G. & Liu, J. Fast and robust segmentation of white blood cell images by self-supervised learning. Micron 107, 55–71 (2018).
BCCDBlood364-3: WBC, RBC, PlateletdetectionLinkMohamed, M., Far, B. & Guaily, A. An efficient technique for white blood cells nuclei automatic segmentation. in 2012 IEEE International Conference on Systems, Man, and Cybernetics (SMC) 220–225 (2012).
AslanBlood100-2: WBC, RBCdetectionLink-
Raabin LeukemiaBlood?4: Acute Lymphoblastic Leukemia, Acute Myeloblastic Leukemia, Chronic Lymphocytic Leukemia, Chronic Myelogenous Leukemia--Link-
APL_AMLBlood25,9152: APL / AML non APLArtifact, Band neutrophils, Basophil, Blast (no lineage spec), Eosinophils, Erythroblast, Giant thrombocyte, Lymphocyte, Lymphocyte (variant), Metamyelocyte, Monocyte, Myelocyte, Plasma cells, Prolymphocyte, Promonocyte, Promyelocyte, Segmented neutrophils, Smudge cells, Thrombocyte aggregation, Unidentified, Young Unidentified-LinkLink
White-Blood-Cell-datasetBlood376--SegmentationLinkMohamed, M.M.A., Far, B.H.: An enhanced threshold based technique for white blood cells nuclei automatic segmentation. In: Healthcom, pp. 202–207. IEEE (2012)

Contributors

ValentinKoch

148 commits

sophiajw

98 commits

patricklabatut

26 commits

qasfb

2 commits

Languages

Python

99.3%