Abstract
We aim to dismantle the prevalent black-box neural architectures used in complex visual reasoning tasks into the proposed eXplainable and eXplicit Neural Modules (XNMs). These modules advance beyond existing neural module networks by using scene graphs—objects as nodes and pairwise relationships as edges—for structured reasoning. By using scene graphs as an inductive bias, we design XNMs in a concise fashion using only four meta-types, reducing parameters by 10 to 100 times. This approach allows us to explicitly trace reasoning flow in terms of graph attentions. XNMs are generic and robust; they achieve 100% accuracy on CLEVR benchmarks with perfect graphs and a competitive 67.5% on real-world VQAv2.0 images, surpassing popular bag-of-objects attention models.
Introduction
Most current Artificial Intelligence models for Visual Question Answering (VQA) operate as "black boxes." They ingest an image and a question, performing complex internal computations to produce an answer without providing insight into their logic. This lack of transparency often leads to models learning "shortcuts"—statistical biases in the dataset rather than true visual reasoning. For instance, a model might always answer "red" when it detects an apple shape because the training data lacks green apples.
While previous Neural Module Networks (NMNs) attempted to address this by decomposing questions into functional sub-tasks, they often coupled visual perception directly with reasoning logic. XNMs aim to decouple these processes, teaching machines how to "think" (reason) independently of how they "look" (perceive).
Methods: The XNM Framework
The core innovation of XNMs is performing reasoning over scene graphs, which are structured representations where objects are nodes (containing attributes like color and material) and relationships are edges (such as "left of" or "riding"). This structure serves as a powerful inductive bias, allowing the model to focus on logical traversal rather than pixel processing.
The framework utilizes four fundamental "meta-types" of neural modules to build complex reasoning chains:
- AttendNode: Identifies specific objects based on attributes (e.g., "find the cylinders").
- AttendEdge: Identifies specific relationships (e.g., "look for things to the right").
- Transfer: Shifts attention from one set of nodes to another across graph edges (e.g., moving from a "cube" to "objects behind it").
- Logic: Executes boolean operations like
And,Or, andNoton attention maps.
Explicit Reasoning and Traceability
Because XNMs operate on graph nodes and edges, the reasoning path is entirely explicit. When a question is asked, the system generates a functional program that dictates which modules to execute and in what order. This allows researchers to visualize the "attention" moving across the graph at every step of the process.
As shown in the example above, to answer "How many objects are right of the brown metal cylinder and left of the red cube?", the model independently locates the cylinder and the cube, shifts attention to their respective right and left neighbors, intersects these sets, and counts the result. This transparency ensures that if a model fails, humans can pinpoint exactly where the logic broke down—whether it failed to identify an attribute or miscalculated a relationship.
Experimental Results
The authors evaluated XNMs across several benchmarks to test reasoning, generalization, and real-world applicability:
- CLEVR & CLEVR-CoGenT: When provided with ground-truth scene graphs, XNMs achieved a perfect 100% accuracy. Notably, they maintained this performance on CLEVR-CoGenT, which tests generalization to novel attribute combinations (e.g., training on blue cubes but testing on red ones), where traditional models often struggle.
- VQAv2.0: On real-world images where scene graphs must be detected (and are thus "noisy"), XNMs reached 67.5% accuracy. This performance surpasses popular "bottom-up and top-down" attention models that lack explicit graph structures.
- Efficiency: XNMs are remarkably lightweight. The XNM-GT model requires only 0.22M parameters, a massive reduction compared to the 115M parameters used by state-of-the-art pixel-based models like TbD-net.
Conclusion and Future Work
XNMs demonstrate that explicit reasoning over structured knowledge is both more efficient and more interpretable than standard black-box approaches. However, a significant "perception bottleneck" remains: the model's reasoning is only as good as the scene graph it receives. In real-world scenarios, imperfect object detection or relationship labeling can lead to errors. Future research will focus on improving scene graph generation in cluttered, open-vocabulary environments to make explicit visual reasoning more robust for everyday applications.
Summary updated