Towards Lifelong Few-Shot Customization of Text-to-Image Diffusion

Nan Song, Xiaofeng Yang, Ze Yang, Guosheng LinarXiv 2024 · DOI

Introduction

Customizing text-to-image (T2I) models like Stable Diffusion for specific objects typically involves fine-tuning on a small set of images. However, a significant challenge arises when attempting to teach a model multiple concepts sequentially—a process known as lifelong learning. In these scenarios, models often suffer from catastrophic forgetting, where learning a new concept leads to the degradation of previously acquired knowledge.

The Forgetting Problem

The authors identify two distinct types of forgetting in the context of T2I customization:

  1. Relevant Concepts Forgetting (RCF): When a model is trained on a specific instance (e.g., "V1 cat"), it may lose its ability to generate the general category (e.g., a generic "cat").
  2. Previous Concepts Forgetting (PCF): As the model learns a sequence of tasks (e.g., Task 1: "V1 cat", Task 2: "V2 chair"), it progressively forgets how to accurately generate objects from earlier tasks.
Illustration of Relevant Concept Forgetting (a) and Previous Concept Forgetting (b).

Existing approaches to mitigate these issues often rely on storing large amounts of historical training data or maintaining multiple model versions, neither of which is scalable for real-world applications with memory and privacy constraints.

Methodology: LFS-Diffusion

To address these challenges, the researchers introduced LFS-Diffusion, a framework designed for lifelong few-shot generation. The system operates across multiple training sessions to maintain concept fidelity over time.

The LFS-Diffusion pipeline for lifelong few-shot generation across sequential sessions.

LFS-Diffusion employs two core mechanisms:

Data-Free Knowledge Distillation (DFKD)

To combat RCF, the model utilizes a "teacher-student" distillation strategy. The previous version of the model acts as a teacher, guiding the current "student" model to maintain its general category knowledge. By matching noise predictions on general categories using the model's own internal generative capabilities, DFKD eliminates the need to store actual images from prior tasks. A key technical insight is the "Same Noise" trick: using identical noisy latents for both teacher and student at each timestep to prevent error accumulation.

In-Context Generation (ICGen)

To solve PCF, the framework adopts a "vision-based context" approach inspired by Large Language Models. For every learned concept, a single "vision context" (a latent representation of a training image) is stored. During inference, this visual anchor is blended with random noise to guide the denoising process. This serves as a persistent visual "reminder" of the specific concept, preventing the model's weights from drifting too far toward newer tasks.

Evaluation and Results

LFS-Diffusion was evaluated on the CustomConcept101 and DreamBooth datasets, adapted for sequential learning sessions.

Key Performance Metrics

  • Superior Retention: LFS-Diffusion demonstrated excellent preservation of old concepts. On the Image-Alignment Dropping (IAD) metric, it showed only a 4.29% drop over time, significantly outperforming the baseline DreamBooth-FT's 14.54% drop.
  • High Fidelity: The model achieved high Text-Alignment (TA) scores (0.811), indicating that generated images remained faithful to user prompts even after multiple training sessions.
  • Efficiency: The training process is highly efficient, taking approximately 9 minutes per concept with zero additional data storage requirements, making it suitable for edge devices.

Human Evaluation

In a user study, 77.8% of participants preferred LFS-Diffusion over baseline methods. Users specifically noted the model's ability to preserve fine-grained details of concepts learned several sessions prior, such as the specific color and texture of a previously taught chair.

Conclusion and Future Work

LFS-Diffusion provides a robust solution for the lifelong customization of T2I models without the need for data replay. While highly effective, the authors note that balancing the strength of the vision context is critical for maintaining image diversity. Future research may focus on automating the tuning of this context strength and extending the framework to handle more complex scenes with multiple interacting custom objects.

Summary updated

BibTeX
@misc{song2024towards,
  author = {Nan Song and Xiaofeng Yang and Ze Yang and Guosheng Lin},
  title = {{Towards Lifelong Few-Shot Customization of Text-to-Image Diffusion}},
  year = {2024},
  eprint = {2411.05544},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2411.05544},
}
Figure