The note of Image generation from scene graphs
Previous work only performs well on limited domains such as followers or birds, but struggle to generate complex sentences with many objects and relationships.
This paper proposes a method for generating images from scene graphs with graph convolution which enable reasoning about objects and their relationships.
In summary, image generation network takes a scene graph and noise as input and outputs and image .
Firstly, embedding vectors representing objects and edges were generated from graph convolution network, which is then concatenated to predict bounding boxes and segementation masks for each predicted object.
After obtaining the scene layout, which contains several bounding-boxes and masks, this high-dimensional representation is fed into cascaded refinement network TODO combined with noise to generate the final result.
As the first stage of processing, each node and edge of the graph from the dataset is converted to a dense vector by an embedding layer, analogous to the embedding layer which is used to get word-embeddings in neural language model.
Graph Convolution Network
A 2D convolution layer takes the above vectors as an input, and produces the output vectors with neighbourhood information of its corresponding input vector. In this way, convolution operation aggregates the information across the neighbourhood of the input.
As the picture shown and concretely speaking, the output vectors for edges is simply computed by , while the calculation of objects vectors is a bit more complicated since the same object may participate in many relationships, e.g. A car is on the street. The street is besides the buildings. where ‘street’ acts as the starting node in the first edge while being the ending node in the second.
To this end, and is used to compute a candidate vector:
Then the ouput vector for object is computed as where is a symmetric function TODO.
After embedding vectors for objects was obtained, which aggregates all information across all objects and relationships in the edge, scene layout will be calculated to give the coarse 2D location information.
As below image shown, mask regression network and box regression network are built to predict a soft binary mask and a bounding-box respectively. The previous consists of several transpose convolutions terminating in sigmoid nonlinear function so that the mask lies in the range while the second is a MLP.
The mask embedding of shape TODO
Cascaded refinement network
This network consists of a series of convolutional refinement modules, doubling the resolution and proceeding in a corase-to-fine manner.
Each module receives both the scene layout and the output from the prvious module as its input, concatenated them channelwise, upsampling them with nearest-neighbor interpolation and then passing it to the next, and finally generate the output result.
A pair of discriminator is built.
The patch-based image discriminator TODO ensures the overall appearance of generated images are realistic.
The object discriminator has two functions:
ensuring objects in the image appears realistic by taking picels of object as inputs.
ensuring each object is recognizable by an auxiliary classifier to predict category.
The loss consists of six components.
Box loss penalizing the distance between ground-truth and predicted boxes.
Mask loss penalizing differences between ground-truth and predicted masks with pixelwise cross-entropy.
Overal pixel loss penalizing the distance between ground-truth and generated images.
Image adversarial loss from encouraging generated image patches to appear realistic.
Object adversarial loss from encouraging each generated object to look realistic.
Auxiliarly classifier loss from ensuring each generated object can be classified by .
Compared to previous work, this paper uses structured text description to reason more explictly about objects and its relationships and generate more complex images with multiple objects.