{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/matchformer-interleaving-attention-in","title":"MatchFormer: Interleaving Attention in Transformers for Feature Matching","arxiv_id":"2203.09645","date":"2022-03-17","proceeding":null,"authors":["Qing Wang","Jiaming Zhang","Kailun Yang","Kunyu Peng","Rainer Stiefelhagen"],"abstract":"Local feature matching is a computationally intensive task at the subpixel level. While detector-based methods coupled with feature descriptors struggle in low-texture scenes, CNN-based methods with a sequential extract-to-match pipeline, fail to make use of the matching capacity of the encoder and tend to overburden the decoder for matching. In contrast, we propose a novel hierarchical extract-and-match transformer, termed as MatchFormer. Inside each stage of the hierarchical encoder, we interleave self-attention for feature extraction and cross-attention for feature matching, yielding a human-intuitive extract-and-match scheme. Such a match-aware encoder releases the overloaded decoder and makes the model highly efficient. Further, combining self- and cross-attention on multi-scale features in a hierarchical architecture improves matching robustness, particularly in low-texture indoor scenes or with less outdoor training data. Thanks to such a strategy, MatchFormer is a multi-win solution in efficiency, robustness, and precision. Compared to the previous best method in indoor pose estimation, our lite MatchFormer has only 45% GFLOPs, yet achieves a +1.3% precision gain and a 41% running speed boost. The large MatchFormer reaches state-of-the-art on four different benchmarks, including indoor pose estimation (ScanNet), outdoor pose estimation (MegaDepth), homography estimation and image matching (HPatch), and visual localization (InLoc).","url_abs":"https://arxiv.org/abs/2203.09645v3","url_pdf":"https://arxiv.org/pdf/2203.09645v3.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"matchformer-interleaving-attention-in","repo_url":"https://github.com/jamycheung/matchformer","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}}],"tasks":[{"task_slug":"decoder","task_name":"Decoder"},{"task_slug":"homography-estimation","task_name":"Homography Estimation"},{"task_slug":"pose-estimation","task_name":"Pose Estimation"},{"task_slug":"visual-localization","task_name":"Visual Localization"}],"methods":[{"method_slug":"speed","method_name":"SPEED"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2203.09645","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2203.09645"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/jamycheung/matchformer","reach":{"status":"ok","spdx":"Apache-2.0"}}],"summary":{"ran_honours":2,"ran_draft_wrong":2,"unverified":1},"by_repo_kind":{"official":{"samples":5,"ran":4,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"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"},"n_pointer_only_for_licence":0,"samples":[{"code_sha256_prefix":"67a8b79fd250e22b","entry":"compute_max_candidates","repo":"jamycheung/matchformer","repo_kind":"official","path":"model/backbone/coarse_matching.py","file_url":"https://github.com/jamycheung/matchformer/blob/HEAD/model/backbone/coarse_matching.py","link_basis":"harvester_set","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"67a8b79fd250e22b"}},{"code_sha256_prefix":"be3fea8e6f5db9c7","entry":"conv1x1","repo":"jamycheung/matchformer","repo_kind":"official","path":"model/backbone/match_LA_large.py","file_url":"https://github.com/jamycheung/matchformer/blob/HEAD/model/backbone/match_LA_large.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"be3fea8e6f5db9c7"}},{"code_sha256_prefix":"583f9780bdd00a45","entry":"conv3x3","repo":"jamycheung/matchformer","repo_kind":"official","path":"model/backbone/match_LA_large.py","file_url":"https://github.com/jamycheung/matchformer/blob/HEAD/model/backbone/match_LA_large.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"583f9780bdd00a45"}},{"code_sha256_prefix":"0d5505bd782b4a89","entry":"elu_feature_map","repo":"jamycheung/matchformer","repo_kind":"official","path":"model/backbone/match_LA_large.py","file_url":"https://github.com/jamycheung/matchformer/blob/HEAD/model/backbone/match_LA_large.py","link_basis":"harvester_set","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"0d5505bd782b4a89"}},{"code_sha256_prefix":"4781c0cd252d6260","entry":"load_array_from_s3","repo":"jamycheung/matchformer","repo_kind":"official","path":"model/datasets/dataset.py","file_url":"https://github.com/jamycheung/matchformer/blob/HEAD/model/datasets/dataset.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"4781c0cd252d6260"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}