SAM4MLLM: Enhance Multi-Modal Large Language Model for Referring Expression Segmentation

Yi-Chia Chen, Wei-Hua Li, Cheng Sun, Yu-Chiang Frank Wang, Chu-Song Chen

Introduction

Referring Expression Segmentation (RES) is the challenging task of identifying and masking the exact pixels of an object described in natural language. While Multi-Modal Large Language Models (MLLMs) are excellent at understanding complex semantics, they often struggle with spatial precision. Existing solutions typically modify the MLLM architecture with specialized tokens or custom decoders, which increases training complexity and reduces flexibility.

SAM4MLLM introduces a framework that enables MLLMs to perform precise pixel-level segmentation without changing their core architecture. By treating the MLLM as a "prompt generator" for the Segment Anything Model (SAM), the researchers achieve state-of-the-art results using significantly less training data than competing methods.

Methodology

The core innovation of SAM4MLLM is leveraging the MLLM's text-processing capabilities to generate or verify prompt points for SAM. The model is fine-tuned using LoRA and trained solely with standard text cross-entropy loss, avoiding specialized mask losses.

Prompt-Point Generation (PPG)

In the PPG strategy, the MLLM is fine-tuned to directly output a bounding box and a set of "positive" (inside the object) and "negative" (outside the object) points as text strings. These points are then fed into SAM to produce the final mask. During training, a filtering process ensures the sampled points are high-quality.

The PPG training pipeline uses SAM to filter randomly sampled points, which then serve as targets for the MLLM's location proposals.

Proactive Query of Prompt-Points (PQPP)

PQPP is a more sophisticated two-turn dialogue approach based on the insight that verification is easier than generation for MLLMs.

  1. Turn 1: The MLLM identifies a rough bounding box for the target.
  2. Turn 2: The system samples a grid of points within that box and asks the MLLM: "Is this point on the object?"

The MLLM responds with "Yes" or "No," and the points with the highest confidence are used as prompts for SAM. This method is particularly effective for complex reasoning tasks.

The PQPP inference pipeline involves the MLLM identifying prompt points which are then processed by SAM to generate the final predicted mask.

Key Results and Insights

SAM4MLLM demonstrates remarkable efficiency and performance across standard benchmarks like refCOCO, refCOCO+, and refCOCOg.

  • Data Efficiency: Because SAM already understands object boundaries, SAM4MLLM only needs to learn how to "point." It achieved results comparable to models like GLaMM while using 100x fewer images and 10,000x fewer masks during training.
  • State-of-the-Art Performance: On the refCOCOg "val" set, SAM4MLLM (using a LLaVA-1.6-7B backbone) achieved a 74.5 cIoU, outperforming GLaMM-7B (74.2) and LISA-7B (67.9).
  • Zero-Shot Reasoning: On the ReasonSeg benchmark, SAM4MLLM-PQPP achieved a 48.1 cIoU, significantly outperforming the previous state-of-the-art, LISA-13B (46.9), despite being a smaller model.
  • Preserving General Capabilities: Testing on VQAv2 showed that the fine-tuning process did not cause "catastrophic forgetting"; in fact, general visual question-answering performance improved slightly (from 78.2 to 78.7).

Conclusion and Future Work

SAM4MLLM proves that pixel-perfect segmentation can be achieved by MLLMs through intelligent prompting rather than architectural modification. While the PQPP method is currently slower due to its multi-turn nature, its reasoning capabilities and data efficiency mark a significant step forward. Future work will focus on improving inference speed and extending the framework to video-based segmentation tasks.

Summary updated

BibTeX
@inproceedings{chen2024sam,
  author = {Yi-Chia Chen and Wei-Hua Li and Cheng Sun and Yu-Chiang Frank Wang and Chu-Song Chen},
  title = {{SAM4MLLM: Enhance Multi-Modal Large Language Model for Referring Expression Segmentation}},
  booktitle = {European Conference on Computer Vision},
  year = {2024},
  doi = {10.1007/978-3-031-73004-7\_19},
}
Figure