Knowledge-Based Counterfactual Queries for Visual Question Answering

Theodoti Stoikou, Maria Lymperaiou, Giorgos Stamou

Abstract

Visual Question Answering (VQA) models have achieved impressive performance, yet their internal reasoning remains opaque. This paper presents a model-agnostic framework to "stress-test" VQA systems using knowledge-based counterfactual queries. By systematically swapping words for synonyms, hypernyms, or related concepts using WordNet and color hierarchies, the authors expose significant linguistic biases. Results demonstrate that even state-of-the-art models suffer from a lack of semantic robustness, with accuracy dropping by up to 20% under minimal perturbations.

Introduction

Visual Question Answering (VQA) is a complex task where an AI must understand both an image and a text-based question to provide an answer. While performance has skyrocketed thanks to Transformer-based models, these systems remain "black boxes."

The core challenge is determining whether a model is actually reasoning about the scene or simply exploiting "linguistic shortcuts"—statistical biases in how questions are phrased. For example, if a model always sees the word "grass" associated with "green," it might answer "green" to any color question about grass without looking at the image. This paper seeks to expose these hidden biases and evaluate model robustness through counterfactual perturbations: making minimal, controlled changes to the input question to see if the model’s logic holds up.

Methods

The authors propose a framework that treats VQA models as black boxes and applies deterministic word-level replacements to the questions. Unlike random noise, these changes are guided by external knowledge sources to ensure they are semantically meaningful.

Overview of the knowledge-based counterfactual framework for VQA.

Knowledge Hierarchies

  1. WordNet Hierarchy: The system uses WordNet to identify synonyms (e.g., "talk" to "speak"), hypernyms/hyponyms (e.g., "dog" to "canine"), and siblings (e.g., "carrot" to "radish").
  2. Color Relatedness Hierarchy: Using RGB distances, the authors created a hierarchy to perform "Color Minimal" swaps (similar colors like violet to orchid) and "Color Maximal" swaps (distant colors like violet to deepskyblue).
  3. Noun Deletions: Randomly removing a noun to see if the model collapses or maintains functionality.
Examples of question perturbations generated using the proposed framework.

By comparing the model's response to the original question versus the perturbed question, researchers can extract local explanations for specific failures and global rules describing behavioral patterns.

Key Results and Insights

The framework was evaluated using the ViLT (Vision-and-Language Transformer) model on the VQA-v2 and Visual Genome (VG) benchmarks. The quantitative results show a fragile landscape for VQA:

  • Accuracy Plunge: Even with minimal perturbations like synonyms, accuracy dropped by 15–20% across the board.
  • Color Sensitivity: In VQA-v2, "Color Maximal" perturbations caused a 34.2% decline in accuracy for common colors. Even "Color Minimal" swaps caused a 31% decline.
  • Linguistic Inflexibility: The highest accuracy reduction occurred with Sibling Nouns (up to 38.1% on Visual Genome), indicating the model struggles to differentiate between closely related but distinct concepts.

Qualitative analysis revealed several biases. The model often ignores changes involving neutral colors like "gray" or "silver," suggesting it relies more on an object's typical identity than visual evidence. Furthermore, while the model is robust regarding living creatures, it fails significantly when asked about clothing or transport. In many cases, the model falls into an "Easy Answer Trap," ignoring text changes to give an answer based on what is visually dominant in the image.

Conclusion

The findings highlight that current VQA models are highly sensitive to linguistic variations and often rely on statistical shortcuts. Future work aims to expand this knowledge-based approach to the visual modality and other visiolinguistic tasks like Visual Commonsense Reasoning.

Summary updated

Abstract

Visual Question Answering (VQA) has been a popular task that combines vision and language, with numerous relevant implementations in literature. Even though there are some attempts that approach explainability and robustness issues in VQA models, very few of them employ counterfactuals as a means of probing such challenges in a model-agnostic way. In this work, we propose a systematic method for explaining the behavior and investigating the robustness of VQA models through counterfactual perturbations. For this reason, we exploit structured knowledge bases to perform deterministic, optimal and controllable word-level replacements targeting the linguistic modality, and we then evaluate the model's response against such counterfactual inputs. Finally, we qualitatively extract local and global explanations based on counterfactual responses, which are ultimately proven insightful towards interpreting VQA model behaviors. By performing a variety of perturbation types, targeting different parts of speech of the input question, we gain insights to the reasoning of the model, through the comparison of its responses in different adversarial circumstances. Overall, we reveal possible biases in the decision-making process of the model, as well as expected and unexpected patterns, which impact its performance quantitatively and qualitatively, as indicated by our analysis.
BibTeX
@inproceedings{stoikou2023knowledge,
  author = {Theodoti Stoikou and Maria Lymperaiou and Giorgos Stamou},
  title = {{Knowledge-Based Counterfactual Queries for Visual Question Answering}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2023},
  url = {https://openreview.net/forum?id=We0DfwpwTa},
}
Figure