Concept-based Explanations for Out-Of-Distribution Detectors

Jihye Choi, Jayaram Raghuram, Ryan Feng, Jiefeng Chen, Somesh Jha, Atul Prakash

TL;DR

This paper introduces the first unsupervised framework to explain the decisions of black-box Out-of-Distribution (OOD) detectors using high-level, human-understandable concepts. By defining new metrics for detection completeness and concept separability, the authors demonstrate that concepts optimized solely for standard classification fail to explain OOD behavior, whereas their joint optimization framework successfully uncovers why a detector flags or misses anomalous inputs.

What Problem Does This Paper Address?

Deep neural networks (DNNs) are notoriously overconfident when encountering inputs outside their training distribution (OOD data). To ensure safe deployment in critical domains like medical imaging or autonomous driving, classifiers are typically paired with OOD detectors to flag these anomalous inputs.

However, these detectors operate as black boxes. Existing interpretability methods, such as pixel-level feature attributions (saliency maps), are often noisy, unintuitive, and fail to highlight the structural or semantic differences between In-Distribution (ID) and OOD data. This paper addresses this gap by creating a method to explain why an OOD detector makes a decision, using high-level, human-understandable concepts (e.g., "wavy surface of the sea" or "furry skin") rather than raw pixels.

Methods

The authors propose a "two-world" framework to map and evaluate concepts:

  1. Canonical World: The original, unmodified DNN classifier and OOD detector.
  2. Concept World: A parallel space where intermediate feature representations are projected onto a learned concept subspace and then reconstructed using a non-linear mapping.
The Two-World View of the Classifier and OOD Detector

To guide the unsupervised learning of these concepts, they introduce two novel metrics:

  • Detection Completeness: Quantifies whether the learned concepts are sufficient to accurately replicate the original detector's decisions (measured via AUROC).
  • Concept Separability: Inspired by Fisher’s Linear Discriminant Analysis (LDA), this measures how well the concept scores separate the data flagged as ID from the data flagged as OOD.

The final objective function jointly optimizes the concept vectors and the reconstruction network by balancing classification accuracy, feature reconstruction error, instance-level detector score matching (via Mean Squared Error), and concept separability. Post-hoc, a modified Shapley value formulation calculates the marginal contribution of each concept to rank its importance.

Datasets

  • In-Distribution (ID) Dataset: Animals with Attributes (AwA), consisting of 50 animal classes.
  • Auxiliary OOD Dataset (for training concepts): MSCOCO (curated to remove overlapping animal classes) and an augmented version of the AwA dataset.
  • Test OOD Datasets (for evaluation): Places365, SUN, and Textures.

Key Insights and Ideas

  • Classifier concepts $\neq$ Detector concepts: Concepts that are excellent at explaining a model's classification choices (e.g., identifying a dolphin) are often terrible at explaining OOD detection. They fail to capture the background or distribution shifts that trigger OOD alarms.
  • Per-sample alignment is crucial: Matching aggregate statistics (like overall accuracy) between the real world and the concept world isn't enough. Introducing an instance-level mean-squared error (MSE) regularization is vital to accurately replicate the detector's score distribution.
  • A tool for model debugging: Concept profiles allow practitioners to diagnose why a detector failed. For instance, if an OOD image of a beach is mistakenly flagged as an ID "Dolphin", the concept score pattern can reveal if the detector was tricked by a high activation of the "wavy surface of the sea" concept.

Key Results

The proposed method was evaluated across five popular OOD detectors: MSP, ODIN, Generalized-ODIN, Energy, and Mahalanobis.

  • Quantitative Improvements: For the MSP detector evaluated on the SUN dataset, the detection completeness score jumped from 0.774 (using baseline classification concepts) to 0.960 using the proposed method. Simultaneously, the relative concept separability score increased from 0.694 to 2.756.
  • Distribution Alignment: Unlike prior concept-learning methods, the proposed framework closely mirrors the empirical score distributions of the target detectors, ensuring that the explanations are faithful to the black-box model's actual behavior.
Empirical distribution of target detector scores vs reconstructed concept world scores

Limitations and Future Work

  • Dependence on Auxiliary OOD Data: A key limitation is the requirement of an unlabeled auxiliary OOD dataset during the concept learning phase, which might be difficult to obtain in specialized domains. While the authors show that synthetic data augmentation can act as a substitute, optimizing this selection remains an open question.
  • Lack of Human Subject Studies: Although the generated concepts are visually distinct and intuitive, the authors note that a formal user study is still required to evaluate how effectively these explanations help human practitioners debug and trust OOD detectors in practice.

Summary updated

Abstract

Out-of-distribution (OOD) detection plays a crucial role in ensuring the safe deployment of deep neural network (DNN) classifiers. While a myriad of methods have focused on improving the performance of OOD detectors, a critical gap remains in interpreting their decisions. We help bridge this gap by providing explanations for OOD detectors based on learned high-level concepts. We first propose two new metrics for assessing the effectiveness of a particular set of concepts for explaining OOD detectors: 1) detection completeness, which quantifies the sufficiency of concepts for explaining an OOD-detector's decisions, and 2) concept separability, which captures the distributional separation between in-distribution and OOD data in the concept space. Based on these metrics, we propose an unsupervised framework for learning a set of concepts that satisfy the desired properties of high detection completeness and concept separability, and demonstrate its effectiveness in providing concept-based explanations for diverse off-the-shelf OOD detectors. We also show how to identify prominent concepts contributing to the detection results, and provide further reasoning about their decisions.
BibTeX
@inproceedings{choi2023concept,
  author = {Jihye Choi and Jayaram Raghuram and Ryan Feng and Jiefeng Chen and Somesh Jha and Atul Prakash},
  title = {{Concept-based Explanations for Out-Of-Distribution Detectors}},
  booktitle = {International Conference on Machine Learning},
  year = {2023},
  url = {https://openreview.net/forum?id=a33IYBCFey},
}
Figure