Model Calibration in Dense Classification with Adaptive Label Perturbation

Jiawei Liu, Changkun Ye, Shan Wang, Ruikai Cui, Jing Zhang, Kaihao Zhang, Nick Barnes · DOI

Abstract

For safety-related applications, it is crucial to produce trustworthy deep neural networks whose prediction is associated with confidence that can represent the likelihood of correctness for subsequent decision-making. Existing dense binary classification models are prone to being over-confident. To improve model calibration, we propose Adaptive Stochastic Label Perturbation (ASLP) which learns a unique label perturbation level for each training image. ASLP employs our proposed Self-Calibrating Binary Cross Entropy (SC-BCE) loss, which unifies label perturbation processes including stochastic approaches (like DisturbLabel), and label smoothing, to correct calibration while maintaining classification rates. ASLP follows Maximum Entropy Inference of classic statistical mechanics to maximise prediction entropy with respect to missing information. Extensive results demonstrate that ASLP can significantly improve calibration degrees of dense binary classification models on both in-distribution and out-of-distribution data.

The Challenge of Over-Confidence

In safety-critical fields like medical imaging or autonomous driving, it is not enough for a model to be accurate; it must also be well-calibrated. A model’s predicted probability (confidence) should ideally match its actual likelihood of being correct. However, modern Deep Neural Networks (DNNs) are notoriously prone to "mis-calibration," often predicting extreme confidence values even when they are incorrect. This issue is particularly acute in "dense classification" tasks—such as salient object detection or semantic segmentation—where a prediction is made for every pixel. Traditional fixes like global label smoothing apply a uniform level of softening to all data, ignoring the fact that some images or pixels are inherently more difficult or noisier than others.

Adaptive Stochastic Label Perturbation (ASLP)

To address these limitations, we propose Adaptive Stochastic Label Perturbation (ASLP). This method introduces a sample-specific approach to calibration by learning a unique "noise level" for every training image.

Conceptual overview of the ASLP framework and SC-BCE loss.

The framework relies on two key components:

  1. Self-Calibrating Binary Cross Entropy (SC-BCE): This novel loss function unifies label smoothing and stochastic label flipping (DisturbLabel). It uses a Bernoulli variable to decide whether to train on the ground truth or a perturbed version of the label, effectively softening over-confident predictions.
  2. Adaptive Updates: Instead of a fixed noise level, ASLP learns a perturbation level ($\alpha$) for each image. This is updated after every epoch, "tuning" the difficulty of the training signal based on the model's current performance.

We evaluate two variants: ASLP-MEI, which uses Maximum Entropy Inference to maximize uncertainty on unknown data, and ASLP-MC, which specifically targets the minimization of calibration error using a validation set.

Experimental Results

The primary evaluation was conducted on Salient Object Detection (SOD) across multiple benchmarks, including DUTS, DUT-OMRON, and ECSSD.

Quantitative comparison of calibration performance (ECE and OE) across various SOD datasets.

As shown in the results, ASLP-MC consistently achieves the lowest Expected Calibration Error (ECE). For instance, on the DUTS-TE dataset, ASLP-MC reduced the ECE from a baseline of 3.48% to just 1.40%. Importantly, these gains in calibration were achieved without sacrificing classification accuracy (F-measure). In many cases, the regularizing effect of the adaptive perturbation actually improved generalization.

The method also showed remarkable robustness on Out-of-Distribution (OoD) data. When tested on the Describable Texture Dataset (DTD)—which contains images with no clear objects—the baseline model was extremely over-confident (52.36% ECE). ASLP-MEI slashed this error to 13.43%, forcing the model toward a more honest, uncertain prediction when encountering unfamiliar data.

Key Insights and Limitations

The core insight of this work is that global calibration techniques are sub-optimal for dense classification. By allowing the model to adjust supervision strength per image, it learns to be more cautious where it is likely to fail, such as at object boundaries.

While ASLP provides significant improvements, it does introduce some computational overhead (approximately 8.7% longer training time). Additionally, ASLP-MC requires a clean validation set for its accuracy regularization term, which may not always be available in specialized domains. Future work will explore ways to mitigate these requirements while maintaining the high degree of calibration achieved here.

Summary updated

BibTeX
@misc{liu2023model,
  author = {Jiawei Liu and Changkun Ye and Shan Wang and Ruikai Cui and Jing Zhang and Kaihao Zhang and Nick Barnes},
  title = {{Model Calibration in Dense Classification with Adaptive Label Perturbation}},
  year = {2023},
  eprint = {2307.13539},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2307.13539},
}
Figure