Reference Based LSTM for Image Captioning

Minghai Chen, Guiguang Ding, Sicheng Zhao, Hui Chen, Qiang Liu, Jungong Han

Abstract

Standard image captioning models often struggle with object misidentification and fail to distinguish between visually significant words and common articles. This paper introduces the Reference Based LSTM (R-LSTM), which leverages the entire training set as a reference library during both learning and generation. By implementing weighted training based on visual relevance and a consensus-based generation process using nearest neighbors, the R-LSTM achieves superior performance on the MS COCO dataset, producing more accurate and natural descriptions.

Introduction

While deep learning has revolutionized image captioning, two primary challenges persist. First, standard models treat every word in a training caption with equal importance, failing to recognize that words like "bicycle" are more visually grounded than articles like "the." Second, models often misidentify objects—a phenomenon known as "hallucination"—because they rely solely on the visual features of a single, potentially ambiguous image.

The Reference Based LSTM (R-LSTM) addresses these issues by treating the training set as a "reference library." This approach allows the model to determine which words matter most and to verify its predictions against similar-looking images in the dataset.

Methods

The R-LSTM architecture modifies the standard CNN-LSTM framework by incorporating reference data into the training and inference loops.

The R-LSTM architecture utilizes both the target image and the training set to generate captions.

Weighted Training

Instead of a standard loss function where every word contributes equally, R-LSTM assigns weights based on visual relevance. Using Kernel Density Estimation (KDE), the model evaluates how "clustered" an image is relative to others containing the same word. If a word like "bicycle" consistently appears in visually similar images, it receives a high weight. Conversely, ubiquitous words like "the" receive low weights, forcing the LSTM to focus on learning semantically rich content.

Reference-Based Generation

During inference, the model incorporates a Consensus Score to refine its predictions. For a given target image, the model identifies its $k$-nearest neighbors in the training set.

The consensus mechanism compares candidate captions against the captions of visually similar reference images.

The final word choice is determined by a weighted balance between the LSTM's internal probability and the consensus of the neighbor images' captions. This "sanity check" helps the model avoid common misidentifications by leveraging the collective knowledge of the training set.

Results and Insights

The R-LSTM was evaluated on the MS COCO dataset, achieving state-of-the-art performance. On the online test server, it secured top-2 positions on 11 out of 14 metrics, including a CIDEr score of 102.9—a significant improvement over the previous m-RNN baseline of 93.8.

Key insights from the study include:

  • Visual Consistency: Visual similarity is an effective proxy for word importance.
  • Dynamic Weighting: The influence of reference images is most beneficial during the early stages of sentence generation.
  • Error Correction: Qualitative analysis showed the model successfully corrected errors, such as misidentifying a "cat" as a "dog," by relying on the consensus of similar images.

Conclusion

The R-LSTM demonstrates that the training set is more than just a source of parameters; it is a valuable reference for real-time inference. While computationally more intensive due to the nearest-neighbor search, the model provides a robust framework for generating more accurate and human-like captions. Future work may involve integrating attention mechanisms and exploring sentiment-aware captioning.

Summary updated

BibTeX
@inproceedings{chen2017reference,
  author = {Minghai Chen and Guiguang Ding and Sicheng Zhao and Hui Chen and Qiang Liu and Jungong Han},
  title = {{Reference Based LSTM for Image Captioning}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2017},
  doi = {10.1609/aaai.v31i1.11198},
}
Figure