Grounded Compositional Semantics for Finding and Describing Images with Sentences

Richard Socher, Andrej Karpathy, Quoc V. Le, Christopher D. Manning, Andrew Y. NgTrans. Assoc. Comput. Linguistics 2014 · DOI

Abstract

This paper introduces the Dependency-Tree Recursive Neural Network (DT-RNN), a model designed to map sentences and images into a shared multimodal embedding space. By utilizing the structural relationships within dependency trees, the model captures compositional semantics more effectively than traditional bag-of-words or constituency-based models. Evaluated on image-sentence retrieval tasks, the DT-RNN demonstrates superior performance in finding images from descriptions and generating descriptions for images, highlighting the importance of visual grounding in natural language processing.

Introduction

In 2014, while AI excelled at single-object classification (e.g., "cat" or "bicycle"), representing the complex relationships inherent in real-world scenes remained a significant challenge. The core of this problem is compositional semantics: the ability to combine the meanings of individual words into a single vector that represents an entire scene, such as "a man wearing a helmet jumps on his bike."

Previous attempts often utilized Constituency-Tree RNNs (CT-RNNs), which follow formal grammar rules. However, these models frequently over-emphasized word order and syntactic "fluff" rather than the core action. The authors sought a method to create sentence representations that are "visually grounded," meaning the vector for a sentence should be close to the vector of the image it describes, regardless of syntactic variations like active or passive voice.

Methods

The authors proposed a two-pronged approach to create a joint multimodal space:

  1. The DT-RNN (Text): Unlike previous RNNs using phrase-structure trees, the DT-RNN utilizes dependency trees. These trees link words based on functional relationships (e.g., subject-verb-object), allowing the model to focus on actions and agents. A variant, the Semantic DT-RNN (SDT-RNN), employs different weight matrices for different relationship types (e.g., "nominal subject" vs. "direct object").
  2. The Visual Model (Images): A deep neural network (based on Le et al., 2012) trained on 22,000 ImageNet categories extracts a 4,096-dimensional feature vector for each image.
  3. Multimodal Mapping: Both sentence vectors and image vectors are projected into a shared 50-dimensional space. The system is trained using a max-margin ranking loss, which minimizes the distance between correct image-sentence pairs while maximizing the distance between incorrect pairs.
The multimodal embedding pipeline mapping sentence structures to visual features.

Key Insights

  • Dependency over Constituency: Dependency trees are more robust to syntactic variation. For example, "The mother hugged her child" and "The child was hugged by its mother" result in similar dependency structures, allowing the DT-RNN to map them to similar points in the embedding space.
  • Root-Centric Representation: In dependency trees, the verb is typically the root. The DT-RNN computes the final sentence representation at this root node, naturally prioritizing the central action.
  • Structural Weighting: Performance improved when nodes were weighted by the number of words beneath them, ensuring complex phrases carry more weight than single modifiers.
  • Semantic Importance: Analysis showed the model prioritizes nominal subjects, objects, and spatial prepositions (e.g., "at," "on"), which are fundamental to visual scenes.

Results

The model was evaluated on a dataset of 1,000 images, each with five unique descriptions. The SDT-RNN consistently outperformed baselines such as Bag-of-Words (BoW) and standard RNNs:

  • Image Search: When retrieving an image from a sentence description (out of 500 candidates), the SDT-RNN achieved a Mean Rank of 12.5, compared to 14.6 for BoW and 16.1 for CT-RNN.
  • Image Description: When finding the correct description for an image, the SDT-RNN achieved a Mean Rank of 16.9, outperforming kCCA (18.0) and BoW (21.1).
  • Sentence Similarity: The model effectively recognized when different sentences described the same image, even with varying vocabulary.

Discussion and Limitations

A primary failure mode occurs when one sentence uses a verb and another does not (e.g., "Airplane in dive position" vs. "An airplane flying straight down"). Because the DT-RNN relies on the verb as the root, these pairs can end up far apart in the embedding space. Additionally, the model's accuracy is tied to the performance of the underlying dependency parser. The authors noted that training on larger corpora would likely enhance the feasibility of joint image-text training, a concept later realized in modern models like CLIP.

Summary updated

BibTeX
@article{socher2014grounded,
  author = {Richard Socher and Andrej Karpathy and Quoc V. Le and Christopher D. Manning and Andrew Y. Ng},
  title = {{Grounded Compositional Semantics for Finding and Describing Images with Sentences}},
  journal = {Trans. Assoc. Comput. Linguistics},
  year = {2014},
  doi = {10.1162/tacl\_a\_00177},
}
Figure