Many studies have observed that modern neural networks achieve high accuracy while producing poorly calibrated probabilities, making calibration a critical practical issue. In this work, we propose probability bounding (PB), a novel post-hoc calibration method that mitigates both underconfidence and overconfidence by learning lower and upper bounds on the output probabilities. To implement PB, we introduce the box-constrained softmax (BCSoftmax) function, a generalization of Softmax that explicitly enforces lower and upper bounds on the output probabilities. While BCSoftmax is formulated as the solution to a box-constrained optimization problem, we develop an exact and efficient algorithm for computing BCSoftmax. We further provide theoretical guarantees for PB and introduce two variants of PB. We demonstrate the effectiveness of our methods experimentally on four real-world datasets, consistently reducing calibration errors. Our Python implementation is available at https://github.com/neonnnnn/torchbcsoftmax.
翻译:多项研究发现,现代神经网络在实现高准确率的同时,其输出的概率往往校准不佳,这使得校准成为一个关键的实际问题。本文提出概率边界(PB),一种新颖的后验校准方法,通过学习输出概率的下界和上界来缓解欠自信和过自信问题。为实现PB,我们引入了盒约束Softmax(BCSoftmax)函数,该函数作为Softmax的推广,显式地强制输出概率满足上下界约束。尽管BCSoftmax被形式化为一个盒约束优化问题的解,我们开发了一种精确且高效的算法来计算BCSoftmax。我们进一步为PB提供了理论保证,并介绍了PB的两种变体。我们在四个真实世界数据集上通过实验验证了所提方法的有效性,均能持续降低校准误差。我们的Python实现可在https://github.com/neonnnnn/torchbcsoftmax获取。