Papers › TransMatcher: Deep Image Matching Through Transformers for Generalizable Person...

TransMatcher: Deep Image Matching Through Transformers for Generalizable Person Re-identification

30 May 2021NeurIPS 2021 12arXiv:2105.14432archive 2025-07-28

Shengcai Liao, Ling Shao

Transformers have recently gained increasing attention in computer vision. However, existing studies mostly use Transformers for feature representation learning, e.g. for image classification and dense predictions, and the generalizability of Transformers is unknown. In this work, we further investigate the possibility of applying Transformers for image matching and metric learning given pairs of images. We find that the Vision Transformer (ViT) and the vanilla Transformer with decoders are not adequate for image matching due to their lack of image-to-image attention. Thus, we further design two naive solutions, i.e. query-gallery concatenation in ViT, and query-gallery cross-attention in the vanilla Transformer. The latter improves the performance, but it is still limited. This implies that the attention mechanism in Transformers is primarily designed for global feature aggregation, which is not naturally suitable for image matching. Accordingly, we propose a new simplified decoder, which drops the full attention implementation with the softmax weighting, keeping only the query-key similarity computation. Additionally, global max pooling and a multilayer perceptron (MLP) head are applied to decode the matching result. This way, the simplified decoder is computationally more efficient, while at the same time more effective for image matching. The proposed method, called TransMatcher, achieves state-of-the-art performance in generalizable person re-identification, with up to 6.1% and 5.7% performance gains in Rank-1 and mAP, respectively, on several popular datasets. Code is available at https://github.com/ShengcaiLiao/QAConv.

PaperPDFConference PDFCodeCode Syntology ranMethod as code

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 21 code samples: 20 from 3 repositories linked to this paper, 1 identical to code harvested from another paper's repository. Across all 21: 13 ran (of which 4 constructed an object rather than computing a result; 9 with no instrument failure: 0 honoured, 0 violated, 9 with no contract checked; 4 where Syntology's instrument failed) · 8 unverified. Where Syntology's instrument failed: 1 where our contract draft was wrong; 3 where the contract check could not run; failures of Syntology's instrument, not of the code.

By repository: official repository: 12 samples from 2 repositories, 5 ran (5 with no instrument failure; 0 where Syntology's instrument failed); found in paper text by Syntology: 8 samples from 1 repository, 7 ran (4 with no instrument failure; 3 where Syntology's instrument failed); 1 identical to code first harvested elsewhere. 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. 1 of the 13 samples that ran has no recorded date.

shengcailiao/QAConv officialmentioned in papermentioned on GitHubpytorchMITSyntology: 9 samples, 4 ran (0 instrument-failed) · 5 unverified report
ShengcaiLiao/TransMatcher officialmentioned on GitHubpytorchSyntology: 3 samples, 1 ran (0 instrument-failed) · 2 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

