调高softmax温度能提升模型分类准确率和抗干扰能力。
Exploring the Impact of Temperature Scaling in Softmax for Classification and Adversarial Robustness
- 通过调节softmax温度,优化学习步长与优化方向。
- 适度升温可使模型在多个数据集上表现更优。
- 高温显著增强对自然扰动和非目标攻击的鲁棒性。
Softmax函数是深度学习的基础组件。本研究深入探讨了softmax中常被忽视的参数——温度,揭示了其在图像分类中的实用与理论特性。基于卷积神经网络与Transformer在多个基准数据集上的实证分析表明,适度提高温度通常能带来更好的整体性能。通过大量实验与严谨的理论分析,我们发现温度不仅影响学习步长,还决定模型的优化方向。更重要的是,首次发现高温具有意外优势:显著提升模型对常见噪声、自然扰动及非目标对抗攻击(如PGD)的鲁棒性。该发现进一步扩展至对抗训练,表明相较于默认温度的原始softmax,更高温度能有效增强对抗训练效果。本研究为提升深度学习模型性能与安全性提供了新思路。
原文摘要 · Abstract (English)
The softmax function is a fundamental component in deep learning. This study delves into the often-overlooked parameter within the softmax function, known as "temperature," providing novel insights into the practical and theoretical aspects of temperature scaling for image classification. Our empirical studies, adopting convolutional neural networks and transformers on multiple benchmark datasets, reveal that moderate temperatures generally introduce better overall performance. Through extensive experiments and rigorous theoretical analysis, we explore the role of temperature scaling in model training and unveil that temperature not only influences learning step size but also shapes the model's optimization direction. Moreover, for the first time, we discover a surprising benefit of elevated temperatures: enhanced model robustness against common corruption, natural perturbation, and non-targeted adversarial attacks like Projected Gradient Descent. We extend our discoveries to adversarial training, demonstrating that, compared to the standard softmax function with the default temperature value, higher temperatures have the potential to enhance adversarial training. The insights of this work open new avenues for improving model performance and security in deep learning applications.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。