cs.CVOct 28, 2026

The Power Watershed as a Differentiable Segmentation Layer

Authors: Galia Akl, Laurent Najman, Hugues Talbot

Organizations: AUB · LIGM, KUSTAR · OPIS, CVN

Abstract

Can a Watershed transform, the classical tool of morphological segmentation, be placed at the end of a deep network and trained through? The Power Watershed (PW) is the limit of the seeded Random Walker (RW) as p grows to infinity with edge weights raised to the power p. At every finite p the RW solves a sparse positive-definite linear system and is exactly differentiable with respect to the edge weights and the unaries through one adjoint solve; its multi-label form costs one right-hand side per label, and its limit is the PW. We study this family as the last layer of a segmentation network, the watershed layer (WS layer). A conditioning study measures how the solve, the gradient and the distance to the limit evolve with p, and the implicit gradient is checked against unrolling. On synthetic data with correct edge costs the WS layer transforms a soft prediction into an exact boundary. On nuclei segmentation (PanNuke), a binary WS layer is level with a thresholded U-Net. With the instances as labels, the WS layer turns the U-Net into an instance segmenter whose number of labels is set per image by the markers rather than by the output layout, and the network is trained through that partition: instance F1 score rises from 0.656 to 0.795 over a U-Net with connected components, level with the same network followed by a tuned marker watershed. At the training temperature the partition is a watershed of the learned costs, and the finite temperature lets the solve hedge, discounting weak markers and sharing contested pixels. The hedging puts the WS layer 0.015--0.020 F1 ahead of the baseline when trained on a tenth of the data, at the price of having to deploy the finite-p solve rather than its exact limit at inference. Code and the full experimental record are released.

Explore similar work

Oct 7, 2026

Playing with Kruskal: algorithms for flat and hierarchical watershed cuts

In the framework of edge-weighted graphs, watersheds have proven to be linked to well-known optimization problems, as Minimum Spanning Tree, which allowed the design of efficient algorithms for computing (hierarchical) watershed segmentations. In the present article, after reviewing the literature related to watershed segmentation, we present a detailed end-to-end pipeline of algorithms to compute (hierarchical) watershed segmentations, starting from the computation of graph-based image representations, up to the computation of connected components of the final (hierarchical) segmentation. We consider the several variations of watersheds, including their supervised and unsupervised versions, and the various ways of computing seeds, to name a few. For the first time, we bring together all these watershed notions and algorithms in a compact and understandable way. We aim at providing a reference for those interested in employing and reimplementing the watershed segmentation framework for their task at hand.
Jul 22, 2026

A Unified Variational Framework for Deep Weakly Supervised Image Segmentation

We propose a unified variational framework for image segmentation under sparse pixel-level supervision. Our method is based on a simplex-constrained Potts model with a smooth perimeter regularizer, yielding a convex, smooth energy functional that can be used as a training loss in weakly supervised deep learning paradigms or optimized efficiently using iterative methods. Sparse labels are incorporated into the data fidelity term by constructing a fuzzy membership function via a function extension problem in a Reproducing Kernel Hilbert Space (RKHS), which can effectively capture inhomogeneous intensity statistics. The derived discrete loss for training standard networks demonstrates robustness and consistent improvements over non-training and partial cross-entropy (PCE) baselines in experiments, achieving comparable performance without requiring ground-truth segmentation images.
Jan 22, 2026

Superpixel-Based Image Segmentation Using Squared 2-Wasserstein Distances

We present an efficient method for image segmentation in the presence of strong intensity inhomogeneities. The approach combines two levels of clustering: pixels are first grouped into superpixels using Power-SLIC, which admits a discrete optimal transport (OT) interpretation, and these superpixels are subsequently merged using squared 2-Wasserstein distances between their empirical distributions. We formulate the merging process as an adjacency-constrained hierarchical optimization problem with a regularized objective that accounts for the heterogeneities of previously formed regions. We establish NP-completeness of the associated global optimization problem, even for two final regions and two-bin histograms. For the proposed greedy algorithm, we prove exact recovery under suitable histogram separation conditions and derive an additive approximation bound for the regularized energy. Numerical experiments demonstrate competitive segmentation accuracy on images exhibiting substantial intensity inhomogeneity, while retaining computational efficiency.