Unlike the previous work, this paper doesn’t adopt Generative adversarial network, but a combination of encoder-decoder architecture with a semi-parametric retrieval-based approach TOREAD. Under minor modification, this model performs decent generation of different forms of scene representation, including clip-art generation on Abstract Scenes, semantic layout on COCO and compositional image generation on COCO.
Generating rich textual representation has two main challenges, one is indirect hint at the presense of attributes from input textual description (e.g. “Mike is surprised” should change facial attributes on the generated object “Mike”), and another is relative spatial configurations within the text (e.g. “Mike is runing towards to his girlfriend” confines the orientation of “Mike” dependent on “his girlfriend”)
Relative work is as follows:
Semi-parametric Image Synthesis proposed a retrieval-based semi-parametric method for image synthesis given an input by a human. But different from the previous work using ground-truth semantic layout as input, this work learns to predict the location and layout of the object indirectly from the text.
Image generation from scene graphs, it proposed a graph-convolution model to generate from structured scene graph where objects and their relationship are provided as inputs, while this work the presence of objects is inferred from text.
Inferring semantic layout for hierarchical text-to-image synthesis generates the layout as the intermediate representations in separably trained modules, but this work generate pixel-wise outputs with semi-parametric retrieval module without advesarial training.
Visual dialog for collaborative drawing performs pictorial generation from chat logs, compared to out works that need text much considerably more underspecified.
Using a sequence-to-sequence approach, this model arranges the generated object sequentially along with their attributes (locations, sizes, aspect ratios, pose, appearance and more) on an initially empty canvas.
Generally, Text2Scene model consists of
- a text encoder that maps input sentence to a set of embedding representations
- an object decoder that predicts the next generated object conditioned on the current scene state
- an attribute decoder that determines the attribute of the next object
To compute for each word given input text
here BIGRU is a bidirectional GRU cell, is a word embedding and is a vector encoding the current word and its context.
Image encoder and recurrent module
To use a convolutional network to encode current canvas into a feature map representing the current scene state, and to model the history of the scene state by a convolutional GRU. is an important representation of both temporal and spatial dynamical information.
In case that fails to capture small objects, previous step is provided as input to the downstream decoders.
Attention-based object decoder
The object decoder based on attention mechanism outputs the likelihhod score on all objects in object vocabulary library , and takes as input:
- the current scene state
- the text features
- the preiviously predicted object
Spatial attention convolutional network
where is a convolutional network with spatial attention on to collect spatial contexts for the object prediction, e.g. what objects have already been added. Then by average pooling layer, the attended features are fused into a vector .
Text-based attention module
Text-based attention module uses to attend to the text features , and encodes the knowledge of all described objects having been added to the scene thus far ideally.
Likelihood predicting perceptrons
is two-layers perceptrons to predict the likelihhod of the next object using a softmax function.
Attention-based attribute decoder
For each spatial location in , This part predicts both location likelihood and attribute likelihoods to the object . Here possible locations are discretized into the same resolution of . TOREAD
“Zoom in” module
is to zoom in the language context of by attending to the input text feature.
Location prediction convolution network
Compared to which contain information of objects that have not been added yet, focuses more specifically on contents realted to the current object .
Then , a CNN spatially attending to , is to find an affordable location to append .
Likelihood predicting convolutional network
is implemented by a convolutional network with softmax classifiers over each value of and the discrete .
Foreground patch embedding
For the third mission to generate images composed of patches retrieved from others, a particular is proposed to predict every location in the output feature map but is used at test time to retrieve similar patches from pre-computed collection of object segments from other images TOREAD. A patch embedding network using a CNN reduces the foreground patch of target image into a 1D vector . To minimize the -distance between and , it uses the triplet embedding loss (, , ) to minimize the distance of and maximize the distance of . Here is the feature of a negative patch randonly selected from the same category of . TOREAD
where is a margin hyper-parameter.
The loss function with reference values is:
where are regularization terms inspired by the doubly stochastic attention module propose in section 4.2.1 of Show, attend and tell: Neural image caption generation with visual attention and are hyper-parameters controlling the relative contribution of each loss.
Text2Scene model demonstrates the capacity on both abstract and real images, which opens the possibility for future work on transfer learning across domains.