AnyLoss: Transforming Classification Metrics into Loss Functions
Not on the map. Why?
Abstract (arXiv)
Many evaluation metrics can be used to assess the performance of models in binary classification tasks. However, most of them are derived from a confusion matrix in a non-differentiable form, making it very difficult to generate a differentiable loss function that could directly optimize them. The lack of solutions to bridge this challenge not only hinders our ability to solve difficult tasks, such as imbalanced learning, but also requires the deployment of computationally expensive hyperparameter search processes in model selection. In this paper, we propose a general-purpose approach that transforms any confusion matrix-based metric into a loss function, textitAnyLoss, that is available in optimization processes. To this end, we use an approximation function to make a confusion matrix represented in a differentiable form, and this approach enables any confusion matrix-based metric to be directly used as a loss function. The mechanism of the approximation function is provided to ensure its operability and the differentiability of our loss functions is proved by suggesting their derivatives. We conduct extensive experiments under diverse neural networks with many datasets, and we demonstrate their general availability to target any confusion matrix-based metrics. Our method, especially, shows outstanding achievements in dealing with imbalanced datasets, and its competitive learning speed, compared to multiple baseline models, underscores its efficiency.
Key facts. Cited by 3 papers in the map (data through 7 Oct 2026). Builds on 8 of its 27 references that are in the map. First posted on arXiv 23 May 2024.
Builds on
8 of 27 references.
References · 8
- 2015Deep Residual Learning for Image Recognitioncited by 51,809
- 2018Model Evaluation, Model Selection, and Algorithm Selection in Machine Learningcited by 157
- 2016Time for a change: a tutorial for comparing multiple classifiers through Bayesian analysiscited by 92
- 2017On Loss Functions for Deep Neural Networks in Classificationcited by 68
- 2021sigmoidF1: A Smooth F1 Score Surrogate Loss for Multilabel Classificationcited by 23
- 2021Score-oriented loss (SOL) functionscited by 11
- 2021MetricOpt: Learning to Optimize Black-Box Evaluation Metricscited by 9
- 2021A surrogate loss function for optimization of Fβ score in binary classification with imbalanced datacited by 5
Built on by
Citing papers per year: 2025: 1; 2026: 2.
3 papers.