Abstract
Feature matching is a fundamental task in computer vision, yet modern dense matchers often struggle with computational redundancy and noise in textureless regions. We present MESA (Matching Everything by Segmenting Anything), a novel class-agnostic framework that leverages the Segment Anything Model (SAM) to identify and match semantic regions before performing point-level matching. By organizing these regions into a hierarchical "Area Graph," MESA significantly reduces matching redundancy and boosts the accuracy of state-of-the-art dense matchers like DKM by as much as 13.6% on standard benchmarks.
Introduction
Identifying corresponding points between different views of a scene is essential for tasks like Simultaneous Localization and Mapping (SLAM) and 3D reconstruction. While deep-learning matchers have made significant strides, they often suffer from matching redundancy. Most dense matchers attempt to compare features across the entire image, which is computationally expensive and prone to errors in repetitive or textureless areas, such as white walls or tiled floors.
Previous attempts to mitigate this used area matching based on fixed semantic labels (e.g., matching a "chair" to a "chair"). However, these methods are brittle; they fail if the semantic classifier is inaccurate or encounters out-of-distribution objects. MESA addresses these limitations by introducing a class-agnostic "Segment-then-Match" pipeline.
Methods
MESA's core innovation lies in its hierarchical representation of image content and its class-agnostic approach to segmentation. The pipeline consists of four primary stages:
- Implicit Semantic Segmentation: Rather than relying on predefined object categories, MESA uses SAM to generate high-quality, class-agnostic segments. These areas are assumed to possess implicit semantic consistency, allowing the model to handle any scene type.
- The Area Graph (AG): MESA constructs a multi-relational graph where nodes represent image areas. The graph utilizes two types of edges: Inclusion edges, which represent scale hierarchy (e.g., a window within a wall), and Adjacency edges, representing spatial neighbors.
- Graphical Area Matching: Area matching is formulated as an energy minimization problem. MESA derives two graphical models from the AG:
- Area Markov Random Field (AMRF): This uses adjacency to ensure spatial consistency; if two areas are neighbors in the source image, their matches should ideally be neighbors in the target image.
- Area Bayesian Network (ABN): This leverages the scale hierarchy to prune the search space. If a large "parent" area is determined not to match, MESA efficiently skips all its "children" areas, drastically reducing the computational load.
- Learning Area Similarity: To evaluate potential matches, a Siamese CNN with self- and cross-attention mechanisms produces "activity maps," predicting the probability of patches appearing in corresponding areas.
Experimental Evaluation
The authors evaluated MESA across several standard benchmarks to demonstrate its versatility and robustness:
- ScanNet1500: An indoor dataset characterized by low texture and significant viewpoint changes.
- MegaDepth1500: An outdoor dataset focused on extreme scale variations and repetitive architectural patterns.
- KITTI360: Used for visual odometry to test performance in real-world driving scenarios.
Key Results
MESA acts as a powerful "booster" for existing point matchers. When integrated with the DKM (Dense Kernelized Matcher) baseline, the results were significant:
- Indoor Accuracy: MESA achieved a +13.61% improvement in pose estimation on ScanNet.
- Outdoor Accuracy: It set a new state-of-the-art on MegaDepth, outperforming previous methods by identifying detailed area matches where others only perceived broad covisible regions.
- Robustness: In visual odometry tests (KITTI360), MESA consistently reduced rotational and translational errors compared to standalone matchers.
Discussion and Insights
Several key insights emerged from the development of MESA. First, hierarchy is an effective pruning tool. The Area Bayesian Network allows the system to "fail fast" by discarding large mismatched regions early. Second, class-agnosticism is a strength. By moving away from explicit labels, MESA becomes robust to unseen objects; it cares only that a segment represents a coherent entity.
Finally, the use of global context via graphs helps resolve ambiguities. By modeling how areas relate to their neighbors, MESA uses the surrounding environment as a secondary check, which is particularly effective for repetitive patterns.
Limitations and Future Work
Despite its performance, MESA currently takes approximately 3 seconds per image for area matching. While competitive with some correspondence transformers, this is currently too slow for real-time robotics or AR/VR applications. Future work may involve "distilling" SAM’s internal features directly into the matching process to eliminate the overhead of a separate similarity model. Additionally, the authors aim to address 2D vs. 3D inconsistencies by exploring feature-guided fusion to better represent true scene geometry.
Summary updated