Image Caption with Global-Local Attention

Linghui Li, Sheng Tang, Lixi Deng, Yongdong Zhang, Qi Tian

Abstract

Standard image captioning models often fail to capture small, salient objects or misidentify them due to an over-reliance on global scene context. This paper proposes the Global-Local Attention (GLA) framework, which integrates coarse-grained global features with fine-grained local object features. By dynamically weighting these features through an attention mechanism, the model achieves superior descriptive accuracy. Evaluated on the MS COCO dataset, the GLA model demonstrates significant improvements across standard metrics, including BLEU-4 and CIDEr.

Introduction

The traditional CNN-RNN architecture for image captioning typically compresses an entire image into a single global feature vector. While effective for capturing general context, this approach suffers from two primary issues: Object Missing, where small but critical objects are overlooked, and Misprediction, where the model guesses objects based on the surrounding scene (e.g., predicting a "soccer ball" in a grassy field when the actual subject is a "kite"). The GLA framework addresses these by ensuring the model "looks" at both the overall scene and individual objects.

Methodology

The GLA model operates in three distinct stages:

  1. Feature Extraction: The model extracts global context using the fc7 layer of VGG16. Simultaneously, it employs Faster R-CNN to detect the top-10 most confident objects, extracting local feature vectors for each.
  2. Global-Local Attention (GLA) Mechanism: At each word generation step, an attention layer calculates weights for the global feature and the ten local features. This allows the model to focus on specific objects during naming while maintaining situational logic.
  3. Sentence Generation: The weighted features are processed by a stacked two-layer LSTM. Dropout is applied between layers to mitigate overfitting.
The GLA framework architecture, integrating global and local features through an attention mechanism into a stacked LSTM.

Experimental Results

The model was rigorously tested on the Microsoft COCO dataset using the "Karpathy split" (82,783 training, 5,000 validation, and 5,000 test images).

Quantitative Performance

The GLA model significantly outperformed contemporary baselines:

  • BLEU-4: 31.2 (vs. 21.0 for LRCN)
  • CIDEr: 96.4
  • METEOR: 24.9

Qualitative Analysis

Qualitative results highlight the model's ability to correct common errors. For instance, where baseline models might misidentify a "kite" as a "soccer ball" due to the grassy background, the GLA model correctly identifies the object by attending to its specific local feature vector.

Qualitative example where the GLA model correctly identifies a 'kite' by attending to local features, avoiding context-based misprediction.

Conclusion and Future Work

The GLA framework successfully bridges the gap between global context and local content. By leveraging specialized object detectors, it provides higher-quality information than standard spatial attention models. Future research will focus on making the framework end-to-end, allowing the object detector to be fine-tuned specifically for the captioning task.

Summary updated

BibTeX
@inproceedings{li2017image,
  author = {Linghui Li and Sheng Tang and Lixi Deng and Yongdong Zhang and Qi Tian},
  title = {{Image Caption with Global-Local Attention}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2017},
  doi = {10.1609/aaai.v31i1.11236},
}
Figure