Skip to main content
QUICK REVIEW

[Paper Review] Diffusion-Based Scene Graph to Image Generation with Masked Contrastive Pre-Training

L. Yang, Zhilin Huang|arXiv (Cornell University)|Nov 21, 2022
Generative Adversarial Networks and Image SynthesisComputer Science10 citations
TL;DR

This paper proposes SGDiff, a diffusion-based image generation model that improves scene graph to image alignment by pre-training scene graph embeddings using masked autoencoding and contrastive learning. The method outperforms state-of-the-art approaches on Visual Genome and COCO-Stuff, achieving SOTA results in Inception Score (16.4) and FID (26.0) for 256×256 image generation, while enabling semantic manipulation through scene graph editing.

ABSTRACT

Generating images from graph-structured inputs, such as scene graphs, is uniquely challenging due to the difficulty of aligning nodes and connections in graphs with objects and their relations in images. Most existing methods address this challenge by using scene layouts, which are image-like representations of scene graphs designed to capture the coarse structures of scene images. Because scene layouts are manually crafted, the alignment with images may not be fully optimized, causing suboptimal compliance between the generated images and the original scene graphs. To tackle this issue, we propose to learn scene graph embeddings by directly optimizing their alignment with images. Specifically, we pre-train an encoder to extract both global and local information from scene graphs that are predictive of the corresponding images, relying on two loss functions: masked autoencoding loss and contrastive loss. The former trains embeddings by reconstructing randomly masked image regions, while the latter trains embeddings to discriminate between compliant and non-compliant images according to the scene graph. Given these embeddings, we build a latent diffusion model to generate images from scene graphs. The resulting method, called SGDiff, allows for the semantic manipulation of generated images by modifying scene graph nodes and connections. On the Visual Genome and COCO-Stuff datasets, we demonstrate that SGDiff outperforms state-of-the-art methods, as measured by both the Inception Score and Fréchet Inception Distance (FID) metrics. We will release our source code and trained models at https://github.com/YangLing0818/SGDiff.

Motivation & Objective

  • To address the misalignment between scene graphs and generated images caused by manually crafted intermediate representations like scene layouts.
  • To learn scene graph embeddings that explicitly optimize alignment with corresponding images, improving generation fidelity and structural compliance.
  • To enable semantic image manipulation through scene graph editing by learning disentangled, predictive embeddings.
  • To demonstrate that end-to-end learned embeddings outperform hand-designed scene layouts in both qualitative and quantitative image generation benchmarks.

Proposed method

  • Pre-train a scene graph encoder using masked autoencoding loss to reconstruct missing image regions based on unmasked regions and graph embeddings.
  • Apply contrastive learning to distinguish between image-graph pairs that comply with the scene graph and those that do not, enhancing global structural alignment.
  • Combine local (masked autoencoding) and global (contrastive) embeddings into a unified representation for improved predictive power.
  • Condition a latent diffusion model on the pre-trained scene graph embeddings to generate high-fidelity, structurally accurate images.
  • Use the learned embeddings to enable semantic manipulation by modifying nodes and relations in the scene graph.
  • Train and evaluate the model on Visual Genome and COCO-Stuff datasets using IS and FID metrics.

Experimental results

Research questions

  • RQ1Can masked contrastive pre-training of scene graph embeddings improve image generation quality and alignment with input scene graphs?
  • RQ2How do local (masked autoencoding) and global (contrastive) embedding components contribute differently to image generation performance?
  • RQ3Does end-to-end learned scene graph embedding outperform manually designed scene layout representations in scene graph to image generation?
  • RQ4Can the learned embeddings support fine-grained, semantic image manipulation through scene graph editing?

Key findings

  • The combination of masked autoencoding and contrastive pre-training achieved 73.4% accuracy in graph-to-image retrieval and 74.1% in image-to-graph retrieval, outperforming individual losses.
  • SGDiff achieved an Inception Score of 16.4 ± 0.6 and FID of 26.0 on the COCO-Stuff dataset, surpassing one-hot (IS: 10.1, FID: 87.1) and layout-based (IS: 12.3, FID: 52.7) baselines.
  • Masked pre-training improved local structure generation, producing images with finer object details, while contrastive pre-training enhanced global structural compliance.
  • Ablation studies confirmed that both masked autoencoding and contrastive losses are essential, with their combination yielding the best performance.
  • Qualitative results show that SGDiff generates more realistic and graph-compliant images than prior methods, especially in complex relations like 'eating' or 'looking at'.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.