Introduction
Large-scale text-to-image (T2I) diffusion models, such as Stable Diffusion, have demonstrated an impressive ability to generate high-quality images from natural language descriptions. However, these models frequently struggle with compositional prompts involving multiple distinct objects. Common failure modes include "attribute leakage," where features of one object merge into another, and "missing objects," where one concept dominates the attention map at the expense of others.
The authors of "Separate-and-Enhance" (SepEn) identify the root cause of these issues in the cross-attention layers of the diffusion process. When attention activation scores are too low or when attention masks for different objects overlap significantly, the model fails to render distinct, well-aligned entities.
The Separate-and-Enhance (SepEn) Framework
To address these compositional challenges, the researchers propose SepEn, a lightweight finetuning framework that introduces two novel loss functions designed to regularize the model's internal attention mechanisms.
1. The Separate Loss ($L_{Sep}$)
The Separate Loss acts as a spatial regularizer. It aims to minimize the intersection between the attention masks of different objects specified in the prompt. By penalizing overlap, the model is forced to allocate distinct spatial regions for each concept, effectively preventing attribute merging and "blending" of entities.
2. The Enhance Loss ($L_{En}$)
The Enhance Loss serves to ensure that all requested objects are represented in the final image. It identifies the object with the lowest attention activation score and maximizes its signal. This "volume knob" approach prevents dominant objects from suppressing weaker ones, ensuring that even small or rare concepts are successfully generated.
Selective Parameter Optimization: The "Key" Insight
A significant contribution of this work is the discovery that not all parameters in the U-Net are equally important for compositional alignment. Through sensitivity analysis, the authors found that the Key (K) mapping functions in the cross-attention modules are the most critical.
In the standard attention mechanism $Attention(Q, K, V)$, the Key ($K$) maps the text prompt into the image latent space. By selectively finetuning only these parameters, SepEn remains computationally efficient and avoids "catastrophic forgetting," preserving the model's ability to generate high-quality single objects while significantly improving multi-object composition.
Experimental Results
The SepEn framework was evaluated against several baselines, including standard Stable Diffusion and inference-time optimization methods like Attend-and-Excite.
Quantitative Performance
- Compositional Accuracy: Using a pre-trained detector to verify object presence, SepEn achieved a success rate of 41.0%, nearly doubling the 20.9% achieved by Stable Diffusion.
- Image Realism: SepEn maintained high image quality, achieving an FID score of 36.85, which outperformed Attend-and-Excite (45.65).
- Inference Efficiency: Unlike "test-time adaptation" methods that require optimization for every prompt, SepEn is a one-time finetuned model. Consequently, it generates images in approximately 2.45 seconds, compared to 11.69 seconds for Attend-and-Excite.
Generalization
The researchers tested the model on a variety of concept splits: "Seen-Seen," "Seen-Unseen," and "Unseen-Unseen." The results indicated that the model does not merely memorize specific pairs but learns a general strategy for object separation and enhancement. This allows it to perform well even on entirely new object combinations not encountered during finetuning.
Conclusion and Future Work
The Separate-and-Enhance framework provides a robust and efficient solution to the compositional failures of current diffusion models. By regularizing cross-attention maps through targeted losses and selective parameter updates, SepEn achieves superior alignment and realism without the heavy overhead of inference-time optimization.
Future research directions include addressing polysemy (e.g., distinguishing between an animal "mouse" and a computer "mouse") and exploring more advanced language models to better capture complex relational dependencies in prompts.
Summary updated