Papers › Stacked Cross Attention for Image-Text Matching

Stacked Cross Attention for Image-Text Matching

21 Mar 2018ECCV 2018 9arXiv:1803.08024archive 2025-07-28

Kuang-Huei Lee, Xi Chen, Gang Hua, Houdong Hu, Xiaodong He

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.

PaperPDFConference PDFCodeCode Syntology ran

In Syntology View this paper on Syntology, its page in Syntology's graph. That page adds which of its functions are also present in other papers' code Syntology holds, with dates, and its dated run record as JSON and a README badge. It also lists the repositories linked to the paper, the abstract and the calls for agents.

Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, on Syntology's MCP service (how to connect):

Code

Syntology 16 code samples harvested from 4 repositories linked to this paper: 13 ran (of which 0 constructed an object rather than computing a result; 7 with no instrument failure: 1 honoured, 0 violated, 6 with no contract checked; 6 where Syntology's instrument failed) · 3 unverified. Where Syntology's instrument failed: 5 where our contract draft was wrong; 1 where the contract check could not run; failures of Syntology's instrument, not of the code.

By repository: official repository: 1 sample from 1 repository, 0 ran (0 with no instrument failure; 0 where Syntology's instrument failed); community (archive-listed): 15 samples from 3 repositories, 13 ran (7 with no instrument failure; 6 where Syntology's instrument failed). The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

Levels written between 2026-09-22 and 2026-09-26 (UTC): the dates Syntology's graph wrote each sample's verification level, not when the code executed.

kuanghuei/SCAN officialmentioned in papermentioned on GitHubpytorchSyntology: 1 sample, 0 ran · 1 unverified report
MysteryVaibhav/SCAN mentioned on GitHubpytorchSyntology: not harvested report
abhidipbhattacharyya/srl_aware_ret mentioned on GitHubpytorchSyntology: 6 samples, 6 ran (6 instrument-failed) · 0 unverified report
adlnlp/attention_vl mentioned on GitHubpytorchSyntology: not harvested report
idejie/SCAN mentioned on GitHubpytorchApache-2.0Syntology: 8 samples, 6 ran (0 instrument-failed) · 2 unverified report
hthoai/image-text-matching pytorchSyntology: 1 sample, 1 ran (0 instrument-failed) · 0 unverified report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

16 samples harvested: 13 ran (of which 0 constructed an object rather than computing a result; 7 with no instrument failure: 1 honoured, 0 violated, 6 with no contract checked; 6 where Syntology's instrument failed) · 3 unverified. “Where Syntology's instrument failed” counts failures of Syntology's instrument, not of the code. Syntology's record for this page has not changed since , the first build that kept a record date for it; when this build read Syntology's graph is in the build record. That date is not when the samples ran.

1ran · honoured contract
5ran · our draft was wrong
1ran; the contract check could not run
6ran
3unverified

Licence: 1 of the 16 samples is pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from 4 repositories linked to this paper, official or community; the list below is grouped by repository, each group headed by its name and what it is to the paper. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. A line beginning “fixture:” under a sample that ran gives the arguments Syntology's fixture called the sample with, each as name:type/rank/element kind (? where none was recorded), and the type of what the fixture's run returned, exactly as the harness recorded them; the arguments and the returned type were recorded by two separate runs of the same fixture. No output value is shown, and a returned type says nothing about whether the output was right. “Level recorded” gives the UTC date when Syntology's graph wrote the sample's verification level, not when the code executed; where the level was written before Syntology's graph kept that date, the row says “level recorded, date not recorded”. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself. “Our draft was wrong” and “the contract check could not run” are failures of Syntology's instrument, not of the code: the sample ran on Syntology's synthesized input, and then the drafted contract did not describe it, or the check itself raised an error (RAISES), lacked a dependency (DEP_MISSING) or ran out of time (TIMEOUT); hover the label for which. A metamorphic tier, where shown, is evidence of the output's shape, not that the sample implements the method.

Each sample ends with its code_sha256. A sample's code_sha256 is Syntology's identity for that exact code. It is printed in full (16 hexadecimal characters for every sample in this build), and get_code(code_sha256="…") takes it exactly as printed. An agent calls it on Syntology's MCP service (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples are grouped by repository: a repository marked official first, then by how directly the repository is tied to the paper, then in the archive's order; never by how many ran. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of six reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar); this paper's copy was not located, so its licence is not recorded; or this paper's copy is cleared, but the stored copy of the same code that Syntology serves is not. Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

A function or class name links to its page when the name occurs in the harvested code of at least 5 papers; the name is a string, not an identity. A census tag appears when Syntology's census ran implementations with that name on one shared input per bucket: it gives how many were compared, from how many papers, and how many distinct outputs they produced, and names this sample's bucket when this sample was one of them.

kuanghuei/SCAN official repository 1 sample, 0 ran · 1 unverified
encode_data in 19 papers evaluation.py unverified Apache-2.0 (permissive) · 77cfc8299b5facec · report
abhidipbhattacharyya/srl_aware_ret community (archive-listed) 6 samples, 6 ran (6 instrument-failed) · 0 unverified
deserialize_vocab vocab.py ran · our draft was wrong Apache-2.0 (permissive) · cdee6932aa05022e · report fixture: signature src:str/0/str · returned Vocabulary · level recorded 2026-09-22
encode_data in 19 papers evaluation.py ran · our draft was wrong Apache-2.0 (permissive) · 1119155cc37cafa8 · report fixture: signature model:callable/0/?, data_loader:MockDataLoader/0/?, log_step:int/0/int, logging:callable/0/? · returned tuple · level recorded 2026-09-22
from_txt in 5 papers vocab.py ran · our draft was wrong Apache-2.0 (permissive) · ef05dda21c1cc726 · report fixture: signature txt:str/0/str · returned list · level recorded 2026-09-22
from_txt_vocab vocab.py ran · our draft was wrong Apache-2.0 (permissive) · 0da42e0e379224b0 · report fixture: signature txt:str/0/str · returned Vocabulary · level recorded 2026-09-22
process_sim evaluation.py ran; the contract check could not run (RAISES) · metamorphic tier: invariant fingerprinted Apache-2.0 (permissive) · 05aa9e5fd7ec0e01 · report fixture: signature sim:ndarray/2/float, no_prop:int/0/int · returned ndarray · level recorded 2026-09-22
softmax in 240 papers
census: 53 implementations from 63 papers, 16 distinct outputs across 8 buckets, one shared input per bucket this sample: bucket 3 of 8, arg 1: rank 2, kind float, dtype float64
evaluation.py ran · our draft was wrong fingerprinted Apache-2.0 (permissive) · 652f07c5ff410713 · report fixture: signature X:ndarray/2/float, axis:int/0/int · returned ndarray · level recorded 2026-09-22
idejie/SCAN community (archive-listed) 8 samples, 6 ran (0 instrument-failed) · 2 unverified
EncoderImage in 9 papers model.py ran Apache-2.0 (permissive) · 07c90e643974e90d · report fixture: signature data_name:str/0/str, img_dim:int/0/int, embed_size:int/0/int, precomp_enc_type:str/0/str, no_imgnorm:bool/0/bool · returned EncoderImagePrecomp · level recorded 2026-09-25
collate_fn in 500 papers data.py ran Apache-2.0 (permissive) · eb35209092068c75 · report fixture: signature data:list/1/tuple · returned tuple · level recorded 2026-09-25
get_loaders in 51 papers data.py ran Apache-2.0 (permissive) · a3b22af17bee87cc · report fixture: signature data_name:str/0/str, vocab:callable/0/?, batch_size:int/0/int, workers:int/0/int, opt:OptConfig/0/? · returned tuple · level recorded 2026-09-26
get_precomp_loader in 5 papers data.py ran Apache-2.0 (permissive) · f8b728dce3e79700 · report fixture: signature data_path:str/0/str, data_split:str/0/str, vocab:callable/0/?, opt:Opt/0/?, batch_size:int/0/int, shuffle:bool/0/bool, num_workers:int/0/int · returned DataLoader · level recorded 2026-09-26
l1norm in 14 papers
census: 7 implementations from 7 papers, 2 distinct outputs on one shared input
model.py ran fingerprinted Apache-2.0 (permissive) · a1e099b0f700be6a · report fixture: signature X:Tensor/2/float, dim:int/0/int, eps:float/0/float · returned Tensor · level recorded 2026-09-25
l2norm in 84 papers
census: 12 implementations from 20 papers, 3 distinct outputs on one shared input
model.py ran fingerprinted Apache-2.0 (permissive) · fe7440ba7662dcfc · report fixture: signature X:Tensor/2/float, dim:int/0/int, eps:float/0/float · returned Tensor · level recorded 2026-09-25
build_vocab in 36 papers vocab.py unverified Apache-2.0 (permissive) · 7b9b11b5023a6ca4 · report
encode_data in 19 papers evaluation.py unverified Apache-2.0 (permissive) · 647842a3913aa59c · report
hthoai/image-text-matching community (archive-listed) 1 sample, 1 ran (0 instrument-failed) · 0 unverified
read_all_images utils/read_all_images.py ran · honoured contract no licence file found · pointer only · 68f208c3005da07a · report fixture: signature root:str/0/str, split:str/0/str · returned Tensor · level recorded 2026-09-22

Tasks

Cross-Modal RetrievalImage RetrievalImage-text matchingRetrievalSentenceSentence RetrievalText MatchingText Retrievaltext similarity

Results from the paper archive 2025-07-28

TaskDatasetModelMetricValueRank at snapshotLeaderboardReport
Cross-Modal Retrieval COCO 2014 SCAN Image-to-text R@1 50.4 #32 of 36 Archive leaderboard report
Cross-Modal Retrieval COCO 2014 SCAN Image-to-text R@10 90.0 #32 of 36 Archive leaderboard report
Cross-Modal Retrieval COCO 2014 SCAN Image-to-text R@5 82.2 #32 of 36 Archive leaderboard report
Cross-Modal Retrieval COCO 2014 SCAN Text-to-image R@1 38.6 #32 of 36 Archive leaderboard report
Cross-Modal Retrieval COCO 2014 SCAN Text-to-image R@10 80.4 #32 of 36 Archive leaderboard report
Cross-Modal Retrieval COCO 2014 SCAN Text-to-image R@5 69.3 #32 of 36 Archive leaderboard report
Cross-Modal Retrieval Flickr30k SCAN Image-to-text R@1 67.4 #21 of 27 Archive leaderboard report
Cross-Modal Retrieval Flickr30k SCAN Image-to-text R@10 95.8 #21 of 27 Archive leaderboard report
Cross-Modal Retrieval Flickr30k SCAN Image-to-text R@5 90.3 #21 of 27 Archive leaderboard report
Cross-Modal Retrieval Flickr30k SCAN Text-to-image R@1 48.6 #21 of 27 Archive leaderboard report
Cross-Modal Retrieval Flickr30k SCAN Text-to-image R@10 85.2 #21 of 27 Archive leaderboard report
Cross-Modal Retrieval Flickr30k SCAN Text-to-image R@5 77.7 #21 of 27 Archive leaderboard report
Image Retrieval Flickr30K 1K test SCAN i-t R@1 44.0 #10 of 18 Archive leaderboard report
Image Retrieval Flickr30K 1K test SCAN i-t R@10 82.6 #10 of 18 Archive leaderboard report
Image Retrieval Flickr30K 1K test SCAN i-t R@5 74.2 #10 of 18 Archive leaderboard report
Image Retrieval PhotoChat SCAN R1 10.4 #4 of 5 Archive leaderboard report
Image Retrieval PhotoChat SCAN R@10 37.1 #4 of 5 Archive leaderboard report
Image Retrieval PhotoChat SCAN R@5 27.0 #4 of 5 Archive leaderboard report
Image Retrieval PhotoChat SCAN Sum(R@1,5,10) 74.5 #4 of 5 Archive leaderboard report

Ranks are positions in the archive's leaderboards as they stood at the 2025-07-28 snapshot. Results published since then are not among these rows, so a rank here is not a current standing.

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections