[Paper Review] Stacked Cross Attention for Image-Text Matching
SC A N introduces Stacked Cross Attention (SCAN) to align image regions and sentence words, achieving state-of-the-art image-text matching on Flickr30K and MS-COCO by computing latent region-word alignments with dual attention and LogSumExp pooling.
In this paper, we study the problem of image-text matching. Inferring the latent semantic alignment between objects or other salient stuff (e.g. snow, sky, lawn) and the corresponding words in sentences allows to capture fine-grained interplay between vision and language, and makes image-text matching more interpretable. Prior work either simply aggregates the similarity of all possible pairs of regions and words without attending differentially to more and less important words or regions, or uses a multi-step attentional process to capture limited number of semantic alignments which is less interpretable. In this paper, we present Stacked Cross Attention to discover the full latent alignments using both image regions and words in a sentence as context and infer image-text similarity. Our approach achieves the state-of-the-art results on the MS-COCO and Flickr30K datasets. On Flickr30K, our approach outperforms the current best methods by 22.1% relatively in text retrieval from image query, and 18.2% relatively in image retrieval with text query (based on Recall@1). On MS-COCO, our approach improves sentence retrieval by 17.8% relatively and image retrieval by 16.6% relatively (based on Recall@1 using the 5K test set). Code has been made available at: https://github.com/kuanghuei/SCAN.
Motivation & Objective
- Motivate fine-grained image-text matching by inferring latent region-word alignments for interpretable cross-modal retrieval.
- Develop a two-stage attention mechanism that uses context from both image and sentence to weigh regions and words.
- Show that discovering all latent alignments improves retrieval performance over fixed-step attention methods.
Proposed method
- Represent images with bottom-up detected regions via Faster R-CNN and 2048-dim features.
- Represent sentences with a bidirectional GRU-based word embedding in a shared 1024-dim space.
- Propose Stacked Cross Attention in two complementary formulations: Image-Text (attend words per image region, then weigh regions) and Text-Image (attend image regions per word, then weigh words).
- Use cosine similarities between region/word features, followed by a LogSumExp pooling to compute final image-sentence similarity.
- Train with a hard-negative triplet loss to maximize margin against hardest negatives in each mini-batch.
- Provide ablations comparing Sum-Max baselines, AVG/LSE pooling, and bi-directional GRU impacts.
Experimental results
Research questions
- RQ1Can latent, context-aware alignments between image regions and sentence words be discovered in a joint embedding space to improve image-text retrieval?
- RQ2Do dual attention formulations (image-guided word attention and word-guided image attention) yield complementary benefits for cross-modal matching?
- RQ3Does searching over all latent alignments via stacked cross attention outperform fixed-step or one-shot attention methods?
Key findings
- SCAN achieves state-of-the-art recall on Flickr30K and MS-COCO across multiple metrics.
- On Flickr30K, SCAN i-t AVG achieves R@1 of 67.9 for sentence retrieval and 74.2 for image retrieval; SCAN t-i AVG achieves R@1 of 61.8 for sentence retrieval and 74.4 for image retrieval (examples shown in Table 1).
- Ensembling SCAN variants (e.g., t-i AVG + i-t LSE) yields the best Flickr30K image retrieval result with R@1 = 48.6.
- On MS-COCO (5K test), SCAN t-i AVG + i-t LSE improves R@1 for sentence retrieval by 17.8% and image retrieval by 16.6% (relative) over SCO.
- Ablation shows that hard-negatives and the Stacked Cross Attention design critically contribute to performance gains.
- Visualization confirms interpretable attention maps aligning specific words like “boy”, “holding”, and “tennis racket” to corresponding image regions.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.