Fine-grained Cross-modal Fusion based Refinement for Text-to-Image Synthesis

Haoran Sun, Yang Wang, Haipeng Liu, Biao Qian

TL;DR

FF-GAN introduces a novel multi-stage framework for text-to-image synthesis that moves beyond simple feature concatenation. By utilizing a Fine-grained text-image Fusion Block (FF-Block) based on affine transformations and a Global Semantic Refinement (GSR) module, the model achieves significantly higher semantic consistency and visual detail, particularly for complex textual descriptions.

What Problem Does This Paper Address?

Generating realistic images from text (text-to-image synthesis) is a classic "cross-modal" challenge. While multi-stage Generative Adversarial Networks (GANs) have made huge strides, they often struggle with semantic mismatch. A model might generate a high-quality image of a bird, but ignore specific details in the prompt like "red eyes" or a "white superciliary."

The authors identify two main culprits:

  1. Ineffective Fusion: Standard methods often just concatenate text and image features or use basic attention. This doesn't bridge the "semantic gap" well enough to tell the generator exactly which regions need refinement.
  2. Loss of Diversity: Techniques like Conditional Batch Normalization (CBN) can help, but normalizing visual features often leads to a loss of visual diversity.

Methods

The authors propose FF-GAN, which refines a coarse initial image through two key novel components:

  • Fine-grained text-image Fusion Block (FF-Block): Instead of simple concatenation, the FF-Block uses an attention mechanism to select relevant word-level features. It then applies an affine transformation—specifically, linguistic-conditional scaling ($W$) and shifting ($b$)—directly to the visual feature maps.
  • The scaling matrix acts as a "regional selector," highlighting sub-regions that match specific words.
  • The shifting matrix injects fine-grained details that might have been missed in the initial coarse stage.
  • Global Semantic Refinement (GSR): While the FF-Block focuses on local, word-level details, the GSR ensures the overall image remains consistent with the entire sentence. It uses a sentence-level attention mechanism to smooth the refinement process from a global perspective.
The overall framework of FF-GAN, showing the initial generation (Stage 0) followed by two refinement stages (Stage 1 & 2) utilizing FF-Blocks and GSR.

Datasets

The model was evaluated on two standard, yet challenging, benchmarks:

  • CUB-200: A dataset of 200 bird species (approx. 12k images) with ten fine-grained linguistic descriptions per image.
  • COCO: A much more complex dataset (80k training images) featuring multiple objects and varied backgrounds, with five captions per image.

Key Insights and Ideas

  • Affine Transformation as a Precision Tool: The "aha moment" here is that affine transformations are more expressive than concatenation. By scaling and shifting visual features based on text, the model can "highlight" specific pixels for modification without washing out the diversity of the rest of the image.
  • Balancing Local and Global: The interplay between the FF-Block (local/word-level) and GSR (global/sentence-level) is crucial. Local refinement alone can lead to global inconsistency, while global-only refinement lacks the "vivid details" that make an image truly match a complex prompt.
  • Visualizing Attention: The authors demonstrate that their attention weights correctly map words like "bill" or "white" to the appropriate regions of the bird during the refinement stages, proving the model is actually "learning" the mapping between words and visual attributes.
Visualization of the attention maps, showing how the model learns to focus on specific body parts (like the bill) as it progresses through refinement stages.

Key Results

FF-GAN outperformed state-of-the-art models like Attn-GAN and DM-GAN across both datasets:

  • Semantic Consistency (R-precision): On CUB-200, FF-GAN achieved 80.49%, a massive jump from DM-GAN's 72.31%. On the complex COCO dataset, it reached 91.28%.
  • Image Realism (FID): FF-GAN achieved an FID score of 15.13 on CUB-200 and 29.44 on COCO. Lower is better for FID, and these scores represent a significant improvement in generating authentic-looking images compared to most competitors.
  • Qualitative Superiority: As seen in Figure 4, FF-GAN successfully captures complex details (like "roundish" bird shapes or distinct cows in a field) where previous models produced blurry or mismatched results.
Qualitative comparison showing FF-GAN (bottom row) capturing fine details like "white superciliary" and "roundish" shapes better than Attn-GAN and DM-GAN.

Limitations and Future Work

The authors note that due to GPU memory limitations, they only repeated the refinement process twice (up to 256x256 resolution). While the results are impressive, scaling this to even higher resolutions or more refinement stages remains a computational challenge. Future work could explore more memory-efficient ways to implement these fine-grained transformations.

Summary updated

BibTeX
@misc{sun2023fine,
  author = {Haoran Sun and Yang Wang and Haipeng Liu and Biao Qian},
  title = {{Fine-grained Cross-modal Fusion based Refinement for Text-to-Image Synthesis}},
  year = {2023},
  eprint = {2302.08706},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2302.08706},
}
Figure