Trust your neighbours: Penalty-based constraints for model calibration
Balamurali Murugesan, Sukesh Adiga, Bingyuan Liu, Hervé Lombaert, Ismail Ben Ayed, Jose Dolz
TL;DR
The paper addresses miscalibrated confidence in segmentation models by highlighting the neglect of spatial structure in pixel-wise calibration. It analyzes Spatially Varying Label Smoothing (SVLS) through a constrained-optimization lens, showing it imposes an implicit surrounding-class constraint via $\boldsymbol{\tau}$ and a KL term, but lacks explicit weighting. The authors propose a principled alternative that enforces equality constraints on the logits with a tunable penalty, $\mathcal{L}_{CE} + \lambda \sum_k |\tau_k - l_k|$, enabling explicit control and the inclusion of arbitrary priors on the logit distribution. Across medical segmentation benchmarks, the method yields improved segmentation metrics and better-calibrated uncertainty (lower ECE/CECE) with lower logit magnitudes, demonstrating practical impact for safe decision-making in clinical settings.
Abstract
Ensuring reliable confidence scores from deep networks is of pivotal importance in critical decision-making systems, notably in the medical domain. While recent literature on calibrating deep segmentation networks has led to significant progress, their uncertainty is usually modeled by leveraging the information of individual pixels, which disregards the local structure of the object of interest. In particular, only the recent Spatially Varying Label Smoothing (SVLS) approach addresses this issue by softening the pixel label assignments with a discrete spatial Gaussian kernel. In this work, we first present a constrained optimization perspective of SVLS and demonstrate that it enforces an implicit constraint on soft class proportions of surrounding pixels. Furthermore, our analysis shows that SVLS lacks a mechanism to balance the contribution of the constraint with the primary objective, potentially hindering the optimization process. Based on these observations, we propose a principled and simple solution based on equality constraints on the logit values, which enables to control explicitly both the enforced constraint and the weight of the penalty, offering more flexibility. Comprehensive experiments on a variety of well-known segmentation benchmarks demonstrate the superior performance of the proposed approach.
