This is the official code repository for the ICML 2025 submission "An Overview of Prototype Formulations for Interpretable Deep Learning".
This repository is built on PyTorch and PyTorch Lightning. We provide a Conda installation script for a streamlined setup.
# This script assumes CONDA is installed
bash ./install.shThis will create a new environment and install all required dependencies. If you are not using Conda, please manually install the packages listed in install.sh.
Please download the CUB-200-2011, Oxford Flowers 102, and Stanford Cars datasets. The expected directory structure is as follows:
./data/
├── CUB_200_2011/
│ ├── images/
│ ├── bounding_boxes.txt
│ ├── classes.txt
│ ├── image_class_labels.txt
│ └── train_test_split.txt
├── OxfordFlowers102/
│ └── flowers-102/
│ ├── jpg/
│ ├── imagelabels.mat
│ └── setid.mat
└── stanford_cars/
├── cars_test/
├── cars_train/
└── cars_test_annos_withlabels.mat
Use the scripts provided in the ./utils directory to generate bounding box crops and offline augmentations, similar to the ProtoPNet setup.
Experiments are configured using ml-collections. To run an experiment, use the following command:
python main.py --config configs/<CONFIG_FILE>.pyYou can override configuration parameters directly from the command line. For more examples, see multi_run.sh.
# Example: Change prototype module, number of epochs, and seed
python main.py --config configs/ppn_resnet50_birds.py \
--config.model.pm_name=hyperpg \
--config.training.num_epochs=30 \
--config.seed=1337We aimed for a modular and extensible implementation.
- Prototype Formulations: Implemented in
prob_proto.models.prototype_modules. - Training Logic: Handled by PyTorch Lightning in
prob_proto.pl_training.
If you find this work useful in your research, please consider citing our paper.
Li, M. X., et al. (2025). An Overview of Prototype Formulations for Interpretable Deep Learning. arXiv preprint arXiv:2410.08925.
Bibtex
@misc{li2025overviewprototypeformulationsinterpretable,
title={An Overview of Prototype Formulations for Interpretable Deep Learning},
author={Maximilian Xiling Li and Korbinian Franz Rudolf and Nils Blank and Rudolf Lioutikov},
year={2025},
eprint={2410.08925},
archivePrefix={arXiv},
primaryClass={cs.LG},
url={https://arxiv.org/abs/2410.08925},
}