Lecture 44 min.
Automatically generating realistic, high-quality images from text descriptions would be interesting and quite useful, since it has many practical applications, but current artificial intelligence systems are still far from this goal, as it is a rather difficult task in computer vision. However, in recent years versatile and powerful recurrent neural network architectures have been developed for learning various representations of text features. Meanwhile, deep convolutional generative adversarial networks (GANs) have begun to generate quite convincing images of specific categories, such as faces, album covers and room interiors. The samples generated by existing text-to-image approaches can roughly reflect the meaning of the given descriptions, but they lack the necessary details and vivid parts of the object. This article examines the formulation and deep architecture of GANs and brings together advances in text-to-image generation.
AI text-to-image synthesis is a process in which neural networks convert a text description into a visual image. This technology has developed widely thanks to deep learning and large datasets consisting of text-image pairs. The main steps of synthesizing images from text are as follows:
1. Text description (input):
The user enters text, for example: "a cat in a hat sits on a lawn near a house". This text describes the visual elements that the AI must turn into a picture.
2. Text analysis (understanding context):
Using language models such as BERT, GPT and T5, the AI parses the text description. At this stage the system identifies the key objects (for example, "cat", "hat", "lawn"), their properties (color, shape) and their relative positions.
3. Image generation (visualizing the text):
After analyzing the text, the system uses one of the image generation models. The most popular approaches include:
DALL·E and DALL·E 2: Developed by OpenAI, these models use transformers to generate images from text. DALL·E 2, in particular, can create high-quality, photorealistic images from descriptions.
Stable Diffusion: A model that works on the principle of diffusion processes, allowing it to generate high-resolution images, starting from noise and gradually refining details based on the text description.
CLIP + VQGAN: A model in which CLIP is used to compare text and images, while VQGAN (a generative adversarial network) creates the image itself. CLIP helps improve the match between the description and the image.
4. Training on data (the AI's store of knowledge):
The models are trained on huge datasets consisting of pairs of images and text descriptions. During training the AI "learns" to associate objects with their visual characteristics and to understand how they should look in images. For example, after analyzing millions of pictures and their captions, the AI begins to "understand" what a "cat" is, what a "hat" is, and how these objects can look in different contexts.
5. Image composition:
During synthesis the AI forms the composition of the image based on the text description. It decides where objects will be placed, how they will interact with each other and which visual elements will be key. For example, if the text describes "a green lawn in front of a house", the AI first determines the background (the lawn) and adds the other objects (the house, the cat) onto it.
6. Post-processing and quality improvement:
After the initial generation stage, the image may undergo additional processing to improve its sharpness, realism and visual match with the text. Some models use GANs (Generative Adversarial Networks), where one block creates an image and another evaluates its quality in order to improve the realism of the result.
Technologies:
CLIP (Contrastive Language-Image Pre-training): helps improve the match between text and images by aligning text and visual representations.
GAN (Generative Adversarial Networks): adversarial neural networks, one of which generates an image while the other evaluates its quality.
VQ-VAE and Diffusion Models: modern approaches for creating high-quality images by gradually refining details based on text descriptions.
Examples of use:
Creating illustrations from a description: images can be generated from text prompts, which is useful in design, marketing and game development.
Visualizing ideas: users can visualize their ideas or concepts without having to draw or model them by hand.
Artistic experiments: generative models can create unique, creative images that are difficult to create by hand.
Thus, AI text-to-image synthesis makes it possible to create images automatically and quickly from natural language, significantly expanding the possibilities of creativity and design.
Text-to-video generation with generative AI uses complex neural networks trained on huge datasets of images and videos to create sequences of frames based on a text description. Here are the main stages of how it works:
1. Text description:
The user enters a text description of what they want to see in the video. For example: "a sunset over mountains with clouds slowly moving in the background".
2. Converting text into visual concepts:
The AI first analyzes the text and extracts keywords and objects that can be visualized, using language models (for example, GPT, BERT). The meaning of the text is broken down into visual elements (objects, actions, scenes), which are then translated into graphic concepts.
3. Generating initial images (frames):
The system uses models such as Stable Diffusion, DALL·E or VQ-VAE-2, which create images from text descriptions. These models are trained on large volumes of captioned images, which allows them to "understand" how to visualize specific objects, scenes or actions from the text.
4. Frame interpolation and animation:
After individual key images are generated, the AI creates smooth transitions between them to form a continuous sequence of video. This is done using interpolation and animation methods, in which intermediate frames are added to create a sense of motion.
5. Motion generation:
For more complex actions, the AI can generate motion based on information about how various objects should change over time (for example, the movement of clouds, falling water, people moving around).
Some models use temporal neural networks or recurrent neural networks (for example, LSTM or GRU) to track changes over time and maintain smooth motion.
6. Post-processing and video enhancement:
At the last stage, additional effects are added, such as adjusting lighting, color and sharpness to improve video quality. This can be done using GANs (Generative Adversarial Networks), which help improve the realism of the image.
Technologies:
The process is based on neural networks such as GAN, VQ-VAE (variational autoencoders), Diffusion Models, as well as recurrent neural networks for temporal processing.
Today (2025), such technologies are already used to create short animations or simple videos from text prompts, although quality and complexity may still be limited.
The deep learning community is rapidly improving generative models. Among them, three promising types can be singled out: autoregressive models (AR models), variational autoencoders (VAE) and generative adversarial networks. At present, GAN networks generate the highest-quality images (photorealistic and diverse, with convincing high-resolution details). Therefore, in this article we will focus on GAN models.
| Model | Inception Score | FID | Resolution of the generated image | Implementation | Modification (difference from GAN) | Example of a generated image | |
|---|---|---|---|---|---|---|---|
| COCO | Caltech-UCSD | ||||||
| Attribute2Image, 2015 | 14.30±0.10 | — | — | 64×64 | yes | Generates an image as a mixture of foreground and background using a layered generative model. |
|
| GAN-INT-CLS, 2016 | 7.88±0.07 | 2.88±0.04 | 60.62 | 64×64 | yes | Trains on text features encoded by a hybrid convolutional-recurrent neural network. |
|
| StackGAN, 2017 | 8.45±0.03 | 3.70±0.04 | 74.05 | 256×256 | yes | The image is generated in two stages: the first stage creates a rough shape and sets the colors of the objects, and the second corrects the defects of the previous stage and adds finer details. |
|
| FusedGAN, 2018 | — | 3.00±0.03 | — | 64×64 | no | The image is generated in two stages: the first sets the style features, and the second generates the image. |
|
| ChatPainter, 2018 | 9.74±0.02 | — | — | 256×256 | no | A dialogue describing the image is used as additional training data. |
|
| StackGAN++, 2018 | 8.30±0.10 | 3.84±0.06 | 81.59 | 256×256 | yes | Generates images at different scales from different branches of a tree-like structure in which several generators share most of their parameters. |
|
| HTIS, 2018 | 11.46±0.09 | — | — | 256×256 | no | Image generation is split into several steps: first a semantic layout is created from the text, then this layout is converted into an image. |
|
| AttnGAN, 2018 | 25.89±0.47 | 4.36±0.03 | 28.76 | 256×256 | yes | Picks out words to generate image regions using an attention mechanism. |
|
| CVAE&GAN, 2018 | — | — | — | 256×256 | no | Separates foreground and background: a CVAE first generates a low-quality picture, and its quality is then improved with a GAN. |
|
| MMVR, 2018 | 8.30±0.78 | — | — | 256×256 | no | Trains on a modified image description. |
|
| MirrorGAN, 2019 | 26.47±0.41 | 4.56±0.05 | — | 256×256 | yes | Generates an image using the idea of learning through re-description. |
|
| Obj-GAN, 2019 | 31.01±0.27 | — | 17.03 | 256×256 | yes | The main principle of image generation is to recognize and create individual objects from the given text description. |
|
| LayoutVAE, 2019 | — | — | — | 256×256 | no | Generates stochastic scene layouts from a given set of words. |
|
| MCA-GAN, 2019 | — | — | — | 256×256 | no | Generates an image from arbitrary viewpoints based on semantic mapping. |
|
Conditional Image Generation from Visual Attributes (Attribute2Image ) models an image as a composite of foreground and background and develops a layered generative model with disentangled latent variables (Fig. 4), which can be learned end to end using a variational autoencoder (VAE). Experimenting with natural images of faces and birds on the Caltech-UCSD and LFW datasets, Attribute2Image demonstrates that it can generate realistic and diverse 64x64 pixel images with disentangled latent representations — a state in which each factor is captured by an individual element of the latent variables. That is, in a model with learned latent representations, shifting one latent variable while keeping the others fixed generates data showing that only the corresponding factor changes (Fig. 3). Thus, the learned generative models show excellent quantitative and visual results in attribute-conditioned image reconstruction and completion tasks.

Figure 4. Architecture of Attribute2Image.
Deep Convolutional Generative Adversarial Network (DCGAN) — is conditioned on text features encoded by a character-level hybrid convolutional-recurrent neural network. DCGAN has an effective architecture (Fig. 1) and a training structure that make it possible to synthesize images of birds and flowers from text descriptions.
To train this model, the Caltech-UCSD dataset was used for birds and Oxford-102 for flowers. In addition, five text descriptions per image were collected and used as evaluation parameters.
In many cases DCGAN can generate visually plausible 64×64 pixel images from text. It is also distinctive in that the model itself is a generative adversarial network, rather than merely using one for post-processing. Text queries are encoded with a text encoder φ, which produces a vector representation of the words. The concept of a conditional generative adversarial network (Conditional Generative Adversarial Network, CGAN) is then applied. Thus, the description embedding φ(t) is first compressed with a fully connected layer to a small dimension (128 was used in practice), then a Leaky ReLU activation function is applied and the result is concatenated with the noise vector z.

Figure 1. Architecture of DCGAN.
Once the model has learned to generate plausible images (Fig. 2), it must also learn to match them to the text description, and it would be good if it learned to judge whether the images correspond to the given description or not. The model must implicitly separate two sources of error: unrealistic images (for any text) and realistic images of the wrong class that do not match the text features. The GAN training algorithm was modified to separate these sources of error. In addition to real/fake inputs, a third type of input was added to the discriminator during training, consisting of real images with mismatched text descriptions, on which the discriminator must learn to score fake images.

Generated images of birds .

Generated images of flowers .
Figure 2. Example of the output of GAN-CLS, GAN-INT and GAN-INT-CLS.
Stacked Generative Adversarial Networks (StackGAN ) are used to generate photo-realistic 256x256 images conditioned on text descriptions. In this model the difficult task of image generation is decomposed into smaller subtasks by means of a sketch-refinement process. Thus, the Stage-I GAN sketches the primitive shape and colors of the object based on the given text description, yielding low-resolution Stage-I images (Fig. 5). The Stage-II GAN takes the Stage-I results and the text descriptions as input and generates high-resolution images with photo-realistic details. It is able to correct defects in the Stage-I results and add finer details during the refinement process. To improve the diversity of the synthesized images and stabilize the training of the CGAN, a technique called Conditioning Augmentation is introduced, which promotes smoothness in the conditioning manifold.
The contributions of the proposed method are as follows:
The Stage-II generator is designed as an encoder-decoder network with residual blocks. As for the discriminator, its structure is similar to that of the Stage-I discriminator, only with additional downsampling blocks, since the image size is larger at this stage.
| Dataset | Inception Score |
|---|---|
| Caltech-UCSD | 3.70±0.04 |
| Oxford-102 | 3.20±0.01 |
| COCO | 8.45±0.03 |
To validate the method, extensive quantitative and qualitative evaluations were carried out. The results of the model are compared with two state-of-the-art text-to-image synthesis methods, GAN-INT-CLS and GAWWN (Fig. 6).

Generated images of birds .

Generated images of flowers .
To improve image generation from descriptions and to obtain controllable sampling, some models split the generation process into several stages. For example, in the Attribute2Image model, generating the background and the foreground separately made controllable sampling possible (fixing the background and changing the main scene, and vice versa). In turn, the FusedGAN model can perform controllable sampling of diverse images with very high fidelity, which is also achieved by splitting the image generation process into stages. In this model, unlike StackGAN, where the several GAN stages are trained separately with full supervision from labeled intermediate images, FusedGAN has a single-stage pipeline with a built-in StackGAN.
Controllable sampling refers to the process of sampling images by varying factors such as style, background and other details. For example, one can generate different images while keeping the background constant, or generate images in different styles while leaving the rest of the context unchanged. The main advantage of this model is that it can use semi-labeled data for training. This means that, in addition to labeled data (an image and its description) for image generation, the model can use images without a text description. The model consists of two interconnected stages (Fig. 19):
Ms acts as a template, feeding additional features to the second generation step. As a result, the generated bird images not only match the description but also preserve the style information. Therefore, instead of learning from scratch, Gc is built on top of Ms, adding styles to it by means of the text description. It should be noted that the model has no explicit hierarchy, so both stages can be trained simultaneously using an alternating optimization method.

Figure 20. Comparison of FusedGAN with other models
To evaluate the quality of the images generated by FusedGAN, 30 thousand images were sampled and the inception scores were computed using a pre-trained model on the Caltech-UCSD test set. The comparison data are given in the table.
| Model | Inception Score |
|---|---|
| GAN-INT-CLS | 2.88±0.04 |
| StackGAN-I | 2.95±0.02 |
| FusedGAN | 3.00±0.03 |
The preceding and following models use text descriptions to create images. However, these may not be informative enough to cover everything shown in the images, and the model will not have enough data to match the objects in the images to the words in the description. Therefore, the ChatPainter model proposes using dialogues that additionally describe the scenes as extra data (for an example, see Fig. 16). This leads to a significant improvement in the Inception score and in the quality of the generated images on the MS COCO dataset (Microsoft COCO dataset). To create the new dataset with dialogues, the descriptions from the MS COCO dataset were combined with data from the Visual Dialog dataset (VisDial) .

Figure 15. Architecture of ChatPainter:
This architecture (Fig. 15) is based on the StackGAN model. StackGAN generates an image in two stages: the first stage generates a coarse 64×64 image, and the second generates an improved 256×256 image.
The text description vector ϕt is formed by encoding the captions with a pre-trained encoder . Two methods are used to generate the dialogue embeddings ζd:
The outputs for the descriptions and the dialogues are then combined and passed as input to the augmentation module (Conditioning Augmentation, CA). The CA module is needed to obtain latent conditioning variables, which are fed to the generator. The architecture of the upsample, downsample and residual blocks (Fig. 15) is kept the same as in the original StackGAN
The test results and a comparison of ChatPainter with other models are given in the table. It shows that ChatPainter, which receives the additional dialogue information, has a higher Inception score than StackGAN. In addition, the recurrent version of ChatPainter turned out better than the non-recurrent version. This is probably because in the non-recurrent version the encoder does not learn well on long sentences, since it collapses the entire dialogue into a single string.
| Model | Inception Score |
|---|---|
| StackGAN | 8.45±0.03 |
| ChatPainter (non-recurrent) | 9.43±0.04 |
| ChatPainter (recurrent) | 9.74±0.02 |
| AttnGAN | 25.89±0.47 |
Although generative adversarial networks (GANs) have shown remarkable success in various tasks, they still face challenges in generating high-quality images. Therefore, this section first proposes StackGAN-v1[12], a two-stage generative adversarial network architecture for text-to-image synthesis. Stage-I still sketches the primitive shape and colors of the scene based on the given text description, yielding low-resolution images. Stage-II still takes the Stage-I results and the text description as input and generates high-resolution images with photo-realistic details. Second, an advanced multi-stage generative adversarial network architecture, StackGAN-v2, is proposed for both conditional and unconditional generative tasks. StackGAN-v2 consists of multiple generators and multiple discriminators arranged in a tree-like structure (Fig. 7); images at multiple scales corresponding to the same scene are generated from different branches of the tree. StackGAN-v2 shows more stable training behavior than StackGAN-v1, thanks to jointly approximating multiple distributions.
Figure 7.[12] Architecture of StackGAN++.
Despite their success, GANs are known to be hard to train. The training process is usually unstable and sensitive to the choice of hyperparameters. When training a GAN to generate high-resolution images (for example, 256x256), the chance that the image distribution and the model distribution share the same support in a high-dimensional space is very small. Moreover, a common failure in GAN training is mode collapse, where many of the generated samples contain the same color or texture pattern.
An advanced multi-stage generative adversarial network architecture, StackGAN-v2, is proposed for both conditional and unconditional generative tasks. StackGAN-v2 has multiple generators that share most of their parameters in a tree-like structure. The input of the network can be seen as the root of the tree, and images of different scales are generated from different branches of the tree. The ultimate goal of the generator at the deepest branch is to create photo-realistic high-resolution images. The generators in the intermediate branches have the progressive goal of producing images from small to large in order to reach the ultimate goal. The whole network is jointly trained to approximate different but highly related image distributions at different branches. In addition, color-consistency regularization (color-consistency regularization) is used so that the generators can produce more consistent samples at different scales.
| Dataset | StackGAN-v1 | StackGAN-v2 |
|---|---|---|
| Caltech-UCSD | 3.70±0.04 | 4.04±0.05 |
| Oxford-102 | 3.20±0.01 | 3.26±0.01 |
| MS COCO | 8.45±0.03 | 8.30±0.10 |
Conditional image generation has also been studied on the basis of these generative models. Most methods use simple conditioning variables such as attributes or class labels. There is also work on image-to-image generation, including photo editing, domain transfer and super-resolution. However, super-resolution methods can only add a limited amount of detail to low-resolution images and cannot fix large defects.
A color-consistency regularization term is introduced so that samples generated from the same input at different generators are more consistent in color, thereby improving the quality of the generated images (Fig. 8).

Example outputs for the Oxford-102 (leftmost four columns) and COCO (rightmost four columns) test sets.[12].
This section proposes a new hierarchical approach to text-to-image synthesis (Hierarchical Text-to-Image Synthesis, HTIS[13]) by inferring a semantic layout. Instead of learning a direct mapping from text to image, the algorithm breaks the generation process into several steps, in which it first creates a semantic layout from the text using a layout generator and then converts the layout into an image using an image generator (Fig. 9). The proposed layout generator gradually builds the semantic layout from coarse to fine, generating the object bounding boxes (bounding box) and refining each box by estimating the shapes of the objects inside it. The image generator synthesizes an image conditioned on the inferred semantic layout, which provides a useful semantic structure for an image that matches the text description.
The model not only generates more semantically meaningful images, but also makes it possible to annotate the generated images automatically. The generated images and the generation process can be controlled by the user by modifying the generated scene layout.
The capabilities of the proposed model were demonstrated on the challenging MS COCO dataset. It turns out that the model can substantially improve image quality, output interpretability and the semantic alignment of the input text compared with existing approaches.
| Model | Inception Score |
|---|---|
| StackGAN | 8.45±0.03 |
| The model under consideration | 11.46±0.09 |
Generating an image from a general sentence such as "people riding elephants walking through a river" requires a great deal of reasoning about various visual concepts, such as object category (people and elephants), spatial configurations of objects (riding), scene context (walking through a river), and so on, which is much harder than generating a single large object, as in simpler datasets. Existing approaches have not succeeded in producing reasonable images for such complex text descriptions because it is difficult to learn a direct text-to-pixel mapping from ordinary images.
Therefore, instead of learning a direct text-to-image mapping, an alternative approach was proposed that builds a semantic layout as an intermediate representation between text and image. The semantic layout defines the structure of the scene in terms of object instances and provides detailed information about the scene, such as the number of objects, object category, location, size and shape, and it produces a fairly good result (Fig. 10).

Comparison of HTIS[13].
The conventional approach is to encode the entire text description into a global sentence vector (global sentence vector). This approach demonstrates a number of impressive results, but it has major drawbacks: a lack of fine-grained detail at the word level and an inability to generate high-resolution images. This problem becomes even more serious when generating complex scenes, such as those in the COCO dataset.
As a solution to this problem, it was proposed[14] to use a new attentional generative adversarial network (Attentional Generative Adversarial Network, AttnGAN), which treats attention as a learning factor, making it possible to pick out words for generating image fragments.
Figure 11.[14] AttnGAN architecture.
The model consists of several interacting neural networks (Fig. 11):
Thanks to these modifications, the AttnGAN neural network shows significantly better results than traditional GAN systems. In particular, the best known Inception Score for existing neural networks was improved by 14.14% (from 3.82 to 4.36) on the Caltech-UCSD dataset and by a full 170.25% (from 9.58 to 25.89)[15] on the more complex COCO dataset.


The second and third rows show the 5 words most used by the attention networks Fattn1 and Fattn2 respectively[14].

Most existing text-to-image generation methods aim to create holistic images that do not separate the foreground and background of the image, with the result that objects are distorted by the background. Moreover, they usually ignore the complementarity of different kinds of generative models. This solution[16] proposes a context-aware approach to image generation that separates the background and the foreground. For this purpose, a complementary combination of a variational autoencoder and a generative adversarial network is used.
A VAE has a more stable output than a GAN, without mode collapse (mode collapse), which can be used to reliably fit the distribution and capture the diversity of the source image. However, it is not suitable for generating high-quality images, since the images generated by a VAE are easily blurred. To fix this shortcoming, the architecture includes two components (Fig. 13):
The validation results (Fig. 14) on two datasets (Caltech-UCSD and Oxford-102) empirically confirm the effectiveness of the proposed method.

Comparison of CVAE&GAN, StackGAN and GAN-INT-CLS.[16]
The multi-modal vector representation model (Multi-Modal Vector Representation, MMVR), first proposed in the paper[17], is able to create images from a description and to generate a description from a given image. It includes several modifications that improve the generation of images and descriptions, namely: a loss function based on an N-gram metric is introduced, which generalizes the description with respect to the image; also, several semantically similar sentences are used for generation instead of one, which likewise improves the generated images.
The model can be divided into two interdependent modules (Fig. 17):
The forward pass (forward pass) is initiated by feeding a random latent vector (latent vector) ht into the image generator (G), which generates an image x^. Then the caption generator creates a caption from the generated picture. To determine the error between the generated description y^ and the source description y, word-level cross-entropy is used. It is used to iteratively update ht (and with it x^), while keeping all other components fixed. With each iteration y^ gets closer to y, and the image generated at each step x^ is a temporary representation of the final image. To improve the realism of the image, a denoising autoencoder (Denoising Autoencoder, DAE)[20] is used — an image reconstruction error (reconstruction error), computed as the difference between ht and ht^, is added to the update rule.
Training begins by generating a random 4096-dimensional vector ht, which is passed to the model for subsequent iterative updating. The process ends after 200 iterations, and the resulting image is considered representative of the given description.
| Model | Inception Score |
|---|---|
| Plug and Play Generative Networks (PPGN)[20] | 6.71±0.45 |
| MMVR | 7.22±0.81 |
| MMVR (Nc=5) | 8.30±0.78 |
MMVR (Nc) is a modification of MMVR with several text descriptions per image, where Nc is the number of descriptions.
| Model | Inception Score (Caltech-UCSD) | Inception Score (COCO) |
|---|---|---|
| GAN-INT-CLS | 2.88±0.04 | 7.88±0.07 |
| GAWWN | 3.70±0.04 | − |
| StackGAN | 3.62±0.07 | 8.45±0.03 |
| StackGAN++ | 3.82±0.06 | − |
| PPGN[20] | − | 9.58±0.21 |
| AttnGAN | 4.36±0.03 | 25.89±0.47 |
| MirrorGAN | 4.56±0.05 | 26.47±0.41 |
Generating an image from a given text description pursues two main goals: realism and semantic consistency. Although there has been significant progress in creating visually realistic, high-quality images with generative adversarial networks, meeting the goals set out above is still quite a difficult task. To attempt to achieve them, let us consider a semantics-preserving text-to-image-to-text framework with attention, called MirrorGAN[21]. This framework, which generates an image from a text description, uses the idea of learning by redescription (redescription) and consists of three modules:
STEM creates word-level and sentence-level embeddings; GLAM has a cascaded architecture for producing the resulting images from coarse to fine-grained, using attention to both local words and the global sentence to progressively improve the semantic consistency and diversity of the generated images; and STREAM aims to regenerate a text description of the generated image that is semantically similar to the given description.
If an image generated by T2I (text-to-image) semantically matches the given description, its text description produced by I2T (image-to-text) should semantically coincide with the given one.
To train the model end to end, we will use two adversarial loss functions:


Where Ii is the image generated at stage i, drawn from the distribution pIi. In addition, to make effective use of the dual regularization of T2I and I2T, we apply a text-semantic reconstruction loss function based on cross-entropy: 
MirrorGAN is a mirror structure that combines T2I and I2T. To construct a multi-stage cascaded generator, all three networks (STEM, GLAM and STREAM) need to be combined. For the STREAM architecture we will use a fairly common image captioning framework (image captioning framework) based on an encoder and a decoder. The image encoder is a convolutional neural network pretrained on ImageNet[22], and the decoder is a recurrent neural network. Pretraining STREAM helped MirrorGAN achieve a more stable training process and faster convergence, whereas optimizing them jointly is quite unstable, memory-hungry and slow. The encoder-decoder structure and its corresponding parameters are fixed while the other MirrorGAN modules are trained.
When training Gi, the gradients from Lstream are backpropagated through STREAM into Gi, while the network weights of STREAM remain fixed. The final objective function of the generator looks like this:

where λ is a loss weight that balances the contributions of the adversarial loss (adversarial loss) and the text-semantic reconstruction loss (text-semantic reconstruction loss). For the best generation quality, the coefficient can be set to λ=20.
The Inception Score was used to measure both the quality and the diversity of the generated images. R-precision was used to compute the visual-semantic similarity between the generated images and their corresponding text descriptions.

Figure 22.[21] Comparison of MirrorGAN, AttnGAN and other generative adversarial networks.
Text generation is of particular interest in many neuro-linguistic programming (neuro-linguistic programming, NLP) applications, such as machine translation, language modeling and text summarization. Generative adversarial networks have achieved remarkable success in creating high-quality images in computer vision, and recently they have also attracted great interest from the NLP community. However, achieving similar success in NLP is more difficult because of the discreteness of text. This paper[23] introduces a method that uses knowledge distillation (transferring the knowledge learned by a large model (the teacher) to a smaller model (the student)) to work effectively with the network settings.
TextKD-GAN is a solution to the main bottleneck of using generative adversarial networks for text generation, based on knowledge distillation — a method that transfers the knowledge of the softened output of a model (the teacher) to a smaller model (the student). The solution relies on an autoencoder (the teacher) to obtain a smooth representation of real text. This representation is then fed to the TextKD-GAN discriminator instead of the usual one-hot representation. The generator (the student) tries to learn the manifold of the autoencoder's softened smooth representation. TextKD-GAN ultimately outperforms an ordinary generative-adversarial-network-based text generator that needs no pretraining.
In conventional text generation with GANs, the real and generated inputs of the discriminator have different types (one-hot and softmax). One way to avoid this problem is to obtain a continuous smooth representation of words instead of the one-hot representation, and to train the discriminator to distinguish between them. Figure 27 illustrates a model that uses a standard autoencoder (the teacher) to replace the one-hot representation with an output reconstructed by a softmax function, which is a representation that gives lower gradient variance. As can be seen, instead of the one-hot representation of the real words, the softened transformed output of the autoencoder is fed to the discriminator's input. This technique makes the discrimination task considerably harder for the discriminator itself. The generator with a softmax output tries to imitate the distribution of the autoencoder's output rather than the usual one-hot representation.
The autoencoder and TextKD-GAN are trained simultaneously. To achieve this, the objective function must be split into three terms:



These loss functions are trained alternately in order to optimize different parts of the model. In the gradient penalty term, the norm of the gradient must be computed for random samples 
The Object-Driven Attentive Generative Adversarial Network (Object-Driven Attentive Generative Adversarial Network, Obj-GAN) makes it possible to create images from a description while taking the object layout into account. The object-driven image generator creates images through two-stage generation. First a layout is created from the most significant words in the text description, and then an image is generated with the resulting object layout. To match the synthesized objects to the text description and the generated layout, a new object discriminator based on Fast R-CNN[25] is proposed[26]. As a result of these modifications, Obj-GAN significantly outperforms other models on the COCO dataset, increasing the Inception score by 11% and decreasing the FID (Fréchet inception distance) by 27%.
| Model | Inception Score | FID |
|---|---|---|
| Obj-GAN (pred box & pred shp) | 27.32±0.40 | 24.70 |
| Obj-GAN (gt box & pred shp) | 28.22±0.35 | 22.67 |
| Obj-GAN (gt box & gt shp) | 31.01±0.27 | 17.03 |
The main goal of Obj-GAN is to generate high-quality images with a semantically meaningful layout and realistic objects. Obj-GAN consists of a pair: an object-driven attentive image generator and an object-wise discriminator (object-wise discriminator). The image generator takes as input a text description and a previously generated semantic layout (semantic layout), from which it creates an image through a process of step-by-step improvement of the quality of the resulting image. At each stage the generator synthesizes an image fragment inside a bounding box (bounding box), focusing on the words most relevant to the object.
More specifically, using an object-driven attention layer, it operates on class labels, querying words in the sentences to form a context vector, and subsequently synthesizes an image fragment conditioned on the label and the context vector. The object-wise discriminator checks each bounding box to make sure that the generated object can indeed be matched to the previously generated layout. To compute all the discrimination losses for all the given bounding boxes simultaneously and efficiently, the discriminator is a fast region-based convolutional neural network (Fast Region-based Convolutional Neural Network, Fast R-CNN) with a binary cross-entropy loss function for each box.
Let us consider the architecture of Obj-GAN. In the first stage, the generative adversarial network takes a text sentence and generates a semantic layout — a sequence of objects specified by the corresponding bounding boxes (along with class labels) and shapes. The box generator (box generator) and the shape generator (shape generator) work accordingly, first creating a sequence of bounding boxes and then a shape for each one. Since most boxes are matched to words from the given text sentence, a seq2seq model with attention captures this correspondence. Next, Gshape is constructed, based on a bidirectional convolutional long short-term memory (bidirectional convolutional long short-term memory, LSTM). The training of Gshape is based on a generative adversarial network framework, in which a perceptual loss is used to constrain the generated shapes and stabilize training.

Obj-GAN comparison[25]

Models used to create scene layouts from text descriptions mostly ignore the possible visual variations within the structure described by the text itself.
Layout variational autoencoder (LayoutVAE) is a framework based on a variational autoencoder for generating stochastic scene layouts (stochastic scene layouts). It is a software modeling platform that can generate either complete image layouts for a given set of labels, or label layouts for an existing image with a new given label.
Consider the task of generating scenes from a description consisting of a set of labels. This set merely provides the collection of labels present in the given image (with no additional description of their relationships), forcing the model to learn spatial and count relationships (spatial and count relationships) from visual data.
The following solutions are proposed for the task described above:

Figure 25.[27] LayoutVAE architecture.
The paper[27] discussed frameworks and model structures related to LayoutVAE, such as: PNP-Net, a variational autoencoder framework for creating an image from a text program that fully describes it (besides being a stochastic generative model, it was tested on synthetic datasets with a small number of classes); LayoutGAN, a model based on generative adversarial networks that creates layouts of graphic elements (rectangles, triangles, and so on); a framework based on a variational autoencoder that encodes object and layout information of 3D indoor scenes in a latent code; and so on...
Generative models must be trained to predict diverse but plausible sets of bounding boxes (bounding boxes) bk,i=[xk,i,yk,i,wk,i,hk,i], given a set of labels as input. The boxes in the set are represented by the top-left coordinates, width and height of the i-th bounding box of category k. LayoutVAE decomposes into a model that predicts the count for each given label, CountVAE, and a model that predicts the location and size of each object, BBoxVAE.
Given a set of labels L and the number of objects in each category {nm:m∈L}, BBoxVAE predicts the distribution of coordinates for the bounding boxes autoregressively. We follow the same predefined ordering of labels in the label space as in CountVAE, and order the bounding boxes from left to right for each label; first all the bounding boxes are predicted for a given label, and only then does the model move on to the next label.
Cross-view image translation (cross-view image translation) is problematic because it operates on images with significantly different viewpoints and heavy deformations. The paper[28] on the Multi-Channel Attention Selection GAN (MCA-GAN) describes an approach that makes it possible to generate an image as close to reality as possible from arbitrary viewpoints, based on semantic mapping (semantic mapping). The network works in two stages:
Extensive experiments on the Dayton, CVUSA[29] and Ego2Top[30] datasets show that this model can generate significantly higher-quality results than other state-of-the-art methods.
Figure 29 illustrates the structure of the network. The first stage, as described above, consists of a cascaded semantic-guided generation subnetwork that takes an image in one view and a conditional semantic map in another view as input and transforms these images into the other view. The resulting images are then fed into a semantic generator to reconstruct the original semantic map, forming a generation cycle. In the second stage, the coarse synthesis (coarse synthesis) and the deep feature maps are combined and fed into the multi-channel attention selection module, which aims to obtain a more detailed synthesis (fine-grained synthesis) from a larger generation space and to create uncertainty maps (uncertainty maps) that guide multiple optimization losses (optimization losses). The multi-channel attention selection module in turn consists of multiscale spatial pooling (multiscale spatial pooling) and a multichannel attention selection component (multichannel attention selection component).
Since there is a volumetric deformation of the object and/or scene between the source view and the resulting one, a single-scale feature (single-scale feature) is unlikely to capture all the spatial information needed for fine-grained generation. Multiscale spatial pooling, on the other hand, uses different kernel sizes and strides to perform global average pooling (global average pooling) on the same input features, thereby obtaining multiscale features with different receptive fields (receptive fields) for perceiving different spatial contexts. The multi-channel attention mechanism makes it possible to perform spatial and temporal selection (spatial and temporal selection) in order to synthesize the final fine-grained result.
Figure 31 Cross-view image translation.
Sign in and the lectures you have studied will be marked in this list.
Choose a course
Comments