Consensus-Adaptive RANSAC

Luca Cavalli, Daniel Barath, Marc Pollefeys, Viktor LarssonarXiv 2023 · DOI

Robust model estimation—the art of finding a geometric "truth" amidst a sea of noisy data and outliers—is a cornerstone of computer vision. Whether you are building a 3D map from photos (SfM) or helping a robot localize itself (SLAM), you are likely using RANSAC. In a new paper titled "Consensus-Adaptive RANSAC" (CA-RANSAC), researchers from ETH Zürich and Lund University propose a way to make this classic algorithm smarter by teaching it to learn from its own history.

The classic Random Sample Consensus (RANSAC) algorithm works by repeatedly picking a tiny random subset of data points, fitting a model, and seeing how many other points agree with it (the "consensus").

The problem is that RANSAC is inherently greedy and forgetful. It treats every iteration as a fresh start, looking only for the single highest-scoring model while ignoring the collective information gathered across hundreds of previous attempts. While variants like PROSAC use prior information to guide sampling, they don't adapt during the search. Conversely, methods like Iteratively Reweighted Least Squares (IRLS) are great at gradually refining a model based on consensus but are notoriously sensitive to high outlier ratios where RANSAC shines.

The authors sought to bridge this gap: How can we make RANSAC "aware" of the consensus it has seen so far to guide its future samples and final refinement?

Methods: Consensus-based Attention

The core innovation is the Consensus-based Attention mechanism. Instead of just counting inliers, CA-RANSAC maintains a "latent state" for every data point that evolves as the algorithm progresses.

The CA-RANSAC pipeline architecture, showing the iterative flow from feature encoding to model hypothesis generation and refinement.

The pipeline consists of several key stages:

  1. Attention via Correlation: A novel attention matrix measures the correlation of agreement between points across multiple model hypotheses. If two points consistently agree on the same models, the attention mechanism strengthens their connection.
  2. One-Step Transformer: A lightweight transformer layer updates the per-point state based on this attention. Crucially, this matrix isn't normalized like a standard transformer; instead, it preserves the "total consensus" signal, allowing the network to distinguish between points that are part of a strong consensus and those that are just noise.
  3. Adaptive Sampling: These updated states are decoded into inlier probabilities. The algorithm then prioritizes sampling points that have a high likelihood of being part of the true model.
  4. Weighted Refinement: In the final step, the model is refined using a robust non-linear optimizer (Levenberg-Marquardt), where each point is weighted by its learned inlier probability.

The entire pipeline is trained end-to-end, supervising the model based on the final pose accuracy and the correctness of the inlier classification.

Key Results

The authors evaluated CA-RANSAC on two primary tasks: Essential and Fundamental matrix estimation using datasets like PhotoTourism (outdoor) and ScanNet (indoor).

Quantitative comparison of CA-RANSAC against state-of-the-art baselines on the PhotoTourism dataset.

CA-RANSAC consistently outperformed top-tier baselines like USAC and MAGSAC++.

  • Outdoor Accuracy: On PhotoTourism with SuperGlue matches, CA-RANSAC achieved an AUC@5° of 75.1, compared to 69.9 for USAC and 70.6 for MAGSAC++.
  • Indoor Robustness: On the challenging ScanNet dataset, it improved the AUC@5° from 14.3 (LM-LO) to 19.5, a significant jump for indoor pose estimation.
  • Refinement Precision: The method showed a marked improvement in the "Med" (median error) and "AUC1" metrics, indicating that its learned weights lead to much more precise final model refinement than traditional hard-thresholding.

Conclusion

CA-RANSAC moves beyond the "greedy" nature of traditional RANSAC by using a lightweight attention mechanism to learn from the consensus found in previous iterations. By dynamically updating per-point inlier probabilities using a one-step transformer, it achieves state-of-the-art accuracy in essential and fundamental matrix estimation with minimal computational overhead. While it introduces a small neural overhead, the gains in robustness and precision make it a powerful new tool for robust geometric estimation.

Summary updated

BibTeX
@misc{cavalli2023consensus,
  author = {Luca Cavalli and Daniel Barath and Marc Pollefeys and Viktor Larsson},
  title = {{Consensus-Adaptive RANSAC}},
  year = {2023},
  eprint = {2307.14030},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2307.14030},
}
Figure