
其中,
h
(
X
)
=
(
Y
^
,
P
^
)
h(X)=(\hat Y,\hat P)
h(X)=(Y^,P^),
h
h
h 为模型,
Y
^
\hat Y
Y^ 为 class prediction,
P
^
\hat P
P^ 为 associated confidence,
Y
Y
Y 为 GT class
We define the average confidence within bin
B
m
B_m
Bm as
这样,
acc
(
B
m
)
\text{acc}(B_m)
acc(Bm) 和
conf
(
B
m
)
\text{conf}(B_m)
conf(Bm) 就分别是对 (1) 式等号左右的估计值,perfectly calibrated model 会满足
acc
(
B
m
)
=
conf
(
B
m
)
\text{acc}(B_m)=\text{conf}(B_m)
acc(Bm)=conf(Bm)
Expected Calibration Error (ECE) 通过离散化来近似计算上式 (similar to the reliability diagrams)
其中
n
n
n 为样本数。下面给出两个示例,分别计算二分类和多分类的 ECE (pp 代表 output pseudo-probability)


Maximum Calibration Error (MCE) 即为对上式的离散化近似

下面作者探讨了一些导致 miscalibration 的原因 (model capacity and lack of regularization are closely related to model (mis)calibration)




对于二分类模型,只考虑对样本属于正类的概率 p i p_i pi 进行校准
即验证集上 bin
B
m
B_m
Bm 内样本的平均正样本数
其中,
D
D
D 为验证集,
s
∈
S
s\in\mathcal S
s∈S 为 binning scheme,包含 the number of bins
M
M
M, bin boundaries 和每个 bin 对应的输出校准概率值
θ
1
,
.
.
.
,
θ
M
\theta_1,...,\theta_M
θ1,...,θM。由于验证集是有限的,因此
S
\mathcal S
S 也是有限集合。
P
(
q
^
t
e
∣
p
^
t
e
,
S
=
s
,
D
)
\mathbb P(\hat q_{te}\mid\hat p_{te},\mathcal S=s,D)
P(q^te∣p^te,S=s,D) 为使用 binning scheme
s
s
s 输出的 calibrated probability. 当采用 uniform prior 时,有
因此,关键就是解出
P
(
D
∣
S
=
s
)
\mathbb P(D\mid S=s)
P(D∣S=s),具体可参考 Naeini et al., 2015 (将
θ
1
,
.
.
,
θ
M
\theta_1,..,\theta_M
θ1,..,θM 看作
M
M
M 个独立二项分布的参数,用 Beta 分布来对
θ
1
,
.
.
,
θ
M
\theta_1,..,\theta_M
θ1,..,θM 进行建模)
为了减小参数量,vector scaling 限制
W
W
W 为对角矩阵
其中,
q
^
i
\hat q_i
q^i 为 calibrated probability,
σ
S
M
\sigma_{SM}
σSM 为 softmax,
T
T
T 为 temperature,
T
T
T 越大,输出概率分布的熵越大。另外注意到,Temperature scaling does not affect the model’s accuracy (并不会对模型的预测结果产生影响) (On the other hand, binning methods tend to change class predictions which hurts accuracy)Calibration Results

Reliability diagrams

Computation time
Ease of implementation