Skip to main content
QUICK REVIEW

[Paper Review] Efficient LoFTR: Semi-Dense Local Feature Matching with Sparse-Like Speed

Yifan Wang, Xingyi He|arXiv (Cornell University)|Mar 7, 2024
Time Series Analysis and ForecastingComputer Science3 citations
TL;DR

This paper proposes Efficient LoFTR, a detector-free semi-dense matching method that achieves near-sparse efficiency while improving accuracy over LoFTR. It introduces an aggregated attention mechanism with adaptive token selection to reduce computation on coarse features and a two-stage correlation layer to refine subpixel correspondences, resulting in ~2.5× faster inference than LoFTR and superior speed-accuracy trade-offs compared to state-of-the-art sparse matchers like SuperPoint + LightGlue.

ABSTRACT

We present a novel method for efficiently producing semi-dense matches across images. Previous detector-free matcher LoFTR has shown remarkable matching capability in handling large-viewpoint change and texture-poor scenarios but suffers from low efficiency. We revisit its design choices and derive multiple improvements for both efficiency and accuracy. One key observation is that performing the transformer over the entire feature map is redundant due to shared local information, therefore we propose an aggregated attention mechanism with adaptive token selection for efficiency. Furthermore, we find spatial variance exists in LoFTR's fine correlation module, which is adverse to matching accuracy. A novel two-stage correlation layer is proposed to achieve accurate subpixel correspondences for accuracy improvement. Our efficiency optimized model is $\sim 2.5 imes$ faster than LoFTR which can even surpass state-of-the-art efficient sparse matching pipeline SuperPoint + LightGlue. Moreover, extensive experiments show that our method can achieve higher accuracy compared with competitive semi-dense matchers, with considerable efficiency benefits. This opens up exciting prospects for large-scale or latency-sensitive applications such as image retrieval and 3D reconstruction. Project page: https://zju3dv.github.io/efficientloftr.

Motivation & Objective

  • To address the low inference efficiency of detector-free matchers like LoFTR, which limits their use in large-scale or latency-sensitive applications.
  • To improve matching accuracy in texture-poor and large-viewpoint-change scenarios without relying on keypoint detectors.
  • To redesign LoFTR’s coarse feature transformation and refinement stages to eliminate redundant computation and spatial variance.
  • To achieve a better speed-accuracy trade-off than both dense and sparse matching pipelines, enabling broader deployment in 3D reconstruction and image retrieval.

Proposed method

  • Proposes an aggregated attention mechanism that performs self-attention only on adaptively selected tokens instead of the full coarse feature map, reducing computation while preserving global context.
  • Introduces a two-stage correlation refinement layer: first applying mutual nearest-neighbor matching on fine patches, then refining to subpixel accuracy via localized correlation and expectation.
  • Adopts a dual-softmax strategy in the coarse matching stage to improve robustness and efficiency, reducing reliance on full-attention computation.
  • Uses a reparameterized VGG-based backbone (RepVGG) to further accelerate inference without sacrificing accuracy.
  • Replaces LoFTR’s single-stage correlation refinement with a two-stage process to suppress location variance caused by noisy correlation patches.
  • Employs a coarse-to-fine pipeline where coarse matches are refined locally using cropped feature patches, maintaining high precision.
Figure 1 : Matching Accuracy and Efficiency Comparisons. Our method achieves competitive accuracy compared with semi-dense matchers ( \scalerel * B) at a significantly higher speed. Compared with dense matcher ROMA ( \scalerel * B), our method is $\sim 7.5\times$ faster. Moreover, our efficiency opt
Figure 1 : Matching Accuracy and Efficiency Comparisons. Our method achieves competitive accuracy compared with semi-dense matchers ( \scalerel * B) at a significantly higher speed. Compared with dense matcher ROMA ( \scalerel * B), our method is $\sim 7.5\times$ faster. Moreover, our efficiency opt

Experimental results

Research questions

  • RQ1Can the global self-attention mechanism in LoFTR be optimized to reduce redundant computation on large feature maps without sacrificing matching accuracy?
  • RQ2Does spatial variance in the correlation refinement stage of LoFTR degrade matching performance, and can it be mitigated by a structured refinement strategy?
  • RQ3Can a detector-free semi-dense matcher achieve both higher efficiency and better accuracy than state-of-the-art sparse matching pipelines like SuperPoint + LightGlue?
  • RQ4How effective is adaptive token selection via aggregated attention in reducing computational cost while maintaining performance on challenging image pairs?
  • RQ5To what extent does a two-stage correlation refinement process improve subpixel correspondence accuracy compared to LoFTR’s single-stage expectation-based refinement?

Key findings

  • The proposed method achieves ~2.5× faster inference than LoFTR on high-resolution images (1200×1200), with a 139.2ms average inference time.
  • The ablation study confirms that replacing the aggregated attention with LoFTR’s full-attention transformer reduces both efficiency and accuracy, validating the effectiveness of the proposed module.
  • The two-stage correlation layer improves accuracy by suppressing location variance, resulting in a 0.6–0.8% AUC improvement on the Aachen benchmark compared to LoFTR’s single-stage refinement.
  • The method surpasses SuperPoint + LightGlue in both speed and accuracy on the Aachen and InLoc benchmarks, achieving 56.4 AUC on pose estimation.
  • Removing the second refinement stage leads to a noticeable drop in AUC@5° (from 56.4 to 55.8), confirming its importance for high-precision matching.
  • Using a RepVGG backbone instead of ResNet reduces inference time by ~15% with comparable accuracy, demonstrating the efficiency gains from model reparameterization.
Figure 2 : Pipeline Overview. (1) Given an image pair, a CNN network extracts coarse feature maps $\tilde{\textbf{F}}_{A}$ and $\tilde{\textbf{F}}_{B}$ , as well as fine features. (2) Then, we transform coarse features for more discriminative feature maps by interleaving our aggregated self- and cro
Figure 2 : Pipeline Overview. (1) Given an image pair, a CNN network extracts coarse feature maps $\tilde{\textbf{F}}_{A}$ and $\tilde{\textbf{F}}_{B}$ , as well as fine features. (2) Then, we transform coarse features for more discriminative feature maps by interleaving our aggregated self- and cro

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.