arXiv:2610.27443cs.LGOct 2026

Manuscript Offprint

arXiv:2610.27443

Using Set Learning to Improve Set-Valued Classifiers on Long-tailed Data

Kevin Kasa, Scott C. Lowe, Graham W. Taylor

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Set-valued classification (SVC) offers a practical approach to communicating uncertainty while maintaining accuracy by predicting variable-sized sets per input rather than fixed-sized sets (e.g. top-1 or top-5). However, set-valued classifiers (SVCs) exhibit significantly degraded performance on long-tailed and imbalanced datasets, a setting for which they are ostensibly well-suited. This becomes apparent under macro-average evaluation, which weighs all classes equally. SVCs are typically formed during a post-hoc calibration stage, so little is known about how training dynamics affect their behaviour. In this work, we investigate how different neural network training strategies and loss functions impact downstream SVC performance on highly imbalanced data. In addition to methods such as label smoothing and class-balancing, we investigate whether loss functions that operate over sets of examples in a batch, rather than treating all examples as independent, lead to better downstream SVCs. We adapt the recently proposed odd-K-out (OKO) loss function, which learns from sets of training samples, improving its sample efficiency whilst introducing algorithmic modifications that reduce its computational overhead from 3.2×3.2\times to just 1.36×1.36\times that of standard cross-entropy training. Experiments on highly long-tailed datasets demonstrate our modified OKO approach significantly improves macro-accuracy across multiple SVC methods—including top-k, average-k, and conformal prediction—while maintaining competitive micro-accuracy. This improved performance on minority classes occurs without substantially increasing prediction set sizes, suggesting that carefully constructed set-based training can produce networks better suited to imbalanced data.

1 Introduction

Consider the case of an ecologist attempting to identify a rare and exotic insect—a challenging task involving dozens of morphologically similar species with limited reference specimens. This may seem like a clear use case for employing the aid of a machine learning (ML) model; unfortunately however, it may fail to provide much help. This kind of ecological data often exhibits a long-tailed class distribution, containing highly imbalanced data. Despite considerable progress, learning from long-tailed and imbalanced data remains a challenging problem for ML classifiers (Buda et al., 2018; Zhang et al., 2023, 2025). Further, the typical deployment practice of identifying only the most probable (top-1) predicted label may provide insufficient information for expert evaluation in these settings.

Numerous attempts have been made to address the challenge of learning from imbalanced data, including better loss functions (Lin et al., 2017), training recipes (Müller et al., 2019; Shwartz-Ziv et al., 2023), and data pipelines (Wan et al., 2017). Further, set valued classification (SVC) has been developed as a method to provide more meaningful insights on datasets with many challenging classes (Chzhen et al., 2021). Instead of returning a single candidate class, SVC returns a set C of classes, which can then be further evaluated by domain experts. SVC has been shown to provide better practical performance particularly in long-tailed data settings (Garcin et al., 2021; Cresswell et al., 2024b).

Unfortunately, despite improvements in ML models and SVC methods, SVCs continue to exhibit poor classification accuracy on underrepresented classes (Ding et al., 2023; Kasa and Taylor, 2023; Cresswell et al., 2024a). This is highly undesirable, since many plant and arthropod species are exceedingly rare yet highly important to ensuring global biodiversity (Ceballos et al., 2020; Steinke et al., 2024). Maintaining high performance on minority classes is also necessary in domains such as medicine, where rare but life-threatening illnesses or under-served demographics should be fairly addressed (Lu et al., 2022), as well as in domains like finance (Zhou and Sesia, 2024), autonomous vehicles (Yang and Pavone, 2023), and automated decision making (Lekeufack et al., 2024). This degradation of performance on rare and infrequent classes is primarily evaluated through macro-average metrics. Unlike micro-average metrics (such as accuracy) which weight all test samples equally, macro-average metrics weight each class equally by computing per-class results then averaging across classes.

Although numerous SVC methods have been developed, in all cases their macro-accuracy performance is still greatly degraded on long-tailed data, lagging behind micro-average metrics (Ding et al., 2023; Kasa and Taylor, 2023). Set valued classification is conducted post-hoc on trained neural nets, and no prior work has examined how training affects downstream SVC performance in this settings.

Our goal is to study the impact of different loss functions on SVC performance for highly imbalanced and long-tailed settings. This is a fundamental challenge with broad applications across domains where minority classes matter. We investigate several loss functions and build on the odd-K-out (OKO) loss which learns from sets of classes (Muttenthaler et al., 2024). We make the following contributions:

• Computational efficiency: propose in-batch set construction for the OKO method, increasing sample efficiency, reducing computational overhead from 3.2×3.2\times to 1.36×1.36\times relative to cross-entropy, and enabling experiments on larger datasets than previously considered.

• Empirical evaluation: On two large-scale biodiversity datasets our improved set-based training improves macro-accuracy across multiple SVC methods by up to 10 percentage points while preserving micro-accuracy and favourable set size trade-offs.

• Loss function analysis: We find that entropy-regularizing losses including set-based learning, consistently improve macro-accuracy across SVC methods, while focal loss degrades macro-accuracy despite improving micro-average results.

References (59)