Spatial Knowledge Distillation to aid Visual Reasoning

Somak Aditya, Rudra Saha, Yezhou Yang, Chitta Baral · DOI

Abstract

For tasks involving language and vision, the current state-of-the-art methods tend not to leverage any additional information that might be present to gather relevant (commonsense) knowledge. A representative task is Visual Question Answering where large diagnostic datasets have been proposed to test a system's capability of answering questions about images. The training data is often accompanied by annotations of individual object properties and spatial locations. In this work, we take a step towards integrating this additional privileged information in the form of spatial knowledge to aid in visual reasoning. We propose a framework that combines recent advances in knowledge distillation (teacher-student framework), relational reasoning and probabilistic logical languages to incorporate such knowledge in existing neural networks for the task of Visual Question Answering. Specifically, for a question posed against an image, we use a probabilistic logical language to encode the spatial knowledge and the spatial understanding about the question in the form of a mask that is directly provided to the teacher network. The student network learns from the ground-truth information as well as the teachers prediction via distillation. We also demonstrate the impact of predicting such a mask inside the teachers network using attention. Empirically, we show that both the methods improve the test accuracy over a state-of-the-art approach on a publicly available dataset.

Introduction

Visual Question Answering (VQA) represents a significant challenge in artificial intelligence, requiring the integration of computer vision, natural language processing, and symbolic reasoning. While modern deep learning models are proficient at identifying objects, they frequently struggle with multi-step logical reasoning—particularly when identifying objects based on complex spatial relationships. For instance, a question like "What shape is the small object in the front of the yellow metallic cube and behind the cyan matte thing?" requires a model to understand how three-dimensional spatial regions overlap.

Spatial reasoning challenges in VQA: (a) complex multi-step questions and (b) spatial commonsense reasoning using overlapping regions.

Current VQA models often operate as "black boxes," relying on statistical pattern matching rather than explicit reasoning. This paper addresses this limitation by proposing a method to "distill" spatial commonsense into neural networks, enabling more effective reasoning without sacrificing the flexibility of deep learning architectures.

Methodology: Spatial Knowledge Distillation

The researchers bridge the gap between symbolic logic and deep learning using a teacher-student knowledge distillation framework. This approach allows the model to leverage "privileged information" during training that is not available during inference.

The Teacher-Student Framework

  1. The Teacher (Logic Expert): The teacher network is provided with a scene graph containing precise object properties and spatial locations. It utilizes Probabilistic Soft Logic (PSL) to reason over the question. PSL combines first-order logic with the ability to handle uncertainty, generating an attentive image mask. This mask acts as a heatmap, directing the model's focus to the specific image regions relevant to the question.
  2. The Student (Agile Learner): The student is a standard neural network (e.g., a Relational Network) that does not have access to the scene graph. It is trained to mimic the teacher's predictions and attention patterns.
  3. Distillation: By learning from the teacher's "soft" probability distributions rather than just "hard" ground-truth labels, the student internalizes the spatial reasoning logic discovered by the teacher.
The proposed teacher-student framework for spatial knowledge distillation, showing the interaction between the LSTM-based question processing, the image features, and the distillation process.

Experimental Results

The framework was evaluated on the CLEVR and Sort-of-CLEVR datasets, which are designed to test visual reasoning through complex spatial queries.

  • Sort-of-CLEVR: The teacher model achieved a 13.7% improvement in test accuracy over the baseline. Notably, the student model—despite lacking access to privileged scene information—saw a 6.2% boost in accuracy through distillation.
  • CLEVR: On the full dataset, the distillation process yielded a 2% improvement for the student model, demonstrating the scalability of the approach to more complex environments.
  • Object Localization: The PSL-based reasoning achieved 75% recall in correctly identifying objects relevant to specific questions.

Conclusion and Future Work

This research demonstrates that symbolic logic can serve as a powerful guide for training neural networks. By using attention masks as a universal language between symbolic and neural components, models can inherit reasoning capabilities that persist even when the symbolic engine is removed.

Future work aims to reduce the dependency on high-quality scene graphs, which are difficult to generate for real-world images. Additionally, improving the robustness of natural language parsing into logical predicates remains a key area for development to ensure the reasoning chain remains intact for complex human speech.

Summary updated

BibTeX
@inproceedings{aditya2018spatial,
  author = {Somak Aditya and Rudra Saha and Yezhou Yang and Chitta Baral},
  title = {{Spatial Knowledge Distillation to aid Visual Reasoning}},
  booktitle = {IEEE/CVF Winter Conference on Applications of Computer Vision},
  year = {2018},
  doi = {10.1109/wacv.2019.00030},
}
Figure