GASP, a generalized framework for agglomerative clustering of signed graphs and its application to Instance Segmentation

Alberto Bailoni, Constantin Pape, Nathan Hütsch, Steffen Wolf, Thorsten Beier, Anna Kreshuk, Fred A. Hamprecht

This paper introduces GASP (Generalized Algorithm for Signed graph Partitioning), a unified theoretical framework for hierarchical agglomerative clustering on graphs with both attractive (positive) and repulsive (negative) edge weights. By generalizing standard hierarchical clustering to these "signed graphs," the authors provide a powerful tool for instance segmentation that is efficient, parameter-free, and achieves state-of-the-art results on challenging biological datasets.

TL;DR

GASP is a unified framework that generalizes several popular clustering algorithms for signed graphs, enabling a simple yet highly effective bottom-up approach to instance segmentation. It achieves state-of-the-art accuracy on the CREMI 2016 brain tissue segmentation benchmark by leveraging robust linkage criteria like average-linkage.

What Problem Does This Paper Address?

Most graph-based clustering methods in computer vision rely on positive edge weights, representing similarities or distances. These often require users to pre-specify the number of clusters or a termination threshold. Signed graphs, which include negative weights representing repulsion, are more powerful because the balance between attraction and repulsion naturally defines the optimal number of clusters without extra parameters.

However, existing algorithms for signed graphs—such as the Mutex Watershed or Greedy Agglomerative Edge Contraction (GAEC)—were developed independently. This paper addresses the lack of a unified framework to compare their theoretical properties (like hierarchical consistency) and their empirical performance across different types of noise and graph structures.

Methods

The authors propose the GASP framework, which operates in three phases:

  1. Phase 1: Iteratively merge the most attractive pairs or add "cannot-link" constraints for the most repulsive pairs.
  2. Phase 2: Remove constraints and merge any remaining clusters that still share an attractive interaction.
  3. Phase 3: Continue merging until only one cluster remains to complete the hierarchical tree (dendrogram).

The framework allows for different linkage criteria (how the "interaction" between two groups of nodes is calculated), including Sum, Average, Single, Complete, and Absolute Maximum linkage.

Figure 1. (a) Some iterations of GASP on a graph with attractive (green) and repulsive (red) interactions. At each iteration, the yellow edge with highest weight is contracted (example with sum linkage criterion is shown). (b) Linkage criteria used in this paper demonstrated on two small clusters (see definitions in Table 1 below). (c) Application of GASP to instance segmentation: we show raw data from the CREMI neuron-segmentation challenge and some predictions of our CNN model, where white pixels represent boundary evidence. (d) Seemingly similar linkage criteria can result in very different clustering dynamics, as shown in this example: color coded sequence of merges from early (white) via late (brown) to never (black).
Figure 1: (a) GASP iterations on a signed graph. (b) Visualizing different linkage criteria. (c) The instance segmentation pipeline. (d) How different linkages affect cluster growth.

The authors also provide formal proofs for which combinations of linkage and constraints define an ultrametric (a key property for consistent hierarchies) and which are weight-shift invariant (meaning the result doesn't change if you add a constant to all edge weights).

Conceptual Contribution Table
Table 1: Categorization of algorithms within the GASP framework. Yellow boxes indicate new algorithms introduced in this paper.

Datasets

The framework was evaluated on a diverse set of problems:

  • Synthetic SSBM graphs: Graphs generated with a Signed Stochastic Block Model to test performance against random sign-flip noise.
  • OpenGM Benchmark: Standard signed graph problems including modularity clustering and image segmentation RAGs (Region Adjacency Graphs).
  • CREMI 2016 Challenge: A high-stakes benchmark for segmenting neurons in 3D electron microscopy (EM) volumes of brain tissue.
  • Fruit-Fly Brain Data: Large-scale 3D RAGs derived from EM scans of fruit fly brains.

Key Insights and Ideas

  • Linkage Strategy Matters: The choice of linkage criterion drastically changes how clusters grow. Sum-linkage (GAEC) uses a "flooding" strategy, growing one cluster at a time. While excellent for synthetic graphs with global noise, it performs poorly on images where noise is spatially correlated.
  • Average Linkage is Robust: For instance segmentation, average-linkage (HC-Avg/HCC-Avg) proved to be the most robust against the structured noise typically produced by neural networks.
  • Ultrametrics Found: The authors proved that Mutex Watershed and Average/Single/Complete linkage variants define ultrametrics on signed graphs, providing a solid theoretical foundation for these greedy algorithms.
  • Simplicity vs. Complexity: A simple bottom-up pipeline (CNN predictions followed by GASP) can outperform much more complex, multi-stage pipelines that rely on highly engineered domain-specific superpixels.

Key Results

  • State-of-the-Art: At the time of publication, GASP variants (specifically HCC-Avg) held leading positions on the CREMI challenge leaderboard, outperforming complex spectral clustering and superpixel-based methods.
  • Synthetic Performance: On SSBM graphs, GAEC achieved the highest accuracy, showing that the "best" algorithm depends heavily on the graph's structure and noise type.
  • Efficiency: Despite its generality, the implementation is highly efficient ($O(N^2 \log N)$ worst-case, but much faster on sparse image graphs), processing millions of nodes in seconds.
Failure cases in neuron segmentation
Figure 4: Qualitative comparison on neuron segmentation. Average linkage (right) produces the cleanest results compared to Sum (left) or AbsMax (middle) linkage.

Limitations and Future Work

  • Greedy Nature: As an agglomerative method, GASP is a greedy heuristic. While efficient, it does not guarantee finding the global optimum of the NP-hard multicut objective.
  • Fixed Linkage: The linkage criteria are currently hand-defined. The authors suggest that learning the optimal linkage criterion for a specific task could be a promising future direction.
  • Scalability: While efficient for many tasks, extremely dense graphs with billions of edges still pose a computational challenge for $O(N^2 \log N)$ algorithms.

Summary updated

BibTeX
@inproceedings{bailoni2022gasp,
  author = {Alberto Bailoni and Constantin Pape and Nathan Hütsch and Steffen Wolf and Thorsten Beier and Anna Kreshuk and Fred A. Hamprecht},
  title = {{GASP, a generalized framework for agglomerative clustering of signed graphs and its application to Instance Segmentation}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2022},
  doi = {10.1109/cvpr52688.2022.01135},
}
Figure