Generate Image Descriptions based on Deep RNN and Memory Cells for Images Features

Shijian Tang, Song HanarXiv 2016

TL;DR

This paper introduces a novel deep recurrent neural network (RNN) architecture for image captioning that incorporates "memory cells" to dynamically control how image features are fed into the network at each step of sentence generation. This approach allows the model to learn to selectively attend to relevant image information, leading to improved performance on standard image captioning benchmarks.

What Problem Does This Paper Address?

Generating natural language descriptions for images is a complex task that bridges computer vision and natural language processing. Traditional approaches often involve using a Convolutional Neural Network (CNN) to extract image features and then feeding these features into a Recurrent Neural Network (RNN) to generate a sentence. While effective, a key challenge is determining when and how much image information should influence the sentence generation process, especially for longer sentences where early image features might be forgotten due to the vanishing gradient problem in standard RNNs. Existing methods often feed image features only once or at fixed intervals, which might not be optimal for capturing the full semantic content of an image.

Methods

The authors propose a deep RNN architecture enhanced with "memory cells" for image feature gating. Here's a breakdown:

  • Image Feature Extraction: They use the VGGNet, a powerful pre-trained CNN, to extract a 4096-dimensional feature vector for each image.
  • Deep RNN for Sequence Generation: Instead of a simple RNN, they employ a deep RNN (similar to Deep Transition RNNs) with multiple hidden layers at each time step. This is intended to increase the model's capacity to represent complex functions and mitigate the vanishing gradient problem.
  • Memory Cells for Gating Image Features: This is the core innovation. At each time step t of the RNN, a "memory gate" g(t) is computed based on the hidden state of the previous time step (h_n(t-1)). This gate's output, ranging from 0 to 1, is then used to element-wise multiply the image features before they are fed into the first hidden layer of the RNN.
  • If g(t) is close to 0, the image features are largely ignored at that time step.
  • If g(t) is close to 1, the full image features are incorporated.

This gating mechanism allows the model to learn to "memorize" how much image information is relevant at each stage of sentence generation, dynamically adjusting its focus based on the words it has already produced.

Datasets

The paper uses two widely recognized datasets for image captioning:

  • Flickr8K: Contains 8,000 images, each with 5 independent sentences.
  • Flickr30K: Contains 31,000 images, also with 5 independent sentences per image.

The datasets are split into development, test, and training sets. The data preprocessing follows the methodology of Karpathy (2015).

Key Insights and Ideas

  • Dynamic Image Feature Gating: The most significant insight is the idea of using a learned "memory gate" to control the flow of image features. This moves beyond static feeding strategies and allows the model to adapt its attention to image content based on its own generated text.
  • Improved Long-Term Dependencies: By feeding image features at each time step (albeit gated), the model is better equipped to handle longer sentences and avoid forgetting crucial visual cues, which is a common issue in image captioning.
  • Deep RNN Benefits: The use of a deep RNN structure, rather than a shallow one, is shown to be beneficial for language modeling tasks, providing a richer function space for the model to learn from.
  • Model Simplicity and Efficiency: The authors highlight that their model, despite its enhanced capabilities, offers lower complexity and is easier to train compared to some other state-of-the-art approaches.

Key Results

The paper reports improved performance on the Flickr8K and Flickr30K datasets using the BLEU score, a standard metric for evaluating machine translation and text generation.

  • Flickr8K: The proposed model achieved a BLEU-4 score of 16.6, outperforming Karpathy (2015) (16.0) and Mao et al. (2014) (23.1 - Note: This comparison seems to have a typo in the paper, as 23.1 is higher than 16.6. However, the paper later clarifies this comparison.).
  • Flickr30K: The model achieved a BLEU-4 score of 17.1, outperforming Karpathy (2015) (15.7) and Mao et al. (2014) (19.5 - Again, a potential typo in the paper's presentation of Mao et al.'s score.).

Crucially, when comparing their model to Vinyals et al. (2014) using the same VGGNet image features, their model achieved better results on Flickr8K (last row of Table 1). They note that direct comparison with Vinyals et al. (2014) using GoogleNet features is unfair.

Limitations and Future Work

  • Dataset Size: The authors acknowledge that the datasets used are not extremely large and suggest training on larger datasets like MSCOCO in the future.
  • CNN Fine-tuning: They did not fine-tune the CNN (VGGNet) on the image captioning datasets. Future work could involve jointly training the CNN and RNN.
  • Model Complexity: While they claim lower complexity, they suggest increasing the number of hidden layers in the deep RNN to further improve performance.
  • CNN Choice: They plan to experiment with other CNN architectures like GoogleNet for feature extraction.
  • Other Architectures: Exploring other advanced RNN variants or attention mechanisms could also be a future direction.

Summary updated

Abstract

Generating natural language descriptions for images is a challenging task. The traditional way is to use the convolutional neural network (CNN) to extract image features, followed by recurrent neural network (RNN) to generate sentences. In this paper, we present a new model that added memory cells to gate the feeding of image features to the deep neural network. The intuition is enabling our model to memorize how much information from images should be fed at each stage of the RNN. Experiments on Flickr8K and Flickr30K datasets showed that our model outperforms other state-of-the-art models with higher BLEU scores.
BibTeX
@misc{tang2016generate,
  author = {Shijian Tang and Song Han},
  title = {{Generate Image Descriptions based on Deep RNN and Memory Cells for Images Features}},
  year = {2016},
  eprint = {1602.01895},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1602.01895},
}
Figure