---
title: 'DS-SAC: Deterministic Density Search Consensus'
url: https://www.emergentmind.com/topics/density-search-sample-consensus-ds-sac
type: topic
---

# DS-SAC: Deterministic Density Search Consensus

Searching arXiv for the specified DS-SAC and related papers to ground the article in current sources.
Density Search Sample Consensus (DS-SAC) is a deterministic robust estimation framework for geometric model fitting in computer vision that avoids repeated random minimal sampling by searching dense residual regions [2607.03972]. Introduced for homography, fundamental matrix, and essential matrix estimation, DS-SAC adheres to the standard consensus-maximization objective but replaces stochastic hypothesis generation with a procedure that starts from an initial model estimated from the available points, performs local exploration via forward and backward search, and then recursively partitions the point set using signed residuals to support global exploration [2607.03972]. In the cited literature, the name is distinct from DSAC, the differentiable counterpart of RANSAC for camera localization [1611.05705], and from DGSAC, a density-guided multi-model fitting pipeline based on Kernel Residual Density [2006.02413].

## 1. Definition and problem formulation

DS-SAC is designed for robust geometric model estimation from point correspondences, where the goal is to recover a parameter vector $\theta$—such as a homography $H$, a fundamental matrix $F$, or an essential matrix $E$—that explains as many input correspondences as possible despite outliers [2607.03972]. The method follows the consensus-maximization formulation
$$
\theta^*=\arg\max_{\theta}\sum_{i=1}^{n}\mathbb{1}(|r_i(\theta)|\le \tau),
$$
where $\tau$ is the inlier threshold and the indicator counts inliers whose residual falls within $\tau$ [2607.03972].

