LAYOUTGAN: GENERATING GRAPHIC LAYOUTS
Year: 2019

Abstract:
Layout is important for graphic design and scene generation. We propose a novel Generative Adversarial Network, called LayoutGAN, that synthesizes layouts by modeling geometric relations of different types of 2D elements. The generator of LayoutGAN takes as input a set of randomly-placed 2D graphic elements and uses self-attention modules to refine their labels and geometric parameters jointly to produce a realistic layout. Accurate alignment is critical for good layouts. We thus propose a novel differentiable wireframe rendering layer that maps the generated layout to a wireframe image, upon which a CNN-based discriminator is used to optimize the layouts in image space. We validate the effectiveness of LayoutGAN in various experiments including MNIST digit generation, document layout generation, clipart abstract scene generation and tangram graphic design.

heading: 1 INTRODUCTION
text: Graphic design is an important visual communication tool in our modern world, encompassing everything from book covers to magazine layouts to web design. Whereas methods for generating realistic natural-looking images have made significant progress lately, particularly with Generative Adversarial Networks (GANs) (Karras et al., 2018), methods for creating designs are far more primitive. This is, in part, due to the difficulty of finding data representations suitable for learning. Graphic designs are normally composed of vector representations of primitive objects, such as polygons, curves and ellipses, instead of pixels laid on a regular lattice. The quality and content of a design depends on the presence of elements, their attributes, and their relations to other elements. The visual perception of design depends on the arrangement of these elements; misalignment of two elements of just a few millimeters can ruin the design. Training from images of designs using conventional GANs synthesizes the layouts in pixel space, and thus mixes up layout and its rendering, and thus would be unlikely to capture layout styles well. Modeling such highly-structured data using neural networks is of great interest as they usually represent human abstract knowledge about the visual world (Zitnick & Parikh, 2013; Song et al., 2017) and how this knowledge are expressed via documents and designs (Deka et al., 2017; Yang et al., 2017).
This paper introduces LayoutGAN, a novel GAN which directly synthesizes a set of graphical elements in a design. In a given design problem, a fixed set of element classes (e.g., “title,” “figure”) is specified in advance. In our network, each element is represented by its class probabilities and its geometric parameters, i.e., bounding-box keypoints. The generator takes as input graphic elements with randomly-sampled class probabilities and geometric parameters, and arranges them in a design; the output is the refined class probabilities and geometric parameters of the design elements. The generator has the desirable property of being permutation-invariant: it will generate the same layout if we re-order the input elements.
We propose two kinds of discriminator networks for this structured data. The first is similar in structure to the generator: it operates directly on the class probabilities and geometric parameters of the elements. Though effective, it is not sensitive enough to misalignment and occlusion between elements. The second discriminator operates in the visual domain. Like a human viewer who judges
∗Work done during Jianan Li's internship at Adobe Research.
a design by looking at its rasterized image, the relations among different elements can be evaluated well by mapping them to 2D layouts. Then Convolutional Neural Networks (CNNs) can be used for layout optimization as they are specialized in distinguishing visual patterns including but not limited to misalignment and occlusion. However, the key challenge is how to map the geometric parameters to pixel-level layouts differentiably. One approach would be to render the graphic elements into bitmap masks using Spatial Transformer Networks (Jaderberg et al., 2015). But we found that filled pixels within the design elements cause occlusions and are ineffective for back-propagation, for example, when a small polygon hides behind a larger one. We experimented with bitmap mask rendering but it was not successful. In this paper, we propose a novel differentiable wireframe rendering layer that rasterizes both synthesized and real structured data of graphic elements into wireframe images, upon which a standard CNN can be used to optimize the layout across the visual and the graphic domain. The wireframe rendering discriminator has several advantages. First, convolution layers are very good at extracting spatial patterns of images so that they are more sensitive to alignment. Second, the rendered wireframes make elements visible even when they overlap and thus the network is alleviated from inferring the occlusions that may occur in other renderings such as masks.
We evaluate the LayoutGAN for several different tasks, including a sanity test on MNIST digits, generating page layouts from labeled bounding boxes, generating clipart abstract scenes, tangram graphic design, and mobile app design layouts. In each case, our method successfully generates layouts respecting the types of elements and their relationships for the problem domain.
In summary, the LayoutGAN comprises the following contributions: 1. A Generator that directly synthesizes structured data, represented as a resolution-independent set of labeled graphic elements in a design. 2. A differentiable wireframe rendering layer which allows the Discriminator to judge alignment from discrete element arrangements.

