Semantic-Guided Generative Image Augmentation Method with Diffusion Models for Image Classification

Bohan Li, Xiao Xu, Xinghao Wang, Yutai Hou, Yunlong Feng, Feng Wang, Xuanliang Zhang, Qingfu Zhu, Wanxiang Che

Semantic-Guided Generative Image Augmentation Method with Diffusion Models for Image Classification

Deep learning models are notoriously data-hungry, requiring extensive datasets to achieve high performance. To meet this demand, researchers employ Data Augmentation (DA). Historically, this has involved a choice between two paradigms: perturbation-based methods (like CutMix or RandAugment) which are semantically safe but offer low diversity, and generative methods (using models like Stable Diffusion) which offer high diversity but often suffer from semantic drift—generating images that no longer match their original labels.

The Diversity-Consistency Trade-off

The authors of this paper identify a critical "diversity-consistency" trade-off in data augmentation. SGID (Semantic-guided Generative Image augmentation method with Diffusion models) is proposed to hit the "Goldilocks zone": generating images that are diverse enough to help the model generalize while ensuring the labels remain 100% accurate.

Comparison of various augmentation methods across the axes of semantic consistency and image diversity. SGID occupies a balanced middle ground compared to traditional methods like CutMix/RA and naive generative methods like Text2Img.

Methodology

SGID operates through a two-stage process designed to maintain semantic integrity while maximizing contextual variety.

1. Label Acquisition and Caption Generation

Instead of using a simple class label (e.g., "Car"), SGID constructs a rich textual description:

  • Captioning & Filtering: The system uses BLIP to generate multiple candidate captions for the original image. These are then ranked using CLIP to select the one with the highest similarity to the source image.
  • Prompt Weighting: The final generation prompt combines the ground-truth label with the selected caption. Crucially, the label is assigned a higher weight (1.5) than the caption (0.9) to prioritize the core category over contextual details.

2. Image-to-Image Generation

The original image and the weighted prompt are processed by Stable Diffusion:

  • Noise Control: A controlled amount of Gaussian noise is added to the original image, allowing the model to alter backgrounds or orientations while preserving the fundamental structure.
  • Dynamic Guidance: A mathematical mapping function adjusts the "guidance scale" based on CLIP similarity scores. This ensures the model leans more heavily on the text prompt when the generated caption is a high-quality match for the image.

Key Results and Insights

SGID was evaluated across seven diverse datasets (including CIFAR, Stanford Cars, and OxfordPets) using ResNet-50 and ViT backbones. The results demonstrate significant gains:

  • Performance Boost: On ResNet-50, SGID achieved an average accuracy of 67.92%, a 10.39% improvement over the baseline and a 3.16% lead over the best generative baseline (Text2Img).
  • Complementary Nature: SGID is not intended to replace traditional DA. In fact, combining SGID with RandAugment (RA) yielded the highest scores, suggesting that generative diversity and geometric perturbations provide complementary training signals.
  • Robustness: The method provided performance gains even when using a CLIP-ViT backbone, indicating that the value added goes beyond simply "replaying" data the diffusion model might have seen during pre-training.

Limitations and Future Work

While effective, SGID is sensitive to the noise rate; excessive noise can still lead to semantic errors, while insufficient noise limits the diversity benefits. Additionally, generating images via diffusion models is more computationally intensive than traditional geometric transformations. Future research will focus on automated parameter tuning and optimizing the computational efficiency of the framework.

Summary updated

BibTeX
@inproceedings{li2024semantic,
  author = {Bohan Li and Xiao Xu and Xinghao Wang and Yutai Hou and Yunlong Feng and Feng Wang and Xuanliang Zhang and Qingfu Zhu and Wanxiang Che},
  title = {{Semantic-Guided Generative Image Augmentation Method with Diffusion Models for Image Classification}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2024},
  doi = {10.1609/aaai.v38i4.28084},
}
Figure