Selective Classification Under Distribution Shifts

Hengyue Liang, Le Peng, Ju Sun

TL;DR

This paper introduces "generalized selective classification" (GSC), a new framework that allows classifiers to abstain from making predictions not just on uncertain in-distribution data, but also on data that has shifted in distribution (covariate or label shifts). They propose novel margin-based confidence scores that are more robust and effective than existing methods for this generalized SC task, especially in high-stakes applications.

What Problem Does This Paper Address?

In real-world applications, especially high-stakes ones like healthcare, classifiers are rarely perfect. Even state-of-the-art deep learning models can make errors due to noisy data or, more critically, distribution shifts – when the data encountered during deployment differs from the data seen during training. Selective Classification (SC) aims to mitigate this by having the classifier "abstain" from making predictions on samples it deems likely to be wrong, deferring them to human experts. However, traditional SC methods primarily focus on in-distribution data and assume the training and deployment distributions are identical. This paper addresses the critical gap of performing selective classification when distribution shifts (covariate and label shifts) are present, a scenario far more common in practice.

Methods

The authors propose a generalized selective classification (GSC) framework that unifies the handling of in-distribution (Type A), label-shifted (Type B), and covariate-shifted (Type C) errors. Their core contribution lies in developing novel non-training-based confidence-score functions for deep learning classifiers. Unlike many existing methods that rely on softmax responses (which can be sensitive to scale), they introduce two margin-based score functions:

  • Geometric Margin (RLgeo-M): Based on the difference between the top two signed geometric distances to decision hyperplanes.
  • Confidence Margin (RLconf-M): Based on the difference between the top two raw logits.

These margin-based scores are designed to be scale-invariant with respect to the raw logits, making them more reliable and less prone to arbitrary performance changes due to simple scaling of model outputs. They also analyze the scale sensitivity of existing softmax-based scores, demonstrating their limitations.

Datasets

The paper evaluates their proposed methods on a variety of standard datasets and their shifted versions:

  • ImageNet: Used with its standard validation set (In-D) and corrupted versions (ImageNet-C for covariate shift) and OpenImage-O for label shift.
  • iWildCam: Utilized with natural covariate shifts due to different geo-locations.
  • Amazon: Used with natural covariate shifts from different user review comments.
  • CIFAR-10/CIFAR-100: Standard benchmarks, also used with corrupted versions (CIFAR-10-C) and label-shifted versions.

They also compare against existing OOD detection methods and a training-based SC method (ScNet).

Key Insights and Ideas

  • Distribution Shifts are Crucial for Real-World SC: The paper strongly argues that ignoring distribution shifts renders traditional SC methods insufficient for high-stakes applications. Their GSC framework is a necessary step towards practical deployment.
  • Softmax Scores are Fragile: The experiments clearly show that common confidence scores based on softmax outputs (like SRmax) are highly sensitive to the scale of raw logits. This means their performance can be manipulated by simple scaling, making comparisons unreliable.
  • Margins Offer Robustness: The proposed margin-based scores (RLgeo-M and RLconf-M) demonstrate superior robustness and reliability, performing consistently well across various datasets and models, even under moderate distribution shifts.
  • Prioritizing Boundary Samples is Key: The analysis of rejection patterns reveals that margin-based scores tend to reject samples closer to decision boundaries, which is conceptually more aligned with the goal of selective classification – identifying uncertain predictions.
  • OOD Detection is Not Enough for SC: The paper highlights that standard OOD detection metrics (like AUROC) don't fully capture the performance of selective classification, as they don't account for the accuracy on accepted samples or the potential rejection of correctly classified in-distribution samples.

Key Results

  • The proposed margin-based score functions (RLgeo-M and RLconf-M) consistently outperform existing non-training-based scores (including softmax-based and OOD detection scores) across various datasets and models in terms of Risk-Coverage curves and AURC metrics.
  • In many scenarios, especially in the low-risk regime (which is critical for high-stakes applications), the margin-based scores achieve significantly lower selection risks for a given coverage level.
  • For example, on ImageNet with the EVA model, RLgeo-M and RLconf-M show the best overall performance when all types of shifts are present (Figure 4(d) and Table 3).
  • The paper demonstrates that OOD detection scores, while useful for their intended purpose, do not translate well to generalized SC performance.

Limitations and Future Work

  • Calibration Set and Threshold Selection: The paper acknowledges that while they propose effective score functions, the practical implementation of selecting the optimal threshold γ based on a calibration set is left for future work.
  • Class-Specific Costs: The current framework treats all classes equally. Future work could explore scenarios with different rejection weights and costs for different classes, which is relevant for applications like medical diagnosis.
  • Training-Based SC Integration: While the focus is on non-training-based scores, future research could investigate how to align training objectives with these margin-based confidence scores for potentially even better performance.
  • Understanding RLconf-M vs. RLgeo-M: While both margin-based scores perform well, their subtle differences and optimal use cases, particularly in relation to deep learning training practices, warrant further investigation.

Summary updated

BibTeX
@article{liang2024selective,
  author = {Hengyue Liang and Le Peng and Ju Sun},
  title = {{Selective Classification Under Distribution Shifts}},
  journal = {Accepted by TMLR},
  year = {2024},
  url = {https://openreview.net/forum?id=dmxMGW6J7N},
}
Figure