RLSAC: Reinforcement Learning enhanced Sample Consensus for End-to-End Robust Estimation

Chang Nie, Guangming Wang, Zhe Liu, Luca Cavalli, Marc Pollefeys, Hesheng Wang

Abstract

Robust estimation is a fundamental task in computer vision, typically addressed by the Random Sample Consensus (RANSAC) algorithm. However, RANSAC's uniform sampling strategy becomes computationally prohibitive in high-outlier environments and lacks differentiability for end-to-end learning. This paper presents RLSAC, a novel framework that reformulates sampling consensus as a Markov Decision Process (MDP). By utilizing a Reinforcement Learning (RL) agent—specifically a Graph Neural Network—RLSAC learns to select optimal minimum sets based on a state representation enriched with "memory features." These features, including previous actions and model residuals, allow the agent to iteratively refine its search. Evaluated on 2D line fitting and fundamental matrix estimation, RLSAC achieves state-of-the-art results, demonstrating superior resilience to noise and significantly improved convergence rates compared to traditional methods.

Introduction

Robust estimation involves fitting mathematical models to data contaminated with outliers. The industry standard, RANSAC (Random Sample Consensus), repeatedly selects a random "minimum set" of points to generate hypotheses. While effective, RANSAC is "blind"—it samples points uniformly without learning from previous failures. As outlier rates increase, the probability of selecting a clean sample set drops exponentially, leading to failure or excessive iterations. RLSAC addresses these limitations by replacing random sampling with a learned, state-aware agent.

Methods: The RLSAC Framework

RLSAC remodels the sampling consensus process as a Markov Decision Process (MDP) solved via Reinforcement Learning. The framework consists of an agent and an environment that interact in a loop to find the best model hypothesis.

The RLSAC framework remodels sampling consensus as a Reinforcement Learning loop.

The core components include:

  • The Agent: A Graph Neural Network (specifically using EdgeConv layers from DGCNN) that processes data points. It outputs a probability distribution over all points, indicating which ones are likely to belong to a "good" minimum set.
  • The Environment: Executes the action (sampling the $m$ points with highest probability), generates a hypothesis, and calculates the reward.
  • The Reward: The Inlier Ratio of the generated hypothesis. Because the reward comes directly from the task's success, the model can be trained unsupervised—it doesn't need ground-truth labels of which points are "real" inliers.

State-Aware Sampling with Memory Features

A key innovation is the use of Memory Features in the state vector. Instead of raw data alone, the agent receives a state augmented with information from previous iterations, allowing it to "walk" toward the ground truth.

The state transition mechanism incorporates memory features (action, residual, and history) to guide the agent.

The state transition incorporates three types of memory features:

  1. Action Features: Which points were picked in the last step?
  2. Residual Features: How well did the previous model fit every point in the dataset?
  3. Historical Features: How many times has each point been sampled across the entire episode?

Experimental Results

The paper evaluates RLSAC on two main tasks: 2D line fitting and fundamental matrix estimation.

  • Fundamental Matrix Estimation: Using the CVPR 2020 RANSAC Tutorial dataset, RLSAC achieved a Mean Average Accuracy (mAA@10°) of 0.760, outperforming RANSAC (0.644), USAC (0.741), and the previous state-of-the-art, MAGSAC++ (0.753).
  • High Outlier Resilience: In 2D line fitting with a 70% outlier rate, RLSAC maintained an mAA of 0.824, while standard RANSAC plummeted to 0.608.
  • Efficiency: RLSAC can reach high accuracy in as few as 100 iterations, whereas traditional methods often require 1,000+ iterations to achieve comparable results in noisy environments.

Conclusion

RLSAC demonstrates that framing robust estimation as an RL problem significantly improves efficiency and accuracy in noisy environments. By leveraging memory features and a GNN-based agent, RLSAC learns an intelligent sampling policy that outperforms traditional random sampling. Future work includes scaling to larger point sets and integrating additional semantic features to further guide the estimation process.

Summary updated

BibTeX
@inproceedings{nie2023rlsac,
  author = {Chang Nie and Guangming Wang and Zhe Liu and Luca Cavalli and Marc Pollefeys and Hesheng Wang},
  title = {{RLSAC: Reinforcement Learning enhanced Sample Consensus for End-to-End Robust Estimation}},
  booktitle = {IEEE/CVF International Conference on Computer Vision},
  year = {2023},
}
Figure