VSFormer: Visual-Spatial Fusion Transformer for Correspondence Pruning

Tangfei Liao, Xiaoqin Zhang, Li Zhao, Tao Wang, Guobao Xiao

TL;DR

VSFormer introduces a novel approach to image correspondence pruning by integrating high-level visual scene context with spatial coordinate data. By leveraging a visual-spatial fusion module and a dual local-global context transformer, it filters out false matches with unprecedented accuracy, significantly improving camera pose estimation in high-outlier environments.

What Problem Does This Paper Address?

Establishing reliable feature matches (correspondences) between two images is a cornerstone of 3D computer vision, essential for tasks like Simultaneous Localization and Mapping (SLAM) and Structure from Motion (SfM). However, initial matching steps often yield outlier ratios exceeding 90% due to challenging real-world conditions like repetitive structures, low texture, and extreme illumination changes.

While traditional methods like RANSAC become exponentially slower as outliers increase, recent deep learning approaches treat correspondence pruning as a spatial filtering problem. The catch? These networks typically discard the original images and operate solely on coordinate pairs. The authors of VSFormer argue that ignoring visual context (e.g., recognizing that a scene has low texture or severe occlusion) severely limits a network's ability to resolve ambiguous matches. VSFormer bridges this gap by introducing a "scene-aware prior" directly into the pruning pipeline.

Figure 1: Comparison between previous methods and ours. Top: the architecture of previous methods, which lack the visual perception of a scene. Bottom: the architecture of our VSFormer introduces visual cues of a scene to guide cor- respondence pruning. For visualization purposes, the corre- spondences (4D) across two-view images are projected into a 2D space by t-SNE (Van der Maaten and Hinton 2008). The circle CA represents the cross-attention layer.

Methods

VSFormer consists of three primary components designed to extract, fuse, and exploit both visual and spatial information:

  1. Visual Cues Extractor (VCExtractor): Using a standard ResNet34 backbone, the network extracts high-dimensional local features from the image pair. These features pass through a cross-attention layer to generate abstract "visual cues" representing the scene's overall matchability (e.g., lower attention scores indicate difficult regions with occlusions or lighting shifts).
  2. Visual-Spatial Fusion (VSFusion) Module: To combine the 2D visual cues with the 4D spatial coordinates of the correspondences, VSFusion projects the spatial data into the visual feature space using a learnable soft assignment. A transformer layer then models the complex intra- and inter-modality relationships before fusing them via element-wise summation.
  3. Context Transformer (ContextFormer): To find consistent matches, the network must look at both local neighborhoods and global geometry. ContextFormer achieves this by stacking a K-Nearest Neighbors (KNN) graph neural network—enhanced by a novel squeeze-and-excitation graph attention block for local context—with a multi-head self-attention transformer that incorporates a "length similarity matrix" to maintain global spatial awareness.
Figure 2: The architecture of our VSFormer mainly con- tains Visual Cues Extractor (VCExtractor), Visual-Spatial Fusion (VSFusion) Module, and Context Transformer (Con- textFormer). Note that we omit the inlier predictor after Con- textFormer for simplicity.

Datasets

The authors evaluated VSFormer on two widely accepted benchmarks, split into both "known" and "unknown" (unseen during training) scenes:

  • YFCC100M: A massive outdoor dataset consisting of photos of tourist landmarks taken under diverse weather, lighting, and viewpoint conditions.
  • SUN3D: An indoor RGB-D video dataset capturing complex indoor spaces characterized by low-texture walls and repetitive structures.

Key Insights and Ideas

  • Scene Cues as an Inlier Prior: The core "aha moment" is that the visual difficulty of an image pair correlates strongly with its expected inlier ratio. By letting the network perceive this difficulty upfront via cross-attention, it can dynamically adjust its strictness when evaluating ambiguous coordinate matches.
  • Squeeze-and-Excitation on Graphs: While KNN graphs are excellent for local context, they can be noisy. Introducing a squeeze-and-excitation mechanism along the channel and neighborhood dimensions allows the network to adaptively reweight graph edges, making neighborhood aggregation much more robust.
  • The Over-Pruning Trap: The authors discovered that iterating the network too many times (e.g., 3x instead of 2x) actually degrades performance. Redundant iterations begin discarding true positive matches, which are critical for downstream geometric calculations like essential matrix estimation.

Key Results

VSFormer achieved state-of-the-art (SOTA) results across both indoor and outdoor datasets, outperforming both MLP-based and graph-based competitors.

  • Outdoor Performance (YFCC100M, Unknown Scenes): VSFormer achieved a 62.18% mAP@5° (without RANSAC post-processing), representing a massive 15.8% absolute improvement over the recent SOTA method PGFNet (53.70%).
  • Indoor Performance (SUN3D, Unknown Scenes): It reached 20.18% mAP@5°, outperforming baselines like OANet++ and CLNet by 24.7% and 27.5% relatively.
  • Plug-and-Play Versatility: In ablation studies, adding the VSFusion module to existing architectures (like PointCN or CLNet) consistently boosted their accuracy, proving that visual context is universally beneficial for spatial pruning tasks.
Figure 4: Partial typical visualization results on two challenging datasets, i.e., YFCC100M, SUN3D. From left to right: the results of OANet++, CLNet, and our VSFormer. From top to bottom: the top three results come from unknown outdoor scenes and the rest come from unknown indoor scenes. The correspondence is drawn in green if it represents the true-positive and red for the false-positive. Best viewed in color.

Limitations and Future Work

The primary limitation identified is the performance penalty associated with over-iteration. Because the pruning threshold is fixed across iterations, the network can become overly aggressive and discard sparse but vital inliers in later stages.

Future research directions could explore adaptive iteration strategies, where the network uses the extracted scene prior to automatically determine the optimal number of pruning steps required for a specific image pair.

Summary updated

BibTeX
@inproceedings{liao2024vsformer,
  author = {Tangfei Liao and Xiaoqin Zhang and Li Zhao and Tao Wang and Guobao Xiao},
  title = {{VSFormer: Visual-Spatial Fusion Transformer for Correspondence Pruning}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2024},
  doi = {10.1609/aaai.v38i4.28123},
}
Figure