Variational Distribution Learning for Unsupervised Text-to-Image Generation

Minsoo Kang, Doyup Lee, Jiseob Kim, Saehoon Kim, Bohyung HanCVPR 2023

Abstract

We propose a text-to-image (T2I) generation algorithm based on deep neural networks designed for scenarios where text captions for images are unavailable during training. Instead of generating pseudo-ground-truth sentences using existing image captioning methods, we leverage a pretrained CLIP model to align embeddings of images and texts in a joint space. We optimize the generation model by maximizing the data log-likelihood conditioned on pairs of image-text CLIP embeddings. To bridge the domain gap between visual and linguistic features, we employ a variational inference framework that efficiently estimates an approximate posterior of the hidden text embedding given an image and its CLIP feature. Experimental results demonstrate that our proposed framework, Variational Distribution Learning (VDL), outperforms existing approaches by significant margins under unsupervised and semi-supervised settings.

Introduction

State-of-the-art text-to-image models, such as DALL-E 2 and Stable Diffusion, have achieved remarkable results but rely heavily on massive datasets of paired images and human-annotated captions. Producing such high-quality annotations is both expensive and time-consuming. Consequently, researchers have turned toward unsupervised T2I generation, where models learn to synthesize images from text without seeing a single ground-truth pair during training.

Most existing unsupervised methods utilize CLIP (Contrastive Language-Image Pre-training), which maps images and text into a shared embedding space. A common strategy is to use an image's CLIP embedding as a "proxy" for a text embedding during training. However, CLIP’s image and text embeddings are not perfectly aligned; a subtle but significant "domain gap" exists between them. Previous methods often ignored this gap or attempted to mitigate it with simple Gaussian noise. This discrepancy causes the model to learn on noisy image-based features while being expected to perform on clean text features at inference, often leading to poor image-text alignment.

Methodology: Variational Distribution Learning (VDL)

To address the domain gap, we treat the text embedding as a hidden (latent) random variable and the image/CLIP features as observable variables. Our approach consists of a two-stage training strategy.

1. The VDL Stage

Instead of a direct mapping, we learn an encoder-decoder architecture. The encoder estimates the distribution of a text embedding given an image embedding, while the decoder attempts to reconstruct the image embedding from that estimated text embedding. Two key technical choices define this stage:

  • Jensen-Shannon (JS) Divergence: Standard variational autoencoders typically use Kullback-Leibler (KL) divergence, which assumes a Gaussian distribution. However, CLIP features reside on the surface of a unit hypersphere. We utilize JS divergence via adversarial training, allowing for more flexible, "implicit" distributions that better respect the geometry of the CLIP space.
  • Relational Knowledge Distillation (RKD): To ensure the estimated text embeddings are semantically meaningful, we enforce structural consistency. We require that the relationships between estimated text embeddings mimic the relationships between the original image embeddings. If two images are visually similar, their inferred text embeddings should maintain a similar relational distance.

2. T2I Model Training

Once the VDL stage can reliably "hallucinate" plausible text embeddings for images, these distributions are used to train a standard generator. Because the VDL framework is model-agnostic, it can be paired with various architectures, including StyleGAN2 or Latent Diffusion Models (LDM).

Experimental Setup

We evaluated the VDL framework on three major benchmarks:

  • MS-COCO: The standard dataset for image captioning and T2I.
  • Conceptual Captions 3M (CC3M): A larger, noisier dataset scraped from the web.
  • LN-COCO (Localized Narratives): Used to evaluate the model's ability to handle detailed, descriptive text.

In our unsupervised setting, we utilized images and a separate, shuffled corpus of text. The model was never shown which caption belonged to which image during the training process.

Results and Analysis

The VDL framework established a new state-of-the-art for unsupervised T2I generation across both quantitative and qualitative metrics.

Quantitative Performance

On the MS-COCO dataset using a StyleGAN2 backbone, VDL achieved an FID (Fréchet Inception Distance) of 13.22, significantly outperforming the previous leading unsupervised method, LAFITE, which scored 18.04.

More importantly, the Sim$_{txt}$ metric—which measures the alignment between the generated image and the text prompt—saw a massive improvement. VDL reached a score of 0.6104, compared to LAFITE’s 0.0965. This indicates that VDL is far more effective at capturing the semantic intent of the text prompt despite the lack of paired training data.

Model Agnosticism

The framework proved robust across different generative architectures. When integrated with a Latent Diffusion Model (LDM), VDL achieved an FID of 13.68 on MS-COCO, demonstrating that the variational approach to distribution learning is not limited to GAN-based generators.

Qualitative Impact

Visual analysis confirms that VDL-generated images are more coherent and better follow complex prompts. While baseline models often fail to capture the full context of a prompt (e.g., "two kids standing outside flying a kite"), VDL successfully synthesizes the various elements of the scene with higher fidelity.

Conclusion

Variational Distribution Learning effectively bridges the domain gap in unsupervised T2I by treating text embeddings as latent variables rather than simple proxies. By respecting the geometry of the CLIP embedding space and enforcing structural consistency through RKD, VDL allows models to learn complex text-to-image mappings without expensive human annotations. While the method currently relies on a pretrained CLIP model, it represents a significant step toward more data-efficient and flexible generative AI.

Summary updated

BibTeX
@inproceedings{kang2023variational,
  author = {Minsoo Kang and Doyup Lee and Jiseob Kim and Saehoon Kim and Bohyung Han},
  title = {{Variational Distribution Learning for Unsupervised Text-to-Image Generation}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2023},
  url = {https://openreview.net/forum?id=vsouBcVwqk},
}
Figure