Being Bayesian about Categorical Probability

Taejong Joo, Uijung Chung, Min-Gwan Seo

Abstract

Deep learning classifiers predominantly rely on the softmax function, which often leads to overconfident predictions and poor uncertainty estimation. This paper introduces Belief Matching (BM), a Bayesian framework that treats categorical probabilities as random variables following a Dirichlet distribution. By optimizing the Evidence Lower Bound (ELBO) and matching the predicted distribution to a Bayesian posterior, BM achieves superior calibration, robust out-of-distribution detection, and improved generalization across large-scale benchmarks like ImageNet, all while maintaining the computational efficiency of standard neural networks.

1. Introduction

Modern deep learning architectures almost universally employ the softmax function for classification tasks. Despite its ubiquity, softmax suffers from two critical deficiencies: overconfidence and a lack of inherent uncertainty quantification. Standard models often assign high probabilities to incorrect classes or out-of-distribution (OOD) samples, providing a point estimate that fails to reflect the model's ignorance. While Bayesian Neural Networks (BNNs) offer a solution by placing distributions over weights, they are notoriously difficult to scale and often incur a performance penalty.

2. The Belief Matching Framework

The authors propose Belief Matching (BM) as a "plug-and-play" alternative to softmax cross-entropy. Instead of placing distributions over model weights, BM is Bayesian about the target distribution itself.

Comparison between standard softmax cross-entropy loss and the proposed Belief Matching framework.

In this framework, the categorical probability of a label is treated as a random variable following a Dirichlet distribution. The neural network is tasked with predicting the concentration parameters of this distribution. By incorporating a prior Dirichlet distribution and updating it with observed labels via Bayes' rule, the model learns to output a "belief" over the probability simplex. The optimization objective is the Evidence Lower Bound (ELBO), stabilized by a "lambda trick" to manage the KL-divergence term during training.

3. Experimental Evaluation

BM was evaluated across diverse benchmarks, including CIFAR-10/100, ImageNet, and SVHN for OOD detection.

  • Generalization: On ImageNet, a ResNext-101 using BM achieved a 20.23% Top-1 error, outperforming the softmax baseline of 20.72%.
  • Calibration: The Expected Calibration Error (ECE) on CIFAR-100 significantly improved, dropping from 13.48% (softmax) to 4.25% (BM).
  • Uncertainty Estimation: When tested on OOD data (SVHN), BM-trained models exhibited sharp peaks in predictive entropy, correctly identifying unknown samples, whereas softmax models remained overconfident.

4. Analysis of Learned Representations

A key insight from the BM framework is its effect on the model's internal representations. Visualization of the penultimate layer reveals that BM induces "Implicit Manifold Regularization."

Latent space visualization showing tighter class clustering with the KL-divergence term in Belief Matching.

As shown in the latent space plots, the inclusion of the KL-divergence term forces the network to learn much tighter and more distinct clusters for each class compared to standard training. This suggests that the model learns a more robust internal representation of the data manifold, allowing it to better distinguish between aleatoric uncertainty (ambiguous data) and epistemic uncertainty (unseen data).

5. Conclusion and Future Directions

Belief Matching provides a scalable, efficient path toward Bayesian deep learning. It acts as a drop-in replacement for cross-entropy loss, offering better accuracy and more reliable uncertainty without the complexity of weight-based BNNs. Future work may explore more expressive distributions beyond the Dirichlet, such as the Logistic Normal, or investigate input-dependent priors to further enhance performance in complex or imbalanced learning scenarios.

Summary updated

BibTeX
@inproceedings{joo2020being,
  author = {Taejong Joo and Uijung Chung and Min-Gwan Seo},
  title = {{Being Bayesian about Categorical Probability}},
  booktitle = {International Conference on Machine Learning},
  year = {2020},
  url = {https://openreview.net/forum?id=_tcT6aW9m_p},
}
Figure