Skip to content
/ xbm Public

Code repository for "Explanation Bottleneck Models" (AAAI2025 Oral)

License

Notifications You must be signed in to change notification settings

yshinya6/xbm

Repository files navigation

XBM is an interpretable model that generates text explanations for the input embedding with respect to target tasks and then predicts final task labels from the explanations.

image

Requirements

Software Requirements

  • CUDA >= 12.3

Python Requirements

  • Please see requirements.txt or apptainer.def

Preparations

Here, we describe the preparation for the experiments on StanfordCars. You can use other datasets by modifying the preparation scripts.

Download pre-trained BLIP backbone (from the official repository)

mkdir pretrained && cd pretrained
wget https://storage.googleapis.com/sfr-vision-language-research/BLIP/models/model_base_caption_capfilt_large.pth
cd ../

Target Datset: Car

  1. Download the dataset from here including {train,test}_annos.npz
  2. Install the dataset into ./data/StanfordCars
  3. Run the preparation script as follows:
  cd ./data/StanfordCars/
  python3 ../script/split_train_test.py
  cd ../../

Example

Run Training

python3 train_exbm.py --config=configs/car_exbm.yaml

Citation

@inproceedings{yamaguchi_AAAI25_XBM,
  title={Explanation Bottleneck Models,
  author={Yamaguchi, Shin'ya and Nishida, Kosuke},
  booktitle={Proceedings of the AAAI Conference on Artificial Intelligence},
  year={2025}
}