21 samples harvested: 13 ran (of which 4 constructed an object rather than computing a result; 9 with no instrument failure: 0 honoured, 0 violated, 9 with no contract checked; 4 where Syntology's instrument failed) · 8 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 · our draft was wrong
3ran; the contract check could not run
9ran
8unverified

Licence: 1 of the 21 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 3 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. 1 sample is listed last, in a group without a repository. “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”. For 3 samples that ran, the graph records a signature this page does not show: for a class the fixture built without calling, the harness called the object with inputs it made up itself, so the recorded signature is the harness's probe, not the fixture's arguments. “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.

shengcailiao/QAConv official repository 9 samples, 4 ran (0 instrument-failed) · 5 unverified
TransformerDecoderLayer in 45 papers projects/transmatcher/transmatcher.py ran MIT (permissive) · 700a80fe0d60b57f · report fixture: signature tgt:Tensor/4/float, memory:Tensor/4/float · returned Tensor · level recorded 2026-09-24
create in 17 papers reid/models/resmap.py ran MIT (permissive) · 6a5b9f52cf3678a2 · report fixture: signature name:str/0/str, pretrained:bool/0/bool, final_layer:str/0/str, neck:int/0/int · returned ResNet · level recorded 2026-09-26
extract_features in 73 papers reid/evaluators.py ran MIT (permissive) · 31d7e2c3ae921a59 · report fixture: signature model:callable/0/?, data_loader:DataLoader/0/?, num_features:int/0/int, fea_height:int/0/int, fea_width:int/0/int, verbose:bool/0/bool · returned Tensor · level recorded 2026-09-25
pre_tlift reid/evaluators.py ran MIT (permissive) · cf997e855309b9ea · report fixture: signature gallery:list/1/tuple, query:list/1/tuple · returned dict · level recorded 2026-09-25
TLift reid/tlift.py unverified MIT (permissive) · 7632194fce63925e · report
TransMatcher projects/transmatcher/transmatcher.py unverified MIT (permissive) · 33abed14c194aba1 · report
TransformerDecoder in 49 papers projects/transmatcher/transmatcher.py unverified MIT (permissive) · 9366a0f55adb1a1b · report
create in 17 papers projects/transmatcher/restranmap.py unverified MIT (permissive) · 10c6466fe43af640 · report
extract_cnn_feature in 14 papers reid/evaluators.py unverified MIT (permissive) · 124a181591c811ba · report
ShengcaiLiao/TransMatcher official repository 3 samples, 1 ran (0 instrument-failed) · 2 unverified
TransformerDecoderLayer in 45 papers matching/transmatcher_match.py ran MIT (permissive) · 28e208cc3e5212ed · report fixture: signature tgt:Tensor/4/float, memory:Tensor/4/float · returned tuple · level recorded 2026-09-24
TransMatcher matching/transmatcher_match.py unverified MIT (permissive) · d616a6fa60f095d2 · report
TransformerDecoder in 49 papers matching/transmatcher_match.py unverified MIT (permissive) · a7701d0fcf35a63a · report
JDAI-CV/fast-reid found in paper text by Syntology 8 samples, 7 ran (3 instrument-failed) · 1 unverified
Block in 252 papers
census: 5 implementations from 5 papers, 3 distinct outputs across 2 buckets, one shared input per bucket
fastreid/modeling/backbones/vision_transformer.py ran · metamorphic tier: deterministic Apache-2.0 (permissive) · ce093271c9f68c89 · report fixture: returned Block · level recorded 2026-09-22
DropPath in 75 papers
census: 17 implementations from 17 papers, 8 distinct outputs across 3 buckets, one shared input per bucket
fastreid/modeling/backbones/vision_transformer.py ran · metamorphic tier: deterministic fingerprinted Apache-2.0 (permissive) · 75f5c156267fccbd · report fixture: returned DropPath · level recorded 2026-09-22
HybridEmbed in 7 papers fastreid/modeling/backbones/vision_transformer.py ran · metamorphic tier: deterministic fingerprinted Apache-2.0 (permissive) · 719c7757b5d6beae · report fixture: returned HybridEmbed · level recorded 2026-09-22
PatchEmbed_overlap fastreid/modeling/backbones/vision_transformer.py ran · metamorphic tier: deterministic Apache-2.0 (permissive) · 9cd956aee362b467 · report fixture: returned PatchEmbed_overlap · level recorded 2026-09-22
_no_grad_trunc_normal_ in 16 papers
census: 16 implementations from 16 papers, 1 distinct output on one shared input this sample: bucket 1 of 1, arg 1: rank 2, kind float, dtype float32
fastreid/modeling/backbones/vision_transformer.py ran; the contract check could not run (RAISES) · metamorphic tier: invariant Apache-2.0 (permissive) · 813ed3a96c17cf42 · report fixture: signature tensor:Tensor/2/float, mean:float/0/float, std:float/0/float, a:float/0/float, b:float/0/float · returned Tensor · level recorded 2026-09-22
_ntuple in 17 papers fastreid/modeling/backbones/vision_transformer.py ran · our draft was wrong Apache-2.0 (permissive) · 019554bbb3a9809d · report fixture: signature n:int/0/int · returned function · level recorded 2026-09-22
trunc_normal_ in 154 papers
census: 37 implementations from 54 papers, 4 distinct outputs on one shared input this sample: bucket 1 of 1, arg 1: rank 2, kind float, dtype float32
fastreid/modeling/backbones/vision_transformer.py ran; the contract check could not run (RAISES) · metamorphic tier: invariant Apache-2.0 (permissive) · 605878f6dcef72e9 · report fixture: signature tensor:Tensor/2/float, mean:float/0/float, std:float/0/float, a:float/0/float, b:float/0/float · returned Tensor · level recorded 2026-09-22
VisionTransformer in 53 papers fastreid/modeling/backbones/vision_transformer.py unverified Apache-2.0 (permissive) · 9368e7f2101c9a30 · report
Repository not located 1 sample, 1 ran (1 instrument-failed) · 0 unverified
1 sample is identical to code Syntology harvested from another paper's repository; this paper's own copy was not located, so no repository is named and no licence is recorded.
drop_path in 325 papers
census: 27 implementations from 61 papers, 5 distinct outputs across 2 buckets, one shared input per bucket this sample: bucket 2 of 2, arg 1: rank 2, kind float, dtype float32
repository not located ran; the contract check could not run (RAISES) · metamorphic tier: invariant fingerprinted licence of this copy not recorded · 3ac6b7d76e8e3584 · report fixture: signature x:Tensor/2/float, drop_prob:float/0/float, training:bool/0/bool · returned Tensor · level recorded, date not recorded

Method as code Syntology

What Syntology's graph records as this paper's claimed method, lifted into code: each assembly names its bricks (functions and classes), each with its own role and its own verification level. An assembly is not a check that the code implements the method correctly or reproduces the paper's results. Levels are each brick's own verification level in Syntology's graph (level 0: no recorded run), listed brick by brick and never combined into one level; “ran” means the brick executed on a synthesized input, not that its output is correct, and the instrument figure counts failures of Syntology's instrument, not of the code. Where a model read the code against the paper's claim, each assembly's label verdict is one model's judgement, kept in this page's JSON twin; it is not calibrated, so no card prints it. Siblings are assemblies lifted from this paper in the same batch for the same method: alternative readings kept side by side; none replaces or supersedes another.

3 assemblies on this paper: 3 harvested, 0 generated, listed in 1 groups (siblings lifted in one batch form one group).

3 sibling assemblies for TransMatcher (harvested), lifted in the same batch on 2026-09-09: alternative readings kept side by side; none replaces or supersedes another.

harvested Assembly for TransMatcher (graph method: TransMatcher). 11 bricks; individually on a fixture: 10 ran (of which 6 constructed an object rather than computing a result; 6 with no instrument failure: 0 honoured, 0 violated, 6 with no contract checked; 4 where Syntology's instrument failed) · 1 unverified. The assembly has not been run end-to-end.

one of 3 siblings

  1. VisionTransformer entry · level 0 · unverified · 9368e7f2101c9a30
  2. Block model · level 1 · ran · ce093271c9f68c89
  3. HybridEmbed model · level 1 · ran · 719c7757b5d6beae
  4. PatchEmbed_overlap model · level 1 · ran · 9cd956aee362b467
  5. trunc_normal_ helper · level 1 · ran; the contract check could not run (RAISES) · 605878f6dcef72e9
  6. Attention model · level 1 · ran · 9af3eb132594e510
  7. DropPath helper · level 1 · ran · 75f5c156267fccbd
  8. Mlp helper · level 1 · ran · a1715055832f71fd
  9. drop_path helper · level 1 · ran; the contract check could not run (RAISES) · 3ac6b7d76e8e3584
  10. _no_grad_trunc_normal_ helper · level 1 · ran; the contract check could not run (RAISES) · 813ed3a96c17cf42
  11. _ntuple helper · level 1 · ran · our draft was wrong · 019554bbb3a9809d

harvested Assembly for TransMatcher (graph method: TransMatcher). 3 bricks; individually on a fixture: 1 ran (of which 0 constructed an object rather than computing a result; 1 with no instrument failure: 0 honoured, 0 violated, 1 with no contract checked; 0 where Syntology's instrument failed) · 2 unverified. The assembly has not been run end-to-end.

one of 3 siblings

  1. TransMatcher entry · level 0 · unverified · 33abed14c194aba1
  2. TransformerDecoder model · level 0 · unverified · 9366a0f55adb1a1b
  3. TransformerDecoderLayer model · level 1 · ran · 700a80fe0d60b57f

harvested Assembly for TransMatcher (graph method: TransMatcher). 3 bricks; individually on a fixture: 1 ran (of which 0 constructed an object rather than computing a result; 1 with no instrument failure: 0 honoured, 0 violated, 1 with no contract checked; 0 where Syntology's instrument failed) · 2 unverified. The assembly has not been run end-to-end.

one of 3 siblings

  1. TransMatcher entry · level 0 · unverified · d616a6fa60f095d2
  2. TransformerDecoder model · level 0 · unverified · a7701d0fcf35a63a
  3. TransformerDecoderLayer model · level 1 · ran · 28e208cc3e5212ed

Each brick ends with its code_sha256, Syntology's identity for that exact code; click one to copy the get_code call that returns it. For agents, on Syntology's MCP service: assembly(arxiv_id="2105.14432") returns these assemblies with each brick's role and wiring (how to connect).

Tasks

DecoderGeneralizable Person Re-identificationImage ClassificationMetric LearningPerson Re-IdentificationRepresentation Learningimage-classification

Results from the paper archive 2025-07-28

TaskDatasetModelMetricValueRank at snapshotLeaderboardReport
Generalizable Person Re-identification CUHK03-NP (detected) TransMatcher ClonedPerson->Rank-1 25.4 #1 of 5 Archive leaderboard report
Generalizable Person Re-identification CUHK03-NP (detected) TransMatcher ClonedPerson->mAP 24.4 #1 of 5 Archive leaderboard report
Generalizable Person Re-identification CUHK03-NP (detected) TransMatcher MSMT17->Rank-1 23.7 #1 of 5 Archive leaderboard report
Generalizable Person Re-identification CUHK03-NP (detected) TransMatcher MSMT17->mAP 22.5 #1 of 5 Archive leaderboard report
Generalizable Person Re-identification CUHK03-NP (detected) TransMatcher MSMT17-All->Rank-1 31.9 #1 of 5 Archive leaderboard report
Generalizable Person Re-identification CUHK03-NP (detected) TransMatcher MSMT17-All->mAP 30.7 #1 of 5 Archive leaderboard report
Generalizable Person Re-identification CUHK03-NP (detected) TransMatcher Market-1501->Rank-1 22.2 #1 of 5 Archive leaderboard report
Generalizable Person Re-identification CUHK03-NP (detected) TransMatcher Market-1501->mAP 21.4 #1 of 5 Archive leaderboard report
Generalizable Person Re-identification CUHK03-NP (detected) TransMatcher RandPerson->Rank-1 17.1 #1 of 5 Archive leaderboard report
Generalizable Person Re-identification CUHK03-NP (detected) TransMatcher RandPerson->mAP 16.0 #1 of 5 Archive leaderboard report
Generalizable Person Re-identification MSMT17 TransMatcher ClonedPerson->Rank-1 51.6 #1 of 4 Archive leaderboard report
Generalizable Person Re-identification MSMT17 TransMatcher ClonedPerson->mAP 20.8 #1 of 4 Archive leaderboard report
Generalizable Person Re-identification MSMT17 TransMatcher Market-1501->Rank1 47.3 #1 of 4 Archive leaderboard report
Generalizable Person Re-identification MSMT17 TransMatcher Market-1501->mAP 18.4 #1 of 4 Archive leaderboard report
Generalizable Person Re-identification MSMT17 TransMatcher RandPerson->Rank-1 48.3 #1 of 4 Archive leaderboard report
Generalizable Person Re-identification MSMT17 TransMatcher RandPerson->mAP 17.7 #1 of 4 Archive leaderboard report
Generalizable Person Re-identification Market-1501 TransMatcher ClonedPerson->Rank-1 84.8 #1 of 5 Archive leaderboard report
Generalizable Person Re-identification Market-1501 TransMatcher ClonedPerson->mAP 62.3 #1 of 5 Archive leaderboard report
Generalizable Person Re-identification Market-1501 TransMatcher MSMT17->Rank-1 80.1 #1 of 5 Archive leaderboard report
Generalizable Person Re-identification Market-1501 TransMatcher MSMT17->mAP 52.0 #1 of 5 Archive leaderboard report
Generalizable Person Re-identification Market-1501 TransMatcher MSMT17-All->Rank-1 82.6 #1 of 5 Archive leaderboard report
Generalizable Person Re-identification Market-1501 TransMatcher MSMT17-All->mAP 58.4 #1 of 5 Archive leaderboard report
Generalizable Person Re-identification Market-1501 TransMatcher RandPerson->Rank-1 77.3 #1 of 5 Archive leaderboard report
Generalizable Person Re-identification Market-1501 TransMatcher RandPerson->mAP 49.1 #1 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.

Methods

Absolute Position EncodingsAdamAttentionBPEDense ConnectionsDropoutLabel SmoothingLayer NormalizationLinear LayerMax PoolingMulti-Head AttentionPosition-Wise Feed-Forward LayerResidual ConnectionSoftmaxTransformerVision Transformer

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