Gen2Det: Generate to Detect

Saksham Suri, Fanyi Xiao, Animesh Sinha, Sean Chang Culatana, Raghuraman Krishnamoorthi, Chenchen Zhu, Abhinav Shrivastava

TL;DR

Gen2Det is a modular pipeline that leverages grounded diffusion models to generate high-quality, scene-centric synthetic data for training object detectors. By combining realistic inpainting with multi-stage filtering and a specialized training recipe, it significantly boosts detection performance, particularly for rare objects and in low-data scenarios, without requiring expensive manual labeling.

What Problem Does This Paper Address?

Deep learning-based object detectors are data-hungry. While datasets like COCO and LVIS provide thousands of labeled images, they suffer from two major issues: the "long tail" (where rare objects have very few examples) and the high cost of manual annotation.

Previous attempts to use synthetic data often relied on "copy-paste" methods—generating an object in isolation and pasting it onto a random background. As shown in the top of Figure 1, this often results in unrealistic scenes that don't respect natural layouts (like a bicycle floating on a bed). Furthermore, these methods often require complex, error-prone segmentation masks to extract the foreground. Gen2Det aims to simplify this by generating realistic, scene-centric images that respect the original image's context.

Figure 1

Methods

The Gen2Det pipeline consists of three main stages:

  1. Grounded Generation: Instead of pasting, the authors use a state-of-the-art grounded inpainting diffusion model. They take an existing image, mask out regions based on bounding box annotations, and ask the model to "fill in" those boxes with new instances of a specific class. This ensures the new objects fit naturally into the surrounding environment.
  2. Two-Stage Filtering: Synthetic data isn't perfect; models often "hallucinate" or produce artifacts.
  3. Image-level: An aesthetic classifier discards globally poor generations.
  4. Instance-level: A detector trained on real data checks the generated objects. If the detector can't find the object in the box where it was supposed to be generated, that specific annotation is removed.
  5. Modified Training Recipe: To best utilize this data, the authors introduce two tweaks:
  6. Batch Sampling: They interleave batches of real and synthetic data (using a sampling probability $p=0.2$) to ensure the model doesn't overfit to synthetic noise.
  7. Background Ignore: If a region was filtered out during the instance-level check but the object is still visually present, the training loss for that area is ignored. This prevents the model from being penalized for "correctly" detecting a hallucinated object that lacks a label.

The full pipeline is illustrated in Figure 2.

Figure 2. Gen2Det: our proposed pipeline for generating and utilizing synthetic data for object detection and segmentation. Gen2Det starts by generating grounded inpainted images using state-of-art diffusion model. The generated images are then filtered at image and instance level to remove globally bad images as well as individual instances which might be low quality or have hallucinations. Finally, we train object detection and segmentation models using the filtered data along with our improved training methodology by intro- ducing sampling and background ignore.

Datasets

The authors evaluated Gen2Det on two primary benchmarks:

  • LVIS: A large-vocabulary dataset with over 1,200 categories, known for its extreme long-tail distribution.
  • COCO: The standard benchmark for object detection (80 categories).
  • LD-COCO (Low-Data COCO): Artificially created subsets of COCO (ranging from 1% to 50% of the original data) to simulate scenarios where labeled data is scarce.

Key Insights and Ideas

  • Context is King: Generating objects within a scene (inpainting) is superior to pasting them on top. It allows the model to learn from realistic occlusions and lighting.
  • Filtering is Essential: The paper demonstrates that naively mixing synthetic and real data can actually hurt performance. The filtering stages are critical for removing "garbage" that confuses the detector.
  • The "Ignore" Strategy: Simply removing a bad label isn't enough because the pixels for the bad object still exist. By telling the detector to "ignore" those pixels during training, the authors prevent the model from learning incorrect background features.
  • Efficiency: Because Gen2Det works with bounding boxes rather than masks, it is roughly 3.4x faster to train than previous state-of-the-art synthetic data methods like XPaste.

Key Results

Gen2Det shows consistent improvements across various architectures (Faster R-CNN, Mask R-CNN, CenterNet2):

  • Long-Tailed Success: On LVIS, the method improved Box AP for rare categories by 2.94 points and Mask AP by 2.88 points over vanilla training.
  • Low-Data Regime: In the 1% COCO setting, Gen2Det provided a massive boost of +3.08 Box AP and +2.55 Mask AP.
  • General Performance: Even on the full COCO dataset, it provided a robust gain of 0.45 Box AP, proving it isn't just for niche cases.

Qualitative examples of these generations can be seen in Figure 3, where the model creates varied, realistic versions of the same scene layout.

Figure 3. Examples of generations using the inpainting diffusion model on the COCO dataset. The first and fifth columns correspond to the original COCO images and the rest of the columns are generations with different seeds. These generated images are then fed to our filtering pipeline for further processing before use in training.

Limitations and Future Work

The authors note that while adding synthetic data helps, there is a point of diminishing returns. Increasing the amount of synthetic data beyond a certain point (e.g., 2x the real data) can lead to overfitting or performance drops if the diversity of the layouts isn't increased.

Future work could involve:

  • Improving the diversity of the underlying layouts used for inpainting.
  • Integrating even more advanced diffusion models as the field progresses.
  • Exploring ways to generate synthetic segmentation masks directly to further boost instance segmentation performance.

Summary updated

BibTeX
@misc{suri2023gen,
  author = {Saksham Suri and Fanyi Xiao and Animesh Sinha and Sean Chang Culatana and Raghuraman Krishnamoorthi and Chenchen Zhu and Abhinav Shrivastava},
  title = {{Gen2Det: Generate to Detect}},
  year = {2023},
  eprint = {2312.04566},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2312.04566},
}
Figure