B-cos Alignment for Inherently Interpretable CNNs and Vision Transformers

Moritz Böhle, Navdeeppal Singh, Mario Fritz, Bernt Schiele
6/19/2023
cs.CV

No official code found. Best implementation: B-cos/B-cos-v2 (61 stars, Apache-2.0, last commit 2025-12-25).

Abstract

We present a new direction for increasing the interpretability of deep neural networks (DNNs) by promoting weight-input alignment during training. For this, we propose to replace the linear transformations in DNNs by our novel B-cos transformation. As we show, a sequence (network) of such transformations induces a single linear transformation that faithfully summarises the full model computations. Moreover, the B-cos transformation is designed such that the weights align with relevant signals during optimisation. As a result, those induced linear transformations become highly interpretable and highlight task-relevant features. Importantly, the B-cos transformation is designed to be compatible with existing architectures and we show that it can easily be integrated into virtually all of the latest state of the art models for computer vision - e.g. ResNets, DenseNets, ConvNext models, as well as Vision Transformers - by combining the B-cos-based explanations with normalisation and attention layers, all whilst maintaining similar accuracy on ImageNet. Finally, we show that the resulting explanations are of high visual quality and perform well under quantitative interpretability metrics.

View on arXivView PDF

Code Implementations(1)

B-cos/B-cos-v2Community100%
Apache-2.0

Official PyTorch implementation of improved B-cos models

618PythonMar 27, 202310 months agoApache-2.0

Similar Papers

Cite this paper

@article{bhle2023bcos,
  title  = {B-cos Alignment for Inherently Interpretable CNNs and Vision Transformers},
  author = {Moritz Böhle and Navdeeppal Singh and Mario Fritz and Bernt Schiele},
  year   = {2023},
  eprint = {2306.10898},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2306.10898v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2306.10898.svg)](https://codeofpaper.com/paper/2306.10898)

Discussion