Context-Aware Captions from Context-Agnostic Supervision

Ramakrishna Vedantam, Samy Bengio, Kevin Murphy, Devi Parikh, Gal Chechik

Introduction

Standard image captioning models typically operate in a "literal" mode, describing an image in isolation. While a model might correctly identify a Boeing 747 as "an airplane flying in the sky," this description fails to be useful when the image is presented alongside a small Cessna. In such contexts, a "pragmatic" description—one that highlights discriminative features like "a large passenger jet"—is far more valuable.

Examples of target and distractor classes/images used to evaluate discriminative captioning.

Traditionally, generating these context-aware captions required specialized training on massive datasets of human-annotated differences. This paper introduces the Introspective Speaker (IS), a framework that enables standard, context-agnostic models to generate discriminative captions at inference time without additional specialized training.

Methodology: The Introspective Speaker

The IS framework is grounded in the Rational Speech Acts (RSA) theory from linguistics. RSA posits that effective communication involves a speaker choosing utterances that help a listener uniquely identify a target object within a specific context.

Self-Correction via Internalized Listening

A significant hurdle in previous pragmatic captioning research was the need for a separate "listener" model to evaluate the discriminativeness of a candidate caption. The authors observe that a well-trained generative model already possesses the latent knowledge required to act as its own listener. By comparing the probability of a word given a target image against its probability given a distractor image, the model can "introspectively" determine which words are most discriminative.

To implement this efficiently, the authors introduce ES Beam Search. During the generation process, the model optimizes for two simultaneous goals:

  1. Linguistic Adequacy (The Emitter): Ensuring the caption is a likely and grammatical description of the target.
  2. Discriminativeness (The Suppressor): Ensuring the caption is significantly more likely for the target than for the distractor.

By calculating the log-likelihood ratio between the target and distractor at each step, the "Suppressor" component penalizes shared attributes (e.g., "bird," "flying") and promotes unique identifiers (e.g., "yellow breast with black streaks").

Experimental Evaluation

The researchers evaluated their framework across several challenging scenarios:

  • Fine-Grained Classification (CUB-200-2011): Using a dataset of 200 bird species, the authors created CUB-Justify, a collection of 3,161 triplets (target image, target class, distractor class) with human-written justifications.
  • General Image Captioning (MS COCO): The model was tested on "easy" and "hard" image pairs to see if it could distinguish between similar scenes.

Key Results

The IS framework demonstrated substantial improvements over baseline literal models and previous speaker-listener architectures:

  • Human Identification: In a task where humans had to pick the correct image based on a generated caption, the success rate on "hard" COCO pairs rose from 52.5% (baseline) to 74.1% (IS).
  • Justification Quality: On the CUB-Justify dataset, the IS model achieved higher CIDEr-D and METEOR scores, indicating that its descriptions more closely matched human reasoning for species differentiation.

Discussion and Limitations

The primary insight of this work is "Zero-Shot Pragmatics": the ability to extract discriminative behavior from models trained on generic data. However, the authors note a trade-off between discriminativeness and grammaticality. If the model focuses too heavily on being different (controlled by a hyperparameter $\lambda$), it may produce repetitive or ungrammatical phrases. Furthermore, the model's performance is inherently capped by the quality of the underlying context-agnostic model; it cannot describe a difference it has not learned to recognize during its initial training.

Conclusion

The Introspective Speaker provides a computationally efficient and effective method for generating context-aware captions. By leveraging the latent knowledge within standard generative models, this approach bypasses the need for expensive, context-specific data collection, paving the way for more helpful and communicative AI systems.

Summary updated

BibTeX
@inproceedings{vedantam2017context,
  author = {Ramakrishna Vedantam and Samy Bengio and Kevin Murphy and Devi Parikh and Gal Chechik},
  title = {{Context-Aware Captions from Context-Agnostic Supervision}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2017},
  doi = {10.1109/cvpr.2017.120},
}
Figure