RANSAC Scoring Done Right

James Pritts, Felix Seegräber, Kevin KöserNeurIPS 2026

TL;DR

For over four decades, RANSAC—computer vision’s workhorse for fitting models to noisy, outlier-ridden data—has relied on a fragile, hand-tuned threshold to separate clean data from junk. By simply reversing the order of mathematical operations during scoring, the authors integrate out the unknown noise level entirely in closed form. The result is a fast, drop-in scoring algorithm that barely flinches when its settings are miscalibrated and needs almost zero validation data to tune.

What Problem Does This Paper Address?

Suppose you are trying to stitch two photos together. You match visual features between them, but many matches are wildly wrong (outliers), and even the good matches (inliers) jitter slightly due to sensor noise. RANSAC (Random Sample Consensus) solves this by proposing thousands of candidate geometric models and picking the one with the best score.

Here is the catch: almost every popular RANSAC variant—whether classic inlier-counting, MSAC, MLESAC, or even "threshold-free" methods like MAGSAC++—requires a hyperparameter tied to the inlier scale ($\sigma$), the standard deviation of the true sensor noise. Guessing $\sigma$ on contaminated data is notoriously tricky, and misjudging it degrades accuracy rapidly.

Under the hood, standard probabilistic RANSAC models data as a mixture: inliers follow a bell curve (Gaussian), and outliers follow a flat background (uniform). Standard methods eliminate the unknown "inlier/outlier" labels first, which leaves $\sigma$ stuck inside the formula as a hard threshold. The authors ask: what happens if we eliminate $\sigma$ first instead?

Methods

The authors introduce the profile-marginal score by flipping the order of inference:

  1. Marginalize the noise scale first: Hold a candidate partition of inliers and outliers fixed. Because the inliers are modeled as a zero-mean Gaussian, placing a conjugate Inverse-Gamma (IG) prior on the noise variance $\sigma^2$ allows $\sigma$ to be integrated out analytically in closed form. $\sigma$ vanishes completely from the formula.
  2. Optimize over partitions via Sort-and-Sweep: Now, find the best inlier/outlier split. Because swapping a distant point for a closer one always improves fit quality, the optimal set of inliers for a candidate model is guaranteed to be a prefix of points sorted by their distance to the model. One radix sort ($O(N)$) followed by a single linear sweep ($O(N)$) finds the exact global maximum, adding just 9–20 $\mu\text{s}$ per hypothesis over MSAC.

This single closed-form equation seamlessly spans three variants:

  • Jeffreys: Uses an uninformative prior ($\alpha_0, \beta_0 \to 0$), requiring zero ground-truth training data.
  • IG-MLE & IG-Robust: Empirical-Bayes variants that learn prior "pseudo-observations" from annotated validation pairs (via maximum likelihood or a heavy-tail-resistant median, respectively) to regularize estimates when inliers are scarce.

The only remaining knob is $a$, the half-width of the uniform outlier domain (e.g., normalized image size).

Datasets

To isolate the scoring function from bells and whistles like guided sampling, the authors evaluate shared pools of 1,000 minimal-sample hypotheses per image pair across ~70,000 pairs spanning three distinct two-view geometry tasks:

  • PhotoTourism (PT): 44,211 landmark pairs with RootSIFT features for Essential matrix estimation.
  • ETH3D: 3,039 pairs with learned SuperPoint + LightGlue features for Fundamental matrix estimation.
  • Homography Estimation Benchmark (HEB): 21,999 architectural pairs with SIFT features for Homography estimation (a brutal "low-cardinality" stress test averaging only ~10 true inliers per dominant plane amid 96% structured outliers from competing surfaces).

Key Insights and Ideas

  • Square-rooted logarithmic armor: Standard methods have decision boundaries directly proportional to their hyperparameter—off by $2\times$ means your threshold is off by $2\times$. Here, the implicit decision boundary depends on $a$ via $\sqrt{\log a}$. Overestimating $a$ by $10\times$ shifts the effective boundary by only 24–45%!
  • Self-adapting per hypothesis: Rather than enforcing one global noise threshold across an entire dataset, the score implicitly estimates scale per model hypothesis, automatically tightening its boundary when outliers get denser.
  • Prior as a smart safety net: Integrating out $\sigma^2$ turns the inlier model into a Student-$t$ distribution. When a pair has plenty of inliers (PT, ETH3D), the data overwhelms the prior and all three proposed variants converge. When inliers are scarce (HEB), IG-Robust acts as two stabilizing "pseudo-residuals" that prevent noisy variance estimates from derailing model selection.
