Learning Object Context for Dense Captioning

Xiangyang Li, Shuqiang Jiang, Jungong Han

Introduction

Dense captioning is a computer vision task that requires a model to simultaneously identify specific regions of interest within an image and generate descriptive natural language for each. While standard image captioning provides a global summary (e.g., "a park scene"), dense captioning focuses on the nuances, such as "a child on a swing" or "a red bench."

Existing methods for dense captioning often treat regions in isolation or rely solely on global image features. This paper identifies a critical gap: these models frequently ignore the explicit relationships between caption regions and the individual objects that comprise them. For instance, a caption region describing "a boy riding a horse" is fundamentally composed of two distinct objects: a person and a horse. Without modeling these object-level interactions, systems struggle to precisely locate regions and often produce generic, context-poor descriptions.

Examples of caption regions (blue) and their associated contextual objects (red).

Methodology: Object Context Encoding

The researchers propose a novel framework that integrates object detection directly into the dense captioning pipeline through a three-step process:

  1. Object Detection & Feature Extraction: A pre-trained Faster R-CNN detects a set of objects in the image. For each object, the model extracts visual features via a CNN and spatial features (location and size).
  2. Object Context Encoding: The detected objects are arranged into a sequence (sorted spatially) and fed into an Object Context Encoding LSTM. This module acts as a selective filter, learning which objects are relevant to a specific target region and aggregating their information into a "context feature."
  3. Localization and Captioning: The model combines these learned context features with the target region's features to refine the bounding box (regression) and generate the final description (language generation).

The authors explored two architectural variants: Context Decoded (COCD) and Context as Guidance (COCG). In COCG, the context is used to guide the caption LSTM at every time step, which proved more effective at alleviating the vanishing gradient problem during training.

Key Insights and Results

Statistical analysis of the Visual Genome dataset revealed that 86.5% of caption regions overlap with between one and five objects, confirming that objects are the primary building blocks of these regions. By visualizing the LSTM's internal gates, the authors demonstrated that the model successfully learns to "pay attention" to relevant objects—such as focusing on a "person" object when captioning "a man wearing shorts"—while ignoring irrelevant background noise.

Quantitative Performance

The proposed COCG model outperformed previous state-of-the-art (SOTA) methods across multiple benchmarks:

  • VG-COCO: Achieved a mean Average Precision (mAP) of 8.90%, a significant improvement over the previous SOTA (JIVC) at 7.85%.
  • Visual Genome v1.2: Reached an mAP of 10.39%.

Beyond metrics, qualitative results showed that the model produces more specific and accurate captions. For example, while a baseline might simply state "horse is white," the context-aware model correctly identifies "horse is eating grass" by leveraging the proximity of the ground/grass objects.

Conclusion

By explicitly modeling the relationships between objects and caption regions, this framework significantly advances the state of dense captioning. While the model's performance currently depends on the quality of the underlying object detector, the success of the Object Context Encoding module suggests that spatial and semantic relationships are vital for deep image understanding. Future work may involve incorporating higher-level semantic structures, such as scene graphs, to provide even richer contextual cues.

Summary updated

BibTeX
@inproceedings{li2019learning,
  author = {Xiangyang Li and Shuqiang Jiang and Jungong Han},
  title = {{Learning Object Context for Dense Captioning}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2019},
  doi = {10.1609/aaai.v33i01.33018650},
}
Figure