arXiv:2610.20251cs.CVOct 2026

Manuscript Offprint

arXiv:2610.20251

Contrastive uncertainty learning for robust multi-structure segmentation in lower-pelvic MR

Bilal Sidiqi, Yipei Wang, Wen Yan, Shaheer U. Saeed, Daniel C. Alexander, Yipeng Hu

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Bilal Sidiqi 1,2^{1,2}, Yipei Wang 1,2^{1,2}[0000-0002-9589-7177], Wen

Yan 1,2^{1,2}[0000-0002-3962-5994], Shaheer U. Saeed 1,3,4^{1,3,4}[0009-0002-9889-9853],

Daniel C. Alexander 1,5^{1,5}[0000-0003-2439-350X], and Yipeng

Hu 1,2^{1,2}[0000-0003-4902-0486]

1^{1} UCL Hawkes Institute, University College London, London, UK

bilal.sidiqi.21@ucl.ac.uk

2^{2} Department of Medical Physics and Biomedical Engineering, University College London, London, UK

3^{3} Centre for Bioengineering, School of Engineering and Materials Science, Queen Mary University of London, London, United Kingdom

4^{4} Digital Environment Research Institute, Queen Mary University of London, London, United Kingdom

5^{5} Department of Computer Science, University College London, London, UK

Abstract. Boundary delineation of anatomical structures in prostate MRI is often compromised by regional ambiguity. Automated segmentation methods relying on global overlap loss functions tend to be insensitive to surface deviations, leading to significant errors in ambiguous regions. Most existing uncertainty-aware methods treat uncertainty as a post-hoc quality indicator or prediction filter. We propose Contrastive Uncertainty Learning (CUL), a supervised framework that uses predictive uncertainty to directly guide representation learning. Using Monte Carlo Dropout, CUL identifies voxel-wise uncertainty and structures the embedding geometry accordingly: low-uncertainty, correctly predicted features form stable voxels while high-uncertainty or misclassified features are actively repelled, preventing feature collapse at difficult boundaries. We evaluate CUL on a 589-scan 3D prostate MRI multi-structure segmentation task (8 anatomical structures) using a ViT with UperNet decoder architecture. Average Dice (83.38%) remains comparable to the baseline (83.35%), while surface distance decreases significantly (p < 0.001) across 6 of 8 anatomical structures. A hard-case analysis reveals a 22× asymmetry between significantly improved and degraded cases (18.8% vs 0.9%). Ablation studies show that removing uncertainty-guided sample selection eliminates improvements for the transition zone, while replacing the contrastive objective with a boundary loss additionally removes bladder improvements, demonstrating that both uncertainty-guided sampling and the contrastive objective are essential for the observed gains. These findings demonstrate that the proposed uncertainty-guided representation learning is a useful mechanism for reducing the risk of extreme errors in safety-critical medical segmentation.

B. Sidiqi et al.

1 Introduction

Deep learning based segmentation is becoming important for quantitative analysis of prostate MRI, enabling automated delineation of prostate zones and associated structures for prostate cancer diagnosis, risk stratification, and treatment planning [1]. Despite strong average performance, convolutional and transformer models often fail on boundary ambiguous cases, producing large boundary deviations that are not fully reflected by global overlap metrics [2]. A key challenge lies in learning representations that remain robust in regions of high predictive uncertainty, typically near boundaries where standard losses such as Dice or cross-entropy do not explicitly incorporate confidence information.

Predictive uncertainty estimates represent model confidence and are widely used in medical image analysis. Bayesian approximations, including Monte Carlo dropout [3] and deep ensembles [4], correlate uncertainty with segmentation error and support quality assurance, error detection, and selective prediction in safety-critical applications.

Uncertainty has also been incorporated into training strategies, particularly in semi-supervised segmentation. In teacher–student frameworks, uncertainty is used to filter unreliable pseudo-labels or weight consistency losses to mitigate confirmation bias [5]. Uncertainty guided contrastive learning similarly excludes high uncertainty pixels from positive pair construction to stabilise representations [6, 7]. Prototype based and memory based approaches construct class prototypes from confident regions while preventing ambiguous voxels from contaminating cluster centres [8]. These methods improve robustness when labelled data are limited, using uncertainty as a filtering or weighting mechanism.

Directly using uncertainty to structure embedding geometry in fully supervised segmentation remains underexplored, particularly for intrinsically ambiguous multi-structure MRI segmentation.

Contrastive learning provides a principled mechanism for structuring representation space. Self-supervised frameworks such as MoCo [9], SimCLR [10], and supervised contrastive learning [11] demonstrate their ability to shape embeddings. Contrastive learning at the pixel and voxel levels has been adopted in segmentation to enhance intra-class compactness and inter-class separation. However, these methods typically define positive pairs solely by class identity or spatial proximity, without considering predictive confidence.

We hypothesise that structuring embedding space based on predictive uncertainty can reduce catastrophic boundary deviations while preserving overall segmentation accuracy. Confident same-class voxels should anchor compact clusters, whereas high-uncertainty voxels should be prevented from distorting these regions of feature space. We therefore propose Contrastive Uncertainty Learning (CUL), a supervised contrastive uncertainty learning framework that: (1) treats predictive uncertainty as a representation level supervisory signal rather than solely a post-hoc reliability estimate or filtering mechanism; (2) structures representation geometry by aligning low uncertainty same class voxel features while preventing ambiguous high uncertainty features from collapsing into confident clusters; (3) demonstrates significant surface distance (SD) improvement across

6 of 8 anatomical structures ( p<0.001p < 0.001), with a 22×22\times asymmetry between significantly improved and degraded hard cases; and (4) validates each component's contribution via two ablations: removing uncertainty guidance achieves 5/8 significant SD anatomical structures; replacing the contrastive term with a boundary loss achieves 4/8, confirming uncertainty guided selection as the decisive factor, improving transition zone, while the contrastive mechanism additionally accounts for bladder. To our knowledge, uncertainty has not been explicitly used as a contrastive structuring signal to improve segmentation robustness.

Figure

Fig. 1: Overview of the proposed Contrastive Uncertainty Learning (CUL) framework. Prostate MRI is processed by a segmentation network to produce voxel wise predictions and an associated uncertainty map. Voxel embeddings are partitioned into low and high uncertainty regions and used to construct contrastive pairs. Low-uncertainty same-class features are pulled together, while high-uncertainty or misclassified features are repelled, improving boundary robustness.