Scene Graph Conditioning in Latent Diffusion

Frank FundelarXiv 2023 · DOI

Abstract

Latent Diffusion Models (LDMs) have revolutionized image synthesis but often struggle with the semantic ambiguity of text prompts, particularly regarding spatial relationships. This paper investigates scene graphs as an explicit structural alternative for conditioning. By integrating Graph Convolutional Networks (GCNs) with established adapter frameworks like ControlNet and Gated Self-Attention (GLIGEN), the authors demonstrate superior control over object arrangements. Results on Visual Genome and COCO-Stuff show significant improvements in Inception Scores over previous state-of-the-art scene-graph-to-image models.

Introduction: The Limits of Textual Conditioning

While models like Stable Diffusion produce high-fidelity images, they frequently fail to capture precise structural relationships. A prompt such as "a dog on a motorcycle" may result in a motorcycle on top of a dog because CLIP embeddings often prioritize keywords over relational syntax. Text is inherently loosely structured. In contrast, scene graphs provide an explicit representation: nodes define objects (e.g., "dog," "motorcycle") and edges define their relationships (e.g., "sitting on"). The primary challenge lies in effectively "plugging" these structured graphs into pre-trained diffusion models, given that scene-graph-labeled data is significantly scarcer than text-image pairs.

Methods: Bridging Graphs and Diffusion

The research explores two primary architectural pathways to condition LDMs on scene graphs:

  1. Spatial Guidance via Scene Layouts (ControlNet): A Graph Convolutional Network (GCN) processes the scene graph to extract features, which are then decoded into a coarse semantic layout. This layout serves as a spatial map for ControlNet to guide the diffusion process.
  2. Direct Embedding Injection (Gated Self-Attention): Instead of an intermediate spatial map, GCN-derived graph embeddings are fused with text embeddings and injected into the model via Gated Self-Attention layers, similar to the GLIGEN architecture. This approach offers more flexible spatial control.
Architectural comparison of ControlNet and Gated Self-Attention pathways for scene graph conditioning.

To further refine these embeddings, the paper evaluates different encoder variants. The Contrastive Graph Encoder (inspired by Structure-CLIP) is designed to handle "hard negatives," ensuring the model distinguishes between inverse relationships like "A on B" vs. "B on A."

Comparison between the standard CLIP Graph Encoder and the Contrastive Graph Encoder.

Data and Evaluation

The models were trained using Visual Genome, which contains over 100,000 human-annotated scene graphs, and COCO-Stuff, where scene graphs were synthetically generated from bounding box and segmentation metadata.

Quantitatively, the proposed methods achieved an Inception Score (IS) of ~32.2 on COCO, a substantial improvement over previous models like SceneGenie (22.2) and SGDiff (17.8). Qualitatively, the models maintain the photorealism of Stable Diffusion while strictly adhering to complex graph-based instructions that typically confound base models. While FID scores were reported as high, the authors attribute this to a limited evaluation sample size (10 images) due to resource constraints.

Key Insights and Limitations

The study highlights that scene graphs effectively bypass the linguistic hurdles of CLIP by explicitly defining edges. Furthermore, "adapter" methods (ControlNet/GLIGEN) prove sufficient for fine-tuning, which is vital given the relative scarcity of graph-labeled data compared to massive datasets like LAION-5B.

However, a significant bottleneck remains: the "coarseness" of predicted scene layouts can limit final image quality. Future work should focus on increasing training volume through automated scene graph generation and improving the resolution of intermediate spatial representations to fully unlock the creative potential of the underlying diffusion models.

Summary updated

BibTeX
@misc{fundel2023scene,
  author = {Frank Fundel},
  title = {{Scene Graph Conditioning in Latent Diffusion}},
  year = {2023},
  eprint = {2310.10338},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2310.10338},
}
Figure