Analysis and Optimization of Loss Functions for Multiclass, Top-k, and Multilabel Classification

Maksim Lapin, Matthias Hein, Bernt Schiele
12/12/2016
108 citations
cs.CVcs.LGstat.ML

Official code: mlapin/libsdca (33 stars, Python, MIT, PyTorch, last commit 2026-11-12).

Abstract

Top-k error is currently a popular performance measure on large scale image classification benchmarks such as ImageNet and Places. Despite its wide acceptance, our understanding of this metric is limited as most of the previous research is focused on its special case, the top-1 error.

Show full abstract

In this work, we explore two directions that shed more light on the top-k error. First, we provide an in-depth analysis of established and recently proposed single-label multiclass methods along with a detailed account of efficient optimization algorithms for them. Our results indicate that the softmax loss and the smooth multiclass SVM are surprisingly competitive in top-k error uniformly across all k, which can be explained by our analysis of multiclass top-k calibration. Further improvements for a specific k are possible with a number of proposed top-k loss functions. Second, we use the top-k methods to explore the transition from multiclass to multilabel learning. In particular, we find that it is possible to obtain effective multilabel classifiers on Pascal VOC using a single label per image for training, while the gap between multiclass and multilabel methods on MS COCO is more significant. Finally, our contribution of efficient algorithms for training with the considered top-k and multilabel loss functions is of independent interest.

View on arXivView PDF

Code Implementations(1)

mlapin/libsdcaOfficial100%
PyTorchMIT

Accurate and fast classification losses for SDCA and neural networks: cross-entropy, top-k, multiclass and multilabel SVM, and distillation losses for PyTorch, JAX, NumPy, Rust, C/C++ and MATLAB

3313Python, C++Oct 25, 20152 weeks agoMIT
cppcross-entropycudahinge-lossjax+13 more

Similar Papers

Cite this paper

@article{lapin2016analysis,
  title  = {Analysis and Optimization of Loss Functions for Multiclass, Top-k, and Multilabel Classification},
  author = {Maksim Lapin and Matthias Hein and Bernt Schiele},
  year   = {2016},
  eprint = {1612.03663},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/1612.03663}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/1612.03663.svg)](https://codeofpaper.com/paper/1612.03663)

Discussion