Skip to main content
QUICK REVIEW

[Paper Review] Diffusion Model is Secretly a Training-free Open Vocabulary Semantic Segmenter

Jinglong Wang, Xiawei Li|arXiv (Cornell University)|Sep 6, 2023
Multimodal Machine Learning ApplicationsComputer Science7 citations
TL;DR

This paper introduces DiffSegmenter, a training-free open-vocabulary semantic segmentation method that leverages pre-trained text-to-image diffusion models like Stable Diffusion by extracting segmentation maps from self-attention and cross-attention maps in the denoising U-Net. It achieves state-of-the-art performance on PASCAL VOC 2012, MS COCO 2014, and Pascal Context with mIoU up to 70.49% in weakly supervised settings, using no additional training or parameters.

ABSTRACT

The pre-trained text-image discriminative models, such as CLIP, has been explored for open-vocabulary semantic segmentation with unsatisfactory results due to the loss of crucial localization information and awareness of object shapes. Recently, there has been a growing interest in expanding the application of generative models from generation tasks to semantic segmentation. These approaches utilize generative models either for generating annotated data or extracting features to facilitate semantic segmentation. This typically involves generating a considerable amount of synthetic data or requiring additional mask annotations. To this end, we uncover the potential of generative text-to-image diffusion models (e.g., Stable Diffusion) as highly efficient open-vocabulary semantic segmenters, and introduce a novel training-free approach named DiffSegmenter. The insight is that to generate realistic objects that are semantically faithful to the input text, both the complete object shapes and the corresponding semantics are implicitly learned by diffusion models. We discover that the object shapes are characterized by the self-attention maps while the semantics are indicated through the cross-attention maps produced by the denoising U-Net, forming the basis of our segmentation results.Additionally, we carefully design effective textual prompts and a category filtering mechanism to further enhance the segmentation results. Extensive experiments on three benchmark datasets show that the proposed DiffSegmenter achieves impressive results for open-vocabulary semantic segmentation.

Motivation & Objective

  • To address the limitations of discriminative models like CLIP in open-vocabulary semantic segmentation, which lose localization and shape awareness due to contrastive learning.
  • To explore whether generative diffusion models can serve as efficient, training-free semantic segmenters by leveraging their implicit learning of object shapes and semantics.
  • To develop a method that extracts pixel-level segmentation maps from pre-trained diffusion models without additional training or learnable components.
  • To improve segmentation quality through effective textual prompt design and category filtering using the BLIP model.
  • To demonstrate the method’s utility in downstream tasks such as controllable image editing.

Proposed method

  • The method extracts segmentation score maps by combining self-attention maps (representing object shapes) and cross-attention maps (representing semantics) from the denoising U-Net in diffusion models.
  • It uses Bayes’ theorem to invert the conditional generation process $p(x|c)$ into a semantic segmentation posterior $p(c|x)$, enabling pixel-wise category prediction.
  • The approach employs a weighted sum of cross-attention maps from different feature map resolutions (8×8, 16×16, 32×32, 64×64) with empirically tuned weights [0.3, 0.5, 0.1, 0.1] to enhance semantic representation.
  • Self-attention maps from all layers ($\widehat{\mathcal{A}}_{all}^{self}$) are combined to improve boundary completeness and shape awareness.
  • Textual prompts are enhanced using the BLIP model to generate conditional captions and reweight class tokens to emphasize target categories and suppress background activations.
  • Inference uses a single denoising step at t=100 for speed in zero-shot mode, or averaging over multiple timesteps (t=1, 50, 100, 150) for improved performance in weakly supervised settings.

Experimental results

Research questions

  • RQ1Can pre-trained text-to-image diffusion models implicitly learn both object shape and semantic information without explicit training for segmentation?
  • RQ2How can attention maps from the denoising U-Net be leveraged to generate accurate, training-free segmentation maps?
  • RQ3What role do self-attention and cross-attention maps play in capturing shape and semantics, respectively, for segmentation?
  • RQ4How does prompt engineering with BLIP and class token reweighting improve segmentation accuracy and category specificity?
  • RQ5Can the method generalize to weakly supervised and zero-shot settings while outperforming existing discriminative and generative baselines?

Key findings

  • DiffSegmenter achieves an mIoU of 70.49% on the MS COCO 2014 dataset in the weakly supervised setting by averaging results across four denoising timesteps (t=1, 50, 100, 150).
  • Using the weighted sum of cross-attention maps from different resolutions improves performance over simple averaging, with the highest weights assigned to 8×8 and 16×16 features.
  • Incorporating self-attention maps from all layers ($\widehat{\mathcal{A}}_{all}^{self}$) significantly improves segmentation quality, especially for object boundaries.
  • The best performance in zero-shot setting is achieved at t=100, with mIoU of 70.30%, and averaging over multiple timesteps further boosts performance.
  • The method enables more accurate image editing than Prompt-to-Prompt (PTP) by generating more complete and precise foreground masks for attention replacement.
  • The approach achieves competitive results comparable to state-of-the-art methods that require extensive training or mask annotations, but without any fine-tuning or additional parameters.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.