GenMix: Effective Data Augmentation with Generative Diffusion Model Image Editing

Khawar Islam, Muhammad Zaigham Zaheer, Arif Mahmood, Karthik Nandakumar, Naveed Akhtar

TL;DR

This paper introduces GenMix, a novel data augmentation technique that leverages generative diffusion models to create more effective training data for computer vision tasks. By intelligently editing images with custom prompts and blending them with original content and fractal patterns, GenMix significantly improves model generalization and robustness, particularly in challenging domain adaptation scenarios.

What Problem Does This Paper Address?

Deep neural networks (DNNs) have achieved remarkable success in computer vision, but their performance often hinges on large, diverse datasets. Traditional data augmentation methods, while helpful, struggle to bridge the "domain gap" when training and testing data distributions differ significantly. This is especially problematic in domain adaptation tasks, where models trained on one domain (e.g., photos) need to perform well on another (e.g., sketches or paintings). Existing methods can lead to label ambiguities or fail to preserve crucial semantic information, limiting their effectiveness. Furthermore, recent attempts using generative models for augmentation have shown limited gains, often due to a lack of control over the generated image quality and relevance.

Methods

GenMix tackles these challenges through a multi-stage process:

  • Prompt-Guided Image Editing: At its core, GenMix uses pre-trained diffusion models for image editing. Instead of generic prompts, it employs carefully curated, "filter-like" conditional prompts (e.g., "autumn," "snowy," "watercolor art") designed to subtly alter the input image's style while preserving its semantic content. This is crucial for generating relevant augmentations.
  • Seamless Concatenation: To ensure the model retains information from both the original and edited images, GenMix uses a smooth, binary mask to blend a portion of the original image with its generated counterpart. This creates a "hybrid image" that combines original semantics with novel visual appearances.
  • Fractal Interpolation: To further enhance structural diversity and improve model robustness, GenMix blends the hybrid image with random self-similarity fractal images. This technique, inspired by prior work on machine learning safety, adds another layer of complexity and variation to the augmented data.
  • Faithful Image Selection: To prevent the use of irrelevant or poorly generated images, GenMix incorporates a filtration module that uses a DINOv2 feature extractor to retain only those generated images that are semantically similar to their original counterparts.

Datasets

GenMix was evaluated on a wide range of datasets across various tasks:

  • General Classification: CIFAR-100, Tiny-ImageNet-200, ImageNet-1K.
  • Fine-Grained Classification: CUB-Birds-200, Stanford Cars, FGVC-Aircraft.
  • Transfer Learning: Flower102, Aircraft, Stanford Cars.
  • Data Scarcity: Flower102 (with only 10 images per class).
  • Domain Adaptation: Office-Home dataset (used with the LEAD framework for Open-Partial, Open-set, and Partial-set domain adaptation).

Key Insights and Ideas

  • The Power of Controlled Generation: The paper highlights that simply using generated images from diffusion models isn't enough. The quality and relevance of these generated images, guided by carefully designed prompts, are paramount for effective augmentation.
  • Preserving Semantics is Key: GenMix's success stems from its ability to blend generated content while retaining the original image's semantic meaning. This is achieved through the seamless concatenation and faithful image selection steps.
  • Fractals for Robustness: The incorporation of fractal patterns, while seemingly abstract, demonstrably improves model robustness, suggesting that structural diversity can enhance generalization beyond just visual style.
  • Unified Approach for Diverse Tasks: GenMix is presented as a versatile technique that works well across standard classification, fine-grained classification, domain adaptation, and self-supervised learning, indicating its broad applicability.

Key Results

GenMix consistently outperformed existing state-of-the-art (SOTA) data augmentation methods across numerous benchmarks:

  • General Classification: Achieved a Top-1 accuracy gain of 2.49% over the Vanilla baseline on ImageNet-1K and a 9.77% gain over Vanilla on Tiny-ImageNet-200.
  • Adversarial Robustness: Demonstrated a lower FGSM error rate (16.83% on CIFAR-100) compared to other methods, indicating improved resilience to adversarial attacks.
  • Fine-Grained Classification: Outperformed competitive methods, achieving an absolute gain of over 1% on FGVC-Aircraft and Stanford Cars datasets.
  • Domain Adaptation: Showed significant improvements, for example, a 2.2% increase in average H-score on the Office-Home dataset for OPDA tasks when used with the LEAD framework.
  • Self-Supervised Learning: Boosted performance for MoCo v2 and SimSiam models, with absolute gains of up to 1.42% on various datasets.

Limitations and Future Work

  • Prompt Sensitivity: The paper acknowledges that the effectiveness of GenMix is dependent on the input prompts. Inappropriate prompts can lead to undesired outputs. The authors propose using "filter-like" prompts as a solution for natural images.
  • Computational Overhead: Image editing introduces additional computational cost. However, the authors suggest this can be mitigated by generating edited images offline and employing faster editing methods.
  • Future Work: The paper implicitly suggests further exploration into prompt engineering and optimizing the diffusion model editing process for even greater efficiency and effectiveness. The versatility of GenMix also opens avenues for its application in other computer vision domains beyond classification.

Summary updated

BibTeX
@misc{islam2024genmix,
  author = {Khawar Islam and Muhammad Zaigham Zaheer and Arif Mahmood and Karthik Nandakumar and Naveed Akhtar},
  title = {{GenMix: Effective Data Augmentation with Generative Diffusion Model Image Editing}},
  year = {2024},
  eprint = {2412.02366},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2412.02366},
}
Figure