Skip to main content
QUICK REVIEW

[Paper Review] Grounded Text-to-Image Synthesis with Attention Refocusing

Quynh Phung, Songwei Ge|arXiv (Cornell University)|Jun 8, 2023
Generative Adversarial Networks and Image SynthesisComputer Science7 citations
TL;DR

This paper proposes a training-free attention-refocusing method to improve text-to-image synthesis controllability by regularizing cross- and self-attention layers using layout-guided losses. By leveraging GPT-4 to generate spatial layouts and applying novel SAR and R or SAR losses, the approach significantly enhances alignment with complex prompts—achieving up to 10% accuracy gain on benchmark tasks like spatial relationships and object counting.

ABSTRACT

Driven by the scalable diffusion models trained on large-scale datasets, text-to-image synthesis methods have shown compelling results. However, these models still fail to precisely follow the text prompt involving multiple objects, attributes, or spatial compositions. In this paper, we reveal the potential causes in the diffusion model's cross-attention and self-attention layers. We propose two novel losses to refocus attention maps according to a given spatial layout during sampling. Creating the layouts manually requires additional effort and can be tedious. Therefore, we explore using large language models (LLM) to produce these layouts for our method. We conduct extensive experiments on the DrawBench, HRS, and TIFA benchmarks to evaluate our proposed method. We show that our proposed attention refocusing effectively improves the controllability of existing approaches.

Motivation & Objective

  • To address the persistent issue of poor alignment in text-to-image diffusion models when generating complex prompts with multiple objects, attributes, and spatial relationships.
  • To identify attention misalignment in cross- and self-attention layers as a root cause of object mixing, missing entities, and attribute confusion.
  • To develop a model-agnostic, training-free method that improves controllability by refocusing attention maps using explicit spatial layouts.
  • To explore the feasibility of using large language models like GPT-4 to generate accurate, structured spatial layouts from natural language prompts.
  • To enable iterative, language-based image refinement by combining LLMs with grounded text-to-image generation.

Proposed method

  • Proposes two novel losses—SAR (Spatial Attention Regularization) and R or SAR (Refocusing with Object-level Regularization)—to refine attention maps during sampling in both cross- and self-attention layers.
  • Uses spatial layouts (e.g., bounding boxes with labels) as supervision to guide attention toward correct regions, reducing confusion between similar-looking objects.
  • Integrates GPT-4 with in-context learning and prompt engineering to generate structured, valid layout representations from text prompts.
  • Applies the losses in a two-stage pipeline: first generate layout via LLM, then synthesize image using grounded diffusion models like GLIGEN or ControlNet.
  • Ensures model-agnostic compatibility by applying losses at inference time without fine-tuning the base text-to-image model.
  • Enables iterative image editing by prompting LLMs to modify layouts, which are then used to generate updated images.

Experimental results

Research questions

  • RQ1Can attention misalignment in cross- and self-attention layers explain failures in multi-object, attribute-rich text-to-image generation?
  • RQ2Can layout-guided losses effectively refocus attention to reduce object confusion and improve prompt alignment?
  • RQ3Can large language models like GPT-4 generate accurate and valid spatial layouts from natural language prompts for use in grounded image synthesis?
  • RQ4Does combining LLM-generated layouts with attention-refocusing losses outperform baseline methods on complex benchmarks?
  • RQ5Can the framework support interactive, language-based image editing through iterative layout refinement?

Key findings

  • Applying SAR and R or SAR losses to GLIGEN improves performance by up to 10% on the TIFA benchmark, with a 6% gain in spatial relationship accuracy.
  • The method consistently improves over strong baselines across DrawBench, HRS, and TIFA benchmarks, demonstrating robustness to complex prompts.
  • GPT-4 generates layouts with 98.5% format accuracy, 98.5% validity, and 88.5% correctness on the HRS benchmark, outperforming Llama 1, Llama 2, and GPT-3.
  • The two-stage pipeline using GPT-4 and attention-refocusing surpasses single-stage Stable Diffusion in prompt understanding and object relationship alignment.
  • Failure cases occur primarily when prompts involve many objects or when layout-to-image alignment breaks due to distribution shift, especially in object counting and size estimation.
  • The framework enables interactive image editing via LLM prompting, allowing users to iteratively refine images through natural language instructions.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.