Table of Contents
Fetching ...

Fixing the RANSAC Stopping Criterion

Johannes Schönberger, Viktor Larsson, Marc Pollefeys

TL;DR

The main contribution of this paper lies in addressing a long-standing error baked into virtually any system building upon the RANSAC algorithm, leading to severe undersampling and thus failure to find good models.

Abstract

For several decades, RANSAC has been one of the most commonly used robust estimation algorithms for many problems in computer vision and related fields. The main contribution of this paper lies in addressing a long-standing error baked into virtually any system building upon the RANSAC algorithm. Since its inception in 1981 by Fischler and Bolles, many variants of RANSAC have been proposed on top of the same original idea relying on the fact that random sampling has a high likelihood of generating a good hypothesis from minimal subsets of measurements. An approximation to the sampling probability was originally derived by the paper in 1981 in support of adaptively stopping RANSAC and is, as such, used in the vast majority of today's RANSAC variants and implementations. The impact of this approximation has since not been questioned or thoroughly studied by any of the later works. As we theoretically derive and practically demonstrate in this paper, the approximation leads to severe undersampling and thus failure to find good models. The discrepancy is especially pronounced in challenging scenarios with few inliers and high model complexity. An implementation of computing the exact probability is surprisingly simple yet highly effective and has potentially drastic impact across a large range of computer vision systems.

Fixing the RANSAC Stopping Criterion

TL;DR

The main contribution of this paper lies in addressing a long-standing error baked into virtually any system building upon the RANSAC algorithm, leading to severe undersampling and thus failure to find good models.

Abstract

For several decades, RANSAC has been one of the most commonly used robust estimation algorithms for many problems in computer vision and related fields. The main contribution of this paper lies in addressing a long-standing error baked into virtually any system building upon the RANSAC algorithm. Since its inception in 1981 by Fischler and Bolles, many variants of RANSAC have been proposed on top of the same original idea relying on the fact that random sampling has a high likelihood of generating a good hypothesis from minimal subsets of measurements. An approximation to the sampling probability was originally derived by the paper in 1981 in support of adaptively stopping RANSAC and is, as such, used in the vast majority of today's RANSAC variants and implementations. The impact of this approximation has since not been questioned or thoroughly studied by any of the later works. As we theoretically derive and practically demonstrate in this paper, the approximation leads to severe undersampling and thus failure to find good models. The discrepancy is especially pronounced in challenging scenarios with few inliers and high model complexity. An implementation of computing the exact probability is surprisingly simple yet highly effective and has potentially drastic impact across a large range of computer vision systems.

Paper Structure

This paper contains 10 sections, 9 equations, 4 figures, 6 tables.

Figures (4)

  • Figure 1: Impact of approximation in RANSAC. The figure shows the accuracy (AUC@10$^\circ$, higher is better) against runtime for essential matrix estimation (see details in Section \ref{['sec:practical-impact']}). Each point on the curve corresponds to a target success probability $s$. The original RANSAC paper (Fischler and Bolles fischler1981random) introduces an approximation for the all-inlier probability (approx). This causes premature stopping for instances with few matches. Using the correct (exact) probability avoids this and yields a consistent improvement. Alternatively, it is possible to increase the hyperparameter $s$ such that the approximation reaches the same number of iterations as using the exact probability. However, as the graph shows, this leads to slower convergence as easy instances are then unnecessarily oversampled. In other words, one cannot simply adjust the target success probability when using the standard approximation.
  • Figure 2: Relative error $\epsilon = \tfrac{P_a-P_e}{P_a}$ in all-inlier probabilities. The error introduced by the approximation as a function of sample size $k$ and inlier ratio $p$. With few measurements (Left, $n=50$), the approximation is much worse. With more measurements (Right, $n=500$), the difference between the approximate and exact probability only appears for low inlier ratios and high sample sizes.
  • Figure 3: True success rate $s_{true}$ as a function of number of measurements. The graphs show the actual success rate attained when using the classic stopping criteria in RANSAC. For instances with fewer measurements, the approximate probability leads to early exits.
  • Figure 4: Amount of undersampling. The graph shows the relative difference of required iterations for the exact versus the approximate stopping criterion as $N_{e/a} = \tfrac{N_e - N_a}{N_a}$ to reach a target success probability $s = 0.99$ with a sample size $k = 5$. The approximation leads to severe undersampling in low inlier scenarios.