NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Linguistically Driven Graph Capsule Network for Visual Question Reasoning

Qingxing Cao, Xiaodan Liang, Keze Wang, Liang LinarXiv 2020

Abstract

Recently, studies of visual question answering have explored various architectures of end-to-end networks and achieved promising results on both natural and synthetic datasets, which require explicitly compositional reasoning. However, it has been argued that these black-box approaches lack interpretability of results, and thus cannot perform well on generalization tasks due to overfitting the dataset bias. In this work, we aim to combine the benefits of both sides and overcome their limitations to achieve an end-to-end interpretable structural reasoning for general images without the requirement of layout annotations. Inspired by the property of a capsule network that can carve a tree structure inside a regular convolutional neural network (CNN), we propose a hierarchical compositional reasoning model called the "Linguistically driven Graph Capsule Network", where the compositional process is guided by the linguistic parse tree. Specifically, we bind each capsule in the lowest layer to bridge the linguistic embedding of a single word in the original question with visual evidence and then route them to the same capsule if they are siblings in the parse tree. This compositional process is achieved by performing inference on a linguistically driven conditional random field (CRF) and is performed across multiple graph capsule layers, which results in a compositional reasoning process inside a CNN. Experiments on the CLEVR dataset, CLEVR compositional generation test, and FigureQA dataset demonstrate the effectiveness and composition generalization ability of our end-to-end model.

Introduction

Visual Question Answering (VQA) models often fall into the trap of "black-box" learning—they memorize statistical biases in datasets rather than performing true logical reasoning. While modular networks attempt to solve this by breaking questions into functional programs, they typically require ground-truth layout annotations (step-by-step reasoning instructions), which are rarely available for real-world images.

The Linguistically Driven Graph Capsule Network (LG-Capsule) is a novel VQA architecture that uses the inherent hierarchical structure of language to guide visual reasoning. By "carving" a linguistic parse tree into a capsule network via a Conditional Random Field (CRF), the model achieves state-of-the-art compositional generalization without requiring expensive, manually-annotated reasoning layouts.

Methodology

The LG-Capsule framework operates through four main stages to achieve end-to-end interpretable structural reasoning.

The LG-Capsule framework architecture, illustrating the flow from linguistic layout generation to word-level multimodal embedding and the hierarchical graph capsule network.

1. Linguistic Layout Generation

The input question is processed by an off-the-shelf parser (e.g., Stanford Parser) to create a dependency tree. This tree defines the hierarchical grouping of words into phrases and clauses, providing a structural prior for the reasoning process.

2. Word-level Multimodal Embedding

Image features extracted from a CNN (like ResNet-101) are fused with individual word embeddings using low-rank bilinear pooling. This creates a set of "initial capsules" in the lowest layer, where each capsule represents a specific word's interaction with the visual scene.

3. Linguistically Driven Tree Routing

Instead of standard "routing by agreement," LG-Capsule uses Graph Capsule Routing. This process is formulated as a labeling problem in a Conditional Random Field (CRF). Unary potentials determine capsule activation, while binary potentials enforce the linguistic structure: capsules representing "sibling" words in the parse tree are encouraged to merge into the same higher-level capsule.

Detailed view of the CRF inference process, showing how unary and binary potentials guide the routing of capsules into the next layer.

4. Hierarchical Composition

As data flows through multiple capsule layers, the model composes representations from words to phrases, and finally to a single sentence-level embedding used by a classifier to predict the final answer.

Key Insights

  • Capsules as Structural Units: Capsule networks are inherently designed for "part-whole" hierarchies. By aligning this hierarchy with the structure of language, the model makes the internal logic of a CNN follow a human-understandable path.
  • Soft Perception Fields: To maintain differentiability for end-to-end training, the authors use a "soft" perception field. This allows capsules to perceive words with varying weights rather than using a rigid binary tree structure.
  • Guidance vs. Supervision: Unlike previous modular approaches that need explicit "programs," LG-Capsule uses the parse tree as a prior. It learns to reason by looking at the final answer, using linguistic structure only to constrain the search space.

Experimental Results

The model was evaluated on three major benchmarks to test its reasoning and generalization capabilities:

  • CLEVR-CoGenT: On the Condition B test—measuring performance on unseen attribute combinations—LG-Capsule achieved 84.06% accuracy, significantly outperforming standard CNN+LSTM baselines (~78%).
  • FigureQA: The model set a new benchmark with 90.7% accuracy, a massive improvement over the previous state-of-the-art Relational Network (72.4%).
  • CLEVR: It achieved 97.9% accuracy, matching models that require much more expensive "program" annotations during training.

Conclusion

LG-Capsule demonstrates that linguistic structures can effectively guide visual reasoning without the need for manual layout annotations. While currently limited by the need to prune deep parse trees for computational efficiency, it represents a significant step toward interpretable and generalizable VQA. Future work will focus on handling more unconstrained, natural image scenarios where linguistic structures may be noisier.

Summary updated

BibTeX
@misc{cao2020linguistically,
  author = {Qingxing Cao and Xiaodan Liang and Keze Wang and Liang Lin},
  title = {{Linguistically Driven Graph Capsule Network for Visual Question Reasoning}},
  year = {2020},
  eprint = {2003.10065},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2003.10065},
}
Figure