Abstract
We present a method for expanding a dataset by incorporating knowledge from the wide distribution of pre-trained latent diffusion models. Data augmentations typically incorporate inductive biases about the image formation process into the training (e.g. translation, scaling, colour changes, etc.). Here, we go beyond simple pixel transformations and introduce the concept of instance-level data augmentation by repainting parts of the image at the level of object instances. The method combines a conditional diffusion model with depth and edge maps control conditioning to seamlessly repaint individual objects inside the scene, being applicable to any segmentation or detection dataset. Used as a data augmentation method, it improves the performance and generalization of the state-of-the-art salient object detection, semantic segmentation and object detection models. By redrawing all privacy-sensitive instances (people, license plates, etc.), the method is also applicable for data anonymization.
Introduction
Deep learning models are notoriously data-hungry, and small datasets often lead to overfitting. While standard augmentations like flipping, cropping, or color jittering help, they don't add new "information" or visual diversity to the scene. Modern generative models like Stable Diffusion can create entirely new images, but generating accompanying pixel-perfect annotations (segmentation masks, bounding boxes) for those images is incredibly difficult. This work bridges the gap by using generative AI to enhance existing datasets without losing expensive, human-verified labels.
Methodology: Instance-Level Augmentation
The core of the approach is targeting specific object instances for "repainting" rather than generating a whole new image.
Shape-Preserving Inpainting
The system uses a Latent Diffusion Model (LDM) equipped with ControlNet. To ensure the new object fits perfectly into the original label, the generation is conditioned on the original object's depth map and edge map. This ensures a "new" dog still has the same pose and boundaries as the "old" dog, keeping the original segmentation mask valid.
Iterative Redrawing and Blending
To avoid noise accumulation from multiple encoder-decoder passes, each object is redrawn independently. These instances are then blended back into the original image using alpha-blending, sorted by depth (back-to-front).
Prompt Engineering and Mask Refinement
To maximize diversity, prompts are extended using WordNet synsets and random color/lighting descriptions. A VQA model (BLIP) is used to describe actions (e.g., "person skiing") to ensure the generated replacement is contextually appropriate. For tasks requiring high precision, such as Salient Object Detection, a refinement step (using TRACER) ensures razor-sharp object boundaries.
Key Insights and Results
By using depth and edge maps as constraints, the texture and identity of an object can be swapped while keeping the geometry identical. This makes original ground-truth labels "free" for the new synthetic data.
Performance Gains
The method was evaluated across several computer vision tasks:
- Object Detection: On MS-COCO, the method consistently improved Average Precision (AP) across architectures, including Deformable-DETR (+1.2 AP) and YOLOv5m (+1.6 AP).
- Semantic Segmentation: On Pascal VOC, training on synthetic data and fine-tuning yielded a massive improvement of 15.5 mIoU over baselines.
- Salient Object Detection: Performance improved in 34 out of 36 metrics across five benchmark datasets (DUTS, ECSSD, etc.).
Data Anonymization
Because the model can replace real people with realistic "virtual" people, it serves as a powerful anonymization tool. Unlike blurring, which destroys data, this method preserves the "person-ness" of the pixels for the AI to learn from. Replacing all people in the COCO dataset resulted in only a marginal (1.0) AP drop, while reducing the face re-identification rate from 2.8% to a negligible 0.14%.
Conclusion
This instance-level augmentation method leverages the vast out-of-domain knowledge of pre-trained generative models to exponentially increase dataset diversity. While it can struggle with highly specific object interactions, it significantly improves model generalization and offers a robust path for data anonymization. The authors have released fully synthetic and anonymized expansions for COCO, Pascal VOC, and DUTS.
Summary updated