Implicit Representations for Constrained Image Segmentation

Jan Philipp Schneider, Mishal Fatima, Jovita Lukasik, Andreas Kolb, Margret Keuper, Michael MoellerICML 2024

Standard image segmentation models, such as U-Net or the Segment Anything Model (SAM), operate on a discrete grid of pixels. While powerful, these models often struggle when faced with occlusions, noisy data, or limited labels. For example, if a tomato is partially hidden behind a branch, a standard model might segment it as two disconnected blobs rather than a single cohesive object.

In classical computer vision, researchers used mathematical "priors" to force segmentations to be convex or connected. However, enforcing these constraints on a pixel grid is computationally brutal—often leading to NP-hard optimization problems or algorithms that scale quadratically with the number of pixels.

This paper introduces a novel method to enforce "hard" geometric constraints—like convexity, symmetry, and path-connectedness—by representing segmentations as Implicit Neural Representations (INRs). By carefully designing the architecture of a coordinate-based neural network, the authors can provably guarantee that the resulting segmentation obeys specific geometric rules, even under heavy occlusion.

Comparison of naive segmentation versus implicit representations enforcing geometric constraints.

How Implicit Representations Enforce Geometry

Instead of predicting a binary mask on a grid, the authors train a small neural network $G(x, y)$ that takes a spatial coordinate as input and outputs a value indicating whether that point is foreground or background. The "magic" lies in the network architecture itself, which mathematically guarantees specific shapes:

  • Convexity: The authors use Input Convex Neural Networks (ICNNs). Because the network is mathematically guaranteed to be convex with respect to its input coordinates, its level sets (the segmented regions) are guaranteed to be convex shapes.
  • Star-Shape: By converting coordinates to polar form $(r, \theta)$ and ensuring the network is convex in the radial direction $r$, they guarantee a star-shaped region centered at a specific point.
  • Path-Connectedness: To represent complex but connected shapes (like an animal behind bars), they compose an ICNN with a diffeomorphism—a smooth, reversible warping of space implemented via normalizing flows like Real NVP. This "warps" a simple convex blob into a complex shape while preserving its fundamental connectedness.
  • Symmetry & Periodicity: By applying periodic functions (like sine/cosine) or absolute value transformations to the input coordinates, they can force the segmentation to be perfectly mirrored (e.g., a butterfly) or repeating (e.g., a perforated metal sheet).

The authors propose two ways to apply these constraints: Sequential Fitting (fitting the implicit shape to the output of a standard model) and Joint Training (using the implicit representation as a "soft penalty" during the training of a standard segmentation network).

Key Insights and Results

The most significant takeaway from this work is that constraints which are nearly impossible to enforce on a discrete grid become trivial when moved to a continuous, functional representation. Unlike "soft" regularizers that merely encourage a property, these architectural choices force it. You cannot get a disconnected result from their path-connected architecture, no matter how noisy the data is.

Spatio-temporal tracking of a rolling ball demonstrating robustness against noise and occlusions.

The researchers evaluated their approach across several datasets, including a custom convexity dataset with sparse "scribble" labels and the FBMS-59 motion segmentation dataset for video sequences.

  • Significant IoU Boosts: On the scribble-based dataset, the "Joint Training" approach significantly boosted Intersection over Union (IoU). For a simple network using only RGB and semantic features, IoU jumped from 0.714 to 0.894 when the convex prior was added. In motion segmentation, adding the path-connectedness prior provided a systematic boost of about 2% IoU across 18 video sequences.
  • Robustness to Noise: The method proved remarkably robust to image corruption. Even when 20% of the input labels were replaced with pure noise, the spatio-temporal prior maintained a stable, accurate shape, suffering only a 3% drop in IoU.
  • Super-Resolution in Space and Time: Because the representation is a continuous function, the segmentation can be evaluated at any sub-pixel coordinate. In videos, this allows for "temporal super-resolution"—predicting an object's position smoothly between frames.

Limitations and Future Directions

While highly effective, the current formulation is primarily designed for segmenting a single foreground object. Using multiple implicit functions for multiple objects is possible but increases complexity. Additionally, mathematically "connected" regions can sometimes be connected via a line that is zero pixels wide; when mapped back to a discrete pixel grid, these connections can disappear, making the object look disconnected to the human eye. Finally, training an implicit representation for every image or sequence adds a layer of optimization that is slower than a simple forward pass of a standard U-Net.

Future work may explore more complex "genus" constraints (shapes with holes) and integrating these priors into large-scale foundation models like SAM to prevent them from breaking objects into disconnected parts under heavy occlusion.

Summary updated

BibTeX
@inproceedings{schneider2024implicit,
  author = {Jan Philipp Schneider and Mishal Fatima and Jovita Lukasik and Andreas Kolb and Margret Keuper and Michael Moeller},
  title = {{Implicit Representations for Constrained Image Segmentation}},
  booktitle = {International Conference on Machine Learning},
  year = {2024},
  url = {https://openreview.net/forum?id=IaV6AgrTUp},
}
Figure