Introduction
Modern Vision-Language Models (VLMs) excel at identifying objects but often struggle with the underlying structural knowledge of a scene. They frequently treat images as a "bag-of-words," failing to distinguish between a man riding a bike and a man standing next to one. This limitation stems from messy natural language captions and the difficulty of learning complex event dependencies simultaneously. ViStruct addresses these challenges by representing visual information as structured Python code and employing a staged learning approach.
Methodology
Code-Vision Representation
To provide a consistent and hierarchical format, ViStruct represents visual data using Python code blocks. Objects are instances with attributes like location and state, while interactions are defined as functions. This structured approach forces the model to recognize specific roles and hierarchies within a scene, moving beyond simple keyword matching.
Curriculum Pyramid and Replay Buffer
Learning complex events requires a foundation in basic object recognition and grounding. ViStruct utilizes a "Curriculum Pyramid" that guides the model through five levels of increasing complexity: Concept Recognition, Object Grounding, Object Attributes, Object Relations, and finally, Event Extraction.
To mitigate "catastrophic forgetting" as the model moves up the pyramid, a Replay Buffer maintains a subset of data from earlier stages throughout the training process. This ensures that while the model learns to identify complex events like "a horse eating grass," it doesn't lose its ability to accurately locate the horse or identify its color.
Datasets and Evaluation
The researchers developed the ViStruct Suite, a massive collection of multi-level structural knowledge. They combined labeled data from ImageNet21K, COCO, and Visual Genome with weakly-supervised event data. To scale the "Event" stage, they used an off-the-shelf semantic role labeling (SRL) tool to automatically extract event structures from millions of raw web captions.
Evaluation on the Visual Genome benchmark showed that ViStruct achieved a Mean Recall (mR@100) of 70.71, significantly outperforming the 55.41 baseline. On the SWiG dataset for situation recognition, it set a new state-of-the-art for Top-1 Predicted Verbs. Notably, ViStruct demonstrated 2.4x better zero-shot performance compared to natural language-based models, highlighting the generalizability of code-based representations.
Key Insights
- Structure as Syntax: The inherent logic of programming languages provides a schema that natural language lacks. By treating visual understanding as a code-generation task, the model fills in a predefined schema rather than just predicting unstructured words.
- Focused Optimization: ViStruct introduces a method to only optimize loss for masked semantic tokens (the actual names of objects and relations). This allows the model to ignore redundant syntax like brackets, improving training efficiency.
- The Power of "Easy Samples First": The curriculum approach acts as a vital "warm-up." Starting with simple object recognition provides the necessary foundation for the much harder task of event extraction, leading to more stable and accurate results.
Conclusion
ViStruct demonstrates that treating visual understanding as a structured code-generation task significantly enhances a model's ability to capture complex relations and events. By leveraging a curriculum-based training strategy and explicit syntax, ViStruct moves VLMs closer to true scene comprehension. Future work involves scaling this framework to larger backbones and optimizing inference speeds for real-time applications.
Summary updated