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 ran

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

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2105.14432")

Code

Syntology Ran 10 of 21 code samples harvested from 3 repositories linked to this paper; 11 have no recorded run. Of those that ran: 1 ran · our draft was wrong; 3 ran · fixture could not drive it; 6 ran with no contract checked.

By repository: official repository: 12 samples from 2 repositories, 2 ran; found in paper text by Syntology: 8 samples from 1 repository, 7 ran; 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.

shengcailiao/QAConv officialmentioned in papermentioned on GitHubpytorchMIT report
ShengcaiLiao/TransMatcher officialmentioned on GitHubpytorch 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; 10 ran; 0 honoured the contract we drafted; 11 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

1ran · our draft was wrong
3ran · fixture could not drive it
6ran
11unverified

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; each sample names its own and says which. Some samples are identical code Syntology first harvested from another repository; for those, this paper's copy is not located and its licence is not recorded. “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. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (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 from a repository marked official are listed first. 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 four 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; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). 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.

TransformerDecoderLayer shengcailiao/QAConv/projects/transmatcher/transmatcher.py official repository ran MIT (permissive) · 700a80fe0d60b57f · report
TransformerDecoderLayer ShengcaiLiao/TransMatcher/matching/transmatcher_match.py official repository ran MIT (permissive) · 28e208cc3e5212ed · report
TLift ShengcaiLiao/QAConv/reid/tlift.py official repository unverified MIT (permissive) · 7632194fce63925e · report
TransMatcher shengcailiao/QAConv/projects/transmatcher/transmatcher.py official repository unverified MIT (permissive) · 33abed14c194aba1 · report
TransMatcher ShengcaiLiao/TransMatcher/matching/transmatcher_match.py official repository unverified MIT (permissive) · d616a6fa60f095d2 · report
TransformerDecoder shengcailiao/QAConv/projects/transmatcher/transmatcher.py official repository unverified MIT (permissive) · 9366a0f55adb1a1b · report
TransformerDecoder ShengcaiLiao/TransMatcher/matching/transmatcher_match.py official repository unverified MIT (permissive) · a7701d0fcf35a63a · report
create ShengcaiLiao/QAConv/reid/models/resmap.py official repository unverified MIT (permissive) · 6a5b9f52cf3678a2 · report
create ShengcaiLiao/QAConv/projects/transmatcher/restranmap.py official repository unverified MIT (permissive) · 10c6466fe43af640 · report
extract_cnn_feature ShengcaiLiao/QAConv/reid/evaluators.py official repository unverified MIT (permissive) · 124a181591c811ba · report
extract_features ShengcaiLiao/QAConv/reid/evaluators.py official repository unverified MIT (permissive) · 31d7e2c3ae921a59 · report
pre_tlift ShengcaiLiao/QAConv/reid/evaluators.py official repository unverified MIT (permissive) · cf997e855309b9ea · report
Block JDAI-CV/fast-reid/fastreid/modeling/backbones/vision_transformer.py found in paper text by Syntology ran · metamorphic tier: deterministic Apache-2.0 (permissive) · ce093271c9f68c89 · report
DropPath JDAI-CV/fast-reid/fastreid/modeling/backbones/vision_transformer.py found in paper text by Syntology ran · metamorphic tier: deterministic fingerprinted Apache-2.0 (permissive) · 75f5c156267fccbd · report
HybridEmbed JDAI-CV/fast-reid/fastreid/modeling/backbones/vision_transformer.py found in paper text by Syntology ran · metamorphic tier: deterministic fingerprinted Apache-2.0 (permissive) · 719c7757b5d6beae · report
PatchEmbed_overlap JDAI-CV/fast-reid/fastreid/modeling/backbones/vision_transformer.py found in paper text by Syntology ran · metamorphic tier: deterministic Apache-2.0 (permissive) · 9cd956aee362b467 · report
_no_grad_trunc_normal_ JDAI-CV/fast-reid/fastreid/modeling/backbones/vision_transformer.py found in paper text by Syntology ran · fixture could not drive it Apache-2.0 (permissive) · 813ed3a96c17cf42 · report
_ntuple JDAI-CV/fast-reid/fastreid/modeling/backbones/vision_transformer.py found in paper text by Syntology ran · our draft was wrong Apache-2.0 (permissive) · 019554bbb3a9809d · report
trunc_normal_ JDAI-CV/fast-reid/fastreid/modeling/backbones/vision_transformer.py found in paper text by Syntology ran · fixture could not drive it Apache-2.0 (permissive) · 605878f6dcef72e9 · report
VisionTransformer JDAI-CV/fast-reid/fastreid/modeling/backbones/vision_transformer.py found in paper text by Syntology unverified Apache-2.0 (permissive) · 9368e7f2101c9a30 · report
drop_path identical code first harvested elsewhere ran · fixture could not drive it fingerprinted licence of this copy not recorded · 3ac6b7d76e8e3584 · report

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