Generation of Loss Functions from Matrix-Based Binary Classification Metrics
Year: 2026
Type: article
Abstract: Most evaluation metrics for binary classification are derived from the confusion matrix, which is inherently non-differentiable because it relies on discrete predictions. This limits their direct use as loss functions in gradient-based learning, creating a mismatch between training objectives and evaluation criteria. To that end, we offer a general-purpose approach, AnyLoss , that transforms any confusion-matrix-based metric into a differentiable loss function. AnyLoss employs a distinct approximation strategy to estimate a specific, targeted metric score for the prediction model. This is followed by a theoretical and practical analysis of the method, which involves conducting extensive experiments with neural network architectures ranging from simple to advanced across diverse data modalities, including tabular, image, and text. The experimental results demonstrate the generality of our new method, which can target any evaluation metrics derived from a confusion matrix, and highlight that it excels at handling imbalanced datasets.
DOI: 10.1145/3805705
Authors: Doheon Han, Nuno Moniz, Nitesh V. Chawla
Institution: University of Notre Dame
Language: English
Subfield: Artificial Intelligence
Field: Computer Science
Domain: Physical Sciences
Open Access status: hybrid
OpenAlex ID: W7141623325
