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

InterFormer: Real-time Interactive Image Segmentation

You Huang, Hao Yang, Ke Sun, Shengchuan Zhang, Guannan Jiang, Rongrong Ji, Liujuan Cao

Abstract

Interactive image segmentation is a critical component of efficient data annotation workflows, yet existing methods often struggle with computational redundancy and high latency. This paper presents InterFormer, a novel framework that achieves state-of-the-art accuracy and real-time performance by decoupling the segmentation process. By separating heavy image feature extraction from lightweight interaction logic, InterFormer enables fluid, responsive segmentation even on CPU-only devices. The core of the architecture is the Interactive Multi-head Self-Attention (I-MSA) module, which treats user interactions as queries to efficiently refine segmentation masks.

Introduction

Interactive image segmentation allows users to guide a model toward a desired object mask through a series of positive and negative clicks. While powerful, current approaches face two primary bottlenecks. First, they exhibit "serial redundancy," where the entire image is re-processed for every new click, despite the image content remaining static. Second, because each interaction depends on the feedback from the previous step, the process is inherently serial, preventing effective utilization of GPU parallelism. InterFormer addresses these challenges by introducing a decoupled pipeline that optimizes both computational efficiency and segmentation quality.

Methodology

Decoupled Pipeline

The InterFormer architecture splits the segmentation task into two distinct stages:

  1. Offline Feature Encoding: A high-capacity Vision Transformer (ViT) processes the input image once to extract multi-scale features. This computationally intensive step occurs before user interaction begins and can be offloaded to high-performance hardware.
  2. Online Interactive Decoding: During the interaction phase, only a lightweight decoder runs. This module utilizes the pre-computed features, significantly reducing the per-click latency.

Interactive Multi-head Self-Attention (I-MSA)

The technical heart of the decoder is the I-MSA module. Unlike standard self-attention, I-MSA reformulates the attention mechanism by treating user clicks as the "Query" ($Q$) and the cached image features as the "Key" ($K$) and "Value" ($V$). This allows the model to perform a targeted similarity search, instantly identifying image regions that correspond to the user's input. For example, a single click on an object allows the attention mechanism to propagate that information across similar features throughout the image.

Zoom-In Strategy and Click Embedding

To further enhance precision and efficiency, InterFormer employs a zoom-in strategy. Once an initial object area is identified, the model focuses its attention on a cropped Region of Interest (RoI). Additionally, clicks are converted into a categorical mask (e.g., "definite foreground," "possible background") and mapped to learnable vectors, which are then fused with the multi-scale image features to guide the decoder.

Experimental Evaluation

Datasets and Benchmarks

InterFormer was evaluated on several standard benchmarks, including GrabCut, Berkeley, SBD, and DAVIS. Training was conducted using the COCO and LVIS datasets. To provide a more accurate measure of efficiency, the authors proposed a new metric: Pixel-wise Inference Efficiency (PIE). Unlike the standard Seconds Per Click (SPC), PIE accounts for different resizing strategies, offering a more robust comparison of how models handle objects of varying scales.

Performance and Accuracy

Results demonstrate that InterFormer-Tiny reaches a 90% Intersection over Union (IoU) on the SBD dataset within just four initial clicks. Notably, the model maintains high performance across all object sizes. While some lightweight competitors struggle with large objects due to aggressive downsampling, InterFormer’s multi-scale feature approach ensures robustness. Most importantly, the model achieves real-time performance on CPU-only devices, making it accessible for crowdsourced annotators using standard hardware.

Discussion and Limitations

While InterFormer offers significant advantages in interaction speed, it introduces a one-time "offline" latency cost for the initial ViT encoding. For tasks requiring only one or two clicks, this initial overhead may result in a higher total time compared to simpler end-to-end models. Furthermore, caching high-dimensional multi-scale features increases the memory footprint. However, for complex annotation tasks requiring multiple refinements, the cumulative time savings and responsiveness of the decoupled pipeline provide a superior user experience.

Conclusion

InterFormer represents a significant step forward in making interactive segmentation truly real-time. By leveraging a decoupled architecture and the I-MSA module, it balances the need for high-quality features with the requirement for low-latency interaction. Future work may explore optimizing the I-MSA module for even lower-power mobile deployment or extending the framework to video object segmentation to maintain temporal consistency across frames.

Summary updated

BibTeX
@inproceedings{huang2023interformer,
  author = {You Huang and Hao Yang and Ke Sun and Shengchuan Zhang and Guannan Jiang and Rongrong Ji and Liujuan Cao},
  title = {{InterFormer: Real-time Interactive Image Segmentation}},
  booktitle = {IEEE/CVF International Conference on Computer Vision},
  year = {2023},
  url = {https://openreview.net/forum?id=6-cmmk--il},
}
Figure