DeepMatcher: A deep transformer-based network for robust and accurate local feature matching

Tao Xie, Kun Dai, Ke Wang, Ruifeng Li, Lijun ZhaoExpert Systems with Applications 2023

TL;DR

This paper introduces DeepMatcher, a novel deep Transformer-based network for local feature matching that excels in challenging scenarios like extreme viewpoint changes. By proposing a "Slimming Transformer" and a "Feature Transition Module," DeepMatcher achieves state-of-the-art performance with improved efficiency and a more human-intuitive approach to matching.

What Problem Does This Paper Address?

Local feature matching is a fundamental task in computer vision, crucial for applications like Simultaneous Localization and Mapping (SLAM) and Structure-from-Motion (SFM). Traditional methods often rely on detecting sparse keypoints and then matching them. However, these methods struggle when images have significant appearance variations, such as extreme viewpoint changes, as keypoint detectors fail to find repeatable features.

More recent "detector-free" methods aim to address this by extracting features from dense grids across images. While these methods have shown promise, existing architectures are often shallow and broad, limiting their ability to capture complex relationships. The authors argue that a deeper, more compact network, akin to how humans process visual information by repeatedly scanning and focusing on relevant cues, could lead to more robust and accurate matching. They identify several key challenges in building such a deep detector-free matcher: bridging the gap between local CNN features and global Transformer context, handling the ambiguity of translation-invariant CNN features, and enabling deeper Transformer layers to effectively learn context without prohibitive computational cost.

Methods

DeepMatcher tackles these challenges with several novel components:

  • Local Feature Extractor: A standard CNN with a Feature Pyramid Network (FPN) is used to extract multi-scale features.
  • Feature Transition Module (FTM): This module bridges the gap between the local CNN features and the global context aggregation of the Transformer. It uses depth-wise convolutions with varying kernel sizes to adjust receptive fields and ensure effective deep feature interaction.
  • Slimming Transformer (SlimFormer): This is the core of DeepMatcher's deep architecture. It's designed for efficiency and effectiveness in capturing long-range global context. Key features include:
  • Vector-based Attention: This efficiently handles pixel tokens with linear complexity, modeling relevance among keypoints.
  • Relative Position Encoding (RPE): Instead of absolute positions, it uses rotary positional embedding (ROPE) to explicitly encode relative distances, which is more human-intuitive and crucial for deeper layers.
  • Layer-Scale Strategy: This learnable scaling factor adaptively balances original features and enhanced messages, allowing the network to simulate how humans acquire different matching cues over time.
  • Coarse Matches Module (CMM): This module establishes initial dense matches by interleaving self- and cross-SlimFormer layers to aggregate global context.
  • Fine Matches Module (FMM): This module refines the coarse matches by viewing the process as a combination of classification (confidence) and regression (offset) problems, leading to more robust and accurate final matches.

Datasets

DeepMatcher was trained and evaluated on several standard datasets:

  • ScanNet: Used for indoor pose estimation experiments.
  • MegaDepth: Used for outdoor pose estimation experiments.
  • HPatches: Used for image matching and homography estimation experiments.

Key Insights and Ideas

  • Depth over Width for Transformers: The paper strongly advocates for deeper Transformer architectures in feature matching, arguing that this better mimics human visual processing and leads to improved performance, contrary to some prior findings.
  • Human-like Matching: The design of SlimFormer, particularly the layer-scale strategy and relative position encoding, is explicitly inspired by how humans scan images and integrate information over multiple passes.
  • Bridging Local and Global: The FTM is a crucial innovation for effectively integrating features from local CNNs into the global context of Transformers, a common challenge in such architectures.
  • Efficiency in Deep Models: The "Slimming" aspect of the Transformer, along with vector-based attention, allows for deeper models without a prohibitive increase in computational cost.

Key Results

DeepMatcher and its variant DeepMatcher-L consistently outperform state-of-the-art methods across various benchmarks:

  • Pose Estimation (ScanNet & MegaDepth): DeepMatcher-L achieves superior AUC scores compared to methods like LoFTR, SuperGlue, and ClusterGNN, demonstrating robustness in challenging indoor and outdoor scenarios. For instance, on ScanNet, DeepMatcher-L surpasses LoFTR by over 5% in AUC.
  • Image Matching (HPatches): DeepMatcher exhibits excellent performance, particularly under viewpoint changes, and strikes a good balance between viewpoint and illumination variations.
  • Homography Estimation (HPatches): DeepMatcher-L shows competitive results, outperforming LoFTR and MatchFormer, especially under extreme viewpoint changes.
  • Efficiency: DeepMatcher achieves competitive inference speed and significantly lower GFLOPs and computational complexity (O(NC) for attention vs. O(NC²) for vanilla Transformers) compared to other methods.

Limitations and Future Work

  • Limitations: While DeepMatcher shows strong performance, the paper notes that in some specific scenarios (e.g., HPatches under low illumination thresholds), it might perform slightly worse than other methods, suggesting room for further improvement. The computational cost, while reduced, is still a factor for extremely large images.
  • Future Work: The authors suggest that their work opens avenues for developing deeper and more compact local feature matchers. The success of the SlimFormer and FTM modules could be explored in other vision tasks. Further research into more efficient attention mechanisms and better integration of multi-scale features could also be beneficial.

Summary updated

BibTeX
@article{xie2023deepmatcher,
  author = {Tao Xie and Kun Dai and Ke Wang and Ruifeng Li and Lijun Zhao},
  title = {{DeepMatcher: A deep transformer-based network for robust and accurate local feature matching}},
  journal = {Expert Systems with Applications},
  year = {2023},
}
Figure