heading: 2 RELATED WORK
text: Structured data generation. Convolutional networks have been shown successful for generating data in regular lattice, such as images (Radford et al., 2015), videos (Vondrick et al., 2016) and 3D volumes (Yan et al., 2016; Wu et al., 2016). When generating highly-structured data, such as text (Donahue et al., 2015) and programs (Reed & De Freitas, 2015), recurrent networks are often the first choice (Sutskever et al., 2014), especially equipped with attention (Bahdanau et al., 2014) and memory modules (Graves et al., 2014). Recently, researchers show that convolutional networks can be also used to synthesize sequences (Oord et al., 2016; van den Oord et al., 2016) using autoregressive models. However, in many cases, an object has no sequential order (Vinyals et al., 2015), but is a set of elements, e.g. point clouds. Fan et al. (2017) propose a point set generation network for synthesizing 3D point clouds of the object shape from a single images. It is further paired with a point set classification network (Charles et al., 2017) for auto-encoding 3D point clouds (Achlioptas et al., 2017). Our work extends the set representation to more general primitive objects, i.e., labeled polygons. Meanwhile, researchers also model the structured data of connected elements using graph convolutions (Kipf & Welling, 2017). Data-driven graphic design. Automating layout is a classic problem in graphic design (Hurst et al., 2009). O’Donovan et al. (2014) formulate an energy function by assembling various heuristic visual cues and design principles to optimize single-page layouts, and extend this to an interactive tool (O’Donovan et al., 2015). The model parameters are learned from a small number of example designs. Pang et al. (2016) optimize layout for desired gaze direction. Deka et al. (2017) collect a mobile app design database for harnessing data-driven applications and present preliminary results of learning similarities of pixel-level textural/non-textual masks for design search, but do not learn models from this data. Swearngin et al. (2018) propose an interactive system that converts example design screenshots to vector graphics for designers to re-use and edit. Bylinskii et al. (2017) analyze the visual importance of graphic designs and use saliency map as the driving force to assist retargeting and thumbnailing. Previous methods have learned models for other graphic design elements, such as fonts (O’Donovan et al., 2014) and colors (O’Donovan et al., 2011). These are orthogonal to the layout problem, and could be combined in future work. No previous method has learned to create design or layout from large datasets, and no previous work has applied GANs to layout. 3D scene synthesis. Interior scene synthesis and furniture layout generation draws great interest in graphics community. Early approaches focus on optimization of hand-crafted design princi-
Generator
Encoder Stacked Relation Module
Real / Fake Prediction
fc
fc fc fc fc
fc
fc
Decoder
CNN
Differentiable Wireframe Rendering
Wireframe Layout
f(p1 ,x1)
f(p2 ,x2)… . f(pi ,xi)… . f(pn ,xn)
f(p1 ,x1) f(p2 ,x2) …. f(pi ,xi) …. f(pn ,xn)
f’(p1 ,x1)
f'(p2 ,x2)… . f'(pi ,xi)… . f'(pn ,xn) Self-attention ➕
Wireframe Rendering Discriminator
(Graphic -> Visual Domain)
Class Probabilities Geometric Parameters
{(p1, θ1), … ,(pN, θN)}
p1 θ1
p2 θ2
● ● ●pN θN
Random Input
Class Probabilities Geometric Parameters
{(p1’, θ1’), … ,(pN’, θN’)}
p1’ θ1’
p2’ θ2’
● ● ●pN’ θN’
Class Probabilities Geometric Parameters
{(p1’, θ1’), … ,(pN’, θN’)}
p1’ θ1’
p2’ θ2’
● ● ●pN’ θN’
Figure 1: Overall architecture of LayoutGAN. The generator takes as input graphic elements with randomly sampled class probabilities and geometric parameters from Uniform and Gaussian distribution respectively. An encoder embeds the input and feeds them into the stacked relation module, which refines the embedded features of each element in a coordinative manner by considering its semantic and spatial relations with all the other elements. Finally, a decoder decodes the refined features back to class probabilities and geometric parameters. The wireframe rendering discriminator feeds the generated results to a differentiable wireframe rendering layer which raterizes the input graphic elements into 2D wireframe images, upon which a CNN is applied for layout optimization.
ples (Merrell et al., 2011) and learning statistical priors of pairwise object relationships (Fisher et al., 2012) due to limited data. Wang et al. (2018a) recently proposed a sequential decision making approach to indoor scene synthesis. In each step, a CNN is trained to predict either location or category of one object by looking at the rendered top-down views. This resembles our wireframe rendering discriminator, in the sense of using convolutions to capture spatial patterns of layouts.

