NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Diverse Image Captioning with Context-Object Split Latent Spaces

Shweta Mahajan, Stefan Roth

Overview

Researchers from TU Darmstadt have developed COS-CVAE, a generative model that produces more diverse and accurate image captions by decoupling "context" (the scene layout) from "objects" (the specific entities) in its latent space. This approach allows the model to "borrow" descriptions from similar scenes in the dataset, enabling it to describe images with novel objects it has never seen in a paired captioning context before.

The Challenge of Diversity and Novelty

Standard image captioning models often suffer from two major limitations:

  1. Lack of Diversity: Most models are trained on paired (image, text) data. Because a single image usually only has around five human-written captions, the model's "imagination" is limited to those specific examples. It fails to capture the true "one-to-many" nature of how humans describe the visual world.
  2. The Novel Object Gap: If a model sees a "zebra" but has only ever been trained on captions for "horses" and "dogs," it struggles to integrate the new object into a coherent sentence.

Current Variational Autoencoder (VAE) approaches try to model diversity using a latent space, but they are still bottlenecked by the limited variety of the paired training data.

Methodology: Context-Object Split (COS)

To overcome these limitations, the authors introduce the Context-Object Split (COS) factorization within a Conditional VAE framework.

The Core Innovation: Splitting the Latent Space

Instead of relying on one monolithic vector to represent the "meaning" of a caption, the researchers split the latent variable $z$ into two distinct parts:

  • $z^m$ (Context): Captures the "template" or background of the scene (e.g., "A <s> sitting on a <s> in a park").
  • $z^o$ (Object): Captures the specific entities filling those slots (e.g., "dog," "bench").
Overview of the Context-Object Split (COS) framework, illustrating how contextual descriptions are used to generate diverse captions for novel images.

Context-Based Pseudo Supervision

Because the context is decoupled from the objects, the model can perform a "nearest neighbor" search in an embedding space to find similar contexts from other images in the dataset. It then uses these retrieved contexts as "pseudo-labels" to train the model. This effectively multiplies the amount of diverse training data available for any given image.

Examples of retrieved contexts with slot tokens and the resulting generated pseudo captions used for training.

Architecture

The model uses a dual-LSTM setup to encode these separate latent spaces and an attention-based decoder (based on the popular "Up-Down" attention mechanism). The decoder uses the latent vectors to decide which parts of the image to focus on when generating each word.

Evaluation Datasets

  • MS COCO: The gold standard for image captioning, containing over 120,000 images with five human captions each.
  • Held-out COCO: A specific subset used to test "Novel Object Captioning." The authors exclude all images and captions containing eight specific objects (e.g., "bus," "pizza," "zebra") during training. They then test the model's ability to describe them at test time using only an object detector's output.

Key Insights

  • Context is Universal: The core insight is realizing that while objects change, the way we describe scenes (the context) is often shared across different images. By learning these templates independently, the model becomes much more flexible.
  • Pseudo-Supervision as a Data Augmentor: By using retrieved captions from "nearby" images, the model learns that a scene isn't just "a dog in a park," but could also be described using the linguistic structure of "a person sitting on a bench" if the visual contexts are similar.
  • Zero-Shot Capability: Because the context latent space ($z^m$) doesn't care about the specific object, the model can successfully place a "novel" object (like a microwave) into a familiar context (like "on a kitchen counter") even if it has never seen a caption containing the word "microwave" during training.

Experimental Results

  • Accuracy Gains: On the standard COCO dataset, COS-CVAE outperformed state-of-the-art models (like LNFMM) in CIDEr score (a measure of caption quality) by approximately 11% when evaluating the best of 100 samples.
  • Diversity Gains: The model showed significantly higher n-gram diversity (Div-1 and Div-2) and lower m-Bleu scores (where lower is better for diversity), indicating it produces a wider variety of plausible captions.
  • Novel Objects: In the held-out COCO task, the model achieved an average F1 score of 68.1, significantly outperforming previous specialized methods like NBT (48.5) and reaching parity with or exceeding other recent benchmarks.

Limitations and Future Directions

  • Dependency on Object Detectors: The model's performance on novel objects is heavily reliant on the quality of the underlying object detector (Faster R-CNN). If the detector misses an object, the "object" part of the latent space remains empty or incorrect.
  • Computational Complexity: While sampling is efficient, the "pseudo-supervision" step requires a retrieval phase during training, which adds complexity to the pipeline.
  • Future Directions: The authors suggest that this factorization could be extended to other multimodal tasks, such as visual question answering or image generation, where separating "style/context" from "content/objects" is equally valuable.

Summary updated

BibTeX
@inproceedings{mahajan2020diverse,
  author = {Shweta Mahajan and Stefan Roth},
  title = {{Diverse Image Captioning with Context-Object Split Latent Spaces}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2020},
  url = {https://openreview.net/forum?id=kvJTjJ6GgjO},
}
Figure