Incorporating Structured Representations into Pretrained Vision & Language Models Using Scene Graphs

Roei Herzig, Alon Mendelson, Leonid Karlinsky, Assaf Arbelle, Rogerio Feris, Trevor Darrell, Amir Globerson

TL;DR

While large-scale Vision-Language Models (VLMs) like CLIP are masters of zero-shot classification, they often behave like a "bag of objects," failing to understand how those objects relate to one another. This paper introduces SGVL, a method that uses small, structured Scene Graph (SG) datasets to teach VLMs compositional reasoning by generating hard textual negatives and adding specialized "Adaptive SG Tokens" to the visual encoder.

What Problem Does This Paper Address?

Modern VLMs are trained on hundreds of millions of noisy image-text pairs from the web. While this makes them incredibly robust, they often miss the "structure" of a scene. For example, a standard VLM might struggle to distinguish between "a dog chasing a cat" and "a cat chasing a dog" because both images contain the same "bag" of objects (dog, cat, grass).

Structured annotations like Scene Graphs—which explicitly map out objects, their attributes (e.g., "brown," "small"), and their relationships (e.g., "standing on," "holding")—could solve this. However, SG datasets are tiny (around 100k images) compared to pretraining sets like LAION (400M+ images). The challenge is: how do we inject this rich, structured knowledge into a massive pretrained model without ruining its general-purpose capabilities?

Methods

The authors propose a two-pronged approach called SGVL (Scene Graphs for Vision-Language Models) to bake structure into both the text and vision components of the model.

  1. Structural Language Component:
    • SG-to-Text: They convert Scene Graphs into highly detailed captions.
  2. Graph-Based Negatives (GN): To force the model to pay attention to structure, they use the SG to generate "hard negatives." If the SG says "man wearing gray shirt," they might generate a negative caption like "man wearing red shirt" or "gray shirt wearing man." The model is then trained to distinguish the correct caption from these structural decoys.
  3. Structural Visual Component:
    • Adaptive SG Tokens: The team adds a set of learnable "prompts" or tokens to the Image Transformer. These tokens are specifically tasked with predicting the Scene Graph (objects, bounding boxes, and relations) directly from the image.
  4. Parameter Decomposition: To prevent the new SG task from interfering with the model's original vision capabilities, they decompose the transformer parameters. One set of weights handles standard image patches, while a separate set handles the SG tokens.
  5. Parameter Efficiency: They use LoRA (Low-Rank Adaptation) to finetune the model, keeping the vast majority of the original weights frozen.
Figure 1: Scene Graphs Improve Pretrained Vision-Language Models. Vision and Language models (VLMs) are typically trained on large-scale image-text pairs (Left). We propose to improve pretrained VLMs by utilizing a small set of scene graph (SG) annotations (Right) from the Visual Genome dataset, that is richer and reflects structured visual and textual information. Specifically, we design a specialized model architecture and a new finetuning scheme when learning from SGs as follows: (i) Use the graph to generate fine-grained positive and negative captions that highlight different compositional aspects of the scene. (ii) Finetune the pretrained model using contrastive learning with the generated captions from the SGs, along with image-text pairs from LAION. (iii) Predict SG information (object, relations, and their coordinates) from an image by incorporating “Adaptive Scene Graph Tokens” into the image transformer encoder. During inference, these learned tokens, which capture structured information from the SG, interact with the patch tokens and CLS tokens to improve compositional scene understanding.

Datasets

  • Training: The Visual Genome (VG) dataset (approx. 108k images with SGs) and a tiny slice (less than 1%) of LAION-400M.
  • Evaluation: The models were tested on four major benchmarks for compositional understanding:
  • Winoground: Probes if models can distinguish between pairs of images/captions with identical words but different meanings.
  • VL-Checklist: Evaluates understanding of objects, attributes, and relations.
  • ARO (Attribution, Relation, and Order): Tests sensitivity to word order and object-attribute binding.
  • VSR (Visual Spatial Reasoning): Focuses specifically on spatial relationships.

Key Insights and Ideas

  • Structure is a Data Efficiency Hack: You don't need billions of images to teach a model structure. A small amount of high-quality, structured data (Visual Genome) can significantly move the needle if the training objective is right.
  • Negatives are Necessary: Simply finetuning on SG-derived captions isn't enough. The "hard negatives" generated by flipping graph edges are crucial for forcing the model to move beyond a "bag of words" strategy.
  • Visual Grounding Matters: By making the image encoder actually predict the graph (where objects are and how they connect), the model develops a more structured internal representation of the visual scene.
Figure 3: “Adaptive SG Tokens” Visualization. The predic- tions of object tokens (pink) and relationship tokens (cyan) are shown for images that are not in the VG training data.

Key Results

The SGVL approach was applied to three popular models: CLIP, BLIP, and BLIP2. Across the board, it yielded impressive gains:

  • ARO Benchmark: CLIP-SGVL saw a massive jump in performance, improving by over 22% on Flickr30k Order and 32% on COCO Order compared to the base CLIP model.
  • Winoground: BLIP-SGVL improved the "Group Score" (the hardest metric) by 6.5%.
  • Zero-Shot Stability: Crucially, these gains in compositional reasoning came with only a mild degradation (~1-2%) in general zero-shot classification performance, proving that the model didn't "forget" its original training.

Limitations and Future Work

The primary limitation is the reliance on high-quality Scene Graph annotations. These are notoriously expensive and time-consuming to produce manually. The authors suggest that future work could explore using other types of dense, structured data—like segmentation maps or depth maps—which might be easier to obtain at scale. Additionally, the quality of the SG data is paramount; poor-quality graphs could lead to lower performance.

Summary updated

BibTeX
@inproceedings{herzig2023incorporating,
  author = {Roei Herzig and Alon Mendelson and Leonid Karlinsky and Assaf Arbelle and Rogerio Feris and Trevor Darrell and Amir Globerson},
  title = {{Incorporating Structured Representations into Pretrained Vision \& Language Models Using Scene Graphs}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2023},
  doi = {10.18653/v1/2023.emnlp-main.870},
}
Figure