Flaws can be Applause: Unleashing Potential of Segmenting Ambiguous Objects in SAM

Chenxin Li, Yuzhihuang, Wuyang Li, Hengyu Liu, Xinyu Liu, Qing Xu, Zhen Chen, Yue Huang, Yixuan Yuan

TL;DR

Researchers have turned the Segment Anything Model’s (SAM) greatest weakness—its extreme sensitivity to slight prompt changes—into a powerful tool for modeling uncertainty. By wrapping SAM in a probabilistic framework (A-SAM), the authors can now generate a diverse range of plausible segmentation masks for "ambiguous" objects, such as medical lesions where even human experts often disagree on the boundaries.

What Problem Does This Paper Address?

In the world of computer vision, we often treat segmentation as a "solved" problem with a single ground truth. However, in fields like medical imaging or remote sensing, boundaries are often fuzzy. One radiologist might outline a tumor slightly differently than another due to imaging noise or personal interpretation.

SAM's sensitivity to prompt variations and object granularity

The Segment Anything Model (SAM) is a breakthrough, but it has a notable "flaw": it is highly sensitive. As illustrated above, a box prompt shifted by just five pixels can result in a completely different mask or a different level of granularity (e.g., segmenting just the "core" of an object vs. the "whole" object). Usually, researchers try to fix this instability to make the model more robust. This paper asks a different question: What if we use this sensitivity to represent the actual distribution of human uncertainty?

Methods

The authors introduce A-SAM, an optimization framework that "lifts" SAM from a deterministic model to a distributional one using a Conditional Variational Autoencoder (cVAE).

The A-SAM optimization framework architecture

The framework models ambiguity at two distinct "strata":

  1. Context-aware Prompt Ambiguity: They use a Prompt Generation Network (PGN) to model the uncertainty of the input prompts. Instead of a single point or box, the model learns a latent Gaussian distribution of potential prompts tailored to the specific image context.
  2. Granularity-aware Object Ambiguity: They use an Image Generation Network (IGN) to model the inherent structural hierarchy of objects. This allows the model to understand that an object might be validly segmented at different levels of detail.

The "Teacher-Student" Training: To make this work, they use a posterior constraint strategy. During training, a "teacher" network has access to the actual ground-truth labels to define the "true" distribution of ambiguity. A "student" network (the one used at inference) learns to mimic this distribution using only the input image and a basic prompt.

Datasets

The authors evaluated A-SAM across four diverse datasets that capture different types of ambiguity:

  • LIDC-IDRI: Lung CT scans with annotations from four different experts (captures inter-observer variability).
  • BraTS 2017: 3D MRI brain tumor data.
  • ISBI 2016: Dermoscopic images of skin lesions.
  • SIM 10k: A synthetic dataset of cars used to simulate overlapping objects and complex boundaries.

Key Insights and Ideas

  • Weakness as a Feature: The core "aha moment" is realizing that SAM’s sensitivity isn't just noise—it's a high-dimensional map of potential boundaries. By probabilistically modeling the input space, they can "tame" SAM to explore this map controllably.
  • Two-Level Modeling: By separating prompt uncertainty from object granularity, the model can distinguish between "I'm not sure where to look" and "I'm not sure how much of this object to include."
  • Diversity over Averaging: Traditional models often produce a single "blurry" average mask when faced with uncertainty. A-SAM produces a series of sharp, distinct, and "convincing" candidates that reflect the actual range of expert opinions.

Key Results

A-SAM significantly outperformed both standard SAM and existing state-of-the-art ambiguous segmentation models (like Probabilistic U-Net).

  • Quantitative: On the LIDC dataset, A-SAM achieved a Generalized Energy Distance (GED) of 0.228 (lower is better), compared to standard SAM's 0.361. It also saw a massive jump in Hungarian-Matched IoU (HM-IoU), rising from ~0.38 to 0.717.
  • Qualitative: Visualizations show that A-SAM’s generated masks closely mirror the variations seen in labels provided by different medical experts, capturing the "real" ambiguity of the lesions.
  • Robustness: The model proved much more resilient to "noisy" or "jittered" prompts than the original SAM, as the latent distribution effectively filters out minor perturbations.

Limitations and Future Work

While A-SAM is a major step forward, the authors note a few hurdles:

  • Unquantifiable Uncertainty: The nature of uncertainty is still somewhat "uncontrolled." In some scenarios, the model might still struggle to perfectly match the specific type of uncertainty present in a new, unseen domain.
  • Computational Overhead: Because the model samples from a distribution to produce multiple outputs, it is computationally more intensive than a single deterministic forward pass.
  • Future Directions: The authors suggest further research into making the latent distributions even more interpretable, perhaps allowing users to manually "dial" the level of granularity or boundary-fuzziness they want to see.

Summary updated

BibTeX
@inproceedings{li2024flaws,
  author = {Chenxin Li and Yuzhihuang and Wuyang Li and Hengyu Liu and Xinyu Liu and Qing Xu and Zhen Chen and Yue Huang and Yixuan Yuan},
  title = {{Flaws can be Applause: Unleashing Potential of Segmenting Ambiguous Objects in SAM}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=vJSNsSFO95},
}
Figure