heading: 3 LAYOUTGAN
text: This section describes our data and model representations.

heading: 3.1 DESIGN REPRESENTATION
text: In our model, a graphic design is comprised of a set of N primitive design elements {(p1,θ1), · · · , (pN ,θN )}. Each element has a set of geometric parameters θ, and a vector of class probabilities p. The entries of these variables are problem-dependent. For example, document layouts include 6 classes, e.g. “title” and “picture” while clipart layouts include 6 classes, e.g. “boy” and “hat”. For 2D point set generation (in MNIST digits), θ ≡ [x, y], representing the coordinates of each point; for bounding-box generation in document layout, θ ≡ [ xL, yT , xR, yB ] , representing the top-left and bottom-right coordinates of each bounding box; for layouts with scale and flip (clipart abstract scenes), θ ≡ [x, y, s, l], representing the center coordinates, scale and flip of each element.

heading: 3.2 GENERATOR ARCHITECTURE
text: In the LayoutGAN, the Generator is a function G(z) that takes a layout as input, where z = {(p1,θ1), · · · , (pN ,θN )} consisting of initial graphic elements with randomly-sampled geometric parameters θi, and one-hot encoding of a randomly-sampled class pi. The Generator outputs a refined layout G(z) = {(p′1,θ′1), · · · , (p′N ,θ′N )} which is meant to resemble a real graphic design. Note that, unlike, conventional GANs where z represents a low-dimensional latent variable, our z represents initial random graphic layout that has the same structure as the real one. The Discriminator learns to capture the geometric relations among different types of elements for layout optimization from both the graphic and the visual domain. Next, we go into details of the generator and discriminator design.
As illustrated in Figure 1, the generator takes as input a set of graphic elements with random class probabilities and geometric parameters sampled from Uniform and Gaussian distribution respectively. An encoder consisting of a multilayer perceptron network (implemented as multiple fully connected layers) first embeds the class one-hot vectors and geometric parameters of each graphic element. The relation module, implemented as self-attention inspired by Wang et al. (2018b), is then used to embed the feature of each graphic element as a function of its spatial context, i.e., its
relations with all the other elements in the design. Denote f(pi,θi) as the embedded feature of the graphic element i, its refined feature representation f ′(pi,θi) can be obtained through a contextual residual learning process, which is defined as:
f ′(pi,θi) =Wr 1
N ∑ ∀j 6=i H(f(pi,θi), f(pj ,θj))U(f(pj ,θj)) + f(pi,θi), (1)
where an unary functionU computes a representation of the embedded feature f(pj ,θj) of element j and a pairwise function H computes a scalar value representing the relation between elements i and j. Thus, all the other elements j 6= i contribute to the feature refinement of element i by summing up their relations. The response is normalized by the total number of elements in the set, N . The weight matrix Wr computes a linear embedding, producing the contextual residual to be added to f(pi,θi) for feature refinement. In our experiments, we defineH as a dot-product:
H(f(pi,θi), f(pj ,θj)) = ψ(f(pi,θi)) Tφ(f(pj ,θj)), (2)
where ψ(f(pi,θi)) = Wψf(pi,θi) and φ(f(pj ,θj)) = Wφf(pj ,θj) are two linear embeddings. We stack 4 relation modules for feature refinement in our experiments. Finally, a decoder consisting of another multilayer perceptron network followed by two branches of fully connected layer with a sigmoid activation function is used to map the refined feature of each element back to class probabilities and geometric parameters respectively. Optionally, Non-Maximum Suppression (NMS) can be applied to remove duplicated elements.

