Soft Labeling Affects Out-of-Distribution Detection of Deep Neural Networks

Doyup Lee, Yeongjae CheonarXiv 2020 · OpenReview

Abstract

Soft labeling becomes a common output regularization for generalization and model compression of deep neural networks. However, the effect of soft labeling on out-of-distribution (OOD) detection, which is an important topic of machine learning safety, is not explored. In this study, we show that soft labeling can determine OOD detection performance. Specifically, how to regularize outputs of incorrect classes by soft labeling can deteriorate or improve OOD detection. Based on the empirical results, we postulate a future work for OOD-robust DNNs: a proper output regularization by soft labeling can construct OOD-robust DNNs without additional training of OOD samples or modifying the models, while improving classification accuracy.

Introduction

Deep neural networks (DNNs) are often deployed in environments where they encounter data far removed from their training distribution. A critical safety requirement is the ability to detect these out-of-distribution (OOD) samples rather than making overconfident, incorrect predictions. While techniques like label smoothing and knowledge distillation are widely used to improve generalization and model efficiency, their impact on OOD detection has remained largely unexamined. This research reveals that soft labeling is a "double-edged sword" that can either significantly degrade or remarkably enhance a model's OOD detection capabilities.

The Pitfalls of Label Smoothing

Label smoothing is a popular regularization technique that replaces one-hot targets with "soft" targets (e.g., [0.9, 0.05, 0.05]). While this prevents overconfidence on in-distribution (ID) data, it inadvertently blurs the distinction between ID and OOD samples.

As shown in our analysis, increasing the label smoothing parameter $\alpha$ typically leads to a degradation in OOD detection performance across various datasets. By forcing the model to be less certain about correct classes, it effectively treats known samples more like outliers, making it harder to separate the two.

Figure 3: AUROC performance for SVHN (ID) against various OOD datasets as the label smoothing parameter increases. Higher smoothing generally leads to lower AUROC.

Outlier Distillation: Transferring Robustness

The researchers propose a novel approach called Outlier Distillation (OD). This method leverages the fact that OOD robustness can be encoded within the soft labels of a "teacher" model. In this setup, a teacher model is first trained using Outlier Exposure (OE), which involves fine-tuning on an auxiliary dataset of outliers. A student model is then trained using standard knowledge distillation, mimicking the teacher's soft labels but using only in-distribution data.

This approach allows the student to inherit the teacher's OOD detection capabilities without ever seeing an OOD sample during its own training.

Figure 5: Comparison of AUROC scores between Teacher (trained with OE) and Student (trained via OD) across three ID datasets (CIFAR-10, SVHN, CIFAR-100). The student consistently matches or nears the teacher's performance.

Key Findings

  • Accuracy Recovery: Traditional Outlier Exposure often comes at the cost of reduced test accuracy on the original task. In contrast, Outlier Distillation (+OD) was found to recover or even improve classification accuracy. For example, on CIFAR-100, accuracy improved from 76.63% (baseline) to 76.80% (+OD), whereas direct OE dropped it to 75.58%.
  • Improved Calibration: Models trained with OD exhibited the lowest Expected Calibration Error (ECE), meaning their confidence levels more accurately reflected their true predictive performance.
  • Architecture Agnostic: The distillation of OOD robustness is effective even when the student and teacher have different architectures, such as distilling from a WideResNet to a DenseNet.

Conclusion and Future Directions

This study highlights that the way we regularize incorrect classes through soft labeling is a primary determinant of OOD detection performance. While standard label smoothing can be detrimental, the success of Outlier Distillation suggests that a "perfect" set of soft labels exists—one that simultaneously optimizes accuracy, calibration, and safety.

The ultimate goal for future research is to discover how to mathematically construct these optimal soft labels without the need for a pre-trained teacher or auxiliary OOD datasets. Achieving this would enable the creation of robust, high-performance DNNs with significantly reduced data requirements.

Summary updated

Abstract

Soft labeling becomes a common output regularization for generalization and model compression of deep neural networks. However, the effect of soft labeling on out-of-distribution (OOD) detection, which is an important topic of machine learning safety, is not explored. In this study, we show that soft labeling can determine OOD detection performance. Specifically, how to regularize outputs of incorrect classes by soft labeling can deteriorate or improve OOD detection. Based on the empirical results, we postulate a future work for OOD-robust DNNs: a proper output regularization by soft labeling can construct OOD-robust DNNs without additional training of OOD samples or modifying the models, while improving classification accuracy.
BibTeX
@misc{lee2020soft,
  author = {Doyup Lee and Yeongjae Cheon},
  title = {{Soft Labeling Affects Out-of-Distribution Detection of Deep Neural Networks}},
  year = {2020},
  eprint = {2007.03212},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2007.03212},
}
Figure