Image Generation From Scene Graphs

Justin Johnson, Agrim Gupta, Li Fei-Fei

Abstract

To truly understand the visual world our models should be able not only to recognize images but also generate them. To this end, there has been exciting recent progress on generating images from natural language descriptions. These methods give stunning results on limited domains such as descriptions of birds or flowers, but struggle to faithfully reproduce complex sentences with many objects and relationships. To overcome this limitation we propose a method for generating images from scene graphs, enabling explicitly reasoning about objects and their relationships. Our model uses graph convolution to process input graphs, computes a scene layout by predicting bounding boxes and segmentation masks for objects, and converts the layout to an image with a cascaded refinement network. The network is trained adversarially against a pair of discriminators to ensure realistic outputs. We validate our approach on Visual Genome and COCO-Stuff, where qualitative results, ablations, and user studies demonstrate our method’s ability to generate complex images with multiple objects.

Introduction

Generating complex images with many interacting objects is a massive challenge for standard text-to-image models. While models like StackGAN showed impressive results in generating images of single subjects (like a bird or a flower), they struggle with complex scenes. If you ask a model to generate "a person riding a horse next to a tree while a dog watches," the linear nature of a sentence makes it difficult for the model to "untangle" which attributes belong to which object and how they relate spatially.

To address this, the authors propose moving beyond simple recognition to structured generation. The core challenge is bridging the gap between symbolic, graph-structured input and continuous, pixel-based output. This paper introduces a method to generate images from scene graphs—structured representations that explicitly define objects and their relationships (e.g., "sheep on grass").

Overview of the proposed pipeline: converting a sentence to a scene graph and then to an image, compared against StackGAN.

Methodology

The proposed architecture is a modular end-to-end neural network consisting of four main components:

  1. Graph Convolutional Network (GCN): The input scene graph (nodes for objects, edges for relationships) is processed by a GCN. This allows information to flow along the edges, so the representation of a "car" changes depending on whether it is "on a street" or "below a kite."
  2. Object Layout Network: This module takes the object embeddings from the GCN and predicts a bounding box and a segmentation mask for every object in the graph. These are combined to create a "scene layout"—a coarse, multi-channel spatial map.
  3. Cascaded Refinement Network (CRN): This network takes the coarse layout and progressively generates a 64x64 image through a series of convolutional modules that increase spatial resolution.
  4. Dual Discriminators: To ensure realism, the model is trained adversarially. An Image Discriminator looks at the whole scene for global coherence, while an Object Discriminator looks at individual cropped objects to ensure they are recognizable and high-quality.

Key Insights

  • Explicit vs. Implicit Reasoning: Text-to-image models must implicitly learn relationships from unstructured strings. Scene graphs make these relationships explicit, allowing the model to "reason" about the scene structure before a single pixel is drawn.
  • The Power of Graph Convolutions: The GCN ensures that the spatial prediction for one object is informed by its neighbors. For example, adding a "boat" to a "grass" node in the graph causes the model to shift the boat's predicted location to respect the "on" relationship.
  • Layout as an Intermediate Step: By predicting bounding boxes and masks first, the model breaks the generation task into two manageable parts: geometry ("where things go") and appearance ("what things look like").
  • Object-Centric GAN Training: Using a dedicated discriminator for individual objects was crucial for preventing objects from disappearing into a "blurry mess," a common failure mode in complex scene generation.

Evaluation and Results

The model was evaluated on Visual Genome (human-annotated scene graphs) and COCO-Stuff (synthetic scene graphs from ground-truth masks).

Key results include:

  • User Preference: In head-to-head comparisons on COCO, human users preferred images generated by this method over StackGAN in 67.6% of trials for semantic interpretability.
  • Object Recognition: Users recognized significantly more objects in scene-graph-generated images, showing a 65% relative improvement in "thing" recall over StackGAN.
  • Ablation Studies: Removing graph convolutions or relationship edges significantly degraded the model's ability to place objects correctly, proving the necessity of the structured approach.
  • Iterative Scene Building: The model can dynamically adjust layouts as new nodes are added to the graph, demonstrating a robust understanding of spatial relationships.

Limitations and Future Work

While pioneering, the method has limitations. The generated images are 64x64 pixels, which is low resolution by modern standards. Furthermore, the final image quality is heavily dependent on the predicted layout; poor box/mask predictions lead to poor final images. Future work includes moving toward higher resolutions and incorporating more complex attributes like color, texture, and pose directly into the graph nodes.

Summary updated

BibTeX
@inproceedings{johnson2018image,
  author = {Justin Johnson and Agrim Gupta and Li Fei-Fei},
  title = {{Image Generation From Scene Graphs}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2018},
  url = {https://openreview.net/forum?id=BJ4vgJGu-H},
}
Figure