heading: 3.3 DISCRIMINATOR NETWORK ARCHITECTURES
text: The discriminator aims to distinguish between synthesized and real layouts. We present two types of discriminators, one based on relation modules directly built upon layout parameters, and the other based on how the layouts look like via rendering.

heading: 3.3.1 RELATION-BASED DISCRIMINATOR
text: The Relation-Based Discriminator takes as input a set of graphic elements represented by class probabilities and geometric parameters, and feeds them to an encoder consisting of a multilayer perceptron network for feature embedding f(pi,θi). It then extracts their global graphical relations g(r(p1,θ1), · · · , r(pN ,θN )) where r(pi,θi) represents a simplified relation module as in equation 1 by removing the shortcut connection, and g is a max-pooling function used in (Charles et al., 2017). Thus, the global relations among all the graphic elements can be modeled, upon which a classifier composed by a multilayer perception network is applied for real/fake prediction.

heading: 3.3.2 WIREFRAME RENDERING DISCRIMINATOR
text: The Wireframe Rendering Discriminator exploits CNNs to classify layouts, in order to learn to classify the visual properties of a layout. The Discriminator consists of a wireframe rendering layer, which produces an output image I , which is then fed into a CNN for classification.
The rasterization is performed as follows. Suppose there are N elements in the design, with parameters {(p1,θ1), ..., (pN ,θN )}. Each element can be rendered into its own grayscale image Fθ(x, y); rendering details for specific types of elements are given below. The image dimensions for each individual F are W ×H , where W and H are the width and height of the design in pixels. The layer output is a multi-channel image I of dimensions W × H × M , where each channel corresponds to one of the M element types. In other words, pixel (x, y) of I is a class activation vector for that pixel, and is computed as:
I(x, y, c) = max i∈[1...N ] pi,cFθi(x, y) (3)
where pi,c is the probability that element i is of class c.
We next describe the rendering process for computing Fθ, in the cases where θ represents a point, a rectangle, and a triangle.
Point. We start with the simplest geometric form, a single keypoint θi = (xi, yi) for element i. We implement an interpolation kernel k for its rasterization. Its spatial rendering response on (x, y) in the rendered image can be written as:
Fθi(x, y) = k(x− xi)k(y − yi). (4)
We adopt bilinear interpretation (Johnson et al., 2016), corresponding to the kernel k(d) = max(0, 1 − |d|) (implemented as ReLU activation), as shown in Figure 2. As I is a differentiable function of the class probabilities and the coordinates, the sub-gradients of the rasterized image can be thus propagated backward to them. We validate such rendering design for MNIST digit generation, detailed experiments can be seen in Section 4.1.
Rectangle. We now consider more complex polygons. Assuming an element is a rectangle, or bounding box represented by its top-left and bottom-right coordinates θ = (xL, yT , xR, yB), which is very common in various designs. Specifically, considering a rectangle i with coordinates θi = (xLi , y T i , x R i , y B i ), as shown in Figure 2, the black grids represent the locations in the rendered image and the orange dotted box represents the rectangle being rasterized in the rendered image. For a wireframe representation, only the points near the boundary of the dotted box (lie in blue solid line) are related to the rectangle, so its spatial rendering response on (x, y) can be formulated as:
Fθi(x, y) = max  k(x− xLi )b(y − yTi )b(yBi − y), k(x− xRi )b(y − yTi )b(yBi − y), k(y − yTi )b(x− xLi )b(xRi − x), k(y − yBi )b(x− xLi )b(xRi − x)  , (5) where b(d) = min(max(0, d), 1) constraining the rendering to nearby pixels.
Triangle. We further describe the wireframe rendering process of another geometric form, triangle. For triangle i represented by its three vertices’ coordinates θi = (x1i , y 1 i , x 2 i , y 2 i , x 3 i , y 3 i ), when x 1 i 6= x2i 6= x3i , its spatial rendering response on (x, y) in the rendered image can be calculated as:
Fθi(x, y) = max  k(y − (y 2 i−y 1 i )·(x−x 1 i ) x2i−x1i − y1i )b(x− x1i )b(x2i − x), k(y − (y 3 i−y 1 i )·(x−x 1 i ) x3i−x1i − y1i )b(x− x3i )b(x1i − x),
k(y − (y 3 i−y 2 i )·(x−x 2 i )
x3i−x2i − y2i )b(x− x3i )b(x2i − x)  , (6) Through this wireframe rendering process, gradients can be propagated backward to both the class probabilities and geometric parameters of the graphic elements for joint optimization.
A CNN consisting of 3 convolutional layers, followed by a fully connected layer with sigmoid activation, is applied to the rasterization layer I to predict real/fake graphic layouts.

heading: 4 EXPERIMENTS
text: The implementation is based on TensorFlow (Abadi et al., 2016). The network parameters are initialized from zero-mean Gaussian with standard deviation of 0.02. All the networks are optimized using Adam (Kingma & Ba, 2014) with a fixed learning rate of 0.00002. Detailed architectures can be found in the appendix.

heading: 4.1 MNIST DIGIT GENERATION
text: As a toy problem, we generate MNIST layouts. MNIST is a handwritten digit database consisting of 60,000 training and 10,000 testing images. For each image, we extract the locations of 128 randomly-selected foreground pixels as the graphic representation so that digit generation can be
Table 1: Inception scores for generated digits.
Methods Score ± std Relation 6.53 ± .09
Wireframe 7.36 ± .07 Real data 9.81 ± .08
Table 2: Spatial analysis of document layout.
Methods Overlap(%) Alignment(%)
Relation 1.52 6.4 Wireframe 1.17 3.4 Real data 0.05 0.5
formulated as generating of 2D point layouts. In Figure 3a, each image shows 8× 8 digits rendered from point layouts. The left and middle images are the generated samples from the LayoutGAN with a relation-based discriminator and a wireframe rendering discriminator, respectively. The right image shows the digits rendered from ground-truth point layouts. One can see that the LayoutGAN with either discriminator captures various patterns. The wireframe rendering discriminator generates more compact, better-aligned point layouts. For quantitative evaluation, we first train a multilayer perceptron network for digit classification, which achieves an accuracy of 98.91% on MNIST test set, and then use the classifier to compute the inception score (Salimans et al., 2016) of 10,000 generated samples. As shown in Table 1, the LayoutGAN with wireframe rendering discriminator achieves a higher inception score than with the relation-based discriminator. To shed light on the relational refinement process of LayoutGAN, we mark each input random point with a locationspecific color, and track their refined locations in the generated layouts, as shown in Figure 3b. One can see that colors change gradually along the strokes, showing the network learns some contextually consistent local displacements of the points.

