Skip to content

VishmiVishara/SC-IBA

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Self-Configurable Information Bottleneck Attribution (SC-IBA)

Accepted at XAIE4: 4th Workshop on Explainable and Ethical AI — ICPR 2026 Workshop on Explainability, endorsed by IAPR.

This repository contains the implementation of Self-Configurable IBA.

Overview

Model_Architecture

SC-IBA is a self-configurable version of IBA that selects the bottleneck layer per sample instead of using one fixed layer for every input. For each image, it evaluates candidate layers and chooses the layer that best fits the current sample before running the information bottleneck optimization. This makes the attribution more adaptive to the input and the model's internal activations.

In practice, the method keeps the core IBA objective but replaces manual layer selection with an automatic strategy. The selected layer is then used to generate the attribution map and compare it against fixed-layer IBA and other baselines.

The codebase also includes a tuned baseline that uses random search over candidate layers and beta settings to identify a strong fixed configuration for comparison, and the proposed method is compared against fixed-layer IBA and other benchmark attribution methods such as EigenCAM, GradCAM, Guided Backpropagation, Guided GradCAM, and Saliency.

Datasets

Three datasets are used for evaluation: the J. Cheng (Brain Tumor) dataset, MSSEG16 (Multiple Sclerosis) dataset, and ImageNet.

Models And Weights

Three models have also been adapted in this project. SEA-ResNet50 is used for the Cheng Brain Tumor dataset, MedicalInceptionv3 is used for the MSSEG2016 dataset, and DenseNet121 is used for ImageNet with pretrained weights. The pretrained weights for SEA-ResNet50 and MedicalInceptionv3 can be downloaded from here. These weights were used in attribution-based experiments.

Dataset Preparation

Cheng Dataset

Step 1: Download the Cheng brain tumour dataset.

Step 2: Split the data into train, val and test set. Use the provided split indices in the directory data/cheng/split_indices/ for reproducibility of the split.

MSSEG16 Dataset

Step 1: Download the dataset and extract it into train and test data inside data/msseg/original_data

Step 2: Run utils/prepare_msseg_data.py (To reproduce the results, use the existing data/msseg/final_dataset_split.json rather than the one generated by the code)

Step 3: Using the JSON file, create bounding box annotation XML files by running utils/create_bbox_annotation_msseg.py

ImageNet Dataset

Step 1: Download the dataset which includes the train, val set and bounding boxes.

Step 2: Run the following script to reorganise the validation directory into per-class sub-directories:

bash <(curl -s https://raw.githubusercontent.com/soumith/imagenetloader.torch/master/valprep.sh)

Environment

Our repository is constructed based on Python 3.12.7.

Install the libraries as follows:

pip install -r requirements.txt

Running Experiments

Step 1: Training the classification model

After training, update the model_weight_checkpoint path in your dataset config file. Replace --env_name with your conda environment name.

Cheng:

bash run_model_training.sh --dataset "cheng" --custom_code_dir "$(pwd)" --env_name "sciba_env" --run_model_training "true"

MS Lesion:

bash run_model_training.sh --dataset "ms_lesion" --custom_code_dir "$(pwd)" --env_name "sciba_env" --run_model_training "true"

Step 2: Generate attribution maps for each image

Cheng:

bash run_all_experiments_once.sh --dataset "cheng" --custom_code_dir "$(pwd)" --env_name "sciba_env" --run_model_training "false"

MS Lesion:

bash run_all_experiments_once.sh --dataset "ms_lesion" --custom_code_dir "$(pwd)" --env_name "sciba_env" --run_model_training "false"

ImageNet:

bash run_all_experiments_once.sh --dataset "imagenet" --custom_code_dir "$(pwd)" --env_name "sciba_env" --run_model_training "false"

Step 3: Visualize the results

Cheng:

bash run_visualization.sh --dataset "cheng" --custom_code_dir "$(pwd)" --env_name sciba_env

MS Lesion:

bash run_visualization.sh --dataset "msseg16" --custom_code_dir "$(pwd)" --env_name sciba_env

ImageNet:

bash run_visualization.sh --dataset "imagenet" --custom_code_dir "$(pwd)" --env_name sciba_env

Aggregate figures across all datasets

Once per-dataset results exist, build the combined paper figures. These run independently of --dataset:

Trade-off analysis (faithfulness vs. localization):

bash run_visualization.sh --run_plot_datasets "true" --custom_code_dir "$(pwd)" --env_name sciba_env

Qualitative comparison block:

bash run_visualization.sh --run_qualitative_block "true" --custom_code_dir "$(pwd)" --env_name sciba_env

Note: Both aggregate scripts read result paths that point to specific experiment runs, so update them to match your own outputs before running:

  • plot_datasets.py reads the per-method summary CSVs (all_experiments_summary.csv and mean_and_std_summary.csv) produced in Step 2. The list of run directories is defined at the top of its main() — update it to your run timestamps. --code-dir sets the repository root used to build those paths.
  • make_qualitative_block.py reads the per-dataset grid images (*_grid_vis.png) from visualization/qualitative_figure/. Use --imagenet-img, --msseg-img, --cheng-img, and --output to point to your own files.

Qualitative Results

Attribution maps are compared across all three datasets (ImageNet, MSSEG16, Cheng) for SC-IBA and competing methods. The top row (a–e) shows IBA variants — Middle Layer, ResNet-50 Ratio, InceptionV3 Ratio, Tuned Baseline, and SC-IBA (Ours) — while the bottom row (f–j) shows gradient-based baselines: EigenCAM, GradCAM, Guided Backpropagation, Guided GradCAM, and Saliency. SC-IBA produces tighter, more focused attribution maps that better align with the ground-truth regions of interest, avoiding the diffuse or background-heavy activations seen in several baselines.

qualitative_result

Trade-off Analysis

trade_off_analysis

Faithfulness vs. Localization Trade-off: Comparison of SC-IBA against baselines across three datasets. The x-axis shows faithfulness (Degradation 8x8 integral) and the y-axis shows localization (Ratio Top in BBox). Bubble sizes represent Dice scores for the medical datasets (b, c), while ImageNet (a) uses uniform markers.

Acknowledgements

This work was funded by Taighde Éireann – Research Ireland under Grant number 18/CRT/6183 (Ganepola, Adegboro) and partially supported by the Insight Research Ireland Centre for Data Analytics.

Credits

This implementation builds on the original Information Bottleneck Attribution (IBA) codebase (BioroboticsLab/IBA, MIT License).

Citation

Vayangi Ganepola *, Oluwabukola Grace Adegboro *, Julia Dietlmeier, Mayug Maniparambil, Simon P. Wilson, Aonghus Lawlor, Claudia Mazo and Noel E. O'Connor. "Self-Configurable Information Bottleneck Attribution", in ICPR 2026 XAIE4: 4th Workshop on Explainable and Ethical AI

* These authors contributed equally.

About

This repository contains the official code for the paper "Self-Configurable Information Bottleneck Attribution," published in the XAIE4 workshop at ICPR 2026.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors