Matteo Pennisi, Giovanni Bellitto, Simone Palazzo, Isaak Kavasidis, Mubarak Shah, Concetto Spampinato
- Install uv if you don't have it.
- Create the environment and install deps:
uv venv --python 3.9 source .venv/bin/activate uv pip install -r requirements.txt
- For
--cnn resnet50, no extra files are needed. - For
--cnn robust50, downloadrobust_resnet50.pthfrom the Salient ImageNet repo: https://github.com/singlasahil14/salient_imagenet/ and place it in the project root.
python main.py --cnn resnet50 --class_to_activate 537 --optim_steps 1000 --diff_steps 4 --device cuda:0Adjust --feature_idx to include the feature loss term, or omit it for CE-only.
If you use this repository in your research, please cite it as:
@article{PENNISI2025104559,
title = {DiffExplainer: Towards cross-modal global explanations with diffusion models},
journal = {Computer Vision and Image Understanding},
volume = {262},
pages = {104559},
year = {2025},
issn = {1077-3142},
doi = {https://doi.org/10.1016/j.cviu.2025.104559},
url = {https://www.sciencedirect.com/science/article/pii/S1077314225002826},
author = {Matteo Pennisi and Giovanni Bellitto and Simone Palazzo and Isaak Kavasidis and Mubarak Shah and Concetto Spampinato},
}