Text-to-Image Synthesis with CLIP and StyleGAN

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Current text-to-image synthesis methods face challenges in generating novel and underrepresented compositions of attributes, leading to issues with robust classification under distributional shift and bias in applications like AI-based systems.

Innovation Solution

A computer-implemented method using a Contrastive Language-Image Pre-Training (CLIP) model and Style Generative Adversarial Network (StyleGAN) to learn embeddings and generate images by predicting text directions and adjusting latent codes, with triplet loss and contrastive loss to align and disentangle attribute directions.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Adaptability or versatility

If text-to-image synthesis uses conventional generative models, then image generation is achieved, but the generated images lack novel and underrepresented compositions of attributes

Engineering Contradiction:
ImprovecompositionalityVSAvoidrobust classification under distributional shift
Core Design Contradiction:
Adaptability or versatilityVSReliability

Solution Approach 1:

The patent segments the text-to-image synthesis process into multiple independent components: a CLIP model for text embedding, a StyleGAN for image generation, and a text-to-direction model for attribute mapping. Each component handles a specific aspect of the synthesis task, allowing for improved compositionality and robustness through modular design.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent introduces a text-to-direction model as an intermediary component that maps text descriptions to latent space directions in StyleGAN. This intermediary layer enables precise control over attribute compositions by translating textual attributes into corresponding latent directions, thereby generating novel compositions while maintaining robustness.

Inventive Principle:
Principle #24Intermediary (Mediator)

2Adaptability or versatility

If text-to-image synthesis uses conventional generative models, then image generation is achieved, but bias is introduced in applications like AI-based systems

Engineering Contradiction:
ImprovecompositionalityVSAvoidbias
Core Design Contradiction:
Adaptability or versatilityVSObject-affected harmful factors

Solution Approach 1:

The patent changes the parameter space by operating in the latent space of StyleGAN rather than directly manipulating pixel data. By training the text-to-direction model to map text to specific latent directions, the system can control and adjust attributes independently, reducing bias while maintaining compositionality through precise parameter control in the latent space.

Inventive Principle:
Principle #35Parameter changes

3Measurement precision

If CLIP model guided contrastive loss is used to train text-to-direction model, then text direction alignment is improved, but computational complexity increases

Engineering Contradiction:
Improvetext direction alignmentVSAvoidcomputational complexity
Core Design Contradiction:
Measurement precisionVSDevice complexity

Solution Approach 1:

The patent performs preliminary action by pre-training the CLIP model and StyleGAN before training the text-to-direction model. The CLIP model pre-embeds text and image data, and StyleGAN pre-learns the image generation manifold. This preliminary training allows the text-to-direction model to focus only on mapping text to latent directions, reducing the computational complexity of the final training task while maintaining high alignment precision.

Inventive Principle:
Principle #10Preliminary action

Data Source

PatentUS20230153606A1Compositional text-to-image synthesis with pretrained models
Publication Date: 2023.05.18 NEC LABORATORIES AMERICA INC
  • US20230153606A1 patent drawing
  • US20230153606A1 patent drawing
  • US20230153606A1 patent drawing

AI summary

A method is provided that includes training a CLIP model to learn embeddings of images and text from matched image-text pairs. The text represents image attributes. The method trains a StyleGAN on images in a training dataset of matched image-text pairs. The method also trains, using a CLIP model guided contrastive loss which attracts matched text embedding pairs and repels unmatched pairs, a text-to-direction model to predict a text direction that is semantically aligned with an input text responsive to the input text and a random latent code. A triplet loss is used to learn text directions using the embeddings learned by the trained CLIP model. The method generates, by the trained StyleGAN, positive and negative synthesized images by respectively adding and subtracting the text direction in the latent space of the trained StyleGAN corresponding to a word for each of the words in the training dataset.