Its primary score is inlier count. As a tie-breaker between hypotheses that yield the same inlier count, DS-SAC uses MSAC’s truncated residual score
$$
C_{\mathrm{MSAC}(\theta)=\sum_{i=1}^{n}\max\left(1-\frac{d^2(x_i,\theta)}{T^2},\,0\right),
$$
where $d(\cdot,\theta)$ is the task-specific distance and $T$ is the inlier threshold [2607.03972]. Final model selection is therefore the lexicographic maximum of inlier count and MSAC score [2607.03972].

A central distinction is that DS-SAC needs two residual-related quantities. It uses a distance $d(x_i,\theta)\ge 0$ for scoring, selecting inliers, and least-squares fitting, and a signed residual $r_i(\theta)\in\mathbb{R}$ for splitting the set into two partitions during global exploration [2607.03972]. The sign of $r_i$ determines on which side of the partition each point lies. This suggests that DS-SAC is organized around a dual view of residuals: one metric for robust support measurement and one signed quantity for deterministic search-space decomposition.

## 2. Residual models for homography, fundamental matrix, and essential matrix

For homography estimation, DS-SAC considers homogeneous points $x=(u,v,1)^\top$ and $x'=(u',v',1)^\top$ under the constraint
$$
x' \sim Hx,\quad H\in\mathbb{R}^{3\times 3},\ \det(H)\neq 0
$$
[2607.03972]. The method uses the reprojection error as distance,
$$
d_{\mathrm{repr}((x,x'),H)}
=\left\| \frac{Hx}{(Hx)_3} - x'\right\|_2,
$$
while also noting the symmetric transfer error variant
$$
d_{\mathrm{sym}^2((x,x'),H)}
=\left\|\frac{Hx}{(Hx)_3}-x'\right\|_2^2
+\left\|\frac{H^{-1}x'}{(H^{-1}x')_3}-x\right\|_2^2
$$
[2607.03972]. For partitioning, DS-SAC uses a linearized algebraic signed residual derived from
$$
u h_{11}+v h_{12}+h_{13}
-
u'(u h_{31}+v h_{32}+h_{33})
=0,
$$
namely
$$
r\big((x,x'),H\big)=
u h_{11}+v h_{12}+h_{13}
-
u'(u h_{31}+v h_{32}+h_{33})
$$
[2607.03972].

For the fundamental matrix, DS-SAC uses the epipolar constraint
$$
x'^{\top}Fx=0,
$$
with $F\in\mathbb{R}^{3\times 3}$ of rank two [2607.03972]. The scoring distance is the Sampson distance,
$$
d\big((x,x'),F\big)=
\frac{\big(x'^{\top}Fx\big)^2}
{(\,Fx\,)_1^2+(\,Fx\,)_2^2+(\,F^{\top}x'\,)_1^2+(\,F^{\top}x'\,)_2^2},
$$
and the signed residual is
$$
r\big((x,x'),F\big)=x'^{\top}Fx
$$
[2607.03972]. The paper states that DS-SAC estimates $F$ with the normalized eight-point algorithm for percentile-point optimization and applies bundle refinement thereafter [2607.03972].

For the essential matrix, the epipolar constraint is again
$$
x'^{\top}Ex=0,
$$
with $E\in\mathbb{R}^{3\times 3}$ of rank two and singular values $(\sigma,\sigma,0)$ [2607.03972]. DS-SAC uses
$$
d\big((x,x'),E\big)=
\frac{\big(x'^{\top}Ex\big)^2}
{(\,Ex\,)_1^2+(\,Ex\,)_2^2+(\,E^{\top}x'\,)_1^2+(\,E^{\top}x'\,)_2^2},
\quad
r\big((x,x'),E\big)=x'^{\top}Ex
$$
[2607.03972]. It uses the eight-point algorithm with rank enforcement for percentile-point updates and the five-point solver for inlier optimization, both on normalized points [2607.03972]. Pose recovery decomposes $E$ via SVD as $E=U\Sigma V^\top$, generates four $(R,t)$ candidates using the canonical matrices $W$ and $Z$, and selects the one with maximum points in front of both cameras by cheirality [2607.03972].

## 3. Deterministic density search algorithm

The algorithmic framework eliminates random minimal sampling and instead combines local density search with recursive partitioning [2607.03972]. In a current partition $S$, initially all points, the method first estimates
$$
\theta_{\mathrm{init}
=\arg\min_{\theta}\sum_{x_i\in S} d^2(x_i,\theta)
$$
by least squares over the partition [2607.03972]. For homography this uses DLT; for the fundamental matrix, normalized eight-point; and for the essential matrix, normalized eight-point with rank enforcement, all with data normalization for stability [2607.03972].

The forward search performs local inward exploration. Starting at $p_{\mathrm{partition}}=|S|/N$, it progressively shrinks the percentile $p$ by $\Delta p$ until $p_{\min}$ [2607.03972]. At each percentile, it computes distances, selects the $\lceil pN\rceil$ smallest-residual points, re-estimates the model by least squares on that set, and scores the result using inlier count and MSAC score [2607.03972]. It then performs inlier optimization by reselecting inliers under threshold $T$, enlarging the set to the top $M_{\min}$ closest points if necessary, and accepting a refined model if the score improves [2607.03972]. The best local model and the percentile at which it occurs are tracked as $\theta_{\mathrm{best,local}}$ and $p_{\mathrm{best}}$ [2607.03972].

Backward search provides local outward exploration. It initializes the current model with $\theta_{\mathrm{best,local}}$, then increases the percentile from $p_{\mathrm{best}}$ to $p_{\mathrm{bwd}}$, for example $p_{\mathrm{bwd}}=0.5\cdot p_{\mathrm{partition}}$, in steps of $\Delta p$ [2607.03972]. The same percentile-points optimization and inlier optimization steps are repeated to search for wider support around the dense residual core discovered in forward search [2607.03972]. The paper characterizes this as balancing precision and recall: forward search shrinks support to a dense residual core, improving precision, while backward search expands around that core to recover additional inliers, improving recall [2607.03972].

Global exploration is implemented by recursive signed-residual partitioning. Using $\theta_{\mathrm{split}}=\theta_{\mathrm{best,local}}$, DS-SAC divides the partition into
$$
S_1=\{x_i\in S\ |\ r(x_i,\theta_{\mathrm{split})\ge 0\},\quad
S_2=\{x_i\in S\ |\ r(x_i,\theta_{\mathrm{split})< 0\}
$$
and recurses on each valid child partition whose relative size satisfies $p_{\mathrm{partition}}\ge p_{\min}$ [2607.03972]. A global best model $\theta^*$ is updated whenever a local best model improves the global score [2607.03972]. The implementation also includes boundary handling: if the best split would place the partition boundary outside the current search space, the method re-scans forward without inlier optimization and picks the smallest-kernel model whose boundary lies within $S$, falling back to $\theta_{\mathrm{init}}$ if necessary [2607.03972].

Post-tuning starts from $\theta^*$ and progressively tightens thresholds using a schedule $T_i=k_i\cdot T$ with $k_1>k_2>\dots>k_L$ [2607.03972]. For each threshold, the method forms inliers, re-fits the model, and accepts the update only if the score improves [2607.03972]. This sharpening step is described as improving geometry without sacrificing consensus [2607.03972].

## 4. Complexity, parameters, and implementation characteristics

The paper analyzes the recursion as a binary tree over partitions and states that DS-SAC has polynomial complexity with respect to the number of points [2607.03972]. In the worst case of highly imbalanced splits, the tree height is approximately $N-1$, and with $\Delta p\ge 1/N$ the total iteration count is bounded by
$$
c_{\mathrm{total}=\frac{4}{\Delta p}\left(\sum_{k=0}^{N-1}\left(1-\frac{k}{N}\right)+\sum_{k=1}^{N-2}\frac{1}{N}\right)
$$
which for $\Delta p=1/N$ yields $c_{\mathrm{total}}\approx 2(N^2+3N-4)$, giving $O(N^2)$ complexity [2607.03972]. In the balanced case, the height is approximately $\log_2 N$, and the total iteration count is bounded by
$$
\frac{4}{\Delta p}\sum_{k=0}^{\log_2N}1 \le 4N(\log_2N+1),
$$
hence $O(N\log N)$ [2607.03972].

Per-iteration cost is dominated by distance evaluation, selecting the $\lceil pN\rceil$ smallest distances, and least-squares re-fitting [2607.03972]. Distance evaluation is $O(|S|)$; selecting the smallest distances is $O(|S|\log|S|)$ with sorting or $O(|S|)$ with selection; and DLT or eight-point re-fitting is $O(|B|)$ for linear systems, while five-point inlier optimization incurs polynomial root finding and bundle updates add small constant factors in practice [2607.03972]. The paper notes that precomputation of linear terms reduces repeated work [2607.03972].

The reported default parameters are $\Delta p=0.03$, $p_{\min}=0.2$, and $p_{\mathrm{bwd}}\approx 0.5\,p_{\mathrm{partition}}$ [2607.03972]. Thresholds are derived from chi-square statistics with expected noise $\sigma=0.3$: for epipolar geometry, $T=3.84\sigma^2$, and for homography, $T=5.99\sigma^2$ [2607.03972]. Minimal solver sizes are four points for homography, eight points for the fundamental matrix, and five points for essential-matrix inlier optimization together with eight points for percentile optimization [2607.03972]. A plausible implication is that DS-SAC is parameterized to behave more like a deterministic search schedule than like an iteration-budgeted sampler.

The paper also reports that practical runtimes are competitive due to a few hundred iterations on average, approximately 465–490 across tasks [2607.03972]. This is presented as one reason the polynomial search remains practical.

## 5. Empirical evaluation and comparative performance

The evaluation covers ScanNet1500, PhotoTourism (IMC’20 validation), LaMAR CAB, 7Scenes, ETH3D (13 training scenes), and KITTI VO, totaling 39,592 image pairs spanning indoor, outdoor, driving, and AR scenarios [2607.03972]. Features and matches are produced by SuperPoint and LightGlue [2607.03972]. Hartley normalization is used for homography and fundamental matrix estimation, while for the essential matrix the pipeline uses camera normalization followed by Hartley normalization for the eight-point step [2607.03972].

Relative pose error is defined as $\varepsilon=\max(\varepsilon_R,\varepsilon_t)$, where $\varepsilon_R$ is the rotation angle difference and $\varepsilon_t$ is the angle between translation directions [2607.03972]. The reported metrics are AUC at $5^\circ$, $10^\circ$, and $20^\circ$, median $\varepsilon$, average inliers, and runtime [2607.03972]. AUC is defined as the area under the recall-versus-threshold curve,
$$
\mathrm{AUC}@T_{\mathrm{AUC}=\frac{1}{T_{\mathrm{AUC}}\int_{0}^{T_{\mathrm{AUC}}}\mathrm{Recall}(\varepsilon)\,d\varepsilon.
$$
All baselines are evaluated with a fixed budget of 1000 iterations, whereas DS-SAC reports its average iterations [2607.03972].

| Task | DS-SAC summary | Comparison stated in the paper |
|---|---|---|
| Homography | AUC@5°=26.74, AUC@10°=40.90, AUC@20°=56.38, median $\varepsilon$=3.87°, inliers=55.68, time=0.007 s | Improves significantly in AUC and median $\varepsilon$, and is fastest |
| Fundamental matrix | AUC@5°=44.38, AUC@10°=57.29, AUC@20°=68.68, median $\varepsilon$=2.06°, inliers=283.29, time=0.008 s | Improves AUC and median $\varepsilon$ while being faster than GC-RANSAC |
| Essential matrix | AUC@5°=51.29, AUC@10°=63.87, AUC@20°=74.35, median $\varepsilon$=1.72°, inliers=275.46, time=0.015 s | Highest AUC at all thresholds and much lower runtime; GC-RANSAC has slightly lower median $\varepsilon$ |

For homography, the best baselines reported are LO-RANSAC with AUC@10°=34.89 and GC-RANSAC with AUC@20°=50.35, while DS-SAC reaches 40.90 and 56.38, respectively, with median $\varepsilon=3.87^\circ$ and runtime 0.007 s [2607.03972]. For the fundamental matrix, GC-RANSAC is reported as the strongest baseline with AUC@10°=55.42, AUC@20°=66.38, median $\varepsilon=2.29^\circ$, and time 0.032 s, compared with DS-SAC’s 57.29, 68.68, 2.06°, and 0.008 s [2607.03972]. For the essential matrix, DS-SAC achieves the highest AUC at all thresholds and much lower runtime, while GC-RANSAC attains a slightly lower median pose error of 1.39° compared with DS-SAC’s 1.72° [2607.03972].

Sensitivity studies report that smaller $\Delta p$ and smaller $p_{\min}$ allow finer search and slightly higher AUC but increase iterations, while iterations decrease nearly linearly with increasing $p_{\min}$ and also drop with larger $\Delta p$ [2607.03972]. Ablations show that removing backward search improves speed, for example to 0.005 s for the fundamental matrix, with marginal AUC drop, but essential matrix estimation loses more accuracy without backward search [2607.03972]. Without post-tuning, AUC and median $\varepsilon$ are slightly worse for the fundamental and essential matrix, while homography is largely unchanged [2607.03972].

## 6. Relation to RANSAC, DSAC, and DGSAC

DS-SAC is presented as an alternative to stochastic robust estimators such as RANSAC, LO-RANSAC, MAGSAC, and GC-RANSAC [2607.03972]. Those methods repeatedly draw random minimal samples and rely on the probability of obtaining all-inlier samples, which deteriorates with higher outlier ratios and larger minimal sample sizes [2607.03972]. By contrast, DS-SAC is deterministic: it uses no random sampling, no iteration budget linked to outlier ratio, systematic local refinement via percentile-based residual selection and inlier optimization, and global coverage via recursive signed-residual partitioning [2607.03972]. The paper characterizes deterministic progression as reducing variance across runs [2607.03972].

This deterministic DS-SAC should be distinguished from DSAC, introduced as “Differentiable SAmple Consensus,” a differentiable counterpart of RANSAC for deep learning pipelines [1611.05705]. DSAC replaces deterministic hypothesis selection with a probabilistic selection over hypotheses using a softmax over scores, allowing optimization of expected task loss through REINFORCE-style gradients [1611.05705]. The similarity in acronym can create confusion, but the underlying mechanisms are different: DS-SAC searches dense residual regions deterministically, whereas DSAC preserves a single-hypothesis selection paradigm while making it differentiable for end-to-end camera localization [1611.05705].

DS-SAC also differs from DGSAC, “Density Guided Sampling and Consensus,” which addresses robust multiple-model fitting using Kernel Residual Density, guided sampling, explanation scores, and model selection algorithms [2006.02413]. DGSAC remains sampling-based, though guided and automatically stopped, whereas DS-SAC explicitly avoids repeated random minimal sampling and instead performs deterministic density search plus recursive signed-residual partitioning [2006.02413; 2607.03972]. This suggests that the three similarly named methods occupy different methodological niches: differentiable robust selection in deep pipelines, density-guided multi-model fitting, and deterministic single-model consensus search.

## 7. Limitations, failure cases, and scope

The reported limitations of DS-SAC center on threshold sensitivity, partition quality, and geometric degeneracy [2607.03972]. Although MSAC tie-breaking mitigates threshold dependence, too-small $T$ lowers recall and too-large $T$ admits many outliers and hurts precision [2607.03972]. The signed-residual partitioning can also fail to isolate dense inlier modes when residual signs are largely random due to noise or severe mismatches, though the method mitigates this by choosing $\theta_{\mathrm{split}}$ after local optimization and by checking partition-boundary validity [2607.03972].

For essential matrix estimation, the paper explicitly notes that GC-RANSAC achieved slightly lower median pose error, while DS-SAC optimized AUC and runtime [2607.03972]. It further states that incorporating spatial coherence could further improve DS-SAC’s median [2607.03972]. In highly degenerate geometries or when inlier support is very sparse, DS-SAC relies on residual density, and if no dense mode exists, both DS-SAC and RANSAC variants are challenged [2607.03972].

The method’s scope is broad within single-model robust geometric estimation. The experiments cover homography, fundamental matrix, and essential matrix estimation on six large datasets [2607.03972]. The core ingredients—distance-based scoring, signed-residual partitioning, percentile-point optimization, inlier optimization, and recursive search—indicate a general-purpose deterministic alternative to stochastic consensus-based methods for problems where an appropriate signed residual can be defined [2607.03972]. A plausible implication is that the method’s applicability depends less on a specific minimal solver than on whether the residual structure admits stable density search and meaningful sign-based partitioning.

Source: https://www.emergentmind.com/topics/density-search-sample-consensus-ds-sac