Abstract
Deep neural networks for semantic segmentation are frequently overconfident, which can be problematic in safety-critical applications such as autonomous driving. This paper presents a systematic study of the factors contributing to model miscalibration and introduces Selective Scaling, a post-hoc algorithm that significantly improves calibration by treating correct and incorrect pixel predictions differently.
Introduction
In machine learning, calibration refers to the alignment between a model’s predicted confidence and its actual accuracy. For instance, if a model assigns a 90% probability to a "pedestrian" label for a pixel, that pixel should indeed be a pedestrian 90% of the time. While calibration is well-studied for image classification, semantic segmentation presents unique challenges due to spatial correlations and the high volume of pixel-level predictions. Current state-of-the-art segmentation models are often highly accurate but poorly calibrated—they are "confidently wrong." This research seeks to understand the drivers of this miscalibration and provides a practical tool to mitigate it without sacrificing accuracy.
Factors Influencing Calibration
The authors conducted a multi-factor analysis to determine how model capacity, input resolution (crop size), and testing strategies affect the Expected Calibration Error (ECE).
Key findings from this analysis include:
- The Model Capacity Paradox: Larger, more modern models (e.g., SegFormer) generally achieve higher accuracy (mIoU) but suffer from worse calibration than smaller, older models.
- Context Calibrates: Increasing the "crop size" improves calibration. Richer global context likely helps the model locate object boundaries more accurately and confidently.
- Mispredictions are the Culprit: ECE is overwhelmingly driven by the model being overconfident on pixels it predicts incorrectly.
- Boundary vs. Interior: Pixels on object boundaries are significantly less calibrated than those in the interior, highlighting the difficulty models face with spatial transitions.
Selective Scaling Algorithm
Building on the finding that mispredictions are the primary source of calibration error, the authors propose Selective Scaling. Unlike standard Temperature Scaling—which applies a single global parameter to "soften" all probability distributions—Selective Scaling uses a binary selector (a small MLP) to categorize predictions as likely correct or incorrect.
- For likely mispredictions: It applies a higher temperature ($T_1$) to smooth the logits, significantly reducing the model's confidence.
- For likely correct predictions: It applies a lower temperature ($T_2$), preserving the model's confidence where it is justified.
This approach is "post-hoc," meaning it is applied to a pre-trained model and does not require retraining the original segmentation network.
Experimental Results
Selective Scaling was evaluated across diverse benchmarks, including ADE20K, CityScapes, and medical imaging datasets. It consistently outperformed existing methods like Temperature Scaling, Dirichlet Scaling, and Ensembling.
On ADE20K using a SegFormer-B5, Selective Scaling reduced the ECE from 0.111 (uncalibrated) to 0.086, outperforming standard Temperature Scaling (0.109). The method proved particularly robust in "domain-shift" scenarios, such as training on synthetic data (SYNTHIA) and testing on real-world city streets (CityScapes), where it achieved an ECE of 0.203 compared to the uncalibrated model's 0.254.
Conclusion and Limitations
Selective Scaling provides an efficient way to calibrate segmentation models with negligible computational overhead. However, the authors note that logit smoothing inherently increases output entropy, which may not be ideal for all downstream tasks. Furthermore, the method's effectiveness depends on the accuracy of the binary selector. Future work may involve integrating this selective logic directly into the training phase for even more robust calibration.
Summary updated