Better than Average: Spatially-Aware Aggregation of Segmentation Uncertainty Improves Downstream Performance

Vanessa Emanuela Guarino, Claudia Winklmayr, Jannik Franzen, Josef Lorenz Rumberger, Manuel Pfeuffer, Sonja Greven, Klaus Maier-Hein, Dagmar Kainmueller, Christoph Karg, Carsten T. Lüth

TL;DR

When deep learning models segment images, they produce pixel-level uncertainty maps that must be squashed into a single image-level score to detect failures or out-of-distribution data. This paper demonstrates that the standard approach—taking a simple global average—is fundamentally flawed because it flattens out crucial spatial structure. By introducing spatially-aware aggregation strategies and a robust mixture-model meta-aggregator (GMM-All), the authors significantly improve downstream out-of-distribution and failure detection across diverse applications.

What Problem Does This Paper Address?

Uncertainty Quantification (UQ) in image segmentation is vital for safety-critical applications like autonomous driving and medical imaging. UQ methods output a 2D map of pixel-wise uncertainty scores. However, downstream tasks like Out-of-Distribution (OoD) detection (identifying unfamiliar data) and Failure Detection (FD) (flagging likely missegmentations) require a single scalar score per image to trigger an action, such as alerting a human reviewer.

Historically, researchers have defaulted to taking the Global Average (AVG) of all pixel uncertainty scores. The authors point out major pitfalls with this approach: AVG completely ignores spatial context. As shown in the paper's overview, a tiny, highly uncertain cluster (like a missegmented tumor boundary) can end up with the exact same global average as diffuse, low-level background noise, rendering the uncertainty map useless for risk management.

Figure 1. Aggregation strategies (AggS). (a) An AggS reduces an uncertainty map to a single scalar score. (b) Empirical evaluation of AggSs. Choosing an appropriate AggS is challenging and highly task-dependent. Hence, we benchmark different strategies in the context of OoD- and failure detection over different datasets. (c) Limitations of individual AggSs. Pixel-wise strategies, in particular, have key shortcomings e.g. 1. AVG ignores spatial structure; 2. AQA lacks proportional invariance; and 3. ATA is not monotonic (see Supp. A for more details). (d) Subtypes of AggSs. Beyond pixel-wise AggSs, we also explore spatially-aware approaches—such as prediction-based and spatial AggSs, which measure the fraction of uncertainty mass within structured regions of the uncertainty map. Finally, we consider Meta-AggSs, which combine intensity-based and spatial strategies by fitting a Gaussian Mixture Model (GMM).

Methods

The authors systematically categorize existing aggregation strategies into intensity-based and prediction-based methods, and then introduce two major innovations:

  1. Spatial Aggregation Strategies (SMR): They propose calculating a Spatial Mass Ratio (SMR) based on classical spatial statistics: Moran's I (measuring spatial autocorrelation/clustering), Edge Density Score (capturing boundary localization), and Shannon Entropy (reflecting local randomness). SMR measures the fraction of total uncertainty mass concentrated within structurally complex regions rather than flat or noisy ones.
  2. Meta-Aggregation (GMM-All): Because no single strategy works best for every dataset, they combine multiple intensity and spatial features into a single vector. They fit a Gaussian Mixture Model (GMM) on a small set of known in-distribution (iD) uncertainty maps. The negative log-likelihood (NLL) of a new image's feature vector serves as its final aggregated uncertainty score—effectively measuring how much its uncertainty pattern deviates from "normal" training data.

Datasets

The authors benchmarked their approaches across 10 structurally diverse datasets covering semantic and instance segmentation tasks:

  • Pathology: Arctique (ARC) and Lizard (LIZ) for nuclei segmentation under covariate and semantic shifts.
  • Medical CT: LIDC for binary lung nodule segmentation.
  • Microscopy: WORM (C. Elegans) and SinfNet subsets for microorganism segmentation.
  • Autonomous Driving: GTA (CAR-ID) and Cityscapes (CAR-CS) for urban street scenes.
  • Agriculture: Weedsgalore (WEED) and Crop and Weed (WEED-Hand) for multispectral crop images.

Key Insights and Ideas

  • Average is a dangerous default: In 6 out of 10 evaluation scenarios, the standard Global Average performed close to random guessing for OoD detection. It systematically underestimates risk on fully misclassified small objects.
  • Spatial structure holds the signal: Localized uncertainty patterns (e.g., uncertainty tightly concentrated along object boundaries vs. spread out as blur) carry the real signature of failures and distribution shifts.
  • No silver bullet aggregator: The ideal aggregation strategy is highly dependent on the dataset's geometry and the specific task. For instance, boundary-heavy shifts benefit from edge density metrics, while completely new objects benefit from class-balanced metrics.
  • The power of modeling the uncertainty distribution: By treating different aggregators as features in a GMM, the meta-aggregator automatically learns what "normal" uncertainty looks like for a given dataset, providing a highly robust fallback when the exact failure mode is unknown.

Key Results

  • OoD Detection: Prediction-based methods (BCA, ICA) and the proposed GMM-All meta-aggregator formed the statistically dominant top tier in AUROC performance. GMM-All consistently delivered robust performance across nearly all datasets, avoiding the catastrophic failures seen with individual pixel-wise metrics.
  • Failure Detection: The prediction-based Quantile Foreground Ratio (QFR) achieved the best overall performance by focusing on the most uncertain foreground regions. The proposed GMM-based meta-aggregators performed comparably well, significantly outperforming the standard global average baseline.

Limitations and Future Work

  • Distribution Assumptions: The GMM-All meta-aggregator relies on the assumption that aggregated features follow a learnable multi-modal Gaussian distribution.
  • Data Requirements: It requires a sufficiently large and representative in-distribution dataset to fit the GMM properly before deployment.
  • High Intra-class Variability: In cases where feature variability within the in-distribution data itself is exceptionally high (such as the Lizard pathology dataset), the GMM can struggle to find a clean separation boundary in high-dimensional space.

Summary updated

BibTeX
@inproceedings{guarino2026better,
  author = {Vanessa Emanuela Guarino and Claudia Winklmayr and Jannik Franzen and Josef Lorenz Rumberger and Manuel Pfeuffer and Sonja Greven and Klaus Maier-Hein and Dagmar Kainmueller and Christoph Karg and Carsten T. Lüth},
  title = {{Better than Average: Spatially-Aware Aggregation of Segmentation Uncertainty Improves Downstream Performance}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2026},
  url = {https://openreview.net/forum?id=YgmLwjxWqG},
}
Figure