MaxCon (Maximum Consensus)

Maximum consensus is the optimization problem that RANSAC only approximately solves. Given measurements with residual functions ri(θ)r_i(\theta) and an inlier threshold ϵ\epsilon, find the model that agrees with as many measurements as possible:

θ=argmaxθ  {i:ri(θ)ϵ}\theta^* = \arg\max_{\theta}\; \bigl|\{\, i : |r_i(\theta)| \leq \epsilon \,\}\bigr|

The set being maximized is the consensus set (inlier set). Fitting a fundamental matrix, a homography, a camera pose, or a point-cloud registration “with the most inliers” are all instances of this one problem.

Why RANSAC is not the end of the story

RANSAC attacks maximum consensus by random minimal sampling: it returns a good consensus set with high probability, but

Studying maximum consensus as a proper optimization problem asks: what would it take to find the exact maximizer, deterministically?

Hardness and exact algorithms

The bad news is fundamental: maximum consensus is NP-hard in general — it is a combinatorial problem over which subset of measurements to trust, and no algorithm can solve all instances efficiently unless P = NP. The consensus objective is also nasty analytically: it is a piecewise-constant counting function of θ\theta, with zero gradient almost everywhere, so ordinary non-linear optimization cannot touch it directly.

Exact (globally optimal) methods therefore pay exponential worst-case cost, but can be practical for small problems:

maxθ,zizis.t.ri(θ)ϵ+M(1zi)\max_{\theta,\, z} \sum_i z_i \quad \text{s.t.} \quad |r_i(\theta)| \leq \epsilon + M(1 - z_i)

with a big constant MM, handing the problem to an off-the-shelf MIP solver.

A useful reformulation: maximizing consensus is equivalent to minimizing the number of violated constraints — an 0\ell_0-type objective. This viewpoint connects MaxCon to its tractable surrogates: relaxing 0\ell_0 toward 1\ell_1 or other convex losses gives convex relaxation approaches, and gradually deforming a robust kernel from convex to redescending gives graduated non-convexity (GNC). These give up exactness for polynomial runtime, sometimes with a-posteriori optimality certificates.

The practical landscape

ApproachGuaranteeCostTypical use
RANSAC / PROSACprobabilisticlowreal-time front-ends
Local/deterministic refinementlocal optimumlow-mediumpolishing a RANSAC result
Convex relaxation / GNCnone or certifiablemediumrobust registration, pose graphs
BnB / tree search / MIPglobal optimumexponential worst caseoffline, safety-critical, small problems

Why it matters for SLAM

Every geometric estimation step in SLAM — essential matrix, PnP, loop-closure verification, point-cloud registration — is a consensus maximization problem under the hood. Real-time front-ends will keep using RANSAC-family heuristics, but knowing the exact problem clarifies what is being traded away: a randomized front-end can silently accept a suboptimal consensus set, and a single wrong loop closure built on it can bend the whole map. This motivates the certifiable robust estimation line of work (globally optimal rotation search, TEASER-style registration, GNC back-ends) that increasingly appears in SLAM systems where wrong answers are expensive.