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

Introduction

In computer vision and data science, partitioning graphs where nodes represent pixels or regions is a fundamental task. Traditional methods primarily focus on "unsigned" graphs, where edges denote similarity or attraction. These methods often require a pre-specified number of clusters ($k$), a parameter that is frequently unknown in real-world applications.

Signed graphs, which incorporate both positive (attractive) and negative (repulsive) weights, offer a more powerful alternative. They can theoretically determine the "natural" number of clusters by balancing these opposing forces. However, finding the optimal partition—the "multicut" problem—is NP-hard. While various greedy algorithms have been proposed to approximate solutions, they remained fragmented across different literatures. GASP (Generalized Algorithm for Signed graph Partitioning) addresses this by providing a unified theoretical framework that generalizes existing methods and introduces new, robust variations.

Table showing how GASP generalizes existing algorithms (like GAEC and Mutex Watershed) across different graph types and linkage criteria.

The GASP Framework

GASP is a three-phase hierarchical agglomerative clustering algorithm designed to handle the complexities of signed graphs:

  1. Phase 1 (Constrained Merging): The algorithm iteratively merges nodes with the strongest attractive interactions. If a repulsive interaction is encountered, it can be treated as a "cannot-link" constraint, preventing those clusters from merging during this phase.
  2. Phase 2 (Final Partitioning): The constraints are lifted, and any remaining clusters with a net-positive interaction are merged. This phase concludes the partitioning process.
  3. Phase 3 (Dendrogram Completion): Merging continues until a single cluster remains, producing a complete hierarchical tree (dendrogram).

The core of GASP lies in its flexible linkage criteria, which define how interactions between clusters are calculated. The framework explores several criteria, including Sum Linkage (used in GAEC), Average Linkage, Absolute Maximum Linkage (equivalent to Mutex Watershed), and adapted versions of Single and Complete Linkage.

Visual overview of GASP, illustrating the iterative merging process, various linkage criteria, and the instance segmentation pipeline.

Key Insights and Theoretical Properties

The authors' systematic exploration revealed several critical insights:

  • Context-Dependent Performance: There is no universal "best" linkage criterion. While Sum Linkage (GAEC) excels in dense graphs with random noise by averaging out errors, it struggles with the spatially correlated noise typical of grid-graphs (images).
  • The Power of Average Linkage: For image segmentation, Average Linkage (HC-Avg) proved to be the most robust. It effectively handles "structured noise," such as small gaps in predicted boundaries, which often cause other methods to fail.
  • Mathematical Foundation: The framework is grounded in the theory of "weight-based ultrametrics," providing a rigorous justification for why these greedy merges result in meaningful hierarchies.
  • Weight-Shift Invariance: The study identified that Average, Single, and Complete linkages are "weight-shift invariant"—the clustering order remains unchanged if a constant is added to all edge weights—whereas Sum and AbsMax linkages are not.

Experimental Results

GASP was evaluated across diverse benchmarks, including synthetic Signed Stochastic Block Model (SSBM) graphs, standard image segmentation datasets (OpenGM), and large-scale 3D brain imaging data (Knott-3D, Fruit-Fly).

A standout result was achieved in the CREMI 2016 Challenge, a high-stakes competition for 3D neuron segmentation. GASP, utilizing Average Linkage, reached the top of the leaderboard, outperforming complex, heavily engineered pipelines. Notably, GASP is highly efficient, maintaining a worst-case complexity of $O(N^2 \log N)$ while performing significantly faster on the sparse graphs common in image data. Furthermore, its parameter-free nature makes it exceptionally practical for tasks where the number of clusters is unknown.

Conclusion

GASP provides a much-needed unification of agglomerative clustering for signed graphs. By identifying Average Linkage as a superior criterion for structured image data and providing a mathematically sound framework, it sets a new standard for instance segmentation. Future work may explore "top-down" cues or using neural networks to learn optimal linkage criteria for specific data types, further extending the versatility of this bottom-up framework.

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