Winning solution of MIDOG 2025 Task 2: parameter-efficient fine‑tuning of DINOv3‑H+ with domain‑weighted focal loss for robust atypical mitotic figure classification in histopathology.
7
stars
5
commits
Python
primary language
Aug 11, 2026
updated
This repository contains the code, including the training and inference scripts for our winning solution to MIDOG 2025 — Task 2 (Atypical vs Normal Mitotic Figure Classification).
This work was conducted in collaboration between Mines Paris – PSL and Sanofi Digital R&D.
Task description:
Our method reached 🏆 1st place on the final hidden test set.
In this work, we fine-tuned the recently published DINOv3-H+ Vision Transformer, pretrained on natural images, using Low-Rank Adaptation (LoRA), training only ~1.3M parameters in total.
You can find in the code:
Despite the strong shift between natural images and histopathology, the model transfers effectively and achieves state-of-the-art performance.
Create a conda environment using Python 3.11:
conda create --name dinov3anmf python=3.11
conda activate dinov3anmf
pip install -r requirements.txt
bash scripts/download_midog_task2.sh <DATA_DIR>
This script will download MIDOG++, Ami-BR, AtNormBr and OMG-Octo datasets in < 10 minutes. Data mostly presented here: https://midog2025.deepmicroscopy.org/datasets/
Quick launch
bash scripts/launch_training.sh
You may need to adapt data.root_dir inside the bash script (to point to your data directory)
Manual training
python run_train.py <override parameters via Hydra>
Make sure you have access to the pretrained backbones defined in:
FOUNDATION_HF_CKPT_REGISTRY in src/foundation_models.py
You can download the trained model weights from the GitHub Release.
Then open inference.ipynb. This notebook shows:
We would like to thank the MIDOG 2025 organizers — Marc Aubreville, Jingna Qiu, Sweta Banerjee, Katharina Breininger, and the MICCAI Society
If you use this repository or model in your work, please cite:
@InProceedings{balezo2026efficientfinetuningdinov3,
author="Balezo, Guillaume
and Bourgade, Rapha{\"e}l
and Feki, Hana
and Monnier, Lily
and Blons, Matthieu
and Blondel, Alice
and Decenci{\`e}re, Etienne
and Planas, Albert Pla
and Walter, Thomas",
editor="Aubreville, Marc
and Bertram, Christof A.",
title="Efficient Fine-Tuning of DINOv3 Pretrained on Natural Images for Atypical Mitotic Figure Classification",
booktitle="Mitotic Figure Detection and Atypia Classification in Whole Slide Images",
year="2026",
publisher="Springer Nature Switzerland",
address="Cham",
pages="15--25",
isbn="978-3-032-25180-0",
doi="10.1007/978-3-032-25180-0_2",
url="https://doi.org/10.1007/978-3-032-25180-0_2"
}
5 commits
Python
95.5%
Shell
4.5%
Winning solution of MIDOG 2025 Task 2: parameter-efficient fine‑tuning of DINOv3‑H+ with domain‑weighted focal loss for robust atypical mitotic figure classification in histopathology.
7
stars
5
commits
Python
primary language
Aug 11, 2026
updated
This repository contains the code, including the training and inference scripts for our winning solution to MIDOG 2025 — Task 2 (Atypical vs Normal Mitotic Figure Classification).
This work was conducted in collaboration between Mines Paris – PSL and Sanofi Digital R&D.
Task description:
Our method reached 🏆 1st place on the final hidden test set.
In this work, we fine-tuned the recently published DINOv3-H+ Vision Transformer, pretrained on natural images, using Low-Rank Adaptation (LoRA), training only ~1.3M parameters in total.
You can find in the code:
Despite the strong shift between natural images and histopathology, the model transfers effectively and achieves state-of-the-art performance.
Create a conda environment using Python 3.11:
conda create --name dinov3anmf python=3.11
conda activate dinov3anmf
pip install -r requirements.txt
bash scripts/download_midog_task2.sh <DATA_DIR>
This script will download MIDOG++, Ami-BR, AtNormBr and OMG-Octo datasets in < 10 minutes. Data mostly presented here: https://midog2025.deepmicroscopy.org/datasets/
Quick launch
bash scripts/launch_training.sh
You may need to adapt data.root_dir inside the bash script (to point to your data directory)
Manual training
python run_train.py <override parameters via Hydra>
Make sure you have access to the pretrained backbones defined in:
FOUNDATION_HF_CKPT_REGISTRY in src/foundation_models.py
You can download the trained model weights from the GitHub Release.
Then open inference.ipynb. This notebook shows:
We would like to thank the MIDOG 2025 organizers — Marc Aubreville, Jingna Qiu, Sweta Banerjee, Katharina Breininger, and the MICCAI Society
If you use this repository or model in your work, please cite:
@InProceedings{balezo2026efficientfinetuningdinov3,
author="Balezo, Guillaume
and Bourgade, Rapha{\"e}l
and Feki, Hana
and Monnier, Lily
and Blons, Matthieu
and Blondel, Alice
and Decenci{\`e}re, Etienne
and Planas, Albert Pla
and Walter, Thomas",
editor="Aubreville, Marc
and Bertram, Christof A.",
title="Efficient Fine-Tuning of DINOv3 Pretrained on Natural Images for Atypical Mitotic Figure Classification",
booktitle="Mitotic Figure Detection and Atypia Classification in Whole Slide Images",
year="2026",
publisher="Springer Nature Switzerland",
address="Cham",
pages="15--25",
isbn="978-3-032-25180-0",
doi="10.1007/978-3-032-25180-0_2",
url="https://doi.org/10.1007/978-3-032-25180-0_2"
}
5 commits
Python
95.5%
Shell
4.5%