[论文解读] Proximity-Informed Calibration for Deep Neural Networks
本文提出 ProCal,一种即插即用的校准方法,通过根据样本与训练数据邻居的接近程度调整置信度分数,缓解深度神经网络中的接近度偏差。该方法提出 PIECE,一种基于接近度的校准度量指标,并在多种场景(包括长尾分布和分布偏移场景)中一致地提升了校准性能,具有 90% 的统计显著性。
Confidence calibration is central to providing accurate and interpretable uncertainty estimates, especially under safety-critical scenarios. However, we find that existing calibration algorithms often overlook the issue of *proximity bias*, a phenomenon where models tend to be more overconfident in low proximity data (i.e., data lying in the sparse region of the data distribution) compared to high proximity samples, and thus suffer from inconsistent miscalibration across different proximity samples. We examine the problem over 504 pretrained ImageNet models and observe that: 1) Proximity bias exists across a wide variety of model architectures and sizes; 2) Transformer-based models are relatively more susceptible to proximity bias than CNN-based models; 3) Proximity bias persists even after performing popular calibration algorithms like temperature scaling; 4) Models tend to overfit more heavily on low proximity samples than on high proximity samples. Motivated by the empirical findings, we propose ProCal, a plug-and-play algorithm with a theoretical guarantee to adjust sample confidence based on proximity. To further quantify the effectiveness of calibration algorithms in mitigating proximity bias, we introduce proximity-informed expected calibration error (PIECE) with theoretical analysis. We show that ProCal is effective in addressing proximity bias and improving calibration on balanced, long-tail, and distribution-shift settings under four metrics over various model architectures. We believe our findings on proximity bias will guide the development of *fairer and better-calibrated* models, contributing to the broader pursuit of trustworthy AI. Our code is available at: https://github.com/MiaoXiong2320/ProximityBias-Calibration.
研究动机与目标
- 识别并量化接近度偏差——即模型在低接近度(罕见、分布外)样本上过度自信地误分类的现象——在广泛模型中的影响。
- 证明现有校准方法(如温度缩放)无法缓解此偏差,导致在不同接近度水平下出现不一致的校准偏差。
- 提出 ProCal,一种即插即用的校准方法,通过联合建模置信度与接近度以改善不确定性估计。
- 提出 PIECE,一种理论基础坚实的度量指标,用于量化由接近度偏差引起的校准偏差,其敏感度强于标准 ECE。
提出的方法
- ProCal 采用基于核密度估计(KDE)的密度比估计方法,对置信度-接近度对进行建模,以区分正确与错误预测。
- 通过特征空间中 K 个最近邻的平均 L2 距离计算接近度(K=10–50),并在不同 K 值下表现出鲁棒性。
- 推理阶段,ProCal 使用正确预测与错误预测的 KDE 比值对模型置信度进行校准,同时按类别频率加权。
- 通过定制化实现,支持连续与离散输入类型,实现广泛部署。
- 利用高效的近似最近邻搜索(如 IVFFlat)实现大规模数据集的可扩展性。
- 校准过程为事后处理,使其即插即用,兼容任意预训练模型。
实验结果
研究问题
- RQ1接近度偏差是否在多种模型架构与规模中普遍存在,特别是在真实世界的安全关键型应用中?
- RQ2标准校准方法(如温度缩放)在多大程度上无法纠正低接近度样本中的校准偏差?
- RQ3像 PIECE 这类基于接近度的校准度量能否检测到标准 ECE 因抵消效应而遗漏的校准偏差?
- RQ4ProCal 在平衡数据集、长尾数据集和分布偏移数据集中减少接近度偏差的效率如何?
- RQ5哪些超参数(如 K、距离度量)能实现最佳性能与鲁棒性?
主要发现
- 接近度偏差在 504 个 ImageNet 预训练模型中普遍存在,其中基于 Transformer 的模型比 CNN 更易受影响。
- 即使经过温度缩放,模型在低接近度样本上仍显著过度自信,表明标准校准方法无法解决接近度偏差问题。
- 低接近度样本的过拟合率高于高接近度样本,加剧了罕见或分布外样本中的校准偏差。
- ProCal 在 ImageNet、iNaturalist 2021、ImageNet-LT、MultiNLI 和 ImageNet-C 上,于 ECE、PIECE、准确率和可靠性四项指标上均一致提升校准性能。
- 使用 IVFFlat 进行接近度计算可获得略优性能与更优效率,且在 L2、余弦或 IVFPQ 等不同距离度量间差异极小。
- PIECE 在理论上保证至少与 ECE 相等,且仅当接近度偏差不引起标准 ECE 中的抵消效应时,二者才相等。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。