Skip to main content
QUICK REVIEW

[Paper Review] What's in a Loss Function for Image Classification?

Simon Kornblith, Honglak Lee|arXiv (Cornell University)|Oct 30, 2020
Machine Learning and Data ClassificationComputer Science38 references7 citations
TL;DR

This paper investigates how different loss functions and regularization strategies affect image classification performance, showing that improved objectives like label smoothing enhance class separation in the penultimate layer, boosting accuracy and calibration, but reduce feature transferability to downstream tasks. The key insight is that performance gains stem from better decision boundaries, not deeper representational changes.

ABSTRACT

It is common to use the softmax cross-entropy loss to train neural networks on classification datasets where a single class label is assigned to each example. However, it has been shown that modifying softmax cross-entropy with label smoothing or regularizers such as dropout can lead to higher performance. This paper studies a variety of loss functions and output layer regularization strategies on image classification tasks. We observe meaningful differences in model predictions, accuracy, calibration, and out-of-distribution robustness for networks trained with different objectives. However, differences in hidden representations of networks trained with different objectives are restricted to the last few layers; representational similarity reveals no differences among network layers that are not close to the output. We show that all objectives that improve over vanilla softmax loss produce greater class separation in the penultimate layer of the network, which potentially accounts for improved performance on the original task, but results in features that transfer worse to other tasks.

Motivation & Objective

  • To understand how variations in loss functions and output layer regularization affect model performance, calibration, and robustness in image classification.
  • To investigate whether differences in training objectives lead to meaningful changes in learned representations across network layers.
  • To evaluate the trade-off between in-domain performance and transferability of features learned under different objectives.
  • To identify which components of the training objective most significantly influence model behavior and generalization.

Proposed method

  • Compared multiple loss functions, including vanilla softmax cross-entropy, label-smoothed cross-entropy, and regularized variants such as those with dropout.
  • Trained deep neural networks on standard image classification benchmarks using different objectives while keeping architecture and data identical.
  • Analyzed hidden representations via representational similarity analysis (RSA) to compare feature maps across layers and training objectives.
  • Evaluated model performance on in-distribution accuracy, calibration (e.g., expected calibration error), and out-of-distribution robustness.
  • Quantified class separation in the penultimate layer using metrics like inter-class and intra-class distances.
  • Assessed transferability by fine-tuning features on downstream vision tasks, measuring performance gains.

Experimental results

Research questions

  • RQ1How do different loss functions affect the accuracy, calibration, and out-of-distribution robustness of image classifiers?
  • RQ2To what extent do different training objectives alter the learned representations in deep neural networks?
  • RQ3Are differences in performance due to changes in early or late-layer representations, and where do they primarily emerge?
  • RQ4Does improved performance on the original task correlate with better transferability to other tasks?
  • RQ5What is the relationship between class separation in the penultimate layer and overall model performance?

Key findings

  • Loss functions that improve upon vanilla softmax cross-entropy, such as label smoothing, yield higher accuracy and better calibration on image classification benchmarks.
  • Improved objectives lead to significantly greater class separation in the penultimate layer, which correlates with better in-domain performance.
  • Differences in hidden representations across network layers are minimal and restricted to the final few layers, indicating that representation changes are localized near the output.
  • Despite improved performance on the original task, models trained with advanced objectives exhibit worse transferability to downstream tasks.
  • The gains in accuracy and calibration are primarily driven by improved decision boundaries in the penultimate layer, not by changes in earlier feature hierarchies.
  • The trade-off between in-domain performance and transferability suggests that stronger regularization in the output layer may harm generalization to new tasks.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.