Attribute-Conditioned Layout GAN for Automatic Graphic Design

Jianan Li, Jimei Yang, Jianming Zhang, Chang Liu, Christina Wang, Tingfa Xu

TL;DR

This paper introduces an Attribute-Conditioned Layout GAN (AL-GAN) that generates graphic layouts by incorporating element-specific attributes like area, aspect ratio, and reading order. By forcing both the generator and discriminator to adhere to these attributes, and employing an element dropout strategy for better local pattern recognition, AL-GAN produces more aesthetically pleasing and contextually appropriate designs, even allowing for layout retargeting to new sizes.

What Problem Does This Paper Address?

Creating visually appealing and informative graphic designs, especially for advertisements, is a complex task that typically relies on human expertise. A crucial step in this process is generating the layout – determining the position and size of various design elements (like images, text, buttons). While Generative Adversarial Networks (GANs) have shown promise in image generation, directly applying them to graphic layouts is challenging because layouts are not just pixels but structured arrangements of distinct elements with specific properties. Existing methods often struggle to incorporate essential design constraints such as:

  • Element Area: Ensuring elements have appropriate sizes relative to the page and their content (e.g., text fitting within a bounding box).
  • Aspect Ratio: Maintaining the original proportions of elements like logos, which can be distorted if not handled carefully.
  • Reading Order: Arranging elements in a logical flow (e.g., top-to-bottom, left-to-right) that guides the viewer's eye.

Automating the generation of graphic layouts that respect these attributes, especially when adapting existing designs to new sizes, remains an open problem.

Methods

The core of this work is the Attribute-Conditioned Layout GAN (AL-GAN). Here's a breakdown of their key techniques:

  • Attribute Conditioning: The AL-GAN explicitly incorporates element attributes (expected area, aspect ratio, reading order) as conditions for both the generator and the discriminator. The generator receives these attributes directly to produce attribute-conditioned layouts.
  • Element Dropout: To help the discriminator better learn local patterns (like alignment and non-overlapping), a novel "element dropout" strategy is introduced. This randomly removes some generated elements before they are fed to the discriminator, forcing it to focus on the relationships between the remaining elements.
  • Wireframe Rendering: Similar to prior work (LayoutGAN), elements are rendered into wireframe images to represent the layout structure, which is then processed by CNNs.
  • Attribute Reconstruction for Discriminator: To further enhance the discriminator's ability to understand attribute conditions, it's tasked with reconstructing input attributes. This forces the discriminator to learn more meaningful representations of the layouts.
  • Hand-crafted Loss Functions: Beyond the standard adversarial loss, the authors introduce several loss functions designed to enforce specific design principles:
  • Margin Area Loss: Penalizes deviations of generated element areas from their expected values.
  • Overlapping Loss: Discourages elements from overlapping.
  • Alignment Loss: Encourages elements to align with each other in common ways (left, center, right, top, bottom).
  • Order Loss: Specifically designed for layout adjustment, this loss ensures that the relative distances of elements to the layout origin are consistent with their predefined reading order.

Datasets

The paper uses a dataset of approximately 17,000 advertisement layouts designed by professional designers. These layouts are of three different aspect ratios: portrait, square, and landscape. The dataset is split into training and testing sets, and element attributes are extracted from these layouts to serve as conditions for training and evaluation.

Key Insights and Ideas

  • Attributes are Key to Realistic Layouts: The paper strongly emphasizes that simply generating pixel-perfect images isn't enough for graphic design. Incorporating semantic attributes of design elements is crucial for creating layouts that are not only visually coherent but also functionally sound (e.g., text fitting, logos not distorted).
  • Discriminator Needs Local and Global Views: The element dropout strategy is a clever way to force the discriminator to learn finer-grained local relationships between elements, complementing its ability to grasp overall layout patterns. This is particularly important for avoiding common design flaws like overlapping.
  • Loss Functions as Design Principles: The introduction of specific loss functions for area, overlap, alignment, and reading order directly translates abstract design principles into learnable objectives for the GAN. This is a powerful way to guide the generative process towards desired aesthetic and functional outcomes.
  • Layout Retargeting is Feasible with Attribute Control: The ability to adjust existing layouts to new sizes while preserving reading order is a significant practical contribution, addressing a common need in responsive design.

Key Results

  • Improved Layout Quality: The AL-GAN, especially with element dropout and hand-crafted losses, significantly reduces overlapping and misalignment compared to models without these features. Quantitative metrics show lower overlap and alignment indices.
  • Attribute Preservation: The model effectively preserves input attributes like area and reading order. For example, the mean area difference for elements falls below the set threshold, and the reading-order loss demonstrably improves retention.
  • Competitive Performance: In user studies, designs generated by AL-GAN are ranked better than template-based methods and novice designers, and are sometimes comparable to professional designs.
  • Efficient Layout Adjustment: The method can adjust existing layouts to new sizes while maintaining reading order, producing more appealing retargeted designs than methods without this constraint.
  • Inference Speed: The proposed method is faster or comparable in inference time to template-based and energy-based alternatives.

Limitations and Future Work

  • Reading Order Complexity: The paper acknowledges that defining reading order based on simple heuristics (left-to-right, top-to-bottom) might be insufficient for designs with many elements. Future work could explore more content-adaptive reading-order determination, potentially using visual attention or salience models.
  • Generalizability: While trained on advertisement layouts, extending the model to other types of graphic designs (e.g., web page layouts, posters) could be a future direction.
  • Attribute Definition: The paper focuses on three specific attributes. Exploring a wider range of attributes and their interactions could lead to even more sophisticated layout generation.

Summary updated

BibTeX
@article{li2021attribute,
  author = {Jianan Li and Jimei Yang and Jianming Zhang and Chang Liu and Christina Wang and Tingfa Xu},
  title = {{Attribute-Conditioned Layout GAN for Automatic Graphic Design}},
  journal = {IEEE Trans. Vis. Comput. Graph.},
  year = {2021},
  doi = {10.1109/tvcg.2020.2999335},
}
Figure