RoMa v2

Edstedt 2025 · Paper

One-line summary — Successor to RoMa that pushes dense feature matching to be “harder, better, faster, denser”: a DINOv3 multi-view Transformer matcher plus decoupled refiners with a custom CUDA correlation kernel, combining RoMa’s robustness with UFM-like speed while adding per-pixel error covariance.

Problem

Dense feature matching — estimating a warp WABRHA×WA×2\mathbf{W}^{A\mapsto B}\in\mathbb{R}^{H^A\times W^A\times 2} and confidence pAB\mathbf{p}^{A\mapsto B} for every pixel — has become the gold standard for two-view correspondence, but existing matchers still fail on many hard real-world scenarios (RUBIK exposes RoMa’s weakness under extreme viewpoint change) and the high-precision models are slow. UFM showed dense matching can be much faster, but fine-tunes its backbone (hurting extreme-appearance robustness on WxBS) and loses sub-pixel precision. RoMa v2 sets out to combine both strengths.

Method & architecture

Decoupled two-stage pipeline. Matching and refinement are trained in two separate stages (UFM-style) instead of jointly with detached gradients (RoMa-style), enabling rapid experimentation: the coarse matcher trains 300k steps at batch 128 (~38M pairs), is then frozen, and three refiners train 300k steps at batch 64 (~19M pairs).

Coarse matcher (stride 4). Frozen DINOv3 ViT-L replaces DINOv2 (linear-probe EPE 19.0 vs 27.1, robustness 86.4% vs 77.0%). Features from both images pass through a ViT-B multi-view Transformer alternating frame-wise and global attention (VGGT-style, normalized-grid RoPE). RoMa’s Gaussian Process match encoder is replaced by single-headed attention over the similarity matrix Smn=exp(1τcossim(zmA,znB))\mathcal{S}_{mn}=\exp(\tfrac{1}{\tau}\,\text{cossim}(\mathbf{z}^A_m,\mathbf{z}^B_n)), with an auxiliary dense NLL target on the best-matching patch:

LNLL=m=1Mlog(Softmax(Sm)n),\mathcal{L}_{\text{NLL}}=\sum_{m=1}^{M}-\log(\operatorname{Softmax}(\mathcal{S}_m)_{n^*}),

where nn^* is the patch closest to the ground-truth warp. A DPT head decodes match embeddings + DINOv3 features into warp and confidence at 1/4 resolution. Full matcher loss: Lmatcher=LNLL+Lwarp+102Loverlap\mathcal{L}_{\text{matcher}}=\mathcal{L}_{\text{NLL}}+\mathcal{L}_{\text{warp}}+10^{-2}\mathcal{L}_{\text{overlap}}.

Refiners (strides 4, 2, 1) with a custom CUDA kernel. RoMa-like ConvNet refiners, but the memory-hungry local-correlation op is rewritten as a custom CUDA/PyTorch-extension kernel and channel dims are powers of two. Warp supervision uses the generalized Charbonnier loss Lwarp=(ic)α(r2/(ic)2+1)α/2\mathcal{L}_{\text{warp}}=(ic)^{\alpha}\left(\lVert\mathbf{r}\rVert^{2}/(ic)^{2}+1\right)^{\alpha/2} with α=0.5\alpha=0.5, c=103c=10^{-3}, stride i{4,2,1}i\in\{4,2,1\}; overlap uses pixel-wise BCE. An EMA of weights (decay 0.999) removes a random ±0.1 px sub-pixel prediction bias observed during training.

Predictive covariance. Unlike RoMa/UFM, refiners predict a per-pixel 2×22\times 2 precision matrix of the residual rθ=WθABWGTAB\mathbf{r}_\theta=\mathbf{W}^{A\mapsto B}_\theta-\mathbf{W}^{A\mapsto B}_{\text{GT}} via Cholesky factors (Σ1=LL\Sigma^{-1}=LL^{\top}, Softplus-constrained diagonal), trained by Gaussian NLL Lprecision=12rΣ1r12logdet(Σ1)+log(2π)\mathcal{L}_{\text{precision}}=\frac{1}{2}\mathbf{r}^{\top}\Sigma^{-1}\mathbf{r}-\frac{1}{2}\log\det(\Sigma^{-1})+\log(2\pi) on covisible pixels with r<8\lVert\mathbf{r}\rVert<8 px, accumulated hierarchically across strides.

Curated data mixture. Ten datasets instead of RoMa’s MegaDepth-only: wide-baseline (MegaDepth, AerialMD, BlendedMVS, Hypersim, TartanAir v2, Map-Free, ScanNet++ v2) plus small-baseline (FlyingThings3D, VKITTI2, UnrealStereo4k), 5069 scenes total — aerial data buys robustness to large rotations and air-to-ground views; small-baseline data buys fine-grained detail and textureless-surface prediction.

Results

Why it matters for SLAM

Dense, certainty-aware matching is becoming the front-end of choice for relocalization, loop closure, and offline mapping under extreme appearance change, and the RoMa line is its reference implementation. Speed was the main obstacle to using RoMa-class matchers online in SLAM; RoMa v2’s 1.7× speedup and memory-lean refinement narrow that gap. The per-pixel error covariance is directly consumable by SLAM back-ends — weighting residuals in RANSAC and pose refinement exactly as an estimation pipeline expects — and the model is the natural feature backbone for MASt3R-style two-view reconstruction.