All models

MatchFormer

A hierarchical transformer that interleaves self-attention and cross-attention for local feature matching.

Depth estimation · 760 operations Checked

100%

Showing the top corner; full diagram not loaded yetShowing a small copy; full diagram not loaded yetLarge diagram, not loaded yet

Open SVG

Loading diagram (27 KB)

Open in a new tab

Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.

At a glance

Parameters
23.4M
Operations
760
Framework
PyTorch
Recurrent
No
Published
ACCV 2022
Cited by
213 (as of 3 November 2026)
Authors
Qing Wang, Jiaming Zhang, Kailun Yang and others
License
Apache-2.0
Checked
Passed: the trace was replayed operation by operation and matched the model's own output for this input.

Files

The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.

Details
Stable ID
m18345
Graph hash
a6fa86131c8852b4537a704eee70d84099a167907f40f5bde1b5af7bc7061098
Skeleton hash
ab0dfd8980d4971e4565061e71f71039e822033130d50a1558a58772c011ae8b
Architecture hash
f812661edaea7a8bfd6a7dd631ed1077cb3fe34daed1c1fa97c66c8c091f24cd
Diagram SHA-256
09cec4cc1f4c1157cbf43072dc9505897cb9769bac55ec487ee9b2c3b6e41bf5
TorchLens version
2.36.0
Renderer
graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
Check
Forward pass replayed in PyTorch

What it is

MatchFormer is a hierarchical transformer for local feature matching, built around what the paper calls an extract-and-match scheme. Inside each stage of its hierarchical encoder, self-attention for feature extraction is interleaved with cross-attention for feature matching. The paper contrasts this with CNN-based methods that extract first and match afterwards, which it says fail to use the matching capacity of the encoder and tend to overburden the decoder.

Against the previous best method in indoor pose estimation, the paper reports that the lite MatchFormer has only 45% of the GFLOPs, with a +1.3% precision gain and a 41% running speed boost. For the large MatchFormer it reports the best results at the time on four benchmarks: indoor pose estimation (ScanNet), outdoor pose estimation (MegaDepth), homography estimation and image matching (HPatch), and visual localization (InLoc).

Four checkpoints are released, for indoor and outdoor scenes, each in a large and a lightweight size, using either SEA (Spatial-Entropy Attention) or LA (Linear Attention). The model card lists the indoor large model with the largesea backbone at an AUC of 43.3, 63.4 and 77.1 at 5°, 10° and 20° for relative pose estimation on ScanNet. The code is based on LoFTR.

Key idea. The paper interleaves self-attention for feature extraction with cross-attention for feature matching inside each stage of a hierarchical transformer encoder.

  • MatchFormer
  • feature matching
  • local feature matching
  • image matching
  • extract-and-match
  • interleaving attention
  • relative pose estimation
  • dense correspondences
  • ScanNet
  • MegaDepth

AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.

Cite the paper

@misc{wang2022matchformerinterleavingattentiontransformers,
      title={MatchFormer: Interleaving Attention in Transformers for Feature Matching}, 
      author={Qing Wang and Jiaming Zhang and Kailun Yang and Kunyu Peng and Rainer Stiefelhagen},
      year={2022},
      eprint={2203.09645},
      archivePrefix={arXiv},
      primaryClass={cs.CV},
      url={https://arxiv.org/abs/2203.09645}, 
}