On the Calibration of Nested Dichotomies for Large Multiclass Tasks

Tim Leathart, Eibe Frank, Bernhard Pfahringer, Geoffrey HolmesarXiv 2018

TL;DR

Nested dichotomies are a powerful way to handle massive numbers of classes in machine learning, but they often suffer from poor probability calibration. This paper shows that calibrating the individual binary classifiers within the nested dichotomy, and even the entire structure, significantly improves performance, especially for datasets with many classes.

What Problem Does This Paper Address?

Modern datasets, particularly those from online sources, are exploding in size, not just in terms of the number of examples but also the number of distinct classes. For instance, datasets with tens of thousands or even millions of classes are becoming common. A popular strategy to tackle such "large label spaces" is to use a nested dichotomy. This approach constructs a binary tree where each internal node splits the set of classes into two subsets. A binary classifier is trained at each node to distinguish between these subsets. Predictions are made by traversing the tree from the root to a leaf node.

While effective for managing complexity, a key challenge with nested dichotomies is probability calibration. Ideally, a classifier's predicted probability should reflect the true likelihood of an event. For example, if a model predicts a class with 80% probability, then 80% of instances assigned that probability should actually belong to that class. Nested dichotomies, even when using well-calibrated base binary classifiers, often produce poorly calibrated multiclass probabilities. This is because errors in the binary probability estimates can accumulate as they are multiplied along the path from the root to the leaf. This problem is exacerbated in deeper trees, which are necessary for datasets with more classes. The paper aims to address this by investigating calibration strategies for nested dichotomies.

Methods

The paper explores two main calibration strategies:

  • Internal Calibration: This involves calibrating each individual binary classifier at the internal nodes of the nested dichotomy. The authors hypothesize that improving the quality of these base probabilities will lead to better overall multiclass probabilities. They investigate using Platt scaling and isotonic regression for this purpose, as these are standard techniques for binary calibration.
  • External Calibration: This approach treats the entire nested dichotomy as a single model and applies a calibration technique to its final output probabilities. The paper focuses on vector scaling, an efficient method suitable for large multiclass problems, as a way to correct for any remaining miscalibration in the overall nested dichotomy structure.

The theoretical motivation for internal calibration is based on the observation that the negative log-likelihood (NLL) of an instance under a nested dichotomy is the sum of the NLLs of the binary models on the path to its true leaf node. Therefore, reducing the NLL of an internal model by a certain amount directly reduces the overall multiclass NLL.

Datasets

The authors evaluated their methods on a diverse set of datasets, spanning various domains and numbers of classes:

  • Character Recognition: optdigits, letter, devanagari
  • Biomedical: micromass
  • Text Categorization: RCV1, sector, ODP-5K (a subset of the original ODP dataset with 5,000 classes)
  • Object Recognition: ALOI, ILSVR2010

They used standard train/test splits for larger datasets and 10-fold cross-validation for others. For ILSVR2010, they used visual codewords.

Key Insights and Ideas

  • The "Depth Problem": Even with individually well-calibrated base classifiers (like logistic regression), nested dichotomies become increasingly under-confident as their depth increases. This is due to the multiplicative nature of probability estimation along the tree path.
  • Calibration is Crucial for Nested Dichotomies: The paper strongly suggests that simply using well-calibrated base learners is not enough to guarantee well-calibrated nested dichotomies. The tree structure itself introduces calibration challenges.
  • Internal Calibration Helps, External Calibration Fixes: Calibrating internal binary models improves the overall probability estimates. However, applying external calibration (like vector scaling) to the entire nested dichotomy can further correct miscalibration and often leads to the best results.
  • Synergy of Internal and External Calibration: Combining both internal and external calibration often yields the best performance gains, especially for datasets with a high number of classes.
  • Base Learner Matters, but Calibration is Key: While the choice of base classifier (e.g., Naïve Bayes vs. Boosted Trees) influences performance, calibration strategies consistently improve results across different base learners, particularly when the base learners are poorly calibrated.

Key Results

  • Significant NLL Reduction: External calibration with vector scaling consistently reduced the NLL across all tested datasets when using logistic regression as the base learner. The improvements were more substantial for datasets with more classes.
  • Accuracy Improvements: External calibration also led to accuracy improvements on many datasets, though this was not universal.
  • Internal Calibration Benefits: Applying internal calibration (Platt scaling or isotonic regression) significantly improved both NLL and classification accuracy compared to the baseline, especially when using poorly calibrated base classifiers like Naïve Bayes and Boosted Trees.
  • Best Performance with Combined Calibration: The best results for both NLL and accuracy were often achieved by applying both internal and external calibration together.
  • Vector Scaling Efficiency: Vector scaling proved to be an efficient and scalable external calibration method, making it suitable for large multiclass tasks.

Limitations and Future Work

  • Limited Calibration Methods: The paper primarily focused on Platt scaling, isotonic regression, and vector scaling. Future work could explore more expressive (and potentially more computationally expensive) calibration methods like matrix scaling or Bayesian averaging.
  • Random Tree Structure: The paper used a simple random splitting strategy for constructing the nested dichotomies. Investigating how calibration performs with more sophisticated tree construction methods would be valuable.
  • Selective Calibration: The authors suggest exploring selective calibration of layers within the nested dichotomy. This could potentially reduce training time with minimal impact on predictive performance.
  • Base Learner-Specific Calibration: Further research could investigate whether certain calibration methods are better suited to specific base learners within the nested dichotomy context (e.g., Platt scaling for models that output scores, isotonic regression for models with more complex output relationships).
  • Overfitting with Isotonic Regression: The paper notes that isotonic regression can overfit on small samples, suggesting that Platt scaling might be a better choice for internal models with limited training data.

Summary updated

BibTeX
@misc{leathart2018calibration,
  author = {Tim Leathart and Eibe Frank and Bernhard Pfahringer and Geoffrey Holmes},
  title = {{On the Calibration of Nested Dichotomies for Large Multiclass Tasks}},
  year = {2018},
  eprint = {1809.02744},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1809.02744},
}
Figure