Abstract
Deep Neural Networks (DNNs) have achieved remarkable performance across various domains but remain largely "black boxes," often requiring post-hoc explanation methods that may lack faithfulness to the model's actual decision-making process. While inherently interpretable architectures like B-cos networks offer a solution, they typically require training from scratch, which is computationally prohibitive for large-scale models. This paper presents "B-cosification," a novel method to transform pre-trained DNNs into inherently interpretable models through efficient fine-tuning. By enforcing alignment between inputs and weights, B-cosification achieves state-of-the-art interpretability and competitive accuracy with up to a 9x speedup compared to training from scratch.
1. Introduction
The deployment of deep learning in sensitive areas is often hindered by the lack of transparency in model reasoning. Post-hoc methods like Grad-CAM provide visualizations but are frequently criticized for being unfaithful to the model's internal logic. Inherently interpretable models, such as B-cos networks, address this by design: their outputs are directly proportional to the alignment between the input and the learned weights. However, the "interpretability tax"—the high computational cost of training these models from scratch—has limited their adoption, especially for massive foundation models like CLIP or Vision Transformers (ViTs).
B-cosification bridges this gap. It provides a recipe to convert standard, pre-trained black-box models into B-cos variants. This approach leverages the pre-existing feature representations of standard models, significantly reducing training time while often improving final classification performance.
2. Methodology
The core of the B-cosification process is the replacement of standard linear transformations with B-cos transformations.
2.1 The B-cos Transformation
A B-cos transformation scales the output based on the cosine similarity between the input $x$ and the weights $w$, raised to a power $B$:
$$\text{out} = \|x\| \|w\| \cos(\angle(x, w))^B$$
When $B > 1$, the model is incentivized to align its weights with task-relevant patterns in the input to maximize confidence. The authors demonstrate that a standard ReLU network is essentially a B-cos network where $B=1$, providing a theoretical foundation for the conversion.
2.2 The B-cosification Pipeline
The transformation involves four primary steps:
- Input Encoding: RGB inputs are expanded from 3 to 6 channels ($[r, g, b, 1-r, 1-g, 1-b]$). This allows the model to represent both the presence and absence of color, leading to high-quality, colored explanations.
- Weight Adaptation: Pre-trained weights are re-mapped to accommodate the 6-channel input while preserving the functional equivalence of the original model.
- Bias Removal: Bias terms are systematically removed. This ensures that the model's output is a linear combination of its inputs, making the resulting summary a complete and faithful explanation.
- Fine-tuning: The model undergoes fine-tuning where the alignment pressure (the $B$ parameter) is gradually increased. This phase recovers performance lost during the initial conversion and optimizes the model for interpretability.
3. Experimental Evaluation
The authors evaluated B-cosification across diverse architectures and datasets:
- Architectures: ResNet, DenseNet, and Vision Transformers (ViTs), including CLIP.
- Datasets: ImageNet-1k for supervised tasks; CC3M for CLIP fine-tuning; and a suite of 38 datasets for zero-shot evaluation.
- Interpretability Metric: The Grid Pointing Game (GridPG) on PASCAL VOC was used to quantify how well the model's explanations localize relevant objects.
4. Key Results
4.1 Efficiency and Performance
B-cosification significantly reduces the computational burden of achieving interpretability. The researchers observed a 4.7x speedup for DenseNet-121 and a 9.0x speedup for ViT-S compared to training B-cos models from scratch. Furthermore, B-cosified models frequently outperformed their scratch-trained counterparts. On ImageNet, a B-cosified ResNet-18 achieved 71.5% top-1 accuracy, compared to 68.7% for the scratch version.
4.2 Faithfulness and Localization
The explanations generated by B-cosified models are "faithful by design." Unlike the often blurry heatmaps of post-hoc methods, B-cosification produces fine-grained, colored visualizations. Quantitatively, B-cosified CNNs improved localization scores on the GridPG metric by 32.7 to 71.0 percentage points over standard models.
4.3 Foundation Models
The method successfully scaled to CLIP, demonstrating that large-scale, multi-modal models can be made inherently interpretable without sacrificing their zero-shot capabilities. This suggests that B-cosification is a viable path for making the next generation of foundation models more transparent.
5. Conclusion and Future Work
B-cosification effectively removes the "interpretability tax" by allowing researchers to transform existing high-performing models into glass boxes. While the method shows great promise, challenges remain regarding convergence variance in certain architectures and the optimization of fine-tuning for extremely large models. Future research will focus on refining these optimization strategies to ensure that even the largest models can be made interpretable at minimal cost.
Summary updated