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

NeurIPS 2021  ·  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.

PDF Abstract NeurIPS 2021 PDF NeurIPS 2021 Abstract

Results from the Paper


Task Dataset Model Metric Name Metric Value Global Rank Uses Extra
Training Data
Result Benchmark
Generalizable Person Re-identification CUHK03-NP (detected) TransMatcher ClonedPerson->mAP 24.4 # 1
ClonedPerson->Rank-1 25.4 # 1
RandPerson->mAP 16.0 # 2
RandPerson->Rank-1 17.1 # 2
MSMT17->mAP 22.5 # 1
MSMT17->Rank-1 23.7 # 1
MSMT17-All->mAP 30.7 # 1
MSMT17-All->Rank-1 31.9 # 1
Market-1501->mAP 21.4 # 1
Market-1501->Rank-1 22.2 # 1
Generalizable Person Re-identification Market-1501 TransMatcher ClonedPerson->mAP 62.3 # 1
ClonedPerson->Rank-1 84.8 # 1
RandPerson->mAP 49.1 # 1
RandPerson->Rank-1 77.3 # 1
MSMT17->mAP 52.0 # 1
MSMT17->Rank-1 80.1 # 1
MSMT17-All->mAP 58.4 # 1
MSMT17-All->Rank-1 82.6 # 1
Generalizable Person Re-identification MSMT17 TransMatcher RandPerson->mAP 17.7 # 1
RandPerson->Rank-1 48.3 # 1
Market-1501->Rank1 47.3 # 1
Market-1501->mAP 18.4 # 1
ClonedPerson->mAP 20.8 # 1
ClonedPerson->Rank-1 51.6 # 1

Methods