Preprint | Hugging Face | User Guide | Licenses | Cite
PathoROB is a benchmark for the robustness of pathology foundation models (FMs) to non-biological medical center differences.

PathoROB contains four datasets covering 28 biological classes from 34 medical centers and three metrics:

| Rank | Foundation Model | TCGA 2x2 | Camelyon | Tolkach ESCA | Average (↓) |
|---|---|---|---|---|---|
| 1 | Atlas 2 [1] | 0.879 | 0.940 | 0.964 | 0.928 |
| 2 | GenBio-PathFM [2] | 0.838 | 0.865 | 0.960 | 0.888 |
| 3 | Virchow2 | 0.822 | 0.806 | 0.955 | 0.861 |
| 4 | CONCHv1.5 | 0.832 | 0.774 | 0.951 | 0.852 |
| 5 | Atlas | 0.826 | 0.785 | 0.938 | 0.850 |
| 6 | Virchow | 0.761 | 0.751 | 0.932 | 0.815 |
| 7 | H0-mini | 0.794 | 0.718 | 0.932 | 0.815 |
| 8 | H-optimus-1 [2] | 0.853 | 0.645 | 0.944 | 0.814 |
| 9 | Conch | 0.824 | 0.662 | 0.951 | 0.812 |
| 10 | H-optimus-0 | 0.812 | 0.705 | 0.918 | 0.812 |
| 11 | UNI2-h | 0.803 | 0.544 | 0.923 | 0.757 |
| 12 | MUSK | 0.727 | 0.467 | 0.928 | 0.707 |
| 13 | HIPT | 0.614 | 0.649 | 0.726 | 0.663 |
| 14 | Prov-GigaPath | 0.738 | 0.399 | 0.754 | 0.630 |
| 15 | Kaiko ViT-B/8 | 0.763 | 0.147 | 0.896 | 0.602 |
| 16 | UNI | 0.747 | 0.145 | 0.902 | 0.598 |
| 17 | RETCCL | 0.593 | 0.318 | 0.878 | 0.596 |
| 18 | CTransPath | 0.652 | 0.106 | 0.872 | 0.543 |
| 19 | Kang-DINO | 0.661 | 0.043 | 0.832 | 0.512 |
| 20 | RudolfV | 0.587 | 0.184 | 0.695 | 0.489 |
| 21 | Phikon | 0.623 | 0.011 | 0.795 | 0.476 |
| 22 | Phikon-v2 | 0.619 | 0.019 | 0.768 | 0.469 |
| 23 | Ciga | 0.511 | 0.135 | 0.693 | 0.446 |
Results for models with superscripts [N] were taken from the linked external publications. Note that they were not validated by the authors of this repository. All other results were computed as part of our benchmarking study. For details as well as for the APD and clustering score results, please check our preprint.
[!Note] If you want your model to be added, please contact us.
git clone https://github.com/bifold-pathomics/PathoROB.git
cd PathoROB
conda create -n "pathorob" python=3.10 -y
conda activate pathorob
pip install -e .
[!Note] To ensure that the conda environment does not contain any user-specific site packages (e.g., from
~/.local/lib), runexport PYTHONNOUSERSITE=1after activating your environment.
python3 -m pathorob.features.extract_features --model uni2h_clsmean --model_args '{"hf_token": "<TOKEN>"}'
For feature extraction, ~100K images (~2GB) will be downloaded from Hugging Face.
data/features/uni2h_clsmeancamelyon, tcga, tolkach_esca). To select any subset of these, use --datasets <dataset1> ....pathorob/features/extract_features.pypython3 -m pathorob.robustness_index.robustness_index --model uni2h_clsmean
results/robustness_index (see example results here)
{model}/{dataset}/{max_patches_per_combi}_{k_opt_param}/results_summary.json:
{model}/{dataset}/{max_patches_per_combi}_{k_opt_param}/fig:
--plot_graphs flag is set.{model}/{dataset}/{max_patches_per_combi}_{k_opt_param}/balanced-accuracies-bio.json:
{model}/{dataset}/{max_patches_per_combi}_{k_opt_param}/frequency-same-class.pkl:
pathorob/robustness_index/robustness_index.py
k values per dataset as determined in our preprint.After computing the robustness index for multiple models, you can create further visualizations to compare them:
python3 -m pathorob.robustness_index.robustness_index --mode compare
results/robustness_index/figpython3 -m pathorob.apd.apd --model uni2h_clsmean
results/apd (see example results here)
{model}/{dataset}_summary.json:
{model}/aggregated_summary.json:
{model}/{dataset}_raw.json:
pathorob/apd/apd.pypython3 -m pathorob.clustering_score.clustering_score --model uni2h_clsmean
results/clustering_score (see example results here)
{model}/{dataset}/results_summary.json:
{model}/{dataset}/aris.csv:
{model}/{dataset}/silhouette_scores.csv:
pathorob/clustering_score/clustering_score.pypathorob.models.ModelWrapper from pathorob.models.utils.pathorob.models.uni or pathorob.models.phikon.load_model function in pathorob.models.__init__ and choose a model_name.model_name.
python3 -m pathorob.features.extract_features --model <model_name>from pathorob.models.utils import ModelWrapper
class MyModelWrapper(ModelWrapper):
def __init__(self, ...):
"""
Optional: Define custom arguments that can be passed to the model in the
extract_features entrypoint via `--model_args` as a dictionary.
"""
def get_model(self):
"""
:return: A model object (e.g., `torch.nn.Module`) that has an `eval()` and a
`to(device)` method.
"""
def get_preprocess(self):
"""
Preprocessing to apply to raw PIL images before passing the data to the model.
:return: A function or an executable object (e.g., `torchvision.transforms.Compose`)
that accepts a `PIL.Image` as input and returns what the `extract` function
needs for feature extraction. Note that the result will be batched by the
default `collate_fn` of a torch DataLoader (`torch.utils.data.DataLoader`).
"""
def extract(self, data) -> torch.Tensor:
"""
Feature extraction step for preprocessed and batched image data.
:param data: (batch_size, ...) A batch of preprocessed image data. The images were
preprocessed individually via `get_preprocess()` and batched via the default
`collate_fn` of a torch DataLoader (`torch.utils.data.DataLoader`).
:return: (batch_size, feature_dim) A torch Tensor containing the extracted features.
"""
The PathoROB datasets were subsampled from public sources. Therefore, we redistribute each PathoROB dataset under the license of its original data source. You can run PathoROB on any subset of datasets with licenses suitable for your application.
We want to thank the authors of the original datasets for making their data publicly available.
If you have questions or feedback, please contact:
If you find PathoROB useful, please cite our preprint:
@article{koemen2025pathorob,
title={Towards Robust Foundation Models for Digital Pathology},
author={K{\"o}men, Jonah and de Jong, Edwin D and Hense, Julius and Marienwald, Hannah and Dippel, Jonas and Naumann, Philip and Marcus, Eric and Ruff, Lukas and Alber, Maximilian and Teuwen, Jonas and others},
journal={arXiv preprint arXiv:2507.17845},
year={2025}
}
Please also cite the source publications of all PathoROB datasets that you use:
@article{bejnordi2017camelyon16,
title={Diagnostic Assessment of Deep Learning Algorithms for Detection of Lymph Node Metastases in Women With Breast Cancer},
author={Ehteshami Bejnordi, Babak and Veta, Mitko and Johannes van Diest, Paul and van Ginneken, Bram and Karssemeijer, Nico and Litjens, Geert and van der Laak, Jeroen A. W. M. and and the CAMELYON16 Consortium},
journal={JAMA},
year={2017},
volume={318},
number={22},
pages={2199-2210},
doi={10.1001/jama.2017.14585}
}
@article{bandi19camelyon17,
title={From Detection of Individual Metastases to Classification of Lymph Node Status at the Patient Level: The CAMELYON17 Challenge},
author={Bándi, Péter and Geessink, Oscar and Manson, Quirine and Van Dijk, Marcory and Balkenhol, Maschenka and Hermsen, Meyke and Ehteshami Bejnordi, Babak and Lee, Byungjae and Paeng, Kyunghyun and Zhong, Aoxiao and Li, Quanzheng and Zanjani, Farhad Ghazvinian and Zinger, Svitlana and Fukuta, Keisuke and Komura, Daisuke and Ovtcharov, Vlado and Cheng, Shenghua and Zeng, Shaoqun and Thagaard, Jeppe and Dahl, Anders B. and Lin, Huangjing and Chen, Hao and Jacobsson, Ludwig and Hedlund, Martin and Çetin, Melih and Halıcı, Eren and Jackson, Hunter and Chen, Richard and Both, Fabian and Franke, Jörg and Küsters-Vandevelde, Heidi and Vreuls, Willem and Bult, Peter and van Ginneken, Bram and van der Laak, Jeroen and Litjens, Geert},
journal={IEEE Transactions on Medical Imaging},
year={2019},
volume={38},
number={2},
pages={550-560},
doi={10.1109/TMI.2018.2867350}
}
@article{komura22tcga-ut,
title={Universal encoding of pan-cancer histology by deep texture representations},
author={Daisuke Komura and Akihiro Kawabe and Keisuke Fukuta and Kyohei Sano and Toshikazu Umezaki and Hirotomo Koda and Ryohei Suzuki and Ken Tominaga and Mieko Ochi and Hiroki Konishi and Fumiya Masakado and Noriyuki Saito and Yasuyoshi Sato and Takumi Onoyama and Shu Nishida and Genta Furuya and Hiroto Katoh and Hiroharu Yamashita and Kazuhiro Kakimi and Yasuyuki Seto and Tetsuo Ushiku and Masashi Fukayama and Shumpei Ishikawa},
journal={Cell Reports},
year={2022},
volume={38},
number={9},
pages={110424},
doi={https://doi.org/10.1016/j.celrep.2022.110424}
}
@article{tolkach2023esca,
title={Artificial intelligence for tumour tissue detection and histological regression grading in oesophageal adenocarcinomas: a retrospective algorithm development and validation study},
author={Tolkach, Yuri and Wolgast, Lisa Marie and Damanakis, Alexander and Pryalukhin, Alexey and Schallenberg, Simon and Hulla, Wolfgang and Eich, Marie-Lisa and Schroeder, Wolfgang and Mukhopadhyay, Anirban and Fuchs, Moritz and others},
journal={The Lancet Digital Health},
year={2023},
volume={5},
number={5},
pages={e265--e275},
publisher={Elsevier}
}
Python
65.9%
Jupyter Notebook
34.1%
Preprint | Hugging Face | User Guide | Licenses | Cite
PathoROB is a benchmark for the robustness of pathology foundation models (FMs) to non-biological medical center differences.

PathoROB contains four datasets covering 28 biological classes from 34 medical centers and three metrics:

| Rank | Foundation Model | TCGA 2x2 | Camelyon | Tolkach ESCA | Average (↓) |
|---|---|---|---|---|---|
| 1 | Atlas 2 [1] | 0.879 | 0.940 | 0.964 | 0.928 |
| 2 | GenBio-PathFM [2] | 0.838 | 0.865 | 0.960 | 0.888 |
| 3 | Virchow2 | 0.822 | 0.806 | 0.955 | 0.861 |
| 4 | CONCHv1.5 | 0.832 | 0.774 | 0.951 | 0.852 |
| 5 | Atlas | 0.826 | 0.785 | 0.938 | 0.850 |
| 6 | Virchow | 0.761 | 0.751 | 0.932 | 0.815 |
| 7 | H0-mini | 0.794 | 0.718 | 0.932 | 0.815 |
| 8 | H-optimus-1 [2] | 0.853 | 0.645 | 0.944 | 0.814 |
| 9 | Conch | 0.824 | 0.662 | 0.951 | 0.812 |
| 10 | H-optimus-0 | 0.812 | 0.705 | 0.918 | 0.812 |
| 11 | UNI2-h | 0.803 | 0.544 | 0.923 | 0.757 |
| 12 | MUSK | 0.727 | 0.467 | 0.928 | 0.707 |
| 13 | HIPT | 0.614 | 0.649 | 0.726 | 0.663 |
| 14 | Prov-GigaPath | 0.738 | 0.399 | 0.754 | 0.630 |
| 15 | Kaiko ViT-B/8 | 0.763 | 0.147 | 0.896 | 0.602 |
| 16 | UNI | 0.747 | 0.145 | 0.902 | 0.598 |
| 17 | RETCCL | 0.593 | 0.318 | 0.878 | 0.596 |
| 18 | CTransPath | 0.652 | 0.106 | 0.872 | 0.543 |
| 19 | Kang-DINO | 0.661 | 0.043 | 0.832 | 0.512 |
| 20 | RudolfV | 0.587 | 0.184 | 0.695 | 0.489 |
| 21 | Phikon | 0.623 | 0.011 | 0.795 | 0.476 |
| 22 | Phikon-v2 | 0.619 | 0.019 | 0.768 | 0.469 |
| 23 | Ciga | 0.511 | 0.135 | 0.693 | 0.446 |
Results for models with superscripts [N] were taken from the linked external publications. Note that they were not validated by the authors of this repository. All other results were computed as part of our benchmarking study. For details as well as for the APD and clustering score results, please check our preprint.
[!Note] If you want your model to be added, please contact us.
git clone https://github.com/bifold-pathomics/PathoROB.git
cd PathoROB
conda create -n "pathorob" python=3.10 -y
conda activate pathorob
pip install -e .
[!Note] To ensure that the conda environment does not contain any user-specific site packages (e.g., from
~/.local/lib), runexport PYTHONNOUSERSITE=1after activating your environment.
python3 -m pathorob.features.extract_features --model uni2h_clsmean --model_args '{"hf_token": "<TOKEN>"}'
For feature extraction, ~100K images (~2GB) will be downloaded from Hugging Face.
data/features/uni2h_clsmeancamelyon, tcga, tolkach_esca). To select any subset of these, use --datasets <dataset1> ....pathorob/features/extract_features.pypython3 -m pathorob.robustness_index.robustness_index --model uni2h_clsmean
results/robustness_index (see example results here)
{model}/{dataset}/{max_patches_per_combi}_{k_opt_param}/results_summary.json:
{model}/{dataset}/{max_patches_per_combi}_{k_opt_param}/fig:
--plot_graphs flag is set.{model}/{dataset}/{max_patches_per_combi}_{k_opt_param}/balanced-accuracies-bio.json:
{model}/{dataset}/{max_patches_per_combi}_{k_opt_param}/frequency-same-class.pkl:
pathorob/robustness_index/robustness_index.py
k values per dataset as determined in our preprint.After computing the robustness index for multiple models, you can create further visualizations to compare them:
python3 -m pathorob.robustness_index.robustness_index --mode compare
results/robustness_index/figpython3 -m pathorob.apd.apd --model uni2h_clsmean
results/apd (see example results here)
{model}/{dataset}_summary.json:
{model}/aggregated_summary.json:
{model}/{dataset}_raw.json:
pathorob/apd/apd.pypython3 -m pathorob.clustering_score.clustering_score --model uni2h_clsmean
results/clustering_score (see example results here)
{model}/{dataset}/results_summary.json:
{model}/{dataset}/aris.csv:
{model}/{dataset}/silhouette_scores.csv:
pathorob/clustering_score/clustering_score.pypathorob.models.ModelWrapper from pathorob.models.utils.pathorob.models.uni or pathorob.models.phikon.load_model function in pathorob.models.__init__ and choose a model_name.model_name.
python3 -m pathorob.features.extract_features --model <model_name>from pathorob.models.utils import ModelWrapper
class MyModelWrapper(ModelWrapper):
def __init__(self, ...):
"""
Optional: Define custom arguments that can be passed to the model in the
extract_features entrypoint via `--model_args` as a dictionary.
"""
def get_model(self):
"""
:return: A model object (e.g., `torch.nn.Module`) that has an `eval()` and a
`to(device)` method.
"""
def get_preprocess(self):
"""
Preprocessing to apply to raw PIL images before passing the data to the model.
:return: A function or an executable object (e.g., `torchvision.transforms.Compose`)
that accepts a `PIL.Image` as input and returns what the `extract` function
needs for feature extraction. Note that the result will be batched by the
default `collate_fn` of a torch DataLoader (`torch.utils.data.DataLoader`).
"""
def extract(self, data) -> torch.Tensor:
"""
Feature extraction step for preprocessed and batched image data.
:param data: (batch_size, ...) A batch of preprocessed image data. The images were
preprocessed individually via `get_preprocess()` and batched via the default
`collate_fn` of a torch DataLoader (`torch.utils.data.DataLoader`).
:return: (batch_size, feature_dim) A torch Tensor containing the extracted features.
"""
The PathoROB datasets were subsampled from public sources. Therefore, we redistribute each PathoROB dataset under the license of its original data source. You can run PathoROB on any subset of datasets with licenses suitable for your application.
We want to thank the authors of the original datasets for making their data publicly available.
If you have questions or feedback, please contact:
If you find PathoROB useful, please cite our preprint:
@article{koemen2025pathorob,
title={Towards Robust Foundation Models for Digital Pathology},
author={K{\"o}men, Jonah and de Jong, Edwin D and Hense, Julius and Marienwald, Hannah and Dippel, Jonas and Naumann, Philip and Marcus, Eric and Ruff, Lukas and Alber, Maximilian and Teuwen, Jonas and others},
journal={arXiv preprint arXiv:2507.17845},
year={2025}
}
Please also cite the source publications of all PathoROB datasets that you use:
@article{bejnordi2017camelyon16,
title={Diagnostic Assessment of Deep Learning Algorithms for Detection of Lymph Node Metastases in Women With Breast Cancer},
author={Ehteshami Bejnordi, Babak and Veta, Mitko and Johannes van Diest, Paul and van Ginneken, Bram and Karssemeijer, Nico and Litjens, Geert and van der Laak, Jeroen A. W. M. and and the CAMELYON16 Consortium},
journal={JAMA},
year={2017},
volume={318},
number={22},
pages={2199-2210},
doi={10.1001/jama.2017.14585}
}
@article{bandi19camelyon17,
title={From Detection of Individual Metastases to Classification of Lymph Node Status at the Patient Level: The CAMELYON17 Challenge},
author={Bándi, Péter and Geessink, Oscar and Manson, Quirine and Van Dijk, Marcory and Balkenhol, Maschenka and Hermsen, Meyke and Ehteshami Bejnordi, Babak and Lee, Byungjae and Paeng, Kyunghyun and Zhong, Aoxiao and Li, Quanzheng and Zanjani, Farhad Ghazvinian and Zinger, Svitlana and Fukuta, Keisuke and Komura, Daisuke and Ovtcharov, Vlado and Cheng, Shenghua and Zeng, Shaoqun and Thagaard, Jeppe and Dahl, Anders B. and Lin, Huangjing and Chen, Hao and Jacobsson, Ludwig and Hedlund, Martin and Çetin, Melih and Halıcı, Eren and Jackson, Hunter and Chen, Richard and Both, Fabian and Franke, Jörg and Küsters-Vandevelde, Heidi and Vreuls, Willem and Bult, Peter and van Ginneken, Bram and van der Laak, Jeroen and Litjens, Geert},
journal={IEEE Transactions on Medical Imaging},
year={2019},
volume={38},
number={2},
pages={550-560},
doi={10.1109/TMI.2018.2867350}
}
@article{komura22tcga-ut,
title={Universal encoding of pan-cancer histology by deep texture representations},
author={Daisuke Komura and Akihiro Kawabe and Keisuke Fukuta and Kyohei Sano and Toshikazu Umezaki and Hirotomo Koda and Ryohei Suzuki and Ken Tominaga and Mieko Ochi and Hiroki Konishi and Fumiya Masakado and Noriyuki Saito and Yasuyoshi Sato and Takumi Onoyama and Shu Nishida and Genta Furuya and Hiroto Katoh and Hiroharu Yamashita and Kazuhiro Kakimi and Yasuyuki Seto and Tetsuo Ushiku and Masashi Fukayama and Shumpei Ishikawa},
journal={Cell Reports},
year={2022},
volume={38},
number={9},
pages={110424},
doi={https://doi.org/10.1016/j.celrep.2022.110424}
}
@article{tolkach2023esca,
title={Artificial intelligence for tumour tissue detection and histological regression grading in oesophageal adenocarcinomas: a retrospective algorithm development and validation study},
author={Tolkach, Yuri and Wolgast, Lisa Marie and Damanakis, Alexander and Pryalukhin, Alexey and Schallenberg, Simon and Hulla, Wolfgang and Eich, Marie-Lisa and Schroeder, Wolfgang and Mukhopadhyay, Anirban and Fuchs, Moritz and others},
journal={The Lancet Digital Health},
year={2023},
volume={5},
number={5},
pages={e265--e275},
publisher={Elsevier}
}
Python
65.9%
Jupyter Notebook
34.1%