GAN-based Domain Adaptation for Image-aware Layout Generation in Advertising Poster Design
Authors: Chenchen Xu, Min Zhou, Tiezheng Ge, Weiwei Xu
Organizations: Anhui Normal University, Wuhu, China · Zhejiang University, Hangzhou, China · Shenzhen Bay Laboratory, Shenzhen, China · Alibaba Group, Hangzhou, China
Layout plays a crucial role in graphic design and poster generation. Recently, the application of deep learning models for layout generation has gained significant attention. This paper focuses on using a GAN-based model conditioned on images to generate advertising poster graphic layouts, requiring a dataset of paired product images and layouts. To address this task, we introduce the Content-aware Graphic Layout Dataset (CGL-Dataset), consisting of 60,548 paired inpainted posters with annotations and 121,000 clean product images. The inpainting artifacts introduce a domain gap between the inpainted posters and clean images. To bridge this gap, we design two GAN-based models. The first model, CGL-GAN, uses Gaussian blur on the inpainted regions to generate layouts. The second model combines unsupervised domain adaptation by introducing a GAN with a pixel-level discriminator (PD), abbreviated as PDA-GAN, to generate image-aware layouts based on the visual texture of input images. The PD is connected to shallow-level feature maps and computes the GAN loss for each input-image pixel. Additionally, we propose three novel content-aware metrics to assess the model's ability to capture the intricate relationships between graphic elements and image content. Quantitative and qualitative evaluations demonstrate that PDA-GAN achieves state-of-the-art performance and generates high-quality image-aware layouts.
Figures & tables
Fig. 1: Examples of image-aware graphic layout generation for advertising posters. Our model generates graphic layouts (middle) with multiple elements conditioned on product images (left). Designers or even automatic rendering programs can use these layouts to render advertising posters (right).
Dataset
Status
Train S
Test S
Train T
Test T
Element classes
Content
Product category
NDN [ 28 ]
Private
0
500
0
0
Text, logo, image, button
Empty
Car
ICVT [ 44 ]
Private
105,862
11,762
0
166
Text, logo, underlay
Product
Clothing, electronics, cosmetics, etc.
PKU [ 33 ]
Public
9,974
0
0
905
Text, logo, underlay
Product
Clothing, electronics, cosmetics, etc.
CGL(Ours)
Public
54,546
6,002
120,000
1,000
Text, logo, underlay, embellishment
Product
Clothing, electronics, cosmetics, etc.
TABLE I: Different dataset of poster layout. The symbol S ( T ) represents the source (target) domain data.
Fig. 2: Examples of CGL-Dataset. The left part represents the six components of information contained in each sample of the dataset. In the upper right corner are examples of different product types, and in the lower right corner are examples with different layout positions.
Fig. 3: Domain gap visualization. To illustrate the domain gap, we manually design several posters based on clean product images (target data), and then inpaint the graphic elements to generate the corresponding source data. The visual content in the inpainted areas (highlighted with yellow boxes) appears distorted and blurred compared to the original content (highlighted with red boxes).
Fig. 4: The architecture of our network. Annotated posters (source domain data) must be inpainted before input to the model. The model has both reconstruction and GAN loss when training with source domain data, while only a GAN loss is used when training with target domain data. Please refer to Sec. IV for the definition of each loss term: LPD , LPDG , and Lrec . During the discriminator or generator pass, both inpainted and clean images are fed into the discriminator.
Model
Rcom↓
Rshm↓
Rsub↓
cFID↓
Rove↓
Rund↑
Rali↓
FID↓
Rocc↑
ContentGAN [ 4 ]
45.59
17.08
1.143
26.30
0.0397
0.8626
0.0071
9.62
93.4
Layoutprompter [ 32 ]
39.77
14.66
0.840
25.55
0.2251
0.6786
0.0068
8.67
99.5
CGL-GAN(Ours)
35.77
15.47
0.805
15.31
0.0233
0.9359
0.0098
5.10
99.6
PDA-GAN(Ours)
33.55
12.77
0.688
12.39
0.0290
0.9481
0.0105
4.98
99.7
TABLE II: Comparison with image-aware methods. Bold and underlined numbers denote the best and second best respectively. ↓ (or ↑ ) means the smaller (or bigger) value, the better.
Model
Pe↑
Pb↑
Pe∗↑
Pb∗↑
ContentGAN [ 4 ]
18.89
19.36
18.25
16.58
Layoutprompter [ 32 ]
26.25
20.12
24.58
18.24
CGL-GAN
26.12
28.36
26.45
26.46
PDA-GAN
28.74
32.16
30.72
38.72
TABLE III: User study. Pe ( Pb ) represents the percentage of eligible-selected (best-selected) layouts. The symbol * denotes the professional group.
Fig. 5: Qualitative evaluation for different models. Layouts in each column are conditioned on the same image, while those in each row are generated by the same model. This figure provides a qualitative comparison and analysis of different models from three perspectives: background complexity of text elements, subject overlap, and product overlap attention maps.
Model
Rcom↓
Rshm↓
Rsub↓
cFID↓
Rove↓
Rund↑
Rali↓
FID↓
LT [ 31 ]
40.92
21.08
1.310
27.24
0.0156
0.9516
0.0049
6.25
VTN [ 15 ]
41.77
22.21
1.323
30.14
0.0130
0.9698
0.0047
7.13
LDM [ 26 ]
41.20
27.91
1.792
32.36
0.0146
0.9532
0.0032
5.02
LD [ 27 ]
40.56
27.36
1.772
28.76
0.0116
0.9624
0.0028
4.28
CGL-GAN
35.77
15.47
0.805
15.31
0.0233
0.9359
0.0098
5.10
PDA-GAN
33.55
12.77
0.688
12.39
0.0290
0.9481
0.0105
4.98
TABLE IV: Comparison with image-agnostic methods. LT and VTN represent LayoutTransformer and LayoutVTN, respectively.
Model
Data I
Data II
Gaussian Blur
Rcom↓
Rshm↓
Rsub↓
Rove↓
Rund↑
Rali↓
Rocc↑
CGL-GAN
✓
33.85
13.88
0.766
0.0299
0.9351
0.0139
99.7
CGL-GAN
✓
✓
-
-
-
2.5826
-
-
-
CGL-GAN
✓
✓
35.77
15.47
0.805
0.0233
0.9359
0.0098
99.6
PDA-GAN
✓
✓
36.41
19.48
1.044
0.0244
0.9384
0.0091
99.7
PDA-GAN
✓
✓
30.63
18.14
0.833
0.0589
0.9302
0.0105
99.6
PDA-GAN
✓
33.55
12.77
0.688
0.0290
0.9481
0.0105
99.7
TABLE V: Comprehensive comparison between CGL-GAN and PDA-GAN. Data I and Data II contain 8,000 and 54,546 source domain samples, respectively. ✓indicates the experiment configuration. The symbol ”-” indicates that the model cannot complete the layout generation task since the generated element bounding boxes overlap with each other severely.
Fig. 6: More qualitative comparisons between CGL-GAN and PDA-GAN.
Fig. 7: Layouts generated by different models using source and target domain data. Inpainted images (source domain) and clean images (target domain) are both fed into PDA-GAN and CGL-GAN. The results produced by PDA-GAN are relatively consistent, indicating that our method achieves better feature alignment between the two domains.
Model- W
Rcom↓
Rshm↓
Rsub↓
Rove↓
Rund↑
Rali↓
GD-6.0
-
-
-
9.0000
-
-
GD-1.0
-
-
-
8.9995
-
-
GD-0.01
-
-
-
4.7764
-
-
GD-0.001
34.41
13.78
0.749
0.0327
0.9299
0.0110
GD-0.0001
34.77
14.62
0.777
0.0345
0.9234
0.0122
GD-0.0
34.07
15.13
0.800
0.0350
0.9259
0.0108
TABLE VI: Ablation study with global discriminators. W refers to the weight of GD (or PD) module loss in the training process.
Patch size
Rcom↓
Rshm↓
Rsub↓
Rove↓
Rund↑
Rali↓
12*8
-
-
-
0.9288
-
-
24*16
33.67
16.00
0.844
0.0438
0.9407
0.0075
44*30
34.03
13.02
0.752
0.0284
0.9377
0.0119
88*60
32.65
13.35
0.735
0.0325
0.9173
0.0094
350*240
33.55
12.77
0.688
0.0290
0.9481
0.0105
TABLE VII: Ablation study with PatchGAN-based methods. The input image height and width are 320 and 240 respectively.
Feature map
Rcom↓
Rshm↓
Rsub↓
Rove↓
Rund↑
Rali↓
deep level
34.22
13.97
0.770
0.0396
0.9366
0.0118
fusion
35.36
14.54
0.817
0.0310
0.9513
0.0117
shallow level
33.55
12.77
0.688
0.0290
0.9481
0.0105
TABLE VIII: Quantitative ablation study on different level feature maps for the pixel-level discriminator.
Size
Rcom↓
Rshm↓
Rsub↓
Rove↓
Rund↑
Rali↓
5
33.09
13.66
0.720
0.0349
0.8891
0.0086
7
31.69
14.73
0.743
0.0431
0.9185
0.0081
fusion
32.30
13.25
0.747
0.0333
0.9316
0.0095
3
33.55
12.77
0.688
0.0290
0.9481
0.0105
TABLE IX: Quantitative ablation study on PD with different kernel sizes. 3, 5, and 7 denote convolutional kernel sizes of 3×3, 5×5, and 7×7, respectively, while ’fusion’ indicates a hybrid design combining all three.
Layers
Rcom↓
Rshm↓
Rsub↓
Rove↓
Rund↑
Rali↓
2
32.37
13.48
0.687
0.0360
0.9151
0.0110
6
32.97
15.25
0.792
0.0318
0.9040
0.0130
9
34.07
13.80
0.743
0.0279
0.9295
0.0086
3
33.55
12.77
0.688
0.0290
0.9481
0.0105
TABLE X: Quantitative ablation study on different level feature maps for the pixel-level discriminator. 2, 3, 6, and 9 denote the number of transposed convolutional layers used in the PD module.
smoothing
Rcom↓
Rshm↓
Rsub↓
Rove↓
Rund↑
Rali↓
without
33.61
14.04
0.718
0.0346
0.9188
0.0106
two-side
33.66
14.67
0.794
0.0334
0.9297
0.0098
one-source
32.20
15.23
0.799
0.0431
0.9234
0.0085
one-target
33.55
12.77
0.688
0.0290
0.9481
0.0105
TABLE XI: Ablation study with different label smoothing choices. The first row is the model without label smoothing. Two-side: set 0 to 0.2 and 1 to 0.8; one-source: set 1 to 0.8; and 0ne-target: set 0 to 0.2.
Fig. 8: Impact of Gaussian blur. Layouts in each row are generated using the same input image, while those in each column correspond to different input samples. “PDA-GAN with Gaussian blur” indicates that the input data is preprocessed with Gaussian blurring. The blue-numbered boxes in the middle show enlarged views of the regions marked with yellow numbers. The left part of the vertical dotted line displays the input images, while the right part displays the corresponding product attention heatmaps.
Model
Rcom↓
Rshm↓
Rsub↓
Rove↓
Rund↑
Rali↓
Ours’
34.07
15.13
0.800
0.0350
0.9259
0.0108
Ours
33.55
12.77
0.688
0.0290
0.9481
0.0105
TABLE XII: Quantitative ablation study on PD. Ours’ refers to our model of PDA-GAN without the PD module.
Backbone
Rcom↓
Rshm↓
Rsub↓
Rove↓
Rund↑
Rali↓
D-DETR
32.48
13.03
0.698
0.1085
0.9423
0.0078
DETR
33.55
12.77
0.688
0.0290
0.9481
0.0105
TABLE XIII: Quantitative ablation study on different backbones. D-DETR denotes deformable DETR.
Model
Rcom↓
Rshm↓
Rsub↓
Rove↓
Rund↑
Rali↓
Ours*
36.71
20.14
1.036
0.0475
0.9376
0.0068
Ours
33.55
12.77
0.688
0.0290
0.9481
0.0105
TABLE XIV: Quantitative ablation study on Gaussian blur. Ours* refers to the PDA-GAN model with Gaussian blur applied to the input image.
Fig. 9: Generalization ability of PDA-GAN on PKU-Dataset [ 33 ] .
Dataset
Rcom↓
Rshm↓
Rsub↓
Rove↓
Rund↑
Rali↓
PKU [ 33 ]
33.88
18.03
0.881
0.0445
0.9411
0.0127
CGL(ours)
33.55
12.77
0.688
0.0290
0.9481
0.0105
TABLE XV: Comparison of PDA-GAN trained on different datasets.
Fig. 10: Language-guided layout generation with varying element counts and types. Each row corresponds to the same background image. The left part shows layouts generated from prompts specifying the number of elements (e.g., “generate three elements”, 2 to 6 from left to right), while the right part shows layouts guided by prompts specifying element types (e.g., “generate text and underlay”).
Fig. 11: Failure cases. The first to third rows show layouts generated by models with the global discriminator (GD), patch discriminator (PatchD), and our PD module, respectively.
Generative Adversarial Networks (GANs) train competing generators and discriminators to synthesize data, translate images, and model complex distributions.
School of Engineering (ICAI), Comillas Pontifical University, Spain · Institute for Research in Technology (IIT), School of Engineering (ICAI), Comillas Pontifical University, Spain