Abstract
Standard Label Smoothing (LS) is a popular regularization technique that improves generalization but often ignores the nuances of individual data points and class relationships. We present Instance-based Label Smoothing (ILS), a method that tailors the smoothing factor for each instance and distributes uncertainty non-uniformly across classes based on their semantic similarity. Our results demonstrate that ILS significantly improves both model accuracy and calibration across various benchmarks.
Introduction
Deep Neural Networks (DNNs) are frequently overconfident in their predictions, which can be problematic in safety-critical applications. Label Smoothing (LS) has emerged as a standard solution, replacing "hard" one-hot labels with "soft" targets. However, standard LS is inherently limited by its uniform application across all instances and incorrect classes. This "one-size-fits-all" approach can destroy valuable semantic information and fail to account for varying levels of instance difficulty.
The Limitations of Standard Label Smoothing
Standard LS applies a constant smoothing factor $\epsilon$ to every data point. This ignores two critical factors:
- Instance Difficulty: Not all images are equally easy to classify. Noisy or ambiguous images may require more smoothing than clear, prototypical examples.
- Class Relationships: Standard LS treats all incorrect classes as equally likely. In reality, a "dog" is semantically closer to a "cat" than to a "car." Uniform smoothing erases these relationships, which are crucial for tasks like knowledge distillation.
Instance-based Label Smoothing (ILS)
To overcome these limitations, we propose Instance-based Label Smoothing (ILS), which leverages a well-calibrated teacher network to generate adaptive soft labels. ILS consists of two main components:
- ILS1 (Adaptive Magnitude): A per-instance smoothing factor is calculated using a parametric quadratic function of the teacher's confidence. This allows the model to adapt to the local density of the data distribution.
- ILS2 (Non-uniform Distribution): Instead of uniform distribution, the smoothing mass is allocated based on the teacher's predicted probabilities for incorrect classes, preserving semantic similarity.
Synthetic Analysis
Synthetic 2D dataset designed with dense and sparse regions to demonstrate spatial variance in overfitting. Instance-based Label Smoothing For Better Calibrated Classification Networks, page 2
Experiments on a synthetic 2D Gaussian mixture (Figure 1) reveal that models tend to overfit more in "sparse" regions of the feature space. ILS addresses this by applying higher smoothing factors in these regions while maintaining lower smoothing in "dense" regions, effectively regularizing where it is needed most.
Experimental Results
We evaluated ILS across 11 dataset-architecture pairs, including CIFAR-10/100 and SVHN with ResNet and DenseNet architectures.
Accuracy and Calibration
ILS consistently outperformed standard LS and self-distillation in terms of both accuracy and Expected Calibration Error (ECE). For instance, on CIFAR-100 with ResNet110, ILS achieved a significantly lower cross-entropy loss (1.055) compared to standard LS (1.248).
As shown in Figure 4, the probability distribution produced by our method (LS+Temp) aligns much more closely with the Bayes-optimal distribution than the baseline without instance-based smoothing. This alignment is evident in both the high-confidence (0.5-1.0) and low-confidence (0.0-0.1) regimes.
Knowledge Distillation
A significant advantage of ILS is its impact on knowledge distillation. Unlike standard LS, which often produces poor teacher models, ILS-trained teachers provide more informative soft labels. Students trained using these labels show improved performance and better retention of semantic class relationships.
Conclusion
Instance-based Label Smoothing provides a principled way to adapt regularization to data characteristics. By moving beyond uniform smoothing, ILS achieves superior calibration and accuracy, making it a robust alternative to standard label smoothing for modern deep learning pipelines.
Summary updated