Abstract
DogLayout is a novel generative model that combines the speed of Generative Adversarial Networks (GANs) with the high-quality distribution matching of Diffusion models. By integrating a diffusion process into a GAN framework, it successfully generates both discrete labels (like "Title" or "Image") and continuous coordinates (position and size) up to 175 times faster than traditional diffusion models while significantly reducing element overlap.
The Challenge of Hybrid Layout Generation
Automated layout generation—arranging elements for UI designs, posters, or documents—is a complex task because layouts are "hybrid" data. They consist of discrete labels (categories) and continuous attributes (x, y coordinates, width, and height).
Existing approaches generally fall into two categories, each with significant drawbacks:
- Generative Adversarial Networks (GANs): While fast, GANs struggle with discrete data. The
argmaxfunction used to select categories is non-differentiable, which breaks the gradient flow during training. Additionally, discriminators often easily distinguish "fake" one-hot vectors from real ones, leading to training instability. - Diffusion Models: These represent the state-of-the-art in quality but are computationally expensive, often requiring thousands of sampling steps. Furthermore, they frequently produce layouts with excessive element overlap, which appears unnatural to human designers.
Proposed Method: DogLayout
The authors introduce DogLayout (Denoising Diffusion GAN Layout model) to address these limitations. The core innovation is treating layout generation as a Denoising Diffusion GAN (DDGAN) task.
The Diffusion Bridge
Instead of generating discrete labels directly, DogLayout adds Gaussian noise to one-hot encoded labels. This transforms discrete categories into a continuous space that a GAN can effectively model. This noise acts as a regularizer, smoothing the optimization landscape and preventing the discriminator from "cheating" by identifying simple patterns in one-hot vectors.
System Architecture
The model utilizes a Transformer-based architecture designed for efficiency and spatial awareness.
- The Generator: A Transformer-based model that takes a noisy layout ($x_t$) and a latent variable ($z$) to predict a clean version ($x_0$).
- The Discriminator: Unlike standard GANs, this discriminator evaluates pairs of layouts $(x_t, x_{t-1})$. It determines if the denoising step performed by the generator matches a real transition in the diffusion process.
- Efficiency: While standard diffusion models might take 1,000 steps, DogLayout achieves high-quality results in just 4 to 12 steps by using the GAN to model the complex denoising distribution.
Experimental Results
DogLayout was evaluated on two industry-standard benchmarks: Rico (mobile app screens) and PubLayNet (document layouts).
Key Findings
- Massive Speedup: DogLayout is up to 175x faster than LayoutDM, generating samples in milliseconds rather than seconds.
- Improved Spatial Logic: On the PubLayNet dataset, DogLayout reduced the overlap metric from 16.43 to 9.59, indicating significantly cleaner visual results.
- State-of-the-Art Performance: It outperformed previous GAN-based models across multiple metrics, including FID (Fréchet Inception Distance) and Alignment.
- Human Preference: User studies confirmed that participants preferred DogLayout’s results for both quality and diversity.
Conclusion and Future Work
DogLayout demonstrates that combining diffusion processes with adversarial training can overcome the traditional trade-offs between speed and quality in layout generation. Future work will focus on developing better automated metrics for "aesthetic" quality and incorporating content-aware generation, such as image-layout cross-attention, to allow the model to respond to specific background images or text constraints.
Summary updated