Rethinking Interactive Image Segmentation with Low Latency, High Quality, and Diverse Prompts

Qin Liu, Jaemin Cho, Mohit Bansal, Marc NiethammerCVPR 2024

Abstract

The goal of interactive image segmentation is to delineate specific regions within an image via visual or language prompts. Low-latency and high-quality interactive segmentation with diverse prompts remain challenging for existing specialist and generalist models. Specialist models, with their limited prompts and task-specific designs, experience high latency because the image must be recomputed every time the prompt is updated, due to the joint encoding of image and visual prompts. Generalist models, exemplified by the Segment Anything Model (SAM), have recently excelled in prompt diversity and efficiency, lifting image segmentation to the foundation model era. However, for high-quality segmentations, SAM still lags behind state-of-the-art specialist models despite SAM being trained with x100 more segmentation masks. In this work, we delve deep into the architectural differences between the two types of models. We observe that dense representation and fusion of visual prompts are the key design choices contributing to the high segmentation quality of specialist models. In light of this, we reintroduce this design into the generalist models, to facilitate the development of generalist models with high segmentation quality. To densely represent diverse visual prompts, we propose to use a dense map to capture five types: clicks, boxes, polygons, scribbles, and masks. Thus, we propose SegNext, a next-generation interactive segmentation approach offering low latency, high quality, and diverse prompt support. Our method outperforms current state-of-the-art methods on HQSeg-44K and DAVIS, both quantitatively and qualitatively.

Introduction

Interactive image segmentation allows users to delineate objects by providing prompts like clicks or bounding boxes. Currently, the field is split into two distinct paradigms:

  1. Specialist Models: These are highly accurate but suffer from high latency. Because they encode the image and the user's prompts together (joint encoding), the entire heavy image backbone must be re-run every time the user adds a single click.
  2. Generalist Models (e.g., SAM): These are fast because they decouple image and prompt encoding, processing the image once and then "fusing" prompts later. However, they typically represent prompts as "sparse vectors" (points in space), which can lose critical spatial detail, leading to lower-quality masks, especially for complex boundaries.
Comparison of interactive segmentation architectures showing the evolution from specialist to generalist models with dense fusion.

The challenge is to create a model that is fast (low latency), accurate (high quality), and flexible (supports diverse prompt types).

Methods

The core innovation of SegNext is the dense representation and fusion of visual prompts within a decoupled architecture. By reintroducing dense spatial representations for diverse prompts—including clicks, boxes, scribbles, and polygons—into a decoupled architecture, SegNext achieves state-of-the-art accuracy with significantly lower latency than previous high-quality methods.

Detailed architecture of the SegNext framework illustrating the dense map representation and fusion process.

Decoupled Architecture

Like SAM, SegNext uses a heavy image encoder (ViT-Base) to process the image once. User interactions are processed by a separate, lightweight prompt encoder. This decoupling is the key to achieving low latency during interactive sessions.

Three-Channel Dense Map

Instead of converting clicks to simple coordinates, SegNext maps all visual prompts onto a 1024x1024 three-channel map:

  • Channel 1: Positive clicks and scribbles (foreground).
  • Channel 2: Negative clicks and scribbles (background).
  • Channel 3: Previous mask predictions (for iterative refinement).

Diverse Prompt Support and Fusion

Boxes are represented as four negative clicks at the corners, while polygons and scribbles are treated as sets of clicks. The prompt map is processed by a small convolutional "patch embedding" layer. These embeddings are added element-wise to the image embeddings and then refined through self-attention blocks before being passed to a lightweight decoder.

Key Results

SegNext was benchmarked on HQSeg-44K and DAVIS (video object segmentation), as well as out-of-domain medical datasets like ssTEM and BraTS.

  • Superior Accuracy: On the HQSeg-44K benchmark, SegNext (91.75 mIoU) outperformed the original SAM (86.16) and even the specialized HQ-SAM (89.85).
  • Low Latency: SegNext is significantly faster than previous state-of-the-art specialist models. For example, it reduced the latency of the "Segment Anything Task" (SAT) from ~70 seconds (SimpleClick) to ~17 seconds.
  • Robust Generalization: Despite being trained on natural images (COCO + LVIS), SegNext performed competitively on medical imaging without the specialized "zoom-in" tricks often required by other models.
  • Prompt Flexibility: It successfully handles "unseen" prompts like scribbles and polygons, outperforming SAM's ability to process dense visual inputs.

Conclusion

SegNext bridges the gap between specialist and generalist models by identifying that dense maps preserve the spatial context necessary for high-quality boundary refinement. While dense representations are slightly more memory-intensive than sparse vectors, they eliminate the primary latency bottleneck: joint encoding. Future work may explore downsampled dense representations to further optimize memory usage and scaling to larger backbones like ViT-Large or ViT-Huge to push the boundaries of segmentation quality.

Summary updated

BibTeX
@inproceedings{liu2024rethinking,
  author = {Qin Liu and Jaemin Cho and Mohit Bansal and Marc Niethammer},
  title = {{Rethinking Interactive Image Segmentation with Low Latency, High Quality, and Diverse Prompts}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2024},
  url = {https://openreview.net/forum?id=lp5yDf5Ebj},
}
Figure