Open-vocabulary Object Segmentation with Diffusion Models

Ziyi Li, Qinye Zhou, Xiaoyun Zhang, Ya Zhang, Yanfeng Wang, Weidi Xie

Abstract

The goal of this research is to extract visual-language correspondence from pre-trained text-to-image diffusion models in the form of segmentation maps. We propose a novel grounding module that aligns the visual and textual embedding spaces of a model like Stable Diffusion. By establishing an automatic pipeline for constructing synthetic datasets, we demonstrate that this module can segment objects beyond those seen during training. Furthermore, training standard segmentation models on this synthetic data yields competitive performance on zero-shot segmentation (ZS3) benchmarks, highlighting the potential of generative models for discriminative tasks.

Introduction: Beyond Generation

Text-to-image diffusion models have revolutionized our ability to generate photorealistic images from simple text prompts. However, these models typically function as "black boxes" regarding spatial awareness; while they can render a complex scene, they do not natively provide pixel-level localization of the objects they create. Traditional semantic segmentation, meanwhile, is often bottlenecked by the high cost of manual labeling and a "closed vocabulary" limited to specific training categories.

This paper addresses the challenge of Open-vocabulary Object Segmentation by tapping into the latent knowledge of generative models. The core insight is that if a model can draw a specific entity, it must internally possess the spatial information required to segment it. By "grounding" these generative capabilities, we can create an infinite source of synthetic training data for complex visual tasks.

Methodology: The Grounding Module and Data Pipeline

The researchers introduce a lightweight grounding module appended to a frozen Stable Diffusion backbone. This module consists of three primary components:

  1. Visual Encoder: Extracts and fuses multi-scale feature maps from the U-Net's intermediate layers to capture both high-level semantics and fine-grained spatial details.
  2. Text Encoder: Utilizes CLIP text embeddings of object names to maintain alignment with the diffusion model's latent space.
  3. Fusion Module: A Transformer decoder that treats text embeddings as "queries" to attend to visual features, outputting precise per-segmentation embeddings.

To train this module without manual intervention, the authors developed an automatic data construction pipeline. They use an off-the-shelf detector (e.g., Mask R-CNN) to label images generated by the diffusion model. Although the detector is limited to a few classes (like the 80 COCO categories), the grounding module learns the underlying relationship between text queries and visual features, allowing it to generalize to any prompt.

Simultaneous generation and segmentation of a lion.

Open-Vocabulary Inference and Generalization

A key strength of this approach is its ability to segment "unseen" objects. Because the grounding module is aligned with the shared CLIP/Stable Diffusion embedding space, it can segment any concept the base model can generate—ranging from fictional characters like "Pikachu" to complex robotic entities. This "visual instruction tuning" on a small set of common categories (e.g., 20 PASCAL classes) enables the model to generalize to a virtually infinite vocabulary simply by changing the text prompt.

Key Results: Synthetic Data as a Superpower

The study demonstrates that generative models can serve as "infinite" sources of pixel-level supervision. The researchers generated a synthetic dataset of over 110,000 image-mask pairs to train downstream discriminative models.

  • Zero-Shot Performance: On the PASCAL VOC zero-shot benchmark, their "Model-E" achieved a 74.4 mIoU on unseen categories, significantly outperforming previous state-of-the-art models like ZegFormer (63.6 mIoU).
  • Superior Grounding: The model significantly outperformed DAAM (a previous baseline for interpreting diffusion maps), particularly in complex scenes with multiple objects.
  • Scalability: Performance on unseen categories improved consistently as the number of synthetic training images increased, proving the value of the automated pipeline.
Segmentation masks for a complex scene containing a fox and a basketball.

Conclusion and Future Directions

This work opens new opportunities for using powerful generative models in discriminative tasks. By extracting spatial grounding from diffusion models, the authors provide a path toward scalable, open-vocabulary segmentation without the need for exhaustive manual labeling.

Future work may address current limitations, such as the module's focus on nouns rather than complex interactions (e.g., "a dog chasing a ball") and the potential for further performance gains by co-training the generator and the grounding module to improve both image quality and mask precision.

Summary updated

BibTeX
@inproceedings{li2023open,
  author = {Ziyi Li and Qinye Zhou and Xiaoyun Zhang and Ya Zhang and Yanfeng Wang and Weidi Xie},
  title = {{Open-vocabulary Object Segmentation with Diffusion Models}},
  booktitle = {IEEE/CVF International Conference on Computer Vision},
  year = {2023},
}
Figure