NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Learned Watershed: End-to-End Learning of Seeded Segmentation

Steffen Wolf, Lukas Schott, Ullrich Köthe, Fred A. Hamprecht

Abstract

Learned boundary maps are known to outperform handcrafted ones as a basis for the watershed algorithm. We show, for the first time, how to train watershed computation jointly with boundary map prediction. The estimator for the merging priorities is cast as a neural network that is convolutional (over space) and recurrent (over iterations). The latter allows learning of complex shape priors. The method gives the best known seeded segmentation results on the CREMI segmentation challenge.

Introduction

The watershed algorithm remains a staple in computer vision for segmenting objects with complex, spindly morphologies, such as neurons in biological electron microscopy images. Traditionally, watershed pipelines consist of three independent stages: altitude (edge map) computation, seed definition, and region assignment via "flooding" from seeds.

A critical limitation of this decoupled approach is that the edge detector is typically trained using a pixel-wise loss. Such losses do not explicitly penalize small boundary gaps, which are topologically catastrophic for the watershed algorithm as they lead to "leaks" and incorrect region mergers. This paper addresses this by introducing the first end-to-end trainable watershed framework, where the edge detector and the flooding process are optimized jointly.

Methods

The proposed method treats edge-based watershed as a Minimum Spanning Forest (MSF) problem, enabling a differentiable formulation.

Structured Learning and Root Errors

To directly address topological failures, the authors move beyond pixel-wise loss to a "perceptron loss" based on topographic distances. The training process identifies root error edges—the specific edges where a segmentation first deviates from the ground truth (e.g., a missing cut that allows a region to leak). Gradients are then applied specifically to these locations to adjust their "altitude," effectively teaching the model to "close the gaps" that matter most for the final segmentation.

Identification of a 'root error' edge where a missing cut leads to a segmentation leak.

Dynamic Altitude Prediction and Recurrent Priors

A key innovation is the transition from static edge maps to on-demand altitude prediction ($f_{dyn}$). During the flooding process, a recurrent CNN (utilizing Gated Recurrent Units) computes altitudes based on the current partial segmentation. This allows the model to incorporate complex shape priors; if a growing region begins to take an unnatural shape, the model can dynamically increase edge altitudes to prevent further growth in that direction.

Visualization of the learned watershed process: (a) input image with seeds, (b) resulting growth paths, and (c) topographic distance profiles with associated loss gradients.

Results

The "Learned Watershed" approach was rigorously evaluated on synthetic and high-stakes biological datasets.

  • Artificial Data: On benchmarks using noisy 2D Gaussian processes, the learned approach ($L_{SL} + f_{dyn}$) significantly outperformed standard CNN-watershed pipelines. At high noise levels ($\sigma = 0.9$), it achieved an ARAND error of 32.2, compared to 33.4 for a standard pipeline and 55.0 for raw watershed.
  • CREMI Challenge: On the task of neurite segmentation in Electron Microscopy (EM) images, the method achieved a state-of-the-art ARAND of 0.082, surpassing the previous best heuristic (Distance Transform Watershed) and other established baselines like Power Watershed and Random Walker.

Conclusion

By formulating watershed as a differentiable, recurrent process, this work transforms a passive flooding algorithm into an active, context-aware agent. The model's ability to dynamically adjust to the evolving segmentation and directly penalize topological errors leads to superior accuracy in challenging domains like neurite segmentation. Future work will focus on automating seed definition and extending the framework to 3D volumes.

Summary updated

BibTeX
@inproceedings{wolf2017learned,
  author = {Steffen Wolf and Lukas Schott and Ullrich Köthe and Fred A. Hamprecht},
  title = {{Learned Watershed: End-to-End Learning of Seeded Segmentation}},
  booktitle = {IEEE/CVF International Conference on Computer Vision},
  year = {2017},
  url = {https://openreview.net/forum?id=B1WkFlzuZB},
}
Figure