Abstract
In computer vision, it is well-known that a lack of data diversity will impair model performance. In this study, we address the challenges of enhancing the dataset diversity problem in order to benefit various downstream tasks such as object detection and instance segmentation. We propose a simple yet effective data augmentation approach by leveraging advancements in generative models, specifically text-to-image synthesis technologies like Stable Diffusion. Our method focuses on generating variations of labeled real images, utilizing generative object and background augmentation via inpainting to augment existing training data without the need for additional annotations. We find that background augmentation, in particular, significantly improves the models’ robustness and generalization capabilities. We also investigate how to adjust the prompt and mask to ensure the generated content comply with the existing annotations. The efficacy of our augmentation techniques is validated through comprehensive evaluations of the COCO dataset and several other key object detection benchmarks, demonstrating notable enhancements in model performance across diverse scenarios. This approach offers a promising solution to the challenges of dataset enhancement, contributing to the development of more accurate and robust computer vision models.
Introduction
Deep learning models for object detection and instance segmentation are notoriously data-hungry. While large datasets like MS COCO provide a strong foundation, they often lack the environmental diversity needed for models to generalize well to "in-the-wild" scenarios. Traditionally, researchers have attempted to bridge this gap using synthetic data or generative models to create new training samples.
However, using generative models (like Stable Diffusion) for object detection is fraught with challenges. If a model generates a new object, it rarely aligns perfectly with a predefined mask or bounding box. This misalignment provides noisy signals that can degrade performance. Furthermore, generating high-quality human figures or specific object details remains a significant hurdle for general-purpose diffusion models.
Methodology
To overcome these limitations, we propose Utility-Aware Background Augmentation. This pipeline leverages Stable Diffusion’s inpainting capabilities to modify only the background of a labeled image while keeping the original, high-quality objects intact. This ensures that existing annotations remain 100% accurate.
Key technical components include:
- Simple Prompting: Instead of complex captions that might cause the model to hallucinate "ghost" versions of objects, we use a neutral prompt: "Generate a clean background."
- Background Mask Erosion: To prevent original objects from "bleeding" into the new background, we apply a minimum filter (erosion) to the background mask, ensuring clean boundaries.
- Adaptive Diffusion Steps: We found that the "freedom" of the diffusion process should scale with background size. We use a formula to adjust diffusion steps based on the ratio of background area to total image area, preserving more original information when the background is small.
- Non-Uniform Sampling: When scaling the dataset (e.g., 10x augmentation), we prioritize images containing small objects, as these are typically the most challenging for detectors.
Key Results and Insights
Our evaluation on MS COCO and PASCAL VOC benchmarks revealed several critical insights:
- Context over Content: Changing the background (context) is more beneficial than changing the object itself (content). This forces the detector to learn invariant features of the object rather than relying on background cues.
- Significant mAP Boost: On the 10% COCO data regime, our method increased Mean Average Precision (mAP) by +2.7 points over standard augmentation. With 10x augmented data via non-uniform sampling, the total increase reached 5.3% mAP.
- Architecture Agnostic: Gains were consistent across different backbones, including ResNet-50 and Swin Transformer. For Swin-T, we observed a +1.0 increase in box AP and +0.8 in mask AP on the full dataset.
- Low-Data Efficiency: The method acts as a powerful regularizer, preventing models from overfitting to the limited backgrounds present in small training sets.
Conclusion
Utility-Aware Background Augmentation offers a simple yet highly effective strategy for enhancing dataset diversity without additional manual labeling. While the method shows negligible gains in "Large Object" scenarios where the background is minimal, it significantly improves model robustness in most other contexts. Future work will explore combining this background-centric approach with more sophisticated object generation models capable of better mask alignment.
Summary updated