Figure 1: Profile across three datasets, one per geometric problem: PT / E (left), ETH3D / F (middle), HEB / H (right). Each panel plots, as solid lines, the median rotation error across all pairs in the dataset versus each method’s hyperparameter on a log axis, swept exhaustively over a two- decade interval. Color-matched dashed horizontal lines mark each method’s achievable performance when its hyperparameter is free to be tuned per pair to select the model closest to the ground truth; a large gap to the solid curve indicates hyperparameter-dependent model switching. Filled circles mark each method’s minimum on the fine grid; the axis is normalized by the coarse-search optimum, so x = 1 need not be a minimum. Shaded bands are 95% bootstrap confidence intervals on the median. In the data-rich regime (PT, ETH3D) our variants are remarkably robust to hyperparameter miscalibration, with curves nearly flat across the full two-decade window where threshold-based baselines degrade markedly. On HEB—the data-scarce regime—the IG-Robust prior regularizes the score and outperforms the baselines over most of the hyperparameter interval (cf. Section 3.2).

Key Results

  • Extreme robustness to miscalibration: Sweeping hyperparameters across two orders of magnitude (Figure 1), the proposed methods vary by $<0.02^\circ$ median rotation error on PhotoTourism, while threshold-based baselines degrade by $0.8^\circ\text{--}2.9^\circ$. Under extreme $128\times$ hyperparameter inflation on held-out test scenes, the new score retains $0.490$ mAA@$10^\circ$ versus at most $0.134$ for baselines.
  • 128$\times$ less validation data needed: With a validation budget of just 2 image pairs on PhotoTourism, the proposed variants land within $0.006^\circ$ of their optimal $0.77^\circ$ error floor (with tiny cross-trial standard deviation of $0.002^\circ\text{--}0.019^\circ$). MSAC, GaU, and MAGSAC++ require ~1,024 pairs ($128\times\text{--}512\times$ more data) to reach the same accuracy.
  • Data-scarce dominance: On HEB, IG-Robust achieves the best asymptotic error ($7.65^\circ$ vs. $7.85^\circ$ for the best baseline) and lowest variance.
  • Full pipeline: Plugged into a complete RANSAC pipeline, the score beats SupeRANSAC across all tested scale miscalibrations while running faster at calibration (50 ms vs. 111 ms per pair).

Limitations and Future Work

  • Scale-free, not hyperparameter-free: You still have to set the outlier half-width $a$, even if the algorithm is remarkably forgiving about its exact value.
  • Small inlier sets vs. annotation needs: The training-free Jeffreys variant becomes unreliable when true inlier counts approach the model's minimal degrees of freedom; conversely, IG-Robust handles small sets well but requires ground-truth matches during validation to set its prior.
  • Structured outliers & scope: Like standard RANSAC scores, the underlying Gaussian–uniform mixture assumes outliers are uniformly spread—it does not explicitly model coherent, competing geometric structures (such as secondary walls in HEB). Finally, experiments focus strictly on two-view geometry; future work could extend this framework to broader 3D and multi-model fitting problems.

Summary updated

Abstract

The most widely used RANSAC variants score a candidate model by summing per-point scores that fall to zero beyond a threshold. These scores derive from the negative log-likelihood of a Gaussian-uniform mixture. The threshold separates inliers, which follow the noise model, from outliers, and it is a function of the observation noise level, also known as the inlier scale. We remove this dependence on the threshold by reversing the usual order of RANSAC inference: rather than estimating the scale and then scoring against it, we marginalize the scale in closed form for a fixed inlier partition and then optimize over partitions. The resulting score is maximized by a single sort followed by a linear sweep. A single closed-form expression spans informative and non-informative priors, so the same score adapts to datasets with extensive or limited ground-truth annotation. The proposed score has a single hyperparameter, the half-width of the uniform outlier distribution. We show that this half-width is far less sensitive to miscalibration than the inlier threshold and is easier to cross-validate. The proposed score is the first likelihood-based RANSAC score in which the inlier scale is absent from the formula.
BibTeX
@inproceedings{pritts2026ransac,
  author = {James Pritts and Felix Seegräber and Kevin Köser},
  title = {{RANSAC Scoring Done Right}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=BK5yH67CQC},
}
Figure