heading: 4.2 DOCUMENT LAYOUT GENERATION
text: One document page consists of a number of regions with different element types, such as heading, paragraph, table, figure, caption and list. Each region is represented by a bounding box. Modeling layouts of regions is critical for document analysis, retargeting, and synthesis. In real document data, these bounding boxes are often carefully aligned along the canonical axes, and their placement follows some particular patterns, such as heading always appearing above paragraph or table. Some example layouts are shown in the appendix.
In this experiment, we focus on one-column layouts with no more than 9 bounding boxes that may belong to 6 possible classes as mentioned above. We are interested in how these layout patterns can be captured by our network. For training data, we collect totally around 25,000 layouts from real documents. We also implemented a baseline method that represents the layout by semantic masks as used in Yang et al. (2017); Deka et al. (2017). Specifically, we render all elements into masks and train a DCGAN (Radford et al., 2015) to generate mask layouts in pixels. Then we extract the connected mask regions of each class and output enclosing bounding boxes of all regions. Figure 4 shows some representative generation results (each row consists of 6 samples; high-resolution results can be found in the Appendix). The first row shows the results from DCGAN. DCGAN mixes a layout and its rendering in the generation process. When convolutional layers in DCGAN fails to perfectly replicate the rendering process (which is usually the case), it generates fuzzy and noisy label maps, making the extracted bounding boxes less consistent and less accurate. The third row shows the results from LayoutGAN with wireframe rendering discriminator. We retrieve the most similar real layouts from the training set in the last row as references. It can be seen that LayoutGAN can well capture different document layout patterns with clear definitions of instance-level semantic bounding boxes.
To validate the advantage of wireframe rendering discriminator, we compare the generated results with those from the LayoutGAN with relation-based discriminator. As shown in the second row of Figure 4, the latter can also capture different layout patterns but sometimes suffers from overlapping
Relation-based
Wireframe rendering
Real data
Girl Sun Tree Boy GlassesHat
DCGAN
Figure 5: Clipart abstract scene generation.
and misalignment issues. As the bounding boxes in real document layouts are either left- or centeraligned with no overlaps with each other (except for captions with figures or tables), we propose two metrics to quantitatively measure the quality of the generated layouts. The first one is overlap index, which is the percentage of total overlapping area among any two bounding boxes inside the whole page. The second one is alignment index which is calculated by finding the minimum standard deviation of either left or center coordinates of all the bounding boxes. Table 2 provides quantitative comparisons of real layouts and synthesized layouts from LayoutGAN with two different discriminators. One can see that LayoutGAN with wireframe rendering discriminator achieves lower value in both overlapping index and alignment index than the one with relation-based discriminator, validating the superiority of the proposed wireframe rendering method for layout generation. A similar conclusion can also be drawn by analyzing the loss functions. We add shift perturbations to the bounding boxes of real layouts and feed them to both discriminators to examine their loss behaviors. Figure 6 visualizes the loss landscape of both discriminators corresponding to different extent of shift perturbation. One can see that the loss surface w.r.t. shift perturbation of the wireframe rendering discriminator is much smoother than the one of relation-based discriminator.

heading: 4.3 CLIPART ABSTRACT SCENE GENERATION
text: We now consider generating scenes composed of a set of specific clipart elements. We use the abstract scene dataset (Zitnick et al., 2016) including boy, girl, glasses, hat, sun, and tree elements. To synthesize a reasonable abstract scene, we first use LayoutGAN to generate the layout of inner scene elements by representing each of them as a labeled bounding box with normalized center coordinates, width and height, and flip indicator. Then, we render the corresponding clipart image of each scene element onto a background image according to the predicted position (center coordinates), scale (width and height) and flip, forming a synthesized abstract scene. It is a challenging task as accurate pairwise or higher-order relations of objects are required for synthesizing reasonable scenes, for example, the glasses/hat should be exactly on the eyes/head of a boy/girl with proper scale and orientation. In Figure 5, the first three rows shows the generated layouts and corresponding rendered scenes by DCGAN, LayoutGAN with relation-based discriminator and LayoutGAN with wireframe rendering discriminator respectively. The last row shows some samples rendered from ground-truth scene layouts. It can be seen that, compared to DCGAN and the LayoutGAN with relation-based discriminator, the one with wireframe rendering discriminator can capture pairwise relations of objects precisely, forming more meaningful scene layouts (for example, the glasses/hat accurately lies on the eyes/head of the person with varying scales and flips), validating the superiority of the proposed wireframe rendering strategy. In addition, we conduct a user study involving 20
Perturbated
Real data
Layout GAN
Figure 7: Optimizing perturbed tangram.
participants for a subjective evaluation of the results. Specifically, we randomly sample 30 abstract scenes synthesized by each of the above three models. A subject is asked to rate the synthetic scenes in terms of three scores (Excellent, Fair, Poor) by following three criteria: 1) whether they have coherent overall structures, 2) whether different objects are placed in reasonable relative positions, scales and flips, and 3) whether there are duplicate objects. We compute the rating percentage of all sampled scenes for each model. As shown in Table 3, the results of LayoutGAN with the wireframe rendering discriminator receive better ratings, which suggests that they are preferred by participants.

