SGDiff: Scene Graph Guided Diffusion Model for Image Collaborative SegCaptioning

Xu Zhang, Jin Yuan, Hanwang Zhang, Guojin Zhong, Yongsheng Zang, Jiacheng Lin, Zhiyong Li

Introduction

In the field of controllable image semantic understanding, the goal is to allow users to interact with AI models through intuitive prompts—such as clicks, bounding boxes, or natural language—to isolate and describe specific visual elements. Despite recent progress, current systems suffer from three primary friction points: high prompting costs, rigid and deterministic outputs, and the propagation of errors in sequential pipelines.

To address these challenges, this paper introduces a novel task called Image Collaborative Segmentation and Captioning (SegCaptioning). Unlike traditional methods that produce a single output, SegCaptioning aims to generate multiple, diverse, and semantically rich interpretations of an object from a minimal prompt (e.g., a single bounding box). To solve this task, the authors propose SGDiff, a diffusion-based model that leverages scene graphs to capture user intent and generates masks and captions in parallel.

The SGDiff Framework

SGDiff moves away from the standard autoregressive approach—where text is generated first and masks follow—to a parallel generation paradigm. This architecture is built upon three core technical innovations:

1. Prompt-Centric Scene Graph Adaptor (PSGA)

A simple bounding box is often ambiguous; it identifies a location but not necessarily the user's specific interest in the object's context. The PSGA converts the image and the user-provided box into a localized scene graph. By filtering out irrelevant background noise and ranking nodes to align with natural language word order, the PSGA acts as a sophisticated "intent filter," providing the model with a structured understanding of the object's relationships to its environment.

2. Scene Graph Guided Bimodal Transformer (SGBTrans)

The SGBTrans serves as the backbone of the diffusion process. During the denoising steps, the model takes noisy caption features and uses cross-attention to fuse them with the clean, structured features from the scene graph. Crucially, SGBTrans is designed to be bimodal: it simultaneously predicts the denoised text tokens and the visual features required for mask generation. This parallel execution ensures that the text and the segmentation masks are co-dependent and mutually reinforcing, rather than being generated in a fragile sequence.

3. Multi-Entities Contrastive Learning (MECL) Loss

Aligning text and masks is inherently difficult because the relationship is rarely one-to-one; for instance, the word "dogs" may correspond to multiple distinct masks in an image. The MECL loss addresses this by enforcing alignment at both the intra-sample and inter-sample levels. By contrasting mask embeddings with word embeddings across the entire batch, the model learns to maintain high semantic consistency between what it describes and what it segments.

Experimental Evaluation

Datasets and Benchmarking

Since SegCaptioning is a new task, the authors adapted two standard benchmarks to support parallel mask-caption evaluation:

  • MSCOCO: The authors synthesized ground-truth pairs by matching existing segmentation masks with specific nouns found in the dataset's captions.
  • Flickr30k Entities: Using the Segment Anything Model (SAM), the authors converted existing bounding boxes into binary masks, which were then mapped to the corresponding entities in the captions.

Quantitative Results

SGDiff demonstrates superior performance over state-of-the-art Multimodal Large Language Models (MLLMs) and sequential models like CAT, SCA, and GLaMM.

  • Accuracy: On MSCOCO, SGDiff achieved 66.3 mIoU for segmentation and 137.4 CIDEr for captioning. This significantly outperforms GLaMM, which reached only 36.2 mIoU and 130.9 CIDEr.
  • Efficiency: By avoiding the heavy computational overhead of autoregressive LLMs, SGDiff operates at 1.18 FPS. This is approximately 8x faster than GLaMM (0.14 FPS) and 2x faster than SCA (0.65 FPS), while maintaining a manageable memory footprint of 14.3 GB.

Key Insights and Discussion

The success of SGDiff highlights two major shifts in multimodal research. First, parallel generation beats sequential generation for tasks requiring tight spatial-semantic alignment. By predicting masks and captions within the same diffusion step, SGDiff eliminates the "cascading error" problem where a single incorrect word in a caption leads to a completely failed segmentation mask.

Second, the results suggest that specialized bimodal architectures can outperform general-purpose MLLMs. While models like GPT-4 or LLaMA are powerful, SGDiff proves that a diffusion model guided by structured scene graphs can achieve better alignment and higher inference speeds for localized image understanding tasks.

Limitations and Future Work

Despite its performance, SGDiff faces challenges in scenarios involving heavy occlusion, such as identifying individuals in a dense crowd where visual boundaries are blurred. Additionally, the model occasionally struggles with overlapping part-to-whole masks (e.g., distinguishing the mask for a "blue coat" from the mask of the "man" wearing it). Future research will focus on improving hierarchical segmentation and robustness in cluttered environments.

Summary updated

BibTeX
@inproceedings{zhang2025sgdiff,
  author = {Xu Zhang and Jin Yuan and Hanwang Zhang and Guojin Zhong and Yongsheng Zang and Jiacheng Lin and Zhiyong Li},
  title = {{SGDiff: Scene Graph Guided Diffusion Model for Image Collaborative SegCaptioning}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2025},
  doi = {10.1609/aaai.v39i10.33113},
}
Figure