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

Inspiring the Next Generation of Segment Anything Models: Comprehensively Evaluate SAM and SAM 2 with Diverse Prompts Towards Context-Dependent Concepts under Different Scenes

Xiaoqi Zhao, Youwei Pang, Shijie Chang, Yuan Zhao, Lihe Zhang, Chenyang Yu, Hanqi Liu, Jiaming Zuo, Jinsong Ouyang, Weisi Lin, Georges El Fakhri, Huchuan Lu, Xiaofeng Liu

The Segment Anything Model (SAM) and its successor, SAM 2, have set a new gold standard for general-purpose image and video segmentation. But while they are masters at identifying "things" like cars, people, and bears, how do they handle more abstract "concepts"?

A new paper from researchers at Yale, NTU, and Dalian University of Technology puts SAMs to the test on context-dependent (CD) concepts—tasks where an object's identity is defined by its surroundings, such as camouflage, visual saliency, or medical lesions.

TL;DR

This paper presents the first large-scale, unified evaluation of SAM and SAM 2 across 11 context-dependent concepts using 33 datasets. It reveals that while SAM 2's temporal memory provides a massive boost for video and 3D tasks, both models remain highly sensitive to prompt accuracy and struggle with non-material targets like shadows.

What Problem Does This Paper Address?

Most foundation models for segmentation are trained and evaluated on context-independent (CI) concepts. A car is a car whether it's on a highway or in a forest. However, many critical real-world tasks are context-dependent (CD).

For instance, a "salient" object is only salient because it stands out from its specific background. A "camouflaged" animal is defined by its visual similarity to its environment. Medical lesions and industrial defects are identified by how they deviate from surrounding healthy tissue or pristine components.

The authors argue that the lack of a comprehensive evaluation on these CD concepts hides the performance boundaries of current models, potentially stalling the design of the next generation—SAM 3.

Visual comparison between context-independent (CI) and context-dependent (CD) concepts. CI objects maintain their definition regardless of background, while CD concepts lose meaning when isolated.

Methods

The researchers developed a unified evaluation framework to test SAM and SAM 2 across diverse scenarios:

  • Diverse Prompting Modes: They tested standard point, box, and "everything" (automatic) prompts. They also explored SAM 2’s In-Context Learning (ICL) capability by providing 20 exemplar image-mask pairs as prompts.
  • Bidirectional Inference for 3D Data: To handle 3D medical volumes (like CT or MRI scans), they proposed a strategy that identifies an "anchor" slice with the largest foreground and propagates segmentation masks forward and backward through the sequence.
  • Prompt Robustness Testing: Recognizing that real-world users aren't perfect, they introduced random perturbations (shifting coordinates, scaling boxes, eroding masks) to see how much "noise" the models could handle before failing.

Datasets

The study utilized a massive benchmark of 33 datasets covering 11 CD concepts across three domains:

  • Natural Scenes: Salient objects, camouflaged objects, shadows, and transparent objects.
  • Medical Scenes: Polyp lesions, skin lesions, lung infections (COVID-19), brain tumors, and breast lesions.
  • Industrial Scenes: Power battery defects and surface anomalies.

These include 2D images, videos, and 3D medical volumes, representing the most comprehensive CD-oriented evaluation to date.

Key Insights and Ideas

  • Box Prompts are the "Gold Standard": Across almost all 11 concepts, box prompts yielded the best results. They act as a powerful spatial constraint that filters out distracting background context, which is the primary bottleneck for CD tasks.
  • SAM 2’s Temporal Advantage: SAM 2 significantly outperforms SAM in video and 3D settings. Its built-in memory mechanism stabilizes object identity, reducing the "flicker" and fragmentation often seen when SAM processes video frame-by-frame.
  • The "Everything" Mode Struggle: Both models perform poorly in fully automatic mode for CD concepts. Because these concepts often lack clear material boundaries (like a shadow) or are extremely small, the models' internal "objectness" filters often ignore them.
  • Extreme Sensitivity to Noise: The robustness tests showed that SAMs are surprisingly brittle. Small displacements in a point prompt or slight inaccuracies in a bounding box can lead to total segmentation collapse.
Fig. 1: Organization. (1) A unified evaluation framework for SAM and SAM 2; (2) Comprehensive evaluation for 11 different context-dependent concepts; (3) Outlook of SAM 3.

Key Results

  • Video Performance: SAM 2 with multi-frame mask prompts improved camouflaged object detection (COD) error (MAE) by 60% compared to SAM.
  • 3D Medical Success: In 3D brain tumor segmentation, the proposed bidirectional strategy helped SAM 2 achieve a Dice score 16% higher than specialized models like DRUNet.
  • Failure Cases: Both models failed significantly on "non-material" targets. For shadow detection, the Balanced Error Rate (BER) remained high (>0.15), and for battery plate detection, accuracy was near zero without precise manual prompts.
  • ICL Potential: SAM 2 in In-Context Learning mode (using 20 exemplars) outperformed its own automatic mode on several tasks, though it still trailed behind specialized CD models like Spider.

Limitations and Future Work

The authors provide a roadmap for "SAM 3," suggesting several areas for improvement:

  1. Architecture: Moving prompt embedding to different positions (like "tail embedding") might help the model better distinguish between similar-looking foreground and background features.
  2. Training Data: There is a dire need for a large-scale "CI-CD joint benchmark" to train models on both intrinsic object features and contextual relationships simultaneously.
  3. New Prompt Types: Future models should support more diverse prompts, such as depth maps, infrared data, or even learnable parameter cues that can adapt to specific degradation types (like blur or noise).
  4. Robustness: Engineering models to be more resilient to imperfect user prompts is essential for reliable real-world deployment.

Summary updated

BibTeX
@misc{zhao2024inspiring,
  author = {Xiaoqi Zhao and Youwei Pang and Shijie Chang and Yuan Zhao and Lihe Zhang and Chenyang Yu and Hanqi Liu and Jiaming Zuo and Jinsong Ouyang and Weisi Lin and Georges El Fakhri and Huchuan Lu and Xiaofeng Liu},
  title = {{Inspiring the Next Generation of Segment Anything Models: Comprehensively Evaluate SAM and SAM 2 with Diverse Prompts Towards Context-Dependent Concepts under Different Scenes}},
  year = {2024},
  eprint = {2412.01240},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2412.01240},
}
Figure