Improving Visually Grounded Sentence Representations with Self-Attention

Kang Min Yoo, Youhyun Shin, Sang-goo LeearXiv 2017

Introduction

Traditional Natural Language Processing (NLP) models often suffer from the "grounding problem"—a lack of connection between linguistic symbols and their real-world physical context. While these models excel at identifying statistical patterns in text, they lack an inherent understanding of the concepts they manipulate. For instance, a model might associate "apple" with "red" without any conceptual grasp of what "red" looks like.

Previous research attempted to bridge this gap using visually grounded models trained to predict both text and image features. However, these models typically integrated visual information only at the final stage of encoding. This paper proposes a self-attention mechanism to push grounding deeper into the encoding process, allowing the model to focus on specific, visually descriptive words.

Methodology

The researchers developed an enhanced multi-modal encoder-decoder framework designed to capture fine-grained visual associations within sentences.

  1. Encoder Architecture: The core is a bidirectional Long Short-Term Memory (LSTM) network. Unlike standard models that rely solely on the final hidden state, this approach implements a self-attention mechanism. This allows the model to assign varying weights to words based on their visual relevance.
  2. Hybrid Representation: The final sentence representation is a combination of the standard LSTM output and the new "attended" representation, which emphasizes visually salient terms.
  3. Dual Decoders: This hybrid embedding is used to simultaneously predict the next sentence in a sequence (language task) and the visual features of an associated image (visual task).
  4. Optimized Loss Function: The authors utilized a "log-exp-sum pairwise ranking" loss, which proved more effective than standard margin ranking loss for aligning text and image representations.

Key Insights: Mental Visualization

The self-attention mechanism effectively mimics human mental visualization. When reading, humans do not typically visualize abstract function words like "the" or "is"; instead, we focus on concrete nouns and adjectives.

Self-attention heatmap for the sentence 'man in black shirt is playing guitar', showing higher weights for visually descriptive words.

As seen in the qualitative analysis, the model successfully learns to ignore "stop words" and concentrate its attention on words like "guitar" or "black," which have clear visual counterparts. This suggests that the model is learning which parts of a sentence are most relevant to the visual domain.

Experimental Results

The model was trained on the MS-COCO dataset and evaluated using the SentEval toolkit across eight diverse transfer tasks, including sentiment analysis (MR, SST) and paraphrase detection (MRPC).

Performance comparison of the proposed self-attentive models (Att. CAP2IMG and Att. CAP2ALL) against various baselines on SentEval tasks.

The results demonstrate that the self-attentive grounded models outperformed previous state-of-the-art grounded models in five out of eight tasks. Notably, these improvements were achieved using smaller LSTM cells (1024 dimensions) compared to the 2048-dimension cells used in baselines, highlighting that the structural processing of information is more critical than raw parameter count.

Conclusion and Future Work

By integrating self-attention into visually grounded encoders, this research significantly improves the quality of sentence representations for downstream NLP tasks. While the mechanism occasionally introduces noise in purely non-visual tasks (such as opinion polarity), its overall benefit in grounding language is clear.

Future research will explore cross-modal attention, where the text encoder directly interacts with image features during the encoding process, further intertwining linguistic and visual information.

Summary updated

BibTeX
@misc{yoo2017improving,
  author = {Kang Min Yoo and Youhyun Shin and Sang-goo Lee},
  title = {{Improving Visually Grounded Sentence Representations with Self-Attention}},
  year = {2017},
  eprint = {1712.00609},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1712.00609},
}
Figure