TL;DR
This paper investigates two architectural approaches for image captioning: "inject" (where image features are fed directly into the RNN alongside word embeddings) and "merge" (where image and word features are encoded separately and combined later). The authors find that the "merge" approach, which views the RNN primarily as an encoder of linguistic sequences, generally outperforms "inject," suggesting that RNNs are better suited for encoding rather than directly generating captions.
What Problem Does This Paper Address?
Image captioning, the task of generating a natural language description for an image, is a fundamental challenge in artificial intelligence that bridges computer vision and natural language processing. It serves as a crucial testbed for developing systems that can ground symbolic or linguistic information in perceptual data. While most modern image captioning systems use a combination of Convolutional Neural Networks (CNNs) for image feature extraction and Recurrent Neural Networks (RNNs) for language generation, there's a key architectural question: how should the image information be integrated with the RNN? The dominant paradigm, termed "injection," feeds image features directly into the RNN at each step of the caption generation process, implying the RNN is the primary "generator." This paper questions this assumption, exploring an alternative "merge" architecture where image and linguistic features are processed separately and combined at a later stage. The core problem is to determine the optimal way to combine multimodal information and to clarify the RNN's role – is it a generator or an encoder?
Methods
The paper compares two main architectural approaches for image captioning:
- Inject Architecture: In this approach, image features extracted by a CNN are concatenated with word embeddings at each time step of the RNN. This means the RNN receives both the current word's embedding and the image features when predicting the next word. The authors refer to this as "conditioning-by-inject." This architecture implies the RNN is directly influenced by the image at every generation step, acting as a generator.
- Merge Architecture: Here, the RNN acts primarily as a language model, encoding the sequence of previously generated words. The image features are kept separate and are merged with the RNN's final hidden state in a later "multimodal layer." This multimodal layer then drives the caption generation process. The authors call this "conditioning-by-merge." This architecture positions the RNN as an encoder of linguistic history, with the image features influencing generation only at a later stage.
Both architectures were implemented using a basic neural language model consisting of a word embedding matrix and a Long Short-Term Memory (LSTM) network. Experiments involved varying layer sizes (128, 256, 512) and vocabulary sizes (derived from different token frequency thresholds).
Datasets
The experiments were conducted on two standard image captioning datasets:
- Flickr8k: Consists of 8,000 images, split into 6,000 for training, 1,000 for validation, and 1,000 for testing. Each image has five captions.
- Flickr30k: A larger dataset with 31,000 images, split into 29,000 for training, 1,014 for validation, and 1,000 for testing. Each image also has five captions.
The authors used versions of these datasets distributed by Karpathy and Fei-Fei (2015). Pre-trained 4,096-element image feature vectors from the VGG CNN were also utilized.
Key Insights and Ideas
- RNNs as Encoders, Not Generators: The most significant finding is that the "merge" architecture, where the RNN primarily encodes linguistic sequences and image features are merged later, consistently outperforms the "inject" architecture. This suggests that the RNN's strength lies in encoding linguistic information, rather than directly generating captions based on visual input.
- Late Merging is Advantageous: Delaying the integration of image and linguistic features to a later stage in the architecture appears to be more beneficial for image captioning performance, as measured by standard evaluation metrics.
- Inject Architecture's Complexity: The "inject" architecture forces the RNN to compress both linguistic and visual information into a fixed-size vector at each step. This complexity, along with a potentially larger effective vocabulary (treating image+word combinations as unique), may hinder its performance.
- Merge Architecture's Efficiency: The "merge" architecture allows for a cleaner separation of modalities, potentially leading to more efficient use of resources and better performance, especially with smaller model capacities.
- Vocabulary Usage: Merge models tend to use a greater proportion of the training vocabulary on test captions, though the overall vocabulary usage remains relatively low across both architectures.
Key Results
The paper reports that across various experimental settings (dataset, vocabulary size, layer size), the merge architecture generally outperformed the inject architecture in most evaluation metrics, particularly CIDEr, which is specifically designed for captioning systems.
- CIDEr Scores: Merge consistently achieved higher CIDEr scores than inject. For example, on Flickr8k with a vocabulary size of 2539 and layer size of 256, merge achieved a CIDEr score of 15.439 (0.84) compared to inject's 11.448 (0.71).
- BLEU Scores: While merge generally led, BLEU scores showed less consistent superiority, with some variations depending on the specific BLEU metric (BLEU-1 to BLEU-4).
- Vocabulary Usage: Merge models showed a higher percentage of vocabulary usage, indicating they might be better at leveraging the available vocabulary.
- Model Size vs. Performance: The authors note that for inject models to match merge performance, they often require a larger layer size, suggesting merge is more parameter-efficient.
Limitations and Future Work
- Limitations:
- The study focuses on "parallel-inject," a specific type of inject architecture. Other variations, like those with attention mechanisms, are acknowledged but not deeply explored in this comparison.
- The experiments used "barest" models with minimal hyperparameters to ensure a fair comparison, meaning state-of-the-art performance was not the primary goal.
- The results on Flickr8k being better than Flickr30k might indicate that Flickr8k is an easier dataset, or that the models struggle with the increased variation in Flickr30k.
- Future Work:
- Transfer Learning: The merge architecture's separation of image and language components makes it more amenable to transfer learning. The RNN could potentially be pre-trained on general text and then fine-tuned for captioning, a feat not easily achievable with the inject architecture. The authors plan to investigate initializing RNN weights from general language models.
- Broader Applicability: Investigating whether the merge architecture's advantages extend to other sequence-to-sequence tasks like machine translation, or how it applies to image processing tasks where conditioning might occur at different stages.
- Larger Datasets: Extending experiments to larger datasets like MSCOCO to further validate findings.
- Attentional Mechanisms: While not the focus, the paper acknowledges that attentional mechanisms could be incorporated into both architectures, offering further avenues for research.
Summary updated