Deja vu from the SVM Era: Example-based Explanations with Outlier Detection

Penny Chong, Yuval Elovici, Alexander Binder

Abstract

Deep Neural Networks (DNNs) are powerful but often operate as "black boxes," providing little insight into their decision-making process and failing to identify out-of-distribution data. This paper proposes a unified framework that addresses these issues by training student networks to make predictions based on similarity to real training examples, known as prototypes. This approach, reminiscent of Support Vector Machines (SVMs), provides inherent interpretability and robust outlier detection without compromising classification accuracy.

Introduction

While DNNs excel at classification tasks, they typically lack transparency. Common explainability methods like Grad-CAM highlight relevant input regions but do not explain the underlying reasoning or reference points. Additionally, DNNs are frequently overconfident on "outliers"—data significantly different from the training set.

This research bridges these gaps by anchoring a model's decisions to actual, human-understandable images from the training data. By moving away from abstract latent vectors to real prototypes, the model offers grounded explanations and a natural mechanism for outlier detection.

Methodology

The authors utilize a Teacher-Student learning framework where a high-performing, pre-trained CNN (the teacher) provides soft labels to guide a prototype-based student network.

Prototype Selection and Replacement

A key innovation is the Iterative Prototype Replacement algorithm. Instead of learning synthetic vectors, the model selects actual training images. An auxiliary output branch tracks the contribution of each prototype to the decision boundary, allowing uninformative prototypes to be swapped for better candidates. This ensures scalability to large-scale datasets.

Similarity Head Architectures

The framework supports various "heads" to compute similarity between inputs and prototypes, categorized by their handling of spatial information.

Hierarchy of the proposed similarity head architectures, ranging from simple global pooling to complex attention mechanisms.
  • Head I: Simple non-spatial similarity using global spatial pooling.
  • Head II: Spatial similarity computed across coordinates, matching exact locations or searching for best-matching patches.
  • Head III: Employs an attention mechanism to weight the importance of different image regions during comparison.
Detailed architecture of the Head III prototype network, illustrating the flow from CNN encoder to attended similarity and final classification.

Explainability and Outlier Detection

Interpretability is achieved through Layer-wise Relevance Propagation (LRP), generating heatmaps that show which features in the input match the chosen prototype. Outlier detection is integrated by calculating an "outlier score" based on the sum of top-$k$ similarity scores; inputs with low similarity to all prototypes are flagged as outliers.

Experimental Evaluation

The framework was evaluated on three datasets: LSUN (scene understanding), PCam (medical imaging), and Stanford Cars (fine-grained classification). Outlier detection was tested using Oxford Flowers 102 and synthetic outliers.

Key Results

  • Performance: Prototype-based students often outperformed their black-box teachers. On LSUN, the Head III-B student achieved 83.5% accuracy, surpassing the teacher's 80.1%.
  • Robustness: The integrated outlier score matched or exceeded specialized state-of-the-art methods like ODIN, particularly on LSUN and Stanford Cars.
  • Interpretability: Qualitative analysis confirmed that LRP heatmaps successfully identified shared semantic features, such as specific furniture in room scenes.

Discussion and Limitations

The "SVM-like" architecture demonstrates that explainability and outlier detection are synergistic. However, challenges remain:

  • Complexity: Advanced heads (Head III) significantly increase training time—up to 8x longer per epoch on some datasets.
  • Overfitting: High-complexity heads can overfit on small, fine-grained datasets.
  • Domain Expertise: In specialized fields like pathology, interpreting the generated heatmaps still requires expert knowledge.

Future work may focus on optimizing prototype selection through pre-sorting to accelerate convergence and reduce computational overhead.

Summary updated

BibTeX
@article{chong2022deja,
  author = {Penny Chong and Yuval Elovici and Alexander Binder},
  title = {{Deja vu from the SVM Era: Example-based Explanations with Outlier Detection}},
  journal = {IEEE Trans. Image Process.},
  year = {2022},
  doi = {10.1109/tip.2021.3127847},
}
Figure