EPIC: Explanation of Pretrained Image Classification Networks via Prototype

Piotr Borycki, Magdalena Tredowicz, Szymon Janusz, Jacek Tabor, Przemyslaw Spurek, Arkadiusz Lewicki, Lukasz StruskiarXiv 2025 · DOI

Introduction

Deep neural networks are often criticized as "black boxes." In the field of Explainable AI (XAI), researchers typically choose between two flawed paradigms: flexible but vague post-hoc saliency maps (like Grad-CAM) or rigid, inherently interpretable prototype models (like ProtoPNet) that require training from scratch.

EPIC (Explanation of Pretrained Image Classification) bridges this gap. It is a novel post-hoc method that extracts clear, prototype-based explanations from already pre-trained image classifiers without altering their architecture or predictions, combining the flexibility of post-hoc methods with the deep interpretability of prototype models.

The Disentanglement Module

The core innovation of EPIC is a lightweight "Disentanglement Module" injected into the final layers of a pre-trained model. This module allows the system to separate the task of making an accurate prediction from the task of generating a human-readable explanation.

The EPIC architecture. A disentanglement module is inserted into a frozen pre-trained network. By using an invertible transform U and its inverse U-inverse, the original model's predictions are preserved exactly.

The method works through several key steps:

  • The Invertible Matrix Trick: EPIC inserts a learnable, invertible matrix ($U$) before the final global average pooling layer. To ensure the model's original predictions remain unchanged, the weights of the final classification layer are multiplied by the inverse matrix ($U^{-1}$). Mathematically, the output logits remain identical.
  • Optimizing for Purity: EPIC freezes the base model and trains only the $U$ matrix to maximize a "purity" metric. This forces individual channels to activate strongly on single, distinct visual concepts rather than a messy combination of features.
  • Extracting Prototypes: Once channels are disentangled, EPIC identifies training images that maximally activate specific channels to serve as "prototypes." When explaining a new prediction, EPIC shows which prototypes contributed most heavily to the final classification.

Results and Interpretability

EPIC was evaluated across a mix of fine-grained and large-scale datasets, including CUB-200-2011, ImageNet, and the synthetic FunnyBirds dataset. A primary advantage is that it maintains the exact accuracy of the base model (e.g., 80.8% for ResNet-50 on ImageNet) while providing significantly richer explanations than traditional methods.

Qualitative comparison between EPIC, Grad-CAM, and LRP. EPIC provides prototype-based explanations that identify specific visual concepts, whereas Grad-CAM and LRP provide heatmaps.

Unlike traditional saliency maps that show a blurry heatmap over an object, EPIC's disentangled channels isolate specific textures and parts, such as a bird's wing pattern or a snake's eye. This provides a causal understanding of the model's logic—answering "what" the model saw rather than just "where" it looked. In user studies, participants using EPIC's explanations were able to identify the model's predicted class with statistically significant accuracy compared to random guessing.

Conclusion

EPIC demonstrates that standard networks naturally learn distinct conceptual features that are simply "tangled" in the final layers. By decoupling prediction from explanation, EPIC allows for deep interpretability in existing, high-performance models without sacrificing accuracy. While currently limited to architectures with single-layer classification heads, future work may extend this approach to more complex modern architectures like Vision Transformers.

Summary updated

BibTeX
@misc{borycki2025epic,
  author = {Piotr Borycki and Magdalena Tredowicz and Szymon Janusz and Jacek Tabor and Przemyslaw Spurek and Arkadiusz Lewicki and Lukasz Struski},
  title = {{EPIC: Explanation of Pretrained Image Classification Networks via Prototype}},
  year = {2025},
  eprint = {2505.12897},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2505.12897},
}
Figure