Abstract
Text-to-image diffusion models have shown great success in generating high-quality text-guided images. Yet, these models may still fail to semantically align generated images with the provided text prompts, leading to problems like incorrect attribute binding and/or catastrophic object neglect. Given the pervasive object-oriented structure underlying text prompts, we introduce a novel object-conditioned Energy-Based Attention Map Alignment (EBAMA) method to address the aforementioned problems. We show that an object-centric attribute binding loss naturally emerges by approximately maximizing the log-likelihood of a z-parameterized energy-based model with the help of the negative sampling technique. We further propose an object-centric intensity regularizer to prevent excessive shifts of objects attention towards their attributes. Extensive qualitative and quantitative experiments, including human evaluation, on several challenging benchmarks demonstrate the superior performance of our method over previous strong counterparts. With better aligned attention maps, our approach shows great promise in further enhancing the text-controlled image editing ability of diffusion models.
Introduction: The Challenge of Semantic Alignment
Current state-of-the-art diffusion models, such as Stable Diffusion, excel at generating visually stunning imagery but often struggle with semantic fidelity. This misalignment typically manifests in two ways: incorrect attribute binding (e.g., "a purple crown and a blue suitcase" resulting in a blue crown) and catastrophic object neglect (where one or more requested objects are omitted entirely). These issues are fundamentally linked to the model's internal cross-attention maps, which fail to correctly localize attributes to their corresponding objects or maintain sufficient activation for all requested entities.
Methodology: Energy-Based Attention Map Alignment (EBAMA)
EBAMA is an inference-time optimization technique that requires no retraining or fine-tuning of the base diffusion model. The method operates by treating the relationship between objects and their attributes as an Energy-Based Model (EBM).
The workflow begins with object-oriented parsing using a dependency parser to identify nouns and their modifiers. The core optimization involves a dual-loss objective applied to the latent noise ($z_t$) during the denoising process:
- Object-Centric Binding Loss ($L_b$): This loss maximizes the cosine similarity between the attention maps of an object and its modifiers. Crucially, it employs negative sampling to push unrelated token maps away from the object's map, preventing attribute leakage.
- Intensity Regularizer ($L_n$): To combat object neglect, this regularizer ensures that the maximum intensity of an object's attention map remains high during the critical early stages of generation.
By updating $z_t$ based on the gradient of these losses, EBAMA steers the diffusion process toward a state that satisfies the semantic constraints of the prompt.
Experimental Evaluation and Results
The authors evaluated EBAMA across three benchmarks: the AnE dataset (simple animal/object pairs), the DVMP dataset (complex multi-object prompts), and ABC-6K (natural language captions from MSCOCO).
EBAMA consistently outperformed baseline methods like Attend-and-Excite (AnE) and SynGen (SG). Quantitative metrics showed that EBAMA achieved the highest "Min Sim" scores, indicating it is the most reliable at ensuring all requested objects appear correctly. Qualitative results, as seen in the figure below, highlight the method's ability to maintain distinct color boundaries and prevent object omission in complex scenes.
Human evaluations further confirmed these findings, with raters significantly preferring EBAMA-generated images for their adherence to complex, "in-the-wild" natural language prompts.
Conclusion and Future Directions
EBAMA offers a mathematically grounded, training-free solution to the persistent problems of attribute leakage and object neglect in diffusion models. While the optimization steps introduce some computational overhead during inference, the resulting improvements in semantic alignment are substantial. Future research may focus on optimizing this overhead and leveraging these aligned attention maps to enhance fine-grained, text-controlled image editing.
Summary updated