Skip to content

ai-med/SIC

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SIC: Similarity-Based Interpretable Image Classification

Conference Paper Preprint License

This is the official implementation of SIC for interpretable image classification with neural networks.

If you use this code, please cite:

@article{wolf2025sic,
  title={SIC: Similarity-Based Interpretable Image Classification with Neural Networks},
  author={Wolf, Tom Nuno and Kavak, Emre and Bongratz, Fabian and Wachinger, Christian},
  journal={arXiv preprint arXiv:2501.17328},
  year={2025}
}

Setup Instructions

Prerequisites

Before getting started, ensure you have conda installed and initialized. If not, follow the installation instructions at:

Installation and Data Preparation

  1. Install dependencies

    bash setup/setup.sh
    
    conda activate sic

    This will install the conda environment and all required pip dependencies.

  2. Download the dataset

    Follow the instructions at Stanford Dogs to download the Images and Lists directories. Place them in any directory of your choice.

  3. Prepare the dataset

    python dogs_dataset.py --data_dir=PATH/TO/YOUR/DIR

Training

To train a model, run:

python train_sic.py --data_dir=PATH/TO/YOUR/DIR

For a complete list of available arguments and options:

python train_sic.py --help

Visualization

For exemplary visualization of prototypes and the forward pass of a test sample, run (see --help for more arguments):

python vis_sic.py --data_dir=PATH/TO/YOUR/DIR --checkpoint=PATH/TO/YOUR/.PTH

License and Acknowledgments

This project is licensed under the Apache License 2.0. See the LICENSE file for complete details.

This project includes code from multiple sources:

  • (Modified) code from the B-cos-v2 repository (Apache License 2.0)
  • (Modified) code from the Nadaraya-Watson Head repository (no license specified)

About

Minimal code of SIC: Similarity-Based Interpretable Image Classification with Neural Networks

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages