Abstract
With the unprecedented performance being achieved by text-to-image (T2I) diffusion models, T2I customization further empowers users to tailor the diffusion model to new concepts absent in the pre-training dataset, termed subject-driven generation. Moreover, extracting several new concepts from a single image enables the model to learn multiple concepts, and simultaneously decreases the difficulties of training data preparation, urging the disentanglement of multiple concepts to be a new challenge. However, existing models for disentanglement commonly require pre-determined masks or retain background elements. To this end, we propose an attention-guided method, AttenCraft, for multiple concept disentanglement. In particular, our method leverages self-attention and cross-attention maps to create accurate masks for each concept within a single initialization step, omitting any required mask preparation by humans or other models. The created masks are then applied to guide the cross-attention activation of each target concept during training and achieve concept disentanglement. Additionally, we introduce Uniform sampling and Reweighted sampling schemes to alleviate the non-synchronicity of feature acquisition from different concepts, and improve generation quality. Our method outperforms baseline models in terms of image-alignment, and behaves comparably on text-alignment. Finally, we showcase the applicability of AttenCraft to more complicated settings, such as an input image containing three concepts.
Introduction
Text-to-image (T2I) customization allows users to teach models like Stable Diffusion specific new objects from a few reference images. However, a significant challenge arises when attempting to learn multiple concepts from a single reference image. Existing methods often suffer from two primary issues:
- Feature Fusion: The model confuses features between objects (e.g., a cat inheriting a dog's fur color).
- Asynchronous Learning: Concepts learn at different rates, leading to some being overfitted (noisy) while others remain unlearned.
Traditional solutions require manual masking or heavy external segmentation models like SAM. AttenCraft addresses these by leveraging the model's internal attention mechanisms to automate disentanglement.
Methodology
AttenCraft introduces a three-pronged strategy for robust multi-concept learning:
Attention-Guided Mask Auto-Creation
Instead of manual masks, AttenCraft uses the model's internal cross-attention (pixel-to-word) and self-attention (pixel-to-pixel) maps. By calculating the difference between attention maps—a process called "Delta masking"—the system generates sharp, accurate masks for each object in a single initialization step.
Adaptive Sampling and Synchronicity
The "semantic richness" of token initialization (e.g., "dog" vs. "animal") affects learning speed. AttenCraft employs an algorithm that monitors attention scores and automatically gives "harder-to-learn" concepts more training time through reweighted sampling, ensuring all objects are learned synchronously.
Feature-Retaining Training
To prevent feature smearing, the authors optimized the loss functions. While single objects use standard reconstruction loss, group-sampling relies solely on an attention-based loss. This prevents gradients from incorrectly mapping features across different identities.
Experimental Results
The framework was evaluated on 16 datasets, including 10 from DisenDiff and 6 synthetic datasets from Gen4Gen featuring complex backgrounds.
Key Findings
- High Fidelity: AttenCraft achieved state-of-the-art results in CLIP-I (0.576) and DINO scores, indicating superior image alignment compared to baselines like Custom Diffusion and Break-a-scene.
- Learning Balance: The model achieved the lowest CLIP-I-sync score (0.062), confirming successful balance in the learning process across multiple concepts.
- Zero-Cost Segmentation: The study proves that T2I models inherently "know" object locations; refining this with self-attention enhancement provides high-quality masks without external tools.
Discussion and Future Work
While AttenCraft excels at disentanglement, some limitations remain. In human-centric datasets, masks occasionally prioritize faces over clothing textures. Additionally, the "Delta masking" threshold may require tuning for low-contrast images. Future research will explore scaling the method to even more identities within a single frame and improving accessory detail retention.
Summary updated