ODGEN: Domain-specific Object Detection Data Generation with Diffusion Models

JingYuan Zhu, Shiyu Li, Yuxuan Liu, Jian Yuan, Ping Huang, Jiulong Shan, Huimin Ma

TL;DR

ODGEN is a novel framework that leverages diffusion models to generate high-quality, domain-specific training data for object detection. By utilizing "object-wise" conditioning—encoding each object's text and visual appearance separately—it resolves common generative issues like concept bleeding and poor layout control. This approach leads to massive performance gains (up to 25.3% mAP) for detectors like YOLO.

The Data Scarcity Problem

Deep learning-based object detectors are notoriously data-hungry. While massive datasets exist for general objects (like cars and animals), there is a severe lack of annotated data for specialized domains such as medical imaging, underwater exploration, or specific video games.

Modern AI image generators, specifically diffusion models, seem like a perfect solution to "hallucinate" more training data. However, they face three major hurdles when applied to object detection:

  1. The Domain Gap: Models trained on broad internet data struggle with niche domains. They often do not know what a specific medical anomaly or a rare underwater species looks like.
MRI Tumor Detection
  1. Concept Bleeding: When prompted with multiple objects (e.g., "a red car and a blue truck"), the model often becomes confused, swapping colors or blending attributes.
  2. Spatial Chaos: It is notoriously difficult to force these models to place multiple, overlapping objects exactly where a bounding box dictates.

The ODGEN Solution

The authors introduce ODGEN, which tackles these problems through a multi-stage pipeline designed for precise, controllable generation:

  • Dual-Level Fine-Tuning: Instead of solely fine-tuning a diffusion model on full images, ODGEN also trains on cropped foreground objects. This ensures the model learns the fine-grained textures of the specific objects it needs to detect, prioritizing object fidelity over background aesthetics.
  • Object-wise Text Encoding: Rather than feeding the model one long, complex sentence, ODGEN encodes the name of each object separately using a CLIP text encoder. These individual embeddings are stacked and processed by a trainable encoder, effectively preventing different concepts from "bleeding" into each other.
  • Visual Prompting (Image Lists): To provide a strong spatial anchor, the system generates individual objects, resizes them, and places them onto a blank canvas according to the desired bounding boxes.
Aquarium Layout Control
  • Corrupted Label Filtering: Generative models occasionally fail to render an object properly. ODGEN employs a separate discriminator (a trained ResNet50) to verify if the generated object actually exists in the synthetic image. If it fails this "sanity check," the image is discarded to prevent confusing the detector during training.

Datasets and Evaluation

The researchers evaluated ODGEN across two main areas to prove its versatility:

  • Domain-Specific (RF7): Seven diverse subsets from the Roboflow-100 benchmark, including Apex Game, Robomaster, MRI Image, Cotton, Road Traffic, Aquarium, and Underwater.
  • General Domain: The classic COCO-2014 dataset, utilized to demonstrate that the method remains effective even when real data is abundant.

Key Results

ODGEN significantly outperformed existing state-of-the-art controllable generators (like GLIGEN and ControlNet) in both image quality and downstream detector performance:

  • Massive Performance Boosts: Adding ODGEN-generated data improved YOLOv5 and YOLOv7 performance by up to 25.3% mAP on domain-specific tasks.
  • Superior Image Fidelity: ODGEN achieved significantly lower FID scores (indicating higher image realism) compared to competitors, especially in specialized domains like MRI and underwater scenes.
  • General Domain Success: On the COCO dataset, ODGEN demonstrated a 5.6% mAP advantage over prior methods, proving it is a robust tool beyond just niche, small-dataset applications.

Limitations and Future Work

Despite these impressive results, the authors note a few lingering challenges:

  • The "Realism Gap": A detector trained only on synthetic data still underperforms one trained on real data. There remains an "uncanny valley" in textures that neural networks can detect.
  • Tiny Details: The underlying Variational Autoencoder (VAE) used in Stable Diffusion still struggles with very small details, such as tiny text or UI elements in video games.
  • Pipeline Optimization: The current process of generating individual objects and then composing the final scene is computationally expensive. Future work will likely focus on making this object-wise generation more efficient.

Summary updated

BibTeX
@inproceedings{zhu2024odgen,
  author = {JingYuan Zhu and Shiyu Li and Yuxuan Liu and Jian Yuan and Ping Huang and Jiulong Shan and Huimin Ma},
  title = {{ODGEN: Domain-specific Object Detection Data Generation with Diffusion Models}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=kTtK65vKvD},
}
Figure