Generating Enhanced Negatives for Training Language-Based Object Detectors

Shiyu Zhao, Long Zhao, Vijay Kumar B. G, Yumin Suh, Dimitris N. Metaxas, Manmohan Chandraker, Samuel SchulterCVPR 2023 · DOI

Abstract

Modern language-based object detectors rely on high-quality negative samples to learn the nuances of open-vocabulary descriptions. However, standard training pipelines often rely on random negative sampling, which provides insufficient signal for complex reasoning. This paper introduces a novel framework that leverages Large Language Models (LLMs) and text-to-image diffusion models to automatically generate "hard negatives"—relevant but contradictory text and images. By fine-tuning models on these generated samples, we demonstrate significant performance gains on challenging benchmarks like OmniLabel and $D^3$, establishing generative AI as a powerful tool for improving discriminative vision models.

Introduction

Traditional object detectors are confined to a fixed set of labels, such as "dog" or "car." In contrast, modern language-based detectors (e.g., GLIP, FIBER) aim for open-vocabulary detection, identifying objects based on free-form textual descriptions like "a woman in a red dress walking across a bridge."

To train these models effectively, the system requires both positive samples (correct image-text matches) and negative samples (what the object is not). Traditionally, negatives are selected via random sampling from other images in a dataset. However, random negatives are often "too easy"; a model does not learn much about color or spatial relations if it only compares a "red car" against a "blue sky." The challenge lies in creating "hard negatives"—samples that are semantically similar to the positive but crucially different (e.g., "a blue car" or "a red truck"). Manually creating these at scale is prohibitively expensive, and simple rule-based word swapping often produces nonsensical results.

Methodology

1. LLM-based Negative Text Generation

The authors utilize LLMs (such as GPT-3.5 and LLaMA) to transform positive captions into sophisticated negatives using three distinct strategies:

  • LLM-based Foils: The LLM identifies key concepts—objects, attributes, or relations—and replaces one with a semantically similar but incorrect alternative.
  • Re-combination: The LLM shuffles existing objects within a sentence to create a new, contradictory meaning (e.g., "A boy playing with a dog" becomes "A dog playing with a boy").
  • In-context Summaries: By providing the LLM with human-curated examples of complex negatives (e.g., from the Winoground dataset), the model learns to generate high-quality, "tricky" negatives for new data through few-shot prompting.

2. Diffusion-based Negative Image Generation

Once a negative text is generated (e.g., "a woman in a blue dress"), the framework uses GLIGEN, a grounded text-to-image model, to edit the original image. To maintain consistency, the model modifies only the pixels inside the relevant bounding box to match the new description while keeping the background identical. This creates a direct visual counter-example for the detector to learn from.

3. Noise Filtering

Generative models are prone to hallucinations. To ensure training data quality, the authors implement a dual-filtering mechanism:

  • Box Filter: This ignores boxes that overlap excessively with other objects to prevent the diffusion model from overwriting important contextual information.
  • CLIP Filter: A CLIP model acts as a judge; if the generated image does not strongly align with the negative text, the sample is discarded. In empirical studies, this filtering process reduced noise from 53% to 16%.

Experimental Results

The framework was evaluated by integrating the generated data into two state-of-the-art baselines: GLIP-T and FIBER-B. Training involved a combination of the original Flickr30k data, the new enhanced negatives, and the Objects365 detection dataset.

Performance Gains

  • OmniLabel: This benchmark features complex descriptions where the described object may not even exist in the image. The authors achieved a +2.9 AP gain for GLIP-T and +2.4 AP for FIBER-B.
  • $D^3$ (Described Object Detection): This benchmark focuses on negation and varying text lengths. FIBER-B saw a significant +3.3 AP increase.
  • Negative-Specific Accuracy: On subsets of OmniLabel containing only negative descriptions (where the object is absent), the model's accuracy improved significantly. This suggests the model learned to actually "read" and comprehend the description rather than relying on image-only biases.

Discussion and Insights

The Generative-Discriminative Loop

There is a powerful symmetry in using generative models—which excel at imagining variations—to improve discriminative models, which excel at identification. The study found that LLMs generate a much wider variety of unique verbs, nouns, and adjectives compared to rule-based systems, forcing the detector to learn more robust features.

Limitations

Despite the filtering process, diffusion models still produce artifacts, such as distorted limbs or unrealistic textures. Furthermore, while generated images significantly helped on OmniLabel, the impact on the $D^3$ benchmark was more modest, suggesting a domain gap between synthetic "edited" images and specific real-world distributions. Finally, the computational cost of running LLMs and Diffusion models for large datasets remains a consideration for future optimization.

Conclusion

By automating the creation of hard negatives, this research demonstrates that generative AI can serve as an effective "teacher" for vision models. The diversity and scale of the generated data allow language-based object detectors to move beyond simple pattern matching toward a deeper semantic understanding of the visual world.

Summary updated

BibTeX
@misc{zhao2023generating,
  author = {Shiyu Zhao and Long Zhao and Vijay Kumar B. G and Yumin Suh and Dimitris N. Metaxas and Manmohan Chandraker and Samuel Schulter},
  title = {{Generating Enhanced Negatives for Training Language-Based Object Detectors}},
  year = {2023},
  eprint = {2401.00094},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2401.00094},
}
Figure