TL;DR
Gen-n-Val introduces an agentic framework that leverages Large Language Models (LLMs) and Vision-LLMs (VLLMs) to automatically generate and validate high-quality synthetic training data for object detection and instance segmentation. By optimizing generation prompts and filtering out flawed outputs using TextGrad, it slashes synthetic data failure rates from 50% to just 7%, significantly boosting model performance on long-tailed and rare object categories.
What Problem Does This Paper Address?
Training state-of-the-art object detection and instance segmentation models requires massive amounts of accurately labeled data. However, real-world datasets suffer from severe long-tailed distributions—where rare classes have very few examples—and high manual annotation costs.
While generative models like Stable Diffusion can synthesize images to fill these gaps, existing pipelines struggle to produce clean, single-object foregrounds with precise segmentation masks. They often generate multiple objects under a single mask, cut off objects, or mislabel categories entirely. These issues cause prior state-of-the-art methods like MosaicFusion to produce up to 50% invalid or flawed data, severely limiting their effectiveness.
Methods
Gen-n-Val tackles these challenges using a two-agent pipeline powered by Layer Diffusion (LD) and automatic prompt optimization via TextGrad:
- LD Prompt Agent (LLM): Instead of using basic prompts like "a photo of a single [object]", an LLM (Meta-LLaMA-3.1-8B-Instruct) generates highly detailed, diverse prompts specifying style, texture, lighting, and viewpoint. The agent's system prompt is iteratively optimized using TextGrad to minimize generation failures.
- Layer Diffusion (LD): This model generates transparent foreground images with native alpha channels. This provides pixel-perfect segmentation masks out-of-the-box, eliminating the need for error-prone cross-attention maps or separate post-hoc segmentation models like SAM.
- Data Validation Agent (VLLM): A Vision-LLM (Meta-LLaMA-3.2-11B-Vision-Instruct) inspects the generated images against strict criteria (single object, correct category, intact view, plain background) to filter out any remaining flawed samples.
Finally, the validated foreground instances are composited onto background images using copy-paste augmentation to create final training scenes.
Datasets
The authors evaluated Gen-n-Val on two major computer vision benchmarks:
- LVIS: A large-vocabulary dataset containing 1,203 categories, notorious for its extreme long-tailed distribution where rare categories often have fewer than 10 images.
- COCO: A standard benchmark containing 80 common object categories.
Key Insights and Ideas
- Native Transparency over Post-hoc Segmentation: Relying on Layer Diffusion's alpha channel is inherently cleaner than trying to segment a fully rendered image or extracting messy cross-attention maps.
- TextGrad for Prompt Tuning: Treating text prompts as "differentiable" parameters optimized via feedback loops (TextGrad) drastically improves both the generation diversity and the validation accuracy of LLM/VLLM agents.
- Flattening the Tail: Progressively injecting synthetic instances into the rarest classes systematically balances highly skewed datasets like LVIS, unlocking massive performance gains for underrepresented objects without hurting common ones.
Key Results
- Quality Improvement: Slashes invalid synthetic data from ~50% (MosaicFusion) to just 7%.
- LVIS Performance: On Mask R-CNN, adding 727k synthetic instances boosted overall mask mAP by 3.9% and rare-class mAP by 7.6%. On CenterNet2, rare-class mAP jumped by an impressive 11.5%.
- COCO Performance: Improved rare-class mask mAP by 3.6% for both YOLOv9c and YOLO11m.
- Open-Vocabulary Detection: YOLO11m trained with Gen-n-Val data outperformed YOLO-Worldv2-M by 7.1% mAP on box prediction for novel categories.
Limitations and Future Work
While Gen-n-Val reduces the failure rate significantly, approximately 7% of generated samples still contain flaws (e.g., incomplete objects or multiple categories) that manage to slip past the VLLM validator (see Figure 4). Additionally, minor background noise can still persist in the alpha channel generated by Layer Diffusion, requiring post-processing steps like median filtering. The authors suggest that tighter, iterative integration between the generator and validator agents could be a promising direction to completely eliminate these edge-case failures.
Summary updated