heading: 4.4 TANGRAM GRAPHIC DESIGN
text: A tangram is a geometric puzzle aiming to form specific shapes using seven pieces of 2D shapes without overlaps. The seven pieces include two large right triangles, one medium right triangle, two small right triangles, one square and one parallelogram, which can be assembled to form a square of side one unit and having area one square unit when choosing a unit of measurement. We collect 149 tangram graphic designs including animals, people and objects. In our experiments, we consider eight rotation/reflection poses for each piece. Given the seven pieces with each initialized by random location and ground-truth pose and class, the LayoutGAN with wireframe rendering discriminator is trained to refine their configurations jointly to form reasonable layouts. Note that it is a challenging task due to the complex configurations and limited data. We perform two experiments. The first one is a perturbation recovery test, in which we first add some random spatial perturbations to seven pieces of real layouts and train a LayoutGAN to recover the original layouts. Figure 7 shows that our network is able to pull back the displaced shapes to the right locations, confirming that the network successfully figures out the relations between different graphic elements. We further train another LayoutGAN to generate tangram designs from purely random initialization. In Figure 9 (high-resolution results can be found in the appendix), each row represents the sampled progressive generated results and the retrieved similar real tangrams. We also present some generated results of DCGAN and a sequential model similar to Wang et al. (2018a) for comparison. One can see from Figure 8 that DCGAN cannot well model the spatial relations among different shapes while the sequential model suffers from accumulated errors. In contrast, the LayoutGAN can generate meaningful tangrams like fox and person, although others may be hard to interpret, as shown in the penultimate row.

heading: 5 CONCLUSION
text: In this paper, we have proposed a novel LayoutGAN for generating layouts of relational graphic elements. Different from traditional GANs that generate images in pixel-level, the LayoutGAN can directly output a set of relational graphic elements. A novel differentiable wireframe rendering layer was proposed to rasterize the generated graphic elements to wireframe images, making it feasible to leverage CNNs as discriminator for better layout optimization from visual domain. Future works include adding a content representation, such as text, icon and picture to each graphic element.

heading: 6 APPENDIX

heading: 6.1 REAL DOCUMENT PAGES
text: For better understanding the document semantic layouts, we show some layout samples and their corresponding real document pages, as shown in Figure 1.

heading: 6.2 HIGH-RESOLUTION SYNTHESIZED DOCUMENT LAYOUTS

heading: 6.3 HIGH-RESOLUTION SYNTHESIZED CLIPART ABSTRACT SCENES

heading: 6.4 HIGH-RESOLUTION SYNTHESIZED TANGRAM GRAPHIC DESIGNS

heading: 6.5 DETAILED ARCHITECTURE DESIGN OF THE GENERATOR
text: The generator takes as input a set of graphic elements with random class probabilities and geometric parameters sampled from Uniform and Gaussian distribution respectively. An encoder consisting of three fully connected layers first embeds the semantic and geometric parameters of each graphic element. Two cascaded relation modules implemented as self-attention module followed by a basic residual block (“bottleneck” building block) form one relation block. We cascade two such relation blocks (totally 4 relation modules) for contextual feature refinement. Finally, a decoder consisting of several fully connected layers followed by two heads (implemented as the fully connected layer) with sigmoid activation are used to decode the refined feature of each element back to class probability distributions and geometric parameters respectively.

heading: 6.6 SYNTHESIZED MOBILE APP LAYOUT DESIGNS
text: We further conduct a new experiment of mobile app layout design by using the RICO dataset (Deka et al., 2017). For better understanding the mobile app layouts, we first show some layout samples and their corresponding real mobile app screenshots, as shown in Figure 5.
Figure 6 shows the results from LayoutGAN and the retrieved most-similar real layouts from the training set as references. Both the wireframe and the corresponding mask layouts are provided for better visualization.

Review summaries:
This paper presents a novel GAN framework for generating graphic layouts which consists of a set of graphic elements which are geometrically and semantically related. The generator learns a function that maps input layout ( a random set of graphic elements denoted by their classes probabilities and and geometric parameters) and outputs the new contextually refined layout. The paper also explores two choices of discriminators: (1) relation based discriminator which directly extracts the relations among different graphic elements in the parameter space, and (2) wireframe rendering discriminator which maps graphic elements to 2D wireframe images using a differentiable layer followed by a CNN for learning the discriminator. The novel GAN framework is evaluated on several datasets such as MNIST, document layout comparison and clipart abstract scene generation