Abstract
Selective classification (SC) enables models to make predictions only when they are sufficiently confident, a critical capability for enhancing safety and reliability in high-stakes scenarios like medical diagnosis or autonomous driving. While previous research has primarily focused on modifying the architecture of classification layers to improve confidence estimation, this work demonstrates that optimizing the underlying feature layers is equally essential. We provide a generalization bound for selective classification, revealing that reducing intra-class variance in the feature space directly improves performance. Based on this theory, we propose Confidence-aware Contrastive Learning for Selective Classification (CCL-SC). This novel method aligns features of homogeneous instances and differentiates those of heterogeneous instances, with the optimization strength controlled by the model's confidence. Experimental results on CIFAR-10, CIFAR-100, CelebA, and ImageNet show that CCL-SC achieves significantly lower selective risk than state-of-the-art methods across nearly all coverage degrees.
Introduction
In high-stakes fields, a wrong prediction can be far more costly than no prediction at all. Selective Classification (SC) addresses this by allowing a model to "abstain" from predicting if its confidence falls below a specific threshold. The goal is to maximize "coverage" (the percentage of samples classified) while minimizing "selective risk" (the error rate on those classified samples).
Historically, state-of-the-art methods have focused on the "head" of the neural network—implementing specialized loss functions or auxiliary layers to better estimate confidence. However, these approaches often ignore the "body" of the network: the feature layers. If the underlying features of correctly and incorrectly classified samples are intermingled in the latent space, the model will struggle to distinguish between a certain prediction and a lucky guess. This paper argues that selective classification is fundamentally a feature-level problem.
Theoretical Motivation
The authors derive a generalization bound for selective classification that highlights the importance of feature representation. Their theory discloses that optimizing feature layers—specifically by reducing intra-class variance—directly improves the performance of the selective model. This suggests that if we can force the model to cluster "reliable" features more tightly, we can inherently improve its ability to self-evaluate.
The CCL-SC Framework
To translate this theory into practice, the authors introduce Confidence-aware Contrastive Learning (CCL-SC). This method applies contrastive learning principles specifically tailored for the requirements of selective classification.
1. Redefining Positives and Negatives
Unlike standard supervised contrastive learning, which groups samples simply by their class labels, CCL-SC defines samples based on correctness:
- Positive samples: Instances that share the same label as the anchor and are correctly classified by the model.
- Negative samples: Instances that share the same label as the anchor but are incorrectly classified.
By treating misclassified samples of the same class as negatives, the model learns to identify the subtle feature patterns that lead to errors.
2. Confidence-aware Supervised Contrastive (CSC) Loss
The core innovation is a loss function that "pulls" the anchor toward positive samples and "pushes" it away from negative ones. Crucially, this force is weighted by the model’s Softmax Response (SR). If the model is highly confident in its prediction but the feature representation is poor, the gradient is larger, forcing the model to prioritize fixing those specific features. This acts as an automated curriculum, focusing learning energy on samples where the model is "confident but wrong."
3. One-Stage Training
CCL-SC utilizes a momentum encoder and dual queues to store positive and negative features. This allows the model to train the feature and classification layers simultaneously in a single stage, avoiding the complexity of traditional "pre-train then fine-tune" workflows.
Experimental Evaluation
The researchers evaluated CCL-SC against state-of-the-art (SOTA) methods like SelectiveNet, Deep Gamblers, and Self-Adaptive Training (SAT) across four major benchmarks.
Key Results
- Lower Selective Risk: CCL-SC consistently outperformed SOTA methods. On CIFAR-100, it achieved significantly lower risk when coverage was at 60% or higher. On ImageNet, it maintained the lowest selective risk across nearly all coverage degrees (e.g., at 70% coverage, it reduced risk from ~12.3% to ~11.4% compared to the best baseline).
- Improved Latent Space: t-SNE visualizations confirmed that CCL-SC produces much tighter clusters of correctly classified samples. There are clearer boundaries between the features the model handles well and the features that lead to errors.
- Plug-and-Play Synergy: Because CCL-SC focuses on the feature layers, it can be combined with existing head-based methods to achieve even better results, demonstrating its versatility as a foundational improvement.
Limitations and Future Work
Despite its success, CCL-SC involves some trade-offs. The use of momentum encoders and large feature queues (up to 10,000 samples for ImageNet) increases the memory footprint and training complexity. Furthermore, the method requires an initial "warm-up" period; if the model fails to reach a baseline level of accuracy early on, the quality of the feature queues suffers. Future research may explore applying these feature-level optimizations to Natural Language Processing (NLP) or out-of-distribution (OOD) detection.
Conclusion
CCL-SC represents a shift in how we approach reliable machine learning. By proving that the secret to better selective classification lies in the feature representations, and providing a mechanism to optimize them through confidence-aware contrastive learning, this work provides a robust path toward safer AI deployment in high-stakes environments.
Summary updated