Set-valued prediction in hierarchical classification with constrained representation complexity

Thomas Mortier, Krzysztof Dembczynski, Eyke Hüllermeier, Willem Waegeman

Abstract

Set-valued prediction is a well-known concept in multi-class classification. When a classifier is uncertain about the class label for a test instance, it can predict a set of classes instead of a single class. In this paper, we focus on hierarchical multi-class classification problems, where valid sets (typically) correspond to internal nodes of the hierarchy. We argue that this is a very strong restriction, and we propose a relaxation by introducing the notion of representation complexity for a predicted set. In combination with probabilistic classifiers, this leads to a challenging inference problem for which specific combinatorial optimization algorithms are needed. We propose three methods and evaluate them on benchmark datasets: a naïve approach that is based on matrix-vector multiplication, a reformulation as a knapsack problem with conflict graph, and a recursive tree search method. Experimental results demonstrate that the last method is computationally more efficient than the other two approaches, due to a hierarchical factorization of the conditional class distribution.

Introduction

In complex classification tasks, such as identifying specific plant species or diagnosing rare diseases, models often face significant uncertainty. Traditional "flat" classifiers might provide a list of the top $k$ most likely classes, but such lists can be disjointed and difficult for human experts to interpret.

Hierarchical classification typically addresses this by forcing a prediction of a single node within a predefined taxonomy (e.g., predicting the category "Songbird" instead of a specific species like "House Sparrow"). However, this approach is often too restrictive. If a model is confident that an object is either a "House Sparrow" or a "Purple Finch," forcing a single-node prediction might require moving all the way up to a very broad category like "Bird," losing valuable specific information. This paper addresses this gap by allowing models to predict a set of classes that is flexible enough to be accurate yet structured enough to be easily explained using the hierarchy.

Methodology and Representation Complexity

The core innovation of this work is the definition of Representation Complexity ($R_T$). This metric quantifies the minimum number of tree nodes required to represent a predicted set of classes. For instance, a single node prediction has $R_T = 1$, while a prediction consisting of two unrelated species has $R_T = 2$.

Hierarchical tree structure illustrating how sets of classes map to nodes in a hierarchy.

The authors frame the task as a constrained optimization problem: find the set of classes with the highest probability mass, given a maximum set size ($k$) and a maximum representation complexity ($r$). To solve this, they propose three algorithms:

  1. Matrix-Vector Multiplication (MVM): A naive brute-force approach that searches all possible valid sets, suitable only for very small problems.
  2. Knapsack with Conflict Graph (KCG): A reformulation into a known combinatorial optimization challenge, allowing the use of powerful Integer Linear Programming (ILP) solvers.
  3. Recursive Tree Search (RTS): The paper's primary contribution. By assuming the probability distribution follows the tree structure (hierarchical factorization), this top-down search uses a priority queue to prune the search space efficiently.

Experimental Evaluation

The methods were evaluated on five benchmark datasets with predefined hierarchies, including image datasets (Caltech-101 and Caltech-256), fine-grained visual categorization (PlantCLEF2015), and biological datasets (Bacteria and Proteins).

Examples of set-valued predictions for plant species, showing how multiple species can be grouped to manage uncertainty.

Key Results

  • Efficiency: The RTS algorithm was the clear winner, outperforming the ILP-based KCG and the naive MVM by orders of magnitude in runtime. On the Caltech-256 dataset, RTS found optimal solutions in milliseconds, while MVM's complexity exploded.
  • Performance Gains: Increasing the allowed representation complexity ($r$) significantly improved recall. By allowing just 2 or 3 nodes instead of 1, the models were much more likely to include the true class in the predicted set without making the set size ($k$) unmanageably large.
  • Exactness: Unlike many heuristic methods, both KCG and RTS are exact inference algorithms, guaranteed to find the mathematically optimal set under the given constraints.

Discussion and Insights

The study highlights a critical trade-off between accuracy and interpretability. Representation complexity acts as a proxy for "communicability"; a prediction represented by 2 nodes is much easier for a human to grasp than a list of 50 individual leaf nodes. This approach breaks the "single node" dogma of traditional hierarchical models, proving there is a rich, useful middle ground.

Furthermore, the hierarchy appears more "informative" for biological data (Bacteria/Proteins) than for general image data, as taxonomic structures in biology more closely mirror the underlying data distribution.

Limitations and Future Work

The high-speed RTS algorithm requires the probability model to be factorized according to the tree. For "flat" softmax models, users are currently limited to the slower KCG approach. Additionally, the method relies on the quality of the provided hierarchy; a poorly constructed hierarchy might hinder performance. Future directions include exploring dynamic programming to speed up KCG for non-factorized models and extending the framework to handle other types of constraints, such as average error control.

Summary updated

BibTeX
@inproceedings{mortier2022set,
  author = {Thomas Mortier and Krzysztof Dembczynski and Eyke Hüllermeier and Willem Waegeman},
  title = {{Set-valued prediction in hierarchical classification with constrained representation complexity}},
  booktitle = {Conference on Uncertainty in Artificial Intelligence},
  year = {2022},
  url = {https://openreview.net/forum?id=rY8NwwLoceq},
}
Figure