Learning to Customize Text-to-Image Diffusion In Diverse Context

Taewook Kim, Wei Chen, Qiang Qiu · DOI

Introduction: The Challenge of Concept Overfitting

Personalization techniques like DreamBooth and Textual Inversion have revolutionized text-to-image generation, allowing users to integrate specific subjects—such as a personal pet or a unique object—into AI-generated scenes using only a handful of reference images. However, these methods frequently encounter "concept overfitting." Because training sets are small and often feature the subject in limited backgrounds, the model tends to "glue" the subject to those specific contexts. Consequently, when prompted to place the subject in a novel environment (e.g., "a dog in a space suit"), the model often ignores the prompt and reverts to the training backgrounds, a phenomenon known as low prompt fidelity.

Comparison of subject generation on the Great Wall, showing improved structural integrity and context alignment in the proposed method (right) versus baseline (left).

Methodology: Diversifying Context via Textual Space

To address this, the authors introduce a method that prevents overfitting by diversifying the textual context during the fine-tuning process. This approach avoids the high cost of generating or sourcing additional training images and requires no architectural changes to the diffusion model.

1. Contextual Diversification

The researchers utilize a Large Language Model (LLM) to generate a wide array of descriptive prompts for the target concept (e.g., "[v] dog at the Eiffel Tower," "[v] dog doing yoga"). This forces the model to encounter the concept token [v] in varied semantic environments.

2. Masked Language Modeling (MLM) Objective

A secondary self-supervised task is integrated into the fine-tuning pipeline. Using a "contextualizer" network added to the CLIP text encoder, the model is tasked with predicting masked words within these diverse prompts. By requiring the concept token to assist in predicting its surrounding context, the model's embedding is regularized. This prevents the token from collapsing into a representation tied solely to the original training backgrounds. The final training objective combines the standard diffusion denoising loss ($L_{Diff}$) with the new MLM loss ($L_{MLM}$).

Results and Evaluation

The method was evaluated across 15 subjects from the DreamBooth, Textual Inversion, and CustomDiffusion datasets. Quantitative results showed consistent improvements in CLIP-T scores, which measure the alignment between generated images and input prompts. For instance, Textual Inversion scores improved from 0.279 to 0.305, and CustomDiffusion improved from 0.322 to 0.326.

Qualitatively, the MLM-enhanced models demonstrate a superior ability to follow complex prompts. While baseline models often fail to render requested accessories or environments, the proposed method successfully integrates these elements while preserving the subject's identity.

Qualitative comparison showing the proposed method's superior prompt fidelity and image quality compared to CustomDiffusion.

Discussion and Limitations

The authors identify that overfitting is essentially a semantic alignment issue where the text encoder fails to distinguish between the "concept" and its "context." By diversifying the text alone, the model can be steered toward better generalization.

However, a trade-off exists: increasing the weight of the MLM loss improves prompt fidelity but can slightly diminish "subject fidelity" (the exactness of the subject's likeness). Additionally, while the textual representation is improved, the U-Net component of models like DreamBooth may still require further regularization to fully eliminate image-level overfitting. Future work may explore combining this textual diversification with synthetic image generation to further bridge the gap.

Summary updated

BibTeX
@misc{kim2024learning,
  author = {Taewook Kim and Wei Chen and Qiang Qiu},
  title = {{Learning to Customize Text-to-Image Diffusion In Diverse Context}},
  year = {2024},
  eprint = {2410.10058},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2410.10058},
}
Figure