Skip to main content
QUICK REVIEW

[Paper Review] DiffuMask: Synthesizing Images with Pixel-level Annotations for Semantic Segmentation Using Diffusion Models

Weijia Wu, Yuzhong Zhao|arXiv (Cornell University)|Mar 21, 2023
Generative Adversarial Networks and Image SynthesisComputer Science9 citations
TL;DR

DiffuMask automatically generates high-resolution semantic masks from cross-attention maps in text-guided diffusion models to create large-scale synthetic data for semantic segmentation, achieving competitive real-data performance and state-of-the-art zero-shot results on VOC 2012.

ABSTRACT

Collecting and annotating images with pixel-wise labels is time-consuming and laborious. In contrast, synthetic data can be freely available using a generative model (e.g., DALL-E, Stable Diffusion). In this paper, we show that it is possible to automatically obtain accurate semantic masks of synthetic images generated by the Off-the-shelf Stable Diffusion model, which uses only text-image pairs during training. Our approach, called DiffuMask, exploits the potential of the cross-attention map between text and image, which is natural and seamless to extend the text-driven image synthesis to semantic mask generation. DiffuMask uses text-guided cross-attention information to localize class/word-specific regions, which are combined with practical techniques to create a novel high-resolution and class-discriminative pixel-wise mask. The methods help to reduce data collection and annotation costs obviously. Experiments demonstrate that the existing segmentation methods trained on synthetic data of DiffuMask can achieve a competitive performance over the counterpart of real data (VOC 2012, Cityscapes). For some classes (e.g., bird), DiffuMask presents promising performance, close to the stateof-the-art result of real data (within 3% mIoU gap). Moreover, in the open-vocabulary segmentation (zero-shot) setting, DiffuMask achieves a new SOTA result on Unseen class of VOC 2012. The project website can be found at https://weijiawu.github.io/DiffusionMask/.

Motivation & Objective

  • Demonstrate that cross-attention maps in text-conditioned diffusion models can localize class-specific regions for precise masks without manual annotations.
  • Develop an automatic pipeline to generate high-resolution images and pixel-level semantic masks from text prompts.
  • Improve mask quality via adaptive binarization, noise learning, and prompt/data augmentation to bridge domain gaps.
  • Evaluate diffusion-based synthetic data for standard and open-vocabulary semantic segmentation across multiple datasets.

Proposed method

  • Extract cross-attention maps at multiple resolutions and layers from Stable Diffusion during text-driven image synthesis.
  • Aggregate and normalize cross-attention maps to form class-specific probability maps for mask creation.
  • Convert probability maps to binary masks using adaptive thresholding guided by affinity learning (AffinityNet) to select suitable gamma per image/category.
  • Refine masks with Dense CRF and introduce Noise Learning to prune low-quality synthetic labels.
  • Enhance data diversity through prompt engineering (sub-classes and retrieval-based prompts) and various data augmentations (Splicing, blur, occlusion, perspective) to reduce domain gap.
  • Train segmentation models (e.g., Mask2Former) on the synthetic DiffuMask data and optionally fine-tune on real data to improve performance.
((a)) Cross attention maps of different text tokens.
((a)) Cross attention maps of different text tokens.

Experimental results

Research questions

  • RQ1Can cross-attention maps in text-guided diffusion models provide reliable, high-resolution, class-discriminative masks without manual annotations?
  • RQ2Does synthetic data generated via DiffuMask yield competitive semantic segmentation performance on real datasets such as VOC 2012, Cityscapes, and ADE20K?
  • RQ3How effective are adaptive thresholding, prompt engineering, noise learning, and data augmentations in improving mask quality and cross-domain generalization (including open-vocabulary segmentation)?

Key findings

  • Segmentation models trained on DiffuMask achieve competitive mIoU on VOC 2012 (e.g., 70.6 with Swin-B backbone) compared to real-data training (84.3).
  • DiffuMask performance on Bird and Dog classes approaches real-data performance, with gaps within single-digit to low double-digit margins depending on class.
  • In Cityscapes, DiffuMask attains 79.6 mIoU for Vehicle/Human versus 90.8 mIoU when trained on real data, demonstrating strong cross-domain capability.
  • On ADE20K, DiffuMask with 6k synthetic examples yields competitive results relative to 20.2k real examples, with best-performing class reaching 73.4 mIoU for Car.
  • In open-vocabulary (zero-shot) segmentation on VOC 2012 unseen classes, DiffuMask achieves state-of-the-art results among synthetic-data-based approaches.
  • Ablation studies show adaptive thresholding, prompt engineering (sub-classes and retrieval-based prompts), noise learning, and diverse augmentations each contribute gains in mIoU.
((b)) Cross attention maps of different resolutions.
((b)) Cross attention maps of different resolutions.

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.