Image Captioning at Will: A Versatile Scheme for Effectively Injecting Sentiments into Image Descriptions

Quanzeng You, Hailin Jin, Jiebo LuoarXiv 2018

Abstract

Automatic image captioning has recently approached human-level performance due to the latest advances in computer vision and natural language understanding. However, most of the current models can only generate plain factual descriptions about the content of a given image. For human beings, image caption writing is quite flexible and diverse, where additional language dimensions, such as emotion, humor and language styles, are often incorporated. In particular, we are interested in generating sentiment-conveying image descriptions. The main challenge is how to effectively inject sentiments into the generated captions without altering the semantic matching between the visual content and the generated descriptions. In this work, we propose two different models employing different schemes for injecting sentiments. Experimental results show that our models outperform state-of-the-art models in generating sentimental image captions and allow for easy manipulation of the output sentiment.

Introduction

While computer vision has become remarkably good at identifying objects (e.g., "a dog on a rug"), the resulting captions are often dry and lack the nuance of human language. Humans don't just describe facts; we inject emotion, humor, and style. The challenge in "sentimental" image captioning is two-fold: first, how to add emotional words (like "adorable" or "terrible") without breaking grammatical structure or hallucinating objects; and second, how to make the sentiment controllable so that the same image can be described positively or negatively depending on user intent.

Sentimental captioning examples showing how the same visual content can be described with positive or negative sentiment.

Methodology

The authors build upon the standard "Show and Tell" (CNN-RNN) architecture, proposing two distinct ways to handle sentiment injection within the decoder.

The proposed architecture featuring a CNN Encoder and an RNN equipped with a specialized Sentiment Unit.

Direct Injection

This approach represents sentiment as a label (-1 for negative, 0 for neutral, and 1 for positive) and concatenates it directly to the word embedding at every step of the LSTM decoder. It acts as a constant bias, reminding the model of the desired tone throughout the generation process.

Sentiment Flow

Inspired by the way LSTMs use memory cells, the authors designed a dedicated Sentiment Cell. This cell is initialized with the sentiment label and "flows" alongside the standard memory cell, allowing the model to decide at each step how much sentiment information to incorporate into the next word.

Sentiment Loss ($L_{loss}$)

To ensure the model doesn't "forget" the sentiment halfway through a long sentence, an additional supervision signal was added. This loss function forces the hidden states of the RNN to remain discriminable between different sentiment classes throughout the generation process.

Experimental Results

The researchers utilized MS-COCO for factual training and SentiCap for sentiment-specific fine-tuning. The proposed models significantly outperformed the previous state-of-the-art (SentiCap) across standard NLP metrics:

  • CIDEr Scores: On the negative sentiment test set, the "Sentiment Flow" model achieved a CIDEr score of 0.701, a significant jump from the previous SOTA of 0.618.
  • Controllability: By flipping the input label, the model can generate a "sad" version of a "happy" image. For example, a "beautiful sunny day" can be transformed into a description of a "dying tree" for the same visual input.
  • Ablation Study: The additional Sentiment Loss term proved crucial, especially for negative captions, as it prevented the model from drifting back into neutral, purely factual territory.

Conclusion and Future Work

This work demonstrates that sentiment can be effectively treated as an additional dimension of the input feature space. While the current model requires a manual sentiment label at test time, future work could focus on learning from "weakly labeled" web data (like Instagram captions with emojis) to allow the model to automatically infer the appropriate mood from the image itself. Additionally, better alignment between specific visual attributes and emotional descriptors remains an open area for research.

Summary updated

BibTeX
@misc{you2018image,
  author = {Quanzeng You and Hailin Jin and Jiebo Luo},
  title = {{Image Captioning at Will: A Versatile Scheme for Effectively Injecting Sentiments into Image Descriptions}},
  year = {2018},
  eprint = {1801.10121},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1801.10121},
}
Figure