Implementation for the manuscript "Visualization Comparison of Vision Transformers and Convolutional Neural Networks".
The optimization-based visualization method can be used to understand the semantic meanings of network representations.
- It is safer to create a virtual environment before installing libraries.
- Install necessary libraries listed in requirements.txt.
- Run /s_cal_attr/*.py to compute attribution scores.
- Run /s_vis_cnn/*.py to generate CNN visualizations.
- Run /s_vis_vit/*.py to generate ViT visualizations.
- Check /utils/transform_robust.py to select indirect regularization techniques.
- Check /utils_params/random_params.py for information about frequency domain optimization
- We are very grateful to Robert Geirhos for providing us with the texture-bias dataset. If you need to use this dataset, please refer to: texture-vs-shape.
- Next, we plan to further refactor our codes to improve usability and readability, and upload the reconstructed codes to this repository.