Skip to main content
QUICK REVIEW

[Paper Review] Beyond Generation: Harnessing Text to Image Models for Object Detection and Segmentation

Yunhao Ge, Jiashu Xu|arXiv (Cornell University)|Sep 12, 2023
Multimodal Machine Learning ApplicationsComputer Science3 citations
TL;DR

This paper proposes a novel method to generate high-quality, fully annotated training data for object detection and instance segmentation using text-to-image diffusion models like Stable Diffusion. By decoupling foreground object generation from contextually coherent background synthesis and using language-level interventions to bridge domain gaps, the approach achieves detection performance on par with real-data training and surpasses it when combined with real data.

ABSTRACT

We propose a new paradigm to automatically generate training data with accurate labels at scale using the text-to-image synthesis frameworks (e.g., DALL-E, Stable Diffusion, etc.). The proposed approach1 decouples training data generation into foreground object generation, and contextually coherent background generation. To generate foreground objects, we employ a straightforward textual template, incorporating the object class name as input prompts. This is fed into a text-to-image synthesis framework, producing various foreground images set against isolated backgrounds. A foreground-background segmentation algorithm is then used to generate foreground object masks. To generate context images, we begin by creating language descriptions of the context. This is achieved by applying an image captioning method to a small set of images representing the desired context. These textual descriptions are then transformed into a diverse array of context images via a text-to-image synthesis framework. Subsequently, we composite these with the foreground object masks produced in the initial step, utilizing a cut-and-paste method, to formulate the training data. We demonstrate the advantages of our approach on five object detection and segmentation datasets, including Pascal VOC and COCO. We found that detectors trained solely on synthetic data produced by our method achieve performance comparable to those trained on real data (Fig. 1). Moreover, a combination of real and synthetic data yields even much better results. Further analysis indicates that the synthetic data distribution complements the real data distribution effectively. Additionally, we emphasize the compositional nature of our data generation approach in out-of-distribution and zero-shot data generation scenarios. We open-source our code at https://github.com/gyhandy/Text2Image-for-Detection

Motivation & Objective

  • To address the high cost and scalability limitations of human-annotated datasets for object detection and segmentation.
  • To enable zero-shot and out-of-distribution data generation with minimal human intervention.
  • To leverage the compositional and semantic understanding of text-to-image models for scalable, high-fidelity data synthesis with accurate bounding boxes and segmentation masks.
  • To reduce reliance on expensive real-world annotations while maintaining or improving model performance.
  • To demonstrate that synthetic data generated via this pipeline can effectively complement or even replace real data in training robust detectors.

Proposed method

  • Foreground object generation uses simple textual templates (e.g., 'A [class]') fed into a text-to-image model to produce isolated object images against blank backgrounds.
  • Foreground masks are extracted using a pre-trained instance segmentation model applied to the generated object images.
  • Contextual backgrounds are synthesized by first generating diverse, descriptive captions from a single in-domain image using an image captioning model.
  • These captions are then used as prompts in a text-to-image model to generate a wide variety of contextually coherent background images.
  • Foreground masks are composited onto the generated backgrounds using a cut-and-paste technique to form complete, realistic training images with accurate instance-level annotations.
  • Language-level interventions—such as modifying caption terms (e.g., replacing 'cartoon' with 'real')—are applied to reduce domain shift and align synthetic data distribution with real test data.

Experimental results

Research questions

  • RQ1Can text-to-image models be effectively repurposed to generate fully annotated training data for object detection and instance segmentation?
  • RQ2Can synthetic data generated via this method achieve performance comparable to real-data training on standard benchmarks?
  • RQ3How effective is the method in zero-shot and out-of-distribution settings with minimal real data?
  • RQ4Can language-level modifications to prompts improve alignment between synthetic data distribution and real test data distribution?
  • RQ5Does combining synthetic and real data yield performance gains beyond either alone?

Key findings

  • Detectors trained solely on synthetic data generated by the proposed method achieve mAP scores comparable to those trained on full real datasets, such as COCO and Pascal VOC.
  • Combining synthetic and real data yields a +22.5 mAP performance gain over real-data-only training on the COCO dataset.
  • The method demonstrates strong zero-shot generalization, achieving effective performance even when only class names are available and no real images of the target class exist.
  • Language-level interventions—such as replacing 'cartoon' with 'real' or removing 'people'—improve performance by up to 10.2 mAP in out-of-distribution settings.
  • The compositional nature of the pipeline enables effective data augmentation and domain adaptation without retraining the T2I model.
  • The approach is privacy-preserving, scalable, and requires minimal human involvement, making it suitable for low-resource and rapidly evolving vision tasks.

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.