Addressing Image Hallucination in Text-to-Image Generation through Factual Image Retrieval

Youngsun Lim, Hyunjung ShimarXiv 2024 · OpenReview

Abstract

Text-to-image generation has shown remarkable progress with the emergence of diffusion models. However, these models often generate factually inconsistent images, failing to accurately reflect the factual information and common sense conveyed by the input text prompts. We refer to this issue as Image Hallucination. Drawing from studies on hallucinations in language models, we classify this problem into three types and propose a methodology that uses factual images retrieved from external sources to generate realistic images. Depending on the nature of the hallucination, we employ off-the-shelf image editing tools, either InstructPix2Pix or IP-Adapter, to leverage factual information from the retrieved image. This approach enables the generation of images that accurately reflect the facts and common sense.

Introduction: The Challenge of Image Hallucination

While Large Language Models (LLMs) are frequently scrutinized for textual hallucinations, text-to-image (T2I) models like DALL-E 3 and Stable Diffusion suffer from a parallel phenomenon: Image Hallucination. This occurs when a model generates visuals that are factually incorrect despite being prompted with specific historical or contextual details.

For instance, a prompt for "The Statue of Liberty in 1890" typically results in the iconic blue-green statue familiar to modern observers. However, in 1890, the statue was still its original copper-brown color. This discrepancy arises from co-occurrence bias in training data, where the statue is overwhelmingly associated with its current oxidized state. Such inaccuracies pose significant risks in fields like journalism and education where visual accuracy is paramount.

A typical image hallucination where the Statue of Liberty is incorrectly generated as green for the year 1890 due to training data bias.

Taxonomy of Image Hallucination

The authors categorize image hallucinations into three distinct types:

  1. Factual Inconsistency: Driven by co-occurrence bias (e.g., assuming all statues of liberty are green).
  2. Outdated Knowledge: The model fails to account for temporal changes, such as generating a current world leader when asked for one from a decade ago.
  3. Factual Fabrication: The generation of scenarios that are physically plausible but factually non-existent (e.g., heavy snow at the Golden Gate Bridge).

Methodology: A Tuning-Free Retrieval Framework

To address these issues without the prohibitive cost of retraining foundation models, this paper proposes a tuning-free, retrieval-augmented framework. The process involves three main stages:

  1. Initial Generation & Retrieval: A base T2I model generates an initial image while the prompt is simultaneously used to fetch factual reference images via the Google Search API.
  2. User Selection: A human-in-the-loop selects the most factually accurate retrieved image to serve as the "ground truth" guide.
  3. Dual-Path Correction:
    • Property-Specific Errors: For simple attribute corrections (e.g., color), GPT-4 generates a text-based editing instruction. This instruction is processed by InstructPix2Pix to modify the initial image.
  4. Complex/Wide-Area Errors: For errors involving complex features like human faces, the system uses IP-Adapter. GPT-4 creates a descriptive factual prompt, and the IP-Adapter uses the retrieved image as a visual guide to ensure the final output matches the reference's specific features.

Key Results and Insights

The proposed method successfully corrects various hallucination types by grounding the generative process in real-world data:

  • Historical Accuracy: Successfully corrected the Statue of Liberty's color to copper-brown for the year 1890.
  • Temporal Accuracy: Depicted historical figures in their correct temporal context. For example, when prompted for the Chancellor of Germany in 2015, the system correctly generates Angela Merkel, whereas base models often default to more recent or generic figures.
  • Geographic Accuracy: Removed hallucinated weather patterns, such as snow from summer landscapes of Mount Fuji or the Golden Gate Bridge, reflecting the rare reality of those climates.
Comparison of base model generation (DALL-E 3), retrieved factual image, and the corrected output for a prompt regarding Angela Merkel.

Conclusion and Future Directions

This research demonstrates that external factual retrieval can significantly mitigate image hallucinations in T2I models. By leveraging off-the-shelf editing tools in a tuning-free pipeline, the framework provides a scalable way to ensure visual factualness. Future work will focus on automating the image selection process and developing standardized quantitative benchmarks specifically for measuring image hallucination.

Summary updated

Abstract

Text-to-image generation has shown remarkable progress with the emergence of diffusion models. However, these models often generate factually inconsistent images, failing to accurately reflect the factual information and common sense conveyed by the input text prompts. We refer to this issue as Image hallucination. Drawing from studies on hallucinations in language models, we classify this problem into three types and propose a methodology that uses factual images retrieved from external sources to generate realistic images. Depending on the nature of the hallucination, we employ off-the-shelf image editing tools, either InstructPix2Pix or IP-Adapter, to leverage factual information from the retrieved image. This approach enables the generation of images that accurately reflect the facts and common sense.
BibTeX
@misc{lim2024addressing,
  author = {Youngsun Lim and Hyunjung Shim},
  title = {{Addressing Image Hallucination in Text-to-Image Generation through Factual Image Retrieval}},
  year = {2024},
  eprint = {2407.10683},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2407.10683},
}
Figure