Abstract
Automated graphic layout generation is a critical task in digital marketing and e-commerce, requiring a sophisticated understanding of the relationship between background imagery and foreground elements. Traditional models often suffer from content agnosticism or spatial blindness, leading to layouts that occlude vital image subjects. This paper introduces CGL-GAN, a generative adversarial network designed to produce composition-aware layouts. By incorporating a novel Domain Alignment Module (DAM) and a multi-scale Transformer-based generator, CGL-GAN effectively bridges the gap between training on existing designs and deploying on raw images. Experimental results on the newly curated CGL-Dataset demonstrate that the model significantly outperforms state-of-the-art methods in both aesthetic quality and functional placement.
Introduction
Creating visually compelling posters requires more than just arranging text and logos; it necessitates a deep understanding of visual composition. Professional designers carefully place graphic elements to ensure readability while avoiding the occlusion of key subjects, such as faces or products. However, automating this process is challenging. Existing tools often treat the background as a secondary consideration or lack the spatial precision required to respect the image's semantic structure.
Furthermore, a significant "domain gap" exists in current research. Models are typically trained on existing posters where text has been masked out. This process often leaves visual artifacts or "hints" that allow models to "cheat" by identifying where the original designer placed elements. When applied to clean, raw images during inference, these models often fail. CGL-GAN addresses these challenges through a composition-aware framework and a robust training methodology.
Methodology
Domain Alignment Module (DAM)
To resolve the domain gap and prevent the model from relying on training artifacts, the authors introduced the Domain Alignment Module. The DAM utilizes a pre-trained Inpainting Network to fill the regions where original graphic elements were removed, effectively "cleaning" the training data. Additionally, a Saliency Detection Network is employed to highlight important regions of the image. This ensures that the training data resembles the raw images the model will encounter in real-world applications, forcing the network to learn the underlying principles of composition rather than simple pattern matching.
Composition-aware Layout Generator
The generator serves as the core of the CGL-GAN architecture, combining two powerful components:
- Multi-scale CNN: This extracts visual features at various resolutions, allowing the model to perceive both the global structure of the image and fine-grained local details.
- Transformer: The Transformer module models the complex dependencies between different graphic elements (e.g., how a logo's position should influence the placement of a headline).
Composition-aware Layout Discriminator
The discriminator acts as an adversarial critic, trained to distinguish between professional layouts and those generated by the model. Crucially, it evaluates not just the layout in isolation, but how well the graphic elements harmonize with the background composition.
The CGL-Dataset
To support this research, the authors introduced the CGL-Dataset, a massive benchmark for advertising poster design. It consists of 60,548 posters sourced from e-commerce platforms, significantly larger than previous datasets like MagazineFolders. Each poster is meticulously annotated with bounding boxes and categories for four element types: Logos, Texts, Underlays, and Embellishments. This dataset provides the diversity and scale necessary to train high-capacity generative models.
Evaluation and Key Insights
Aesthetic Metrics
Standard layout metrics often fail to capture the "beauty" or utility of a design. The authors proposed three specialized metrics to better evaluate composition:
- $R_{com}$: Measures if text is placed on low-gradient (flat) areas to ensure high readability.
- $R_{sub}$ & $R_{shm}$: These metrics assess whether graphic elements occlude the primary subject or salient regions of the image.
Results
Quantitative analysis showed that CGL-GAN outperformed baseline models, such as ContentGAN, across nearly all metrics. Notably, it showed a superior ability to avoid subject occlusion. In qualitative user studies, professional designers consistently preferred CGL-GAN’s outputs, noting its ability to place text in "negative space" and its intelligent use of "underlays" (background boxes) to improve contrast on complex backgrounds.
Conclusion and Future Work
CGL-GAN represents a significant step forward in automated graphic design by making layout generation aware of image composition. While the model excels at spatial placement, it currently does not address stylistic attributes such as typography selection or color theory. Future research will focus on integrating these elements to create a comprehensive, end-to-end design system capable of predicting fonts and color palettes that complement the visual characteristics of the background image.
Summary updated