Adaptive Spot-Guided Transformer for Consistent Local Feature Matching

Jiahuan Yu, Jiahao Chang, Jianfeng He, Tianzhu Zhang, Jiyang Yu, Feng WuCVPR 2023

Local feature matching—the process of identifying corresponding points across different images—is a fundamental component of 3D reconstruction, Simultaneous Localization and Mapping (SLAM), and autonomous navigation. While Transformer-based models like LoFTR have significantly advanced the state-of-the-art, they frequently encounter two primary obstacles: maintaining local consistency in scenes with repetitive textures and managing substantial scale variations between viewpoints.

Researchers from the University of Science and Technology of China have introduced the Adaptive Spot-Guided Transformer (ASTR). This framework leverages geometric intuition to guide its attention mechanism and dynamically adapt search windows, addressing the limitations of previous detector-free matchers.

The Challenge: Local Consistency and Scale Variation

Most modern detector-free matchers employ a coarse-to-fine strategy, identifying rough matches on a low-resolution grid before refining them. However, this approach faces two critical issues:

  1. Local Inconsistency: In environments with repetitive patterns (e.g., building facades), global attention mechanisms often become "distracted." This leads to inconsistent matches where adjacent pixels in a reference image are mapped to widely disparate, incorrect locations in the target image.
  2. Scale Variation: When there is a significant change in scale between images (e.g., a close-up vs. a wide shot), fixed-size search windows often fail to encompass the true matching point, resulting in total matching failure.

Methodology

ASTR introduces two novel modules to resolve these issues within a Transformer-based architecture.

1. Spot-Guided Aggregation Module

Standard global attention allows every pixel to attend to every other pixel, which can introduce noise. ASTR instead identifies "seed points"—areas with high matching confidence—and restricts cross-attention to local "spots" around these seeds. This enforces a "neighbor matches neighbor" inductive bias, filtering out irrelevant information from distant image regions. To maintain efficiency, the authors developed a custom, highly optimized sparse attention operator in CUDA.

2. Adaptive Scaling Module

During the refinement stage, traditional models typically crop a fixed $5 \times 5$ window around coarse matches. ASTR replaces this with a geometry-aware approach. It uses coarse matches to estimate relative pose and a rough depth ratio ($d_i/d_j$) between images. The search window size ($s_j$) is then scaled accordingly. For instance, if an object appears twice as large in the second image, the search window automatically doubles in size to ensure the true match is captured.

Comparison of attention mechanisms and matching results. ASTR (Ours) demonstrates more focused, 'spot-guided' attention maps and significantly cleaner matching results compared to vanilla and linear attention baselines.

Experimental Results

ASTR was trained on the MegaDepth dataset and evaluated across several rigorous benchmarks, setting new performance standards for detector-free matching:

  • HPatches: ASTR achieved 71.7% AUC@3px, a significant improvement over LoFTR (65.9%) and PDC-Net+ (66.7%).
  • MegaDepth: The model improved pose estimation accuracy by 3.1% (AUC@5°) compared to LoFTR.
  • Visual Localization: On the InLoc benchmark (DUC1), ASTR reached 53.0% accuracy at the strict 0.25m, 10° threshold, outperforming ASpanFormer and LoFTR.

Notably, despite being trained only on outdoor data, ASTR ranked first on the indoor ScanNet benchmark among "outdoor-only" models, suggesting that the spot-guided approach captures fundamental matching principles that generalize across domains.

Conclusion and Future Work

ASTR demonstrates that incorporating geometric priors—specifically through spot-guided attention and adaptive scaling—can resolve long-standing issues in local feature matching. By transforming a static architecture into a dynamic, geometry-aware one, ASTR achieves superior consistency and scale robustness.

A current limitation is the requirement for camera intrinsics to calculate depth ratios in the Adaptive Scaling Module. Future research may focus on estimating these intrinsics on the fly or developing scale-adaptive mechanisms that do not rely on explicit depth mathematics, further enhancing the model's utility for "in-the-wild" imagery.

Summary updated

BibTeX
@inproceedings{yu2023adaptive,
  author = {Jiahuan Yu and Jiahao Chang and Jianfeng He and Tianzhu Zhang and Jiyang Yu and Feng Wu},
  title = {{Adaptive Spot-Guided Transformer for Consistent Local Feature Matching}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2023},
  url = {https://openreview.net/forum?id=B0NoNiGszQ},
}
Figure