Semantics Disentangling for Text-To-Image Generation

Guojun Yin, Bin Liu, Lu Sheng, Nenghai Yu, Xiaogang Wang, Jing Shao

TL;DR

SD-GAN (Semantics Disentangling GAN) introduces a dual-branch architecture to solve a major challenge in text-to-image synthesis: linguistic diversity. By utilizing a Siamese structure and a novel "Semantic-Conditioned Batch Normalization" (SCBN), the model learns to extract a "semantic common ground" from varied descriptions while preserving fine-grained details.

What Problem Does This Paper Address?

Generating photo-realistic images from text is complicated by the subjectivity of human language. Different users may describe the same visual scene using distinct vocabulary or phrasing (e.g., "a yellow bird with black wings" vs. "this bird has speckled wings and a yellow belly").

Comparison of standard GANs vs. SD-GAN handling linguistic diversity.

Standard GANs often treat each sentence as a unique, holistic instruction, leading to "generation deviation" where minor phrasing changes result in inconsistent or low-quality images. SD-GAN aims to disentangle these semantics, identifying the high-level "essence" of an object for consistency while capturing descriptive nuances for diversity.

Methods

The Semantics Disentangling GAN (SD-GAN) architecture rests on two primary pillars:

  1. Siamese Discriminator with Contrastive Loss: The model processes pairs of descriptions. For "intra-class" pairs (two descriptions of the same image), a contrastive loss forces generated images to be semantically close in the discriminator's feature space. For "inter-class" pairs, it pushes them apart. This process distills the semantic core of the object regardless of phrasing.
  2. Semantic-Conditioned Batch Normalization (SCBN): While the Siamese structure ensures consistency, SCBN handles detail. It modulates visual feature maps using linguistic cues at both the sentence level (global context) and word level (local details), allowing text to directly shape visual patterns during up-sampling.
The SD-GAN architecture featuring a multi-stage Siamese structure and contrastive loss.

The backbone follows a hierarchical, coarse-to-fine structure, generating images at increasing resolutions from 64x64 to 256x256.

Datasets and Evaluation

The model was evaluated on two standard benchmarks:

  • CUB-200-2011: 200 bird species with fine-grained textual descriptions.
  • MS-COCO: A complex dataset featuring diverse objects and scenes, presenting a significant challenge for generative models.

Key Insights

  • Consistency vs. Diversity: Effective generation requires a balance between recognizing that different sentences share the same meaning (via Siamese/Contrastive Loss) and remaining flexible enough to adjust the image based on specific adjectives (via SCBN).
  • Normalization as Modulation: Using text to modulate normalization parameters (scaling and shifting) is more effective than simple concatenation for injecting style and detail into the synthesis process.
  • Linguistic Robustness: Training on pairs makes the model robust to "expression variants," learning that different phrases can be functionally identical for pixel synthesis.

Key Results

SD-GAN achieved state-of-the-art results at the time of its publication:

  • Inception Score (IS): On the CUB dataset, it reached 4.67 (up from AttnGAN's 4.36). On MS-COCO, it achieved a significant jump from 25.89 to 35.69.
  • Human Evaluation: Users preferred SD-GAN results approximately 70% of the time over StackGAN and AttnGAN due to better text relevance and clarity.
  • Qualitative Stability: Visual outputs demonstrate that SD-GAN maintains consistent object identity across different descriptions, whereas previous models often changed species or colors entirely.

Limitations and Future Work

Despite improvements, generating complex multi-object scenes in MS-COCO remains difficult. Additionally, the Siamese structure increases computational overhead during training. Future work may explore more sophisticated visual-semantic embedding methods to further refine the disentangling of complex spatial relationships.

Summary updated

BibTeX
@inproceedings{yin2019semantics,
  author = {Guojun Yin and Bin Liu and Lu Sheng and Nenghai Yu and Xiaogang Wang and Jing Shao},
  title = {{Semantics Disentangling for Text-To-Image Generation}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2019},
  doi = {10.1109/cvpr.2019.00243},
}
Figure