Differentiable Top-k Classification Learning

Felix Petersen, Hilde Kuehne, Christian Borgelt, Oliver Deussen
6/15/2022
cs.LGcs.CV

Official code: Felix-Petersen/difftopk (96 stars, Python, MIT, last commit 2023-01-03).

Abstract

The top-k classification accuracy is one of the core metrics in machine learning. Here, k is conventionally a positive integer, such as 1 or 5, leading to top-1 or top-5 training objectives.

Show full abstract

In this work, we relax this assumption and optimize the model for multiple k simultaneously instead of using a single k. Leveraging recent advances in differentiable sorting and ranking, we propose a differentiable top-k cross-entropy classification loss. This allows training the network while not only considering the top-1 prediction, but also, e.g., the top-2 and top-5 predictions. We evaluate the proposed loss function for fine-tuning on state-of-the-art architectures, as well as for training from scratch. We find that relaxing k does not only produce better top-5 accuracies, but also leads to top-1 accuracy improvements. When fine-tuning publicly available ImageNet models, we achieve a new state-of-the-art for these models.

View on arXivView PDF

Code Implementations(1)

MIT

Differentiable Top-k Classification Learning

964PythonJun 15, 20223 years agoMIT

Similar Papers

Cite this paper

@article{petersen2022differentiable,
  title  = {Differentiable Top-k Classification Learning},
  author = {Felix Petersen and Hilde Kuehne and Christian Borgelt and Oliver Deussen},
  year   = {2022},
  eprint = {2206.07290},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2206.07290}
}

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/2206.07290.svg)](https://codeofpaper.com/paper/2206.07290)

Discussion