Introduction
Modern deep neural networks (DNNs) are highly accurate but often poorly calibrated, exhibiting significant overconfidence. A well-calibrated model's predicted probability should reflect its actual accuracy—for instance, a 90% confidence score should correspond to a 90% success rate. Standard training with cross-entropy loss tends to maximize the "logit distance" between the correct class and others, leading to overconfident, one-hot-like probability distributions.
Existing techniques like Label Smoothing (LS) and Focal Loss (FL) attempt to curb this by penalizing overconfidence. However, these methods typically impose "equality constraints" that push the model toward a uniform distribution, potentially hindering the learning of discriminative features.
Margin-based Label Smoothing (MbLS)
The authors propose Margin-based Label Smoothing (MbLS) to address the limitations of rigid equality constraints. While traditional losses act as linear penalties forcing logit distances toward zero, MbLS introduces an inequality constraint via a margin ($m$).
The modified loss function incorporates a ReLU-based term: $$\min \mathcal{L}_{CE} + \lambda \sum_k \max(0, \max_j (l_j) - l_k - m)$$
This formulation ensures that if the gap between the maximum logit and others is within the margin $m$, no penalty is applied. The gradient only activates when the model becomes excessively confident, allowing it to maintain discriminative power while preventing over-smoothing.
Experimental Setup
MbLS was evaluated across several domains:
- Image Classification: CIFAR-10, Tiny-ImageNet, and CUB-200-2011 (fine-grained).
- Semantic Segmentation: PASCAL VOC 2012.
- NLP: 20 Newsgroups dataset.
- Architectures: ResNet-50, ResNet-101, DeepLabV3, and Vision Transformers (ViT).
Key Results
The primary metric, Expected Calibration Error (ECE), measures the gap between confidence and accuracy. MbLS consistently outperformed baseline methods across various datasets and architectures.
- Tiny-ImageNet: MbLS reduced ECE to 1.64%, significantly lower than standard cross-entropy (3.73%) and Label Smoothing (3.17%).
- Fine-grained Classification: On the CUB dataset, MbLS halved the ECE compared to Label Smoothing (2.78% vs. 5.16%) while simultaneously improving top-1 accuracy.
- Segmentation: Qualitative analysis on PASCAL VOC showed that MbLS produces more reliable uncertainty maps, particularly at object boundaries.
- NLP: On the 20 Newsgroups task, MbLS achieved a dramatic reduction in ECE from 22.75% (CE) to 5.40%.
Discussion and Limitations
While MbLS offers a robust solution for calibration, it introduces the margin $m$ as a hyperparameter. Empirical results suggest that values like $m=6$ or $m=10$ are generally effective, but optimal performance may require task-specific tuning. Additionally, while MbLS improves calibration on standard benchmarks, its behavior under extreme out-of-distribution (OOD) shifts remains a subject for future research.
The shift from equality to inequality constraints represents a significant step in rethinking how we regularize neural networks for better uncertainty estimation without compromising their predictive capabilities.
Summary updated