Loss re-scaling VQA: Revisiting the Language Prior Problem from a Class-imbalance View

Yangyang GuoOpenReview 2022

TL;DR

This paper tackles the "language prior problem" in Visual Question Answering (VQA), where models rely on text shortcuts instead of visual reasoning. They propose a novel interpretation of this problem as a class imbalance issue within answer distributions for specific question types, leading to a simple yet effective loss re-scaling method that significantly improves VQA model performance.

What Problem Does This Paper Address?

Visual Question Answering (VQA) aims to answer natural language questions about images. Despite significant progress, many VQA models suffer from the "language prior problem." This means they learn spurious correlations between question phrasing and common answers (e.g., "how many" questions often being answered with "2") rather than truly understanding the visual content. This leads to brittle models that perform poorly on datasets designed to expose these biases, like VQA-CP. Existing methods often focus on enhancing visual features or adding complex model branches, but a clear understanding of why this language prior problem occurs has been lacking, hindering purposeful model development.

Methods

The core contribution is a new perspective: the language prior problem in VQA can be viewed as a class imbalance problem. Specifically, for a given question type (e.g., "how many"), the distribution of possible answers is often highly skewed, with a few answers appearing very frequently and many others appearing rarely. The authors hypothesize that this imbalance causes models to over-rely on frequent answers.

To address this, they propose two main components:

  1. Answer Mask Module: This module aims to ensure that predicted answers for a given question type fall within the set of plausible answers for that type. It uses a learned mask to filter out unlikely answers, especially those that are "out-of-type" (like "yes" for a "how many" question).
  2. Loss Re-scaling: This is the primary technique. Based on the class imbalance observation, they re-scale the loss for each answer. Frequent answers (head classes) receive smaller weights, while sparse answers (tail classes) receive larger weights. This encourages the model to pay more attention to learning from rare but potentially correct answers.

Datasets

The primary datasets used for evaluation are:

  • VQA-CP v2 and VQA-CP v1: These are specifically designed to challenge language priors by having distinct answer distributions between training and testing sets for question types.
  • VQA v2: A more generally biased dataset, used for comparison to quantify the bias learning level.

The authors also demonstrate the validity of their class imbalance interpretation on other computer vision tasks:

  • Face Recognition: Labeled Faces in the Wild (LFW) dataset, with a subset of seven individuals.
  • Image Classification: Imbalanced CIFAR-10 dataset.

Key Insights and Ideas

  • Language Prior as Class Imbalance: The most significant insight is reframing the language prior problem as a class imbalance issue within answer distributions per question type. This provides a clear, interpretable cause for the model's behavior.
  • Late Training Phase Behavior: The paper highlights that during the late stages of training (when models converge), models penalize "hard mistakes" (predicting a rare answer incorrectly) much more heavily than "easy mistakes" (predicting a frequent answer incorrectly). This suggests that the imbalance actively hinders learning from rare answers.
  • Question Encoding Layer Blame: The authors provide evidence that the gradient norms are larger for the question encoding layer parameters compared to the prediction layer. This suggests that the question encoding mechanism is more responsible for learning language priors, aligning with why methods targeting this layer are effective.
  • Model-Agnostic Solution: The proposed loss re-scaling method is designed to be plug-and-play, compatible with various VQA architectures without requiring significant architectural changes or introducing new trainable parameters for the re-scaling itself.

Key Results

  • Significant Performance Gains: The proposed method, when applied to six strong baselines, consistently achieved significant performance improvements on the VQA-CP v2 and VQA-CP v1 datasets. For example, UpDn's accuracy on VQA-CP v2 increased from 38.80% to 47.09% (an 8.29% absolute gain).
  • Superiority over Baselines: The method outperformed existing state-of-the-art methods designed to combat language priors, particularly on the VQA-CP datasets.
  • Effectiveness of Modules: Ablation studies showed that both the answer mask and loss re-scaling modules contribute to performance gains, with the loss re-scaling being particularly impactful.
  • Validation on Other Tasks: The class imbalance interpretation and loss re-scaling approach showed similar positive effects on face recognition and image classification tasks, demonstrating its broader applicability.
  • Comparison to Focal Loss: The proposed loss re-scaling method showed a performance advantage over Focal Loss, suggesting that question-type-specific re-scaling is more effective than a general hard-example focusing strategy.

Limitations and Future Work

  • Generalization to Other Tasks: While the paper shows promise on face recognition and image classification, further exploration of its applicability to other vision-and-language tasks (like image captioning) is suggested.
  • Exploring Other Class Imbalance Techniques: The authors mention future work could involve exploring other class imbalance strategies like data re-balancing or transfer learning for alleviating language priors.
  • Answer Mask Module: While beneficial, the answer mask module does add some complexity. The paper notes that for some models (like LXMERT), it was not applied to avoid undermining pre-trained features.
  • Computational Cost: While the loss re-scaling itself adds no inference cost, the answer mask module does introduce some computation. The paper focuses on the loss re-scaling as the primary driver of performance.

Summary updated

Abstract

Recent studies have pointed out that many well-developed Visual Question Answering (VQA) models are heavily affected by the language prior problem. It refers to making predictions based on the co-occurrence pattern between textual questions and answers instead of reasoning upon visual contents. To tackle this problem, most existing methods focus on strengthening the visual feature learning capability to reduce this text shortcut influence on model decisions. However, few efforts have been devoted to analyzing its inherent cause and providing an explicit interpretation. It thus lacks a good guidance for the research community to move forward in a purposeful way, resulting in model construction perplexity towards overcoming this non-trivial problem. In this paper, we propose to interpret the language prior problem in VQA from a class-imbalance view. Concretely, we design a novel interpretation scheme whereby the loss of mis-predicted frequent and sparse answers from the same question type is distinctly exhibited during the late training phase. It explicitly reveals why the VQA model tends to produce a frequent yet obviously wrong answer, to a given question whose right answer is sparse in the training set. Based upon this observation, we further propose a novel loss re-scaling approach to assign different weights to each answer according to the training data statistics for estimating the final loss. We apply our approach into six strong baselines and the experimental results on two VQA-CP benchmark datasets evidently demonstrate its effectiveness. In addition, we also justify the validity of the class imbalance interpretation scheme on other computer vision tasks, such as face recognition and image classification.
BibTeX
@misc{guo2022loss,
  author = {Yangyang Guo},
  title = {{Loss re-scaling VQA: Revisiting the Language Prior Problem from a Class-imbalance View}},
  year = {2022},
  url = {https://openreview.net/forum?id=8Icl0LjfuFs},
  howpublished = {OpenReview},
}
Figure