See or Guess: Counterfactually Regularized Image Captioning

Qian Cao, Xu Chen, Ruihua Song, Xiting Wang, Xinting Huang, Yuchen Ren

Abstract

Modern image captioning models often rely on statistical shortcuts—"guessing" descriptions based on linguistic patterns—rather than "seeing" the actual visual evidence. This behavior leads to object hallucinations and poor interpretability. We present a counterfactual regularization framework that leverages causal inference to force models to rely on visual pixels. By optimizing for Total Effect (TE) and Natural Direct Effect (NDE), our approach significantly reduces hallucinations and improves the faithfulness of generated captions across various model architectures.

Introduction

While AI-generated image descriptions have become increasingly sophisticated, they remain prone to shortcut correlations. For example, if a training dataset frequently depicts bicycles near rivers, a model may predict the word "bicycle" upon seeing a river, even if the bicycle is absent. This results in object hallucination and a lack of interpretability, as it becomes unclear whether a model's output is driven by visual features or linguistic bias.

Humans excel at interventional reasoning; we can easily describe what remains in a scene if an object is removed. This paper bridges the gap between statistical fitting and causal understanding by making models robust to these "counterfactual" (what-if) scenarios.

Methodology

The proposed framework is a model-agnostic, two-stage training process designed to strengthen the causal link between visual input and textual output.

1. Counterfactual Data Construction

Using datasets with bounding box annotations, the authors create "counterfactual images" ($I^*$) by masking out specific objects. For instance, a bicycle in a park might be replaced with a black mask to test if the model still "guesses" its presence.

Figure 1: An example of a counterfactual image where a specific object (a bicycle) has been masked to test the model's reliance on visual evidence.

2. Causal Regularization

The core of the method involves two new loss functions derived from causal inference:

  • Total Effect (TE): This measures the overall change in word probability when an image is modified. The objective is to maximize the difference in the probability of a specific word (e.g., "bicycle") between the original image and its masked counterpart.
  • Natural Direct Effect (NDE): A more refined metric that isolates the direct influence of the image on a word, effectively stripping away the "indirect" influence of preceding tokens (linguistic bias).
Figure 6: Causal diagrams illustrating (a) the observed generation process, (b) the counterfactual image generation, and (c) the counterfactual outcome used to calculate the Natural Direct Effect (NDE).

Experimental Results

The framework was evaluated on Flickr30k Entities, MSCOCO, and a specialized COCO-Counterfactuals (COCO-CF) test set.

Hallucination and Faithfulness

Using the CHAIR metric (where lower scores indicate fewer hallucinations), the NDE-regularized BLIP model showed a significant improvement, dropping from 12.14 to 9.53 on Flickr30k. Human evaluations corroborated these findings, with regularized models scoring higher for "Faithfulness" and "Overall Quality."

Robustness to Bias

When tested on gender-biased datasets (e.g., a 5:1 male-to-female ratio), regularized models demonstrated a lower error rate in misidentifying gender. This suggests the models were less reliant on dataset-wide statistical shortcuts and more focused on the actual visual features of the subjects.

Conclusion

By penalizing models for predicting objects that are not visually present, counterfactual regularization forces a stronger causal connection between pixels and words. The Natural Direct Effect (NDE) proved particularly effective at preventing linguistic "flow" from overriding visual evidence. Future work will explore extending this framework to more complex multimodal tasks like Visual Question Answering (VQA) and dialogue systems.

Summary updated

BibTeX
@inproceedings{cao2024see,
  author = {Qian Cao and Xu Chen and Ruihua Song and Xiting Wang and Xinting Huang and Yuchen Ren},
  title = {{See or Guess: Counterfactually Regularized Image Captioning}},
  booktitle = {ACM Multimedia},
  year = {2024},
  doi = {10.1145/3664647.3681458},
}
Figure