Few-Shot Image and Sentence Matching via Gated Visual-Semantic Embedding

Yan Huang, Yang Long, Liang Wang

Introduction

Matching images with their corresponding textual descriptions is a fundamental task in cross-modal retrieval. While deep learning has significantly advanced this field, existing models often struggle with the "long-tail" problem—instances where objects or words appear rarely in the training data. This paper, presented at AAAI-19, introduces Gated Visual-Semantic Embedding (GVSE), a novel architecture designed to bridge this gap by effectively handling few-shot matching scenarios.

The Long-Tail Challenge in Cross-Modal Retrieval

Standard image-sentence matching models are typically data-intensive, excelling at frequent patterns but failing on rare concepts. For instance, a model might easily identify "a dog in a park" but struggle with "a child licking a wooden spoon" or "nuns holding paper."

The long-tail distribution of word frequencies in datasets like Flickr30k, highlighting the difficulty of learning rare concepts.

In the Flickr30k dataset, approximately 24% of words appear fewer than 10 times during training. These rare instances constitute a "few-shot" bottleneck, as models cannot learn robust, discriminative representations for them from scratch.

Methodology: Gated Visual-Semantic Embedding (GVSE)

To address the long-tail problem, the authors propose a dual-path architecture that separates the processing of common and uncommon concepts.

The GVSE architecture, featuring Uncommon VSE with external knowledge, Common VSE for frequent patterns, and a Gated Metric Fusion module.

The GVSE framework consists of three primary components:

  1. Uncommon VSE: This module leverages external auxiliary resources to understand rare concepts. It utilizes a Faster R-CNN pretrained on the Visual Genome dataset for broad object recognition and a Skip-Thought LSTM pretrained on Wikipedia for linguistic context. An attentional LSTM integrates these features by modeling semantic relations, such as spatial layouts and word order.
  2. Common VSE: A traditional pipeline that learns discriminative features from scratch using a standard CNN and LSTM, optimized for the frequent patterns specific to the training dataset.
  3. Gated Metric Fusion: An adaptive gating mechanism that determines the relative importance of the two VSE modules. Based on the query's content, the gate predicts a scalar weight; if the input contains uncommon elements, it prioritizes the similarity score from the Uncommon VSE.

Experimental Evaluation

The model was evaluated on the Flickr30k and MSCOCO benchmarks using a specialized K-shot matching protocol. This protocol filters test sets to include only instances containing words that appeared $\le K$ times in the training data.

Key Results

GVSE demonstrated significant improvements over state-of-the-art methods like VSE++ and SCO:

  • Few-Shot Performance: In the "0-shot" setting (concepts never seen during training), GVSE improved Mean Recall (mR) by 11.2% on Flickr30k and 6.2% on MSCOCO.
  • Standard Benchmarks: On the full Flickr30k dataset, the model achieved an R@1 for image annotation of 68.5%, a substantial jump from the previous best of 55.5%.

Insights and Future Directions

The success of GVSE highlights several critical points:

  • External Knowledge: Importing semantic understanding from large-scale datasets (Wikipedia, Visual Genome) is essential for handling the long tail.
  • Adaptive Fusion: A dynamic gating mechanism is more effective than static ensembles, allowing the model to focus on the most relevant features for a given query.
  • Relational Modeling: Understanding how objects relate spatially and semantically is key to aligning images with complex sentences.

Despite its performance, the model faces challenges regarding training complexity due to its multi-step fine-tuning process. Future work may explore end-to-end training strategies and more sophisticated spatial modeling, such as Graph Neural Networks, to further enhance cross-modal alignment.

Summary updated

BibTeX
@inproceedings{huang2019few,
  author = {Yan Huang and Yang Long and Liang Wang},
  title = {{Few-Shot Image and Sentence Matching via Gated Visual-Semantic Embedding}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2019},
  doi = {10.1609/aaai.v33i01.33018489},
}
Figure