{'fraction_non_alphanumeric': 0.029364474909029364, 'fraction_numerical': 0.00897012778200897, 'mean_word_length': 4.569274269557022, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
More Informed Random Sample Consensus

Random sample consensus (RANSAC) is a robust model-fitting algorithm. It is widely used in many fields including image-stitching and point cloud registration. In RANSAC, data is uniformly sampled for hypothesis generation. However, this uniform sampling strategy does not fully utilize all the information on many problems. In this paper, we propose a method that samples data with a L\'{e}vy distribution together with a data sorting algorithm. In the hypothesis sampling step of the proposed method, data is sorted with a sorting algorithm we proposed, which sorts data based on the likelihood of a data point being in the inlier set. Then, hypotheses are sampled from the sorted data with L\'{e}vy distribution. The proposed method is evaluated on both simulation and real-world public datasets. Our method shows better results compared with the uniform baseline method.


I. INTRODUCTION
The random sample consensus (RANSAC) [1] is a robust model parameter estimation algorithm that can work with data which contain a large proportion of outliers. Due to its robustness to outliers, RANSAC is widely used in many fields including signal estimation [2], image-stitching [3], visual odometry [4], pattern detection [5] and point cloud registration [6], [7].
However, the RANSAC algorithm requires long computation time [2] because it needs to test a large number of hypotheses to find a good model. The number of hypotheses is set by a formula that depends on the number of inliers. But, in practice, the number of inliers is typically unknown. Thus RANSAC may be used with fewer iterations. Also, the probability of getting a correct model estimation dramatically decreases when the initial inlier ratio is low [8]. Moreover, it has been observed that a noise-contaminated outlier-free hypothesis may lead to a bad model estimate, which further requires more hypotheses to be tested [9].
In this work, we propose More Informed Random Sample Consensus (MI-RANSAC) that samples data with a Lévy distribution on ranked data. In the hypothesis sampling step of our proposed method, data is ranked with a sorting metric we proposed, which sorts data based on the likelihood of a data point being from the inlier set. Then, hypotheses are sampled from the sorted data with Lévy distribution.
This Lévy distribution-based sampling strategy improves the probability of sampling a good hypothesis thus increase the chance of finding correct solutions. On the other hand, our method can converge to correct solutions with a similar probability with a smaller number of iterations. Our experiments on simulation and real-world data confirm the advantage of our method.

II. RELATED WORK
After RANSAC [1] proposed by Fischler and Bolles, research has been done to improve its performance. LO-RANSAC [9] proposes a local optimization step after the minimal sample model, which remedy an incorrect assumption that a model computed from outlier-free samples is consistent with all inliers. In MLESAC [10], Torr and Zisserman proposed a new way of accessing model quality by choosing the solution that maximizes the likelihood rather than just the number of inliers. It is reported to be superior to the inlier counting of the plain RANSAC and less sensitive to threshold setting [11]. A differentiable RANSAC layer is introduced in [12] that can be used in neural networks in an end-to-end manner which provides promising results. Latent RANSAC [13] presents an approach that can evaluate a hypothesis independent of input size. This method is based on the assumption that correct hypotheses are tightly clustered together in the latent parameter domain.
Among all the different improvements on RANSAC, a few of them are closely related to our method. PROSAC [14] orders the set of correspondences by a similarity function. Its samples are drawn from progressively larger sets of topranked correspondences. EVSAC [15] proposes a probabilistic parametric model that allows assigning a confidence value to each matching correspondence and thus accelerates iterations with hypothesis models. In NAPSAC [16] a new sampling strategy is proposed under the assumption that inliers tend to be closer to one another than outliers. GroupSAC [17] assumes that there exists some grouping between features in data. The grouping can come from prior information such as optical flow based clustering. To utilize this information, a binomial mixture model is introduced for sampling. Compared with these previous works, our method has a totally different sampling strategy with Lévy distribution.

III. METHOD
The overall steps of our proposed algorithm, as described in Algorithm 1, has a similar structure to RANSAC. First, input data X are ranked with a similarity metric. Then hypothesis samples are drawn from ranked data with a Lévy distribution rather than a uniform distribution as in the plain RANSAC. These hypotheses are tested to get a set of inlier points. Finally, the model which leads to the largest inlier set is selected as the result. For details of the ranking and sampling steps, we describe them in III-A and III-B respectively.
Sample a subset of m points with Lévy distribution from X r

A. Data ranking
In many RANSAC use cases, input data include matched point correspondence, such as in image matching and point cloud registration. For these cases, there is information useful to exploit. In our MI-RANSAC, we rank these correspondence pairs in descending order in terms of likelihood to be an inlier pair. Ranking data helps to put good pairs of point matches to the front and the ones that are more likely to be the wrong ones to the end. Different ranking methods can be used in our MI-RANSAC. Here, we use a simple yet efficient ranking metric. Given a pair of feature vectors (x 1 , x 2 ) from two points. We have Equation (1) maps the feature vector pair to a metric space r ∈ R. such that r > r when p(x 1 , x 2 ) > p(x 1 , x 2 ), where p(x 1 , x 2 ) denotes the probability of the point correspondence pair being a correct one.
We run experiments on Augmented ICL-NUIM dataset [18] and generate groundtruth correspondences by locating nearest neighbors after transforming point clouds to the world frame. We show the ranking results of this handcrafted ranking metric by visualizing the correct ratio at a specific index. We get Fig. 1.

B. Lévy sampling
Lévy Distribution is a probability distribution that is both continuous, for non-negative random variables, and stable. It follows probability distribution function as in (2).
where c is the scale parameter (c > 0) and µ is the location parameter. It is meaningful when x ≥ µ. We sample from Lévy distribution such that it can give more weight on top-ranked correspondences while not leave the less likely ones behind. It can also approximate uniform distribution so that it can degenerate to the plain RANSAC in the worst case. A special step needs to be considered because hypothesis sampling is integer index sampling. These indices are within a range. To solve this, we sample from truncated Lévy distribution in range [0, m]. Then we scale the random numbers to [0, n] and round them to the nearest integer. With the truncated Lévy distribution that follows a probability distribution function (PDF) as (2), we can get PDFs of different shape if they have different parameters. In Fig. 2, when we truncate and normalize the PDFs within (0, 100) with different µ, we get different curves. When µ → ∞, the curve is flatter thus more similar to the PDF of a uniform distribution. We also plot a histogram of sampled indices using the described sampling method. The plots are in Fig. 3. In this experiment, 400000 hypotheses with each hypothesis containing 4 point correspondences are sampled.  In order to test the performance of different hypotheses sampling strategies, we create a simulation that is informative and easy to perform. In this simulation, a vector of boolean is generated as input data. This vector simulates a set of feature correspondences with true as an inlier pair and false as an outlier pair. This vector is generated in a way that the indices of true elements follow truncated Lévy distribution. A visualization of one instance of such data is in Fig. 4, in which true elements are visualized as vertical lines. The data is generated such that vertical lines are denser on the left and sparser on the right to simulate ranked data.
In our experiments, we create boolean input vector data using Lévy distribution with µ = −10 and c = 1. The boolean vector will have true value on Lévy sampled index positions and false on all the other locations. We use 3000 as the length of data and 300 is the number of inliers.
We evaluate eight different hypothesis sampling strategies: We also change number of samples in a hypothesis from {2, 3, 4} and number of hypotheses from {10 2 , 10 3 , 10 4 , 10 5 , 10 6 } to explore performance difference under different coverage settings.
We run experiments with all the configurations specified above and plot results in Fig. 5. Under all the different sampling strategies, Lévy distributions with µ = −1 performs the best, much better than uniform sampling distribution. In Fig. 5 (a), when number of hypotheses go up, the results become less diverge. But when the hypotheses number is low, a more skewed distribution leads to a better result. More interestingly, In Fig. 5 (c), the performance is better with 10 5 hypotheses tested when u = −1 than the rest of u values even with an order of magnitude more hypotheses tested.

B. Point cloud registration
We further evaluate our method on the point cloud registration problem. We use the augmented ICL-NUIM point cloud registration dataset [18] to quantitatively analysis performance of our method. This dataset has four sets of point clouds and groundtruth rigid transformation between all possible point cloud pairs that overlap more than 30%. The evaluation metrics are precision and recall defined as in (3): where T P is true positive; T N is true negative; F P is false positive and F N is false negative. Both precision and recall are the higher the better. We compare the performance of our MI-RANSAC system to the baseline RANSAC that samples from a uniform distribution. We run experiments on this dataset with different sampling distributions. We use the same setting as in section IV-A: eight Lévy distributions and one uniform distribution. Experiments are repeated for 20 times to remove the influence of randomness on the final results. Results are shown in Fig. 6. Each curve is for a point cloud set.
In this result, we value more on a better recall because precision can be improved by post-processing but recall cannot. We can see that there are a few µ values that lead to better recall results than the baseline. There is consistency in the performance along µ. The performance starts low when µ is very small. Then it goes up when µ is around −50. Then converge to the performance of uniform distribution. From this figure, we can see a clear performance benefit. More importantly, from the performance curves, we notice that the best value for µ is consistent across all the data sequences, which means that the method generalizes well on different data.

V. CONCLUSION AND FUTURE WORK
In this work, we propose MI-RANSAC that samples data with a Lévy distribution after data ranking. The proposed method is evaluated on both simulation and real-world public datasets. In experiments, our method shows better results compared with the uniform baseline method.
In the future, we will explore more on the effect of changing the scale parameter c in the Lévy distribution. Another effort is to explore potential performance gain on real-world LiDAR-based point cloud data processing.