Object-Attribute Binding in Text-to-Image Generation: Evaluation and Control

Maria Mihaela Trusca, Wolf Nuyts, Jonathan Thomm, Robert Honig, Thomas Hofmann, Tinne Tuytelaars, Marie-Francine MoensarXiv 2024

Abstract

Current diffusion models create photorealistic images given a text prompt as input but struggle to correctly bind attributes mentioned in the text to the right objects in the image. This is evidenced by our novel image-graph alignment model called EPViT (Edge Prediction Vision Transformer) for the evaluation of image-text alignment. To alleviate the above problem, we propose focused cross-attention (FCA) that controls the visual attention maps by syntactic constraints found in the input sentence. Additionally, the syntax structure of the prompt helps to disentangle the multimodal CLIP embeddings that are commonly used in T2I generation. The resulting DisCLIP embeddings and FCA are easily integrated in state-of-the-art diffusion models without additional training of these models. We show substantial improvements in T2I generation and especially its attribute-object binding on several datasets.

Introduction

While modern text-to-image (T2I) models like Stable Diffusion produce high-fidelity images, they frequently suffer from "attribute leakage." This phenomenon occurs when attributes (like colors or textures) intended for one object are incorrectly applied to another. For instance, a prompt for "a golden car and a red watch" might result in a red car. This failure stems from the entanglement of semantic information within CLIP embeddings and the lack of spatial constraints in standard cross-attention mechanisms.

Furthermore, traditional evaluation metrics like the CLIP score are often too coarse to detect these binding errors, as they measure global similarity rather than fine-grained object-attribute relationships.

EPViT: A New Standard for Evaluation

To address the limitations of existing metrics, this research introduces the Edge Prediction Vision Transformer (EPViT). Unlike standard CLIP, which provides a global alignment score, EPViT is specifically trained to predict the "edges" of an image graph. It assesses whether a specific attribute correctly describes a specific object within the generated scene. On the DAA-200 (Difficult Adversarial Attributes) benchmark, EPViT achieved 91% accuracy in identifying correctly bound images, significantly outperforming CLIP's 63%.

Methodology: FCA and DisCLIP

The authors propose two training-free, "plug-and-play" modules to improve attribute binding by leveraging the linguistic syntax of the input prompt.

Overview of the DisCLIP and FCA framework. DisCLIP disentangles embeddings using constituency trees, while FCA uses dependency parsing to mask cross-attention.

Disentangled CLIP (DisCLIP)

Standard CLIP embeddings often "smear" information across the entire prompt. DisCLIP utilizes a constituency tree to break the prompt into its grammatical components (e.g., "a golden car" and "a red watch"). By encoding these constituents separately and then concatenating them, the model prevents semantic bleeding during the initial text encoding phase.

Focused Cross-Attention (FCA)

FCA modifies the diffusion process by applying syntactic constraints to visual attention. Using a syntactic dependency parse, FCA creates a "focus mask" that restricts the visual attention of an attribute to the spatial regions where its corresponding object is active. This ensures that "golden" only influences the pixels belonging to the "car."

Experimental Results

The proposed methods were evaluated across several benchmarks, including CC-500 (Concept Conjunction) and AE-276.

Qualitative comparison showing how FCA and DisCLIP improve attribute binding across multiple base models (Stable Diffusion, DeepFloyd IF, SynGen, etc.).

Key findings include:

  • Human Preference: In human evaluations on the CC-500 dataset, the inclusion of FCA and DisCLIP improved attribute binding by up to 25 percentage points.
  • Broad Applicability: As shown in the visual comparisons, these modules successfully enhance various architectures, including Stable Diffusion, DeepFloyd IF, and SynGen, without requiring any retraining of the base models.
  • Fidelity Preservation: Quantitative metrics (FID and IS) on MSCOCO confirmed that these constraints improve text-image alignment without degrading the overall photorealism or quality of the generated images.

Conclusion

By treating the grammatical structure of a sentence as a reliable spatial prior, FCA and DisCLIP provide a robust, training-free solution to the problem of attribute leakage. Combined with the more sensitive EPViT evaluation metric, this work offers a comprehensive framework for both controlling and measuring fine-grained alignment in text-to-image generation.

Summary updated

BibTeX
@misc{trusca2024object,
  author = {Maria Mihaela Trusca and Wolf Nuyts and Jonathan Thomm and Robert Honig and Thomas Hofmann and Tinne Tuytelaars and Marie-Francine Moens},
  title = {{Object-Attribute Binding in Text-to-Image Generation: Evaluation and Control}},
  year = {2024},
  eprint = {2404.13766},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2404.13766},
}
Figure