Controllable Textual Inversion for Personalized Text-to-Image Generation

Jianan Yang, Haobo Wang, Yanming Zhang, Ruixuan Xiao, Sai Wu, Gang Chen, Junbo Zhao

TL;DR

Controllable Textual Inversion (COTI) is a new framework that automates and optimizes the personalization of text-to-image models. By combining an active learning paradigm with a dual scoring system for aesthetics and concept-matching, COTI eliminates the need for arduous manual data curation while significantly outperforming standard methods in both image fidelity and semantic alignment.

What Problem Does This Paper Address?

Large-scale diffusion models like Stable Diffusion are incredibly powerful, but they often struggle with "long-tail" or user-defined concepts—specific objects or styles not well-represented in their training data. Textual Inversion (TI) was introduced to solve this by learning a new "word" (embedding vector) for a specific concept while keeping the rest of the model frozen.

However, the authors identify that practical TI is often a "dark art." It typically requires a small, hand-picked set of high-quality images. If you try to scale this by using raw, web-crawled data, the results are often poor because the data is noisy and inconsistent. As shown in Figure 1, simply increasing the amount of web data (c) actually degrades performance compared to a small, curated set. The challenge is: how do we build a robust, data-efficient TI framework that works with large, noisy data pools without requiring human-in-the-loop annotation?

Comparison of different TI versions showing that COTI produces the highest fidelity results compared to standard TI with web data.

Methods

The authors propose COntrollable Textual Inversion (COTI), which shifts TI from a static training process to an active, iterative one. The core components include:

  1. Active Learning Paradigm: Instead of training on a fixed set, COTI iteratively selects the best samples from a large web-crawled pool to expand its training set ($X_T$) cycle-by-cycle.
  2. Dual Scoring System: To select data, COTI uses a theoretically-grounded scoring mechanism derived from the Pythagorean Theorem for Minimum Mean Square Error (MMSE). It decomposes the objective into two parts:
  3. Aesthetic Score ($S_{aes}$): Measures how "good" an image looks using a fine-tuned perception model.
  4. Concept-matching Score ($S_{con}$): Measures how well a candidate image matches the target concept using an image encoder (like CLIP).
  5. Dynamic Weighting: The balance between these two scores isn't fixed. It adapts based on the current state of the learned embedding. If the model is producing high-quality but semantically incorrect images, it prioritizes concept-matching, and vice-versa.
  6. Dynamic Scheduling: The authors introduce a trigonometric indicator, $\phi(v)$, to monitor training progress. This indicator signals when to decay the learning rate or trigger a new cycle of data selection, preventing the model from overfitting to a specific subset of data.
The COTI pipeline (right) compared to vanilla TI (left), highlighting the automated data selection and weighted scoring loop.

Datasets

The researchers evaluated COTI on 8 distinct, challenging concepts (e.g., "axolotl," "frilled lizard," "emperor penguin chick") that are difficult for base models to generate accurately. They utilized:

  • Public Datasets: ImageNet, iNaturalist 2018, and IP102.
  • Web Data: 1,000 raw web-crawled images per concept to serve as the candidate pool ($W$).
  • Base Model: Stable Diffusion 2.0 pre-trained on LAION-5B.

Key Insights and Ideas

  • Quantity $\neq$ Quality: Figure 1(c) is a crucial "aha" moment. It proves that for personalization, more data is actually harmful if it's not high-quality. This justifies the need for an active selection mechanism.
  • Theoretical Grounding: By linking the Latent Diffusion Model (LDM) loss to MMSE theory, the authors provide a rigorous mathematical justification for why their dual scoring system (aesthetics + concept matching) is the right way to approximate the ideal training objective.
  • Iterative Refinement: Figure 4 demonstrates how the concept "emerges" over cycles. Early cycles capture basic attributes like color and texture, while later cycles refine complex shapes and fine details (like the antennae of an axolotl).
Generative results across cycles, showing the progressive refinement of the target concept.

Key Results

COTI demonstrates a massive leap over baseline Textual Inversion:

  • Quantitative: It achieved a 26.05 decrease in FID score (lower is better for image quality) and a 23.00% boost in R-precision (measuring how well the image matches the text prompt) compared to standard TI.
  • Qualitative: As seen in Figure 3, COTI consistently captures the correct shape, color, and texture of complex biological concepts where other methods produce distorted or generic-looking results.
  • Efficiency: COTI achieves these results using only a fraction of the available data (e.g., 200 selected samples vs. 1,000 total), proving its sample efficiency.
Qualitative comparison across multiple concepts, showing COTI's superior ability to capture specific photographic attributes.

Limitations and Future Work

While COTI significantly reduces manual effort, the paper notes that the initial "seed" set ($X_T^{(0)}$) is still manually selected to define the target concept. Future work could involve automating this initial seeding. Additionally, the authors aim to release COTI to the open-source community to help build a library of long-tail concept embeddings through collective effort.

Summary updated

BibTeX
@misc{yang2023controllable,
  author = {Jianan Yang and Haobo Wang and Yanming Zhang and Ruixuan Xiao and Sai Wu and Gang Chen and Junbo Zhao},
  title = {{Controllable Textual Inversion for Personalized Text-to-Image Generation}},
  year = {2023},
  eprint = {2304.05265},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2304.05265},
}
Figure