TL;DR
Modern computer vision models often overfit to narrow visual domains and struggle to generalize to real-world shifts. This paper introduces Semantic Augmentation, a framework that manipulates image captions at the linguistic level and uses Stable Diffusion to generate photorealistic synthetic training images. By augmenting captions with new contexts, styles, and supercategory label swaps, the method significantly boosts out-of-domain classification robustness compared to traditional augmentation methods like Mixup and AugMix.
What Problem Does This Paper Address?
Large deep learning architectures—such as Vision Transformers and deep ResNets—require massive labeled datasets to generalize well. Conventional pixel-level augmentations (e.g., Mixup, CutMix, AugMix) blend or distort existing training samples, which often yields unnatural artifacts without introducing genuinely new semantic contexts.
Meanwhile, prior generative approaches relying on GANs (like CycleGAN or StyleGAN) typically struggle with multi-label interactions, lack latent disentanglement for contextual details, or require training distinct models for every single object category. The authors address this by asking: Can we leverage large-scale text-to-image diffusion models, guided by systematically altered image captions, to generate diverse, context-rich augmentations that enhance both in-domain and out-of-domain classification?
Methods
The proposed pipeline consists of two main stages: caption manipulation and text-conditioned image synthesis.
Original Caption
↳ [BERT Cosine Similarity] ➔ Class Label Extraction
↳ [Semantic Transformation] ➔ Augmented Caption
↳ [Stable Diffusion] ➔ Synthetic Image + Updated Annotations
- Caption Label Extraction: COCO captions often use informal synonyms rather than strict ontology names (e.g., "woman" instead of "person"). The authors use a pre-trained BERT model to compute contextual embeddings for all caption tokens and identify class-relevant words via cosine similarity to the ground-truth target labels.
- Text Augmentation Strategies: Once target words are identified, captions are altered via one of four policies:
- Prefix Augmentation: Prepends stylistic attributes (e.g., "A cartoon of...", "A black and white image of...").
- Suffix Augmentation: Appends environmental or contextual backdrops (e.g., "...on a rainy day", "...in the mountains").
- Replacement Augmentation: Replaces an identified object label with another class from the same broad supercategory (e.g., swapping "dog" with "sheep" within the animal supercategory).
- Compound Augmentation: Sequentially combines prefix, suffix, and label replacement for comprehensive semantic shifts.
- Image Synthesis and Packaging: The altered captions are fed into Stable Diffusion to generate corresponding photorealistic images, which are converted into standard COCO format and merged into the training set.
Datasets
- COCO Captions: Used as the primary source for caption extraction, image generation, and in-domain multi-label classification training and evaluation.
- PASCAL VOC: Used as an out-of-domain transfer benchmark. The classification backbone is frozen, and a newly initialized classification head is trained on PASCAL VOC.
- (Tiny ImageNet is also noted in the paper as a reference domain for comparative analysis).
No new benchmark datasets were introduced.
Key Insights and Ideas
- Language as a Semantic Control Knob: Instead of hand-crafting pixel distortions, language allows for structured perturbations of environment, lighting, artistic style, and co-occurring objects while maintaining photorealism.
- Inheriting Generative Priors: Diffusion models trained on web-scale text-image datasets encode rich visual priors. Synthetic images transfer this external knowledge into downstream vision models without manually collecting new data.
- Out-of-Domain Gains Dominate In-Domain Gains: Exposing the model to varied environments (rainy days, foggy nights, stylistic renderings) during training provides the largest benefits when transferring to unseen domains, preventing models from relying on spurious background cues.
Key Results
The framework was evaluated using a ResNet architecture against a standard baseline, AugMix, and Mixup:
1. In-Domain Performance (COCO)
Semantic Augmentation achieved the highest mean Average Precision (mAP):
- Vanilla ResNet: 0.529 mAP | 0.974 Accuracy
- Mixup: 0.552 mAP | 0.972 Accuracy
- AugMix: 0.558 mAP | 0.975 Accuracy
- Semantic Augmentation: 0.564 mAP | 0.975 Accuracy
2. Out-of-Domain Generalization (PASCAL VOC)
When freezing feature representations and linear probing on PASCAL VOC, Semantic Augmentation showed a distinct margin of improvement:
- Vanilla ResNet: 0.652 mAP | 0.952 Accuracy
- Mixup: 0.672 mAP | 0.952 Accuracy
- AugMix: 0.675 mAP | 0.954 Accuracy
- Semantic Augmentation: 0.702 mAP | 0.957 Accuracy (+0.027 mAP over the strongest baseline).
Limitations and Future Work
- Evaluation Scope: Out-of-domain experiments were primarily limited to PASCAL VOC; testing across broader domain-shift benchmarks (e.g., ImageNet-C, ImageNet-R, or WILDS) remains future work.
- Off-the-Shelf Generation: Stable Diffusion was utilized without task-specific fine-tuning, which can occasionally result in discrepancies between complex prompt nuances and generated image content.
- Augmentation Ratio Tuning: Balancing the proportion of synthetic to real images per sample is a sensitive hyperparameter requiring careful tuning to avoid dataset bias or overrepresentation.
Summary updated