Semantics Disentangling for Text-to-Image Generation

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

Introduction: The Challenge of Linguistic Diversity

Generating photo-realistic images from natural language descriptions is a "holy grail" task in computer vision. However, a significant hurdle remains: the inherent subjectivity of human language. Different observers may describe the same scene using vastly different vocabulary or focusing on different attributes. For instance, one person might describe a bird by its "speckled wings," while another emphasizes its "black crown."

Existing Generative Adversarial Networks (GANs) often struggle with this linguistic diversity. When presented with two different descriptions of the same ground-truth image, standard models frequently produce inconsistent visual outputs. This failure stems from an inability to "disentangle" semantics—distinguishing between high-level category identity (e.g., "it is a yellow bird") and low-level descriptive nuances (e.g., "it has a sharp beak").

SD-GAN addresses the inconsistency of standard text-to-image models by distilling semantic essence from diverse descriptions.

The SD-GAN Framework

To address the consistency-diversity trade-off, the authors introduce SD-GAN (Semantics Disentangling GAN). The model is built upon two primary innovations: a Siamese training structure and a novel normalization layer.

Siamese Structure with Contrastive Loss

During the training phase, SD-GAN employs a Siamese architecture that processes pairs of descriptions. These pairs are categorized as either "intra-class" (referring to the same image) or "inter-class" (referring to different images). A contrastive loss function is applied to the discriminator's feature space:

  • Intra-class pairs: The generator is forced to produce images that are visually similar, encouraging the model to find the "semantic commons"—the core identity that remains invariant across different descriptions.
  • Inter-class pairs: The model pushes the generated features apart, ensuring distinct visual identities for different objects.
The multi-stage SD-GAN framework utilizes contrastive loss across different image scales to ensure semantic consistency.

Semantic-Conditioned Batch Normalization (SCBN)

While consistency is vital, the model must also remain sensitive to specific descriptive details. The Semantic-Conditioned Batch Normalization (SCBN) layer modulates neural activations using both global sentence-level features and fine-grained word-level features. By scaling and shifting feature maps based on specific linguistic cues (e.g., "red" or "striped"), SCBN allows the model to inject precise details into the visual synthesis process across multiple scales ($G_0$ to $G_2$).

Experimental Results and Insights

SD-GAN was evaluated on the CUB-200-2011 bird dataset and the complex MS-COCO scene dataset. The model achieved state-of-the-art performance at the time of publication:

  • Inception Score (IS): On the CUB dataset, SD-GAN reached a score of 4.67 (up from AttnGAN's 4.36). On MS-COCO, it demonstrated a significant leap from 25.89 to 35.69.
  • Human Evaluation: In subjective rankings, users preferred SD-GAN's outputs nearly 70% of the time over competing models like StackGAN and AttnGAN.
  • Visual Robustness: Qualitative analysis shows that SD-GAN is highly responsive to minor textual changes. For example, altering a single color word in a complex sentence successfully updates the image without disrupting the overall structure.

Conclusion

SD-GAN demonstrates that semantic disentanglement is a "two-way street." The Siamese structure ensures high-level consistency (the "what is it?"), while the SCBN layer provides low-level diversity (the "what does it look like specifically?"). While generating complex multi-object scenes remains a challenge, SD-GAN's ability to distill semantic essence from diverse language marks a significant advancement in robust text-to-image synthesis.

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