Temperature in Cosine-Based SoftMax Loss

Abstract

While deep models are effectively trained based on a softmax cross-entropy loss, a cosine-based softmax loss also works for producing favorable feature embedding.In the cosine-based softmax, temperature plays a crucial role in properly scaling the logits of cosine similarities, though being manually tuned in ad-hoc ways as there is less prior knowledge about the temperature.In this paper, we address the challenging problem to adaptively estimate the temperature of cosine-based softmax in the framework of supervised image classification.By analyzing the cosine-based softmax representation from a geometrical viewpoint regarding features and classifiers, we construct a criterion in a least-square fashion which enables us to optimize the temperature at each sample via simple greedy search.Besides, our thorough analysis about temperature clarifies that feature embedding by the cosine-based softmax loss is endowed with diverse characteristics which are controllable by the temperature in an explainable way.The experimental results demonstrate that our optimized temperature contributes to determine a feasible range of temperature to control the feature characteristics and produces favorable performance on various image classification tasks.

Cite

Text

Kobayashi. "Temperature in Cosine-Based SoftMax Loss." International Conference on Computer Vision, 2025.

Markdown

[Kobayashi. "Temperature in Cosine-Based SoftMax Loss." International Conference on Computer Vision, 2025.](https://mlanthology.org/iccv/2025/kobayashi2025iccv-temperature/)

BibTeX

@inproceedings{kobayashi2025iccv-temperature,
  title     = {{Temperature in Cosine-Based SoftMax Loss}},
  author    = {Kobayashi, Takumi},
  booktitle = {International Conference on Computer Vision},
  year      = {2025},
  pages     = {22199-22208},
  url       = {https://mlanthology.org/iccv/2025/kobayashi2025iccv-temperature/}
}