DISK

Tyszkiewicz 2020 · Paper

One-line summary — Trains a joint keypoint detector and descriptor end-to-end with policy gradients, treating discrete keypoint selection as a stochastic policy whose reward is the number of correct downstream matches.

Problem

Local feature frameworks are difficult to learn end-to-end because of the discreteness inherent to selecting and matching sparse keypoints: NMS and top-kk selection are non-differentiable. Prior methods worked around this with proxy losses or inexact approximations — SuperPoint’s homographic adaptation, R2D2’s reliability maps, or descriptor-space assumptions — none of which directly optimizes what actually matters: the number of correct matches. DISK (DIScrete Keypoints) instead leverages reinforcement learning with a probabilistic model expressive enough to keep training and inference regimes close, while converging reliably from scratch.

Method & architecture

A U-Net (4 down/up blocks, 1.1M parameters, receptive field 219×219) maps an image II to a detection heatmap KK plus a dense N=128N{=}128-dimensional descriptor map. Everything downstream is defined as distributions so that gradients of expected reward can be estimated.

Feature distribution. The heatmap is split into h×hh \times h grid cells (h=8h{=}8); at most one feature is sampled per cell uu with heatmap crop KuK^u. A pixel p\mathbf{p} is proposed with relative probability and then accepted with absolute probability, giving

P(pKu)=softmax(Ku)pσ(Kpu)P(\mathbf{p} \mid K^u) = \mathrm{softmax}(K^u)_\mathbf{p} \cdot \sigma(K^u_\mathbf{p})

where σ\sigma is a sigmoid. Accepted locations take the 2\ell_2-normalized descriptor at that pixel. At inference, softmax becomes argmax and the sigmoid a sign function, plus NMS over the heatmap.

Match distribution. Cycle-consistent matching is relaxed: with descriptor distance matrix d\mathbf{d}, forward matches are drawn from PAB(jd,i)=softmax(τd(i,))jP_{A \to B}(j \mid \mathbf{d}, i) = \mathrm{softmax}(-\tau\, \mathbf{d}(i,\cdot))_j (reverse analogously from columns), and iji \leftrightarrow j match iff both directions are sampled. The match probability has closed form P(ij)=PAB(jd,i)PBA(id,j)P(i \leftrightarrow j) = P_{A \to B}(j \mid \mathbf{d}, i) \cdot P_{B \to A}(i \mid \mathbf{d}, j), so matching adds no variance to the gradient estimate — key to stable convergence.

Reward. R(MAB)=(i,j)r(ij)R(M_{AB}) = \sum_{(i,j)} r(i \leftrightarrow j) with λtp=1\lambda_{\mathrm{tp}} = 1 for correct matches (both points within ϵ\epsilon px of their depth-based reprojections), λfp=0.25\lambda_{\mathrm{fp}} = -0.25 for incorrect ones, neutral for “plausible” matches (no depth, but epipolar distance below ϵ\epsilon), plus a small per-keypoint penalty λkp=0.001\lambda_{\mathrm{kp}} = -0.001 to discourage unmatchable clutter.

Gradient estimator (REINFORCE-style, exact over matches). With FA,FBF_A, F_B sampled from the feature distributions:

θEMABR(MAB)=EFA,FBi,jP(ijFA,FB,θM)r(ij)θΓij\nabla_\theta \mathbb{E}_{M_{AB}} R(M_{AB}) = \mathbb{E}_{F_A, F_B} \sum_{i,j} P(i \leftrightarrow j \mid F_A, F_B, \theta_M)\, r(i \leftrightarrow j)\, \nabla_\theta \Gamma_{ij}

Γij=logP(ijFA,FB,θM)+logP(FA,iA,θF)+logP(FB,jB,θF)\Gamma_{ij} = \log P(i \leftrightarrow j \mid F_A, F_B, \theta_M) + \log P(F_{A,i} \mid A, \theta_F) + \log P(F_{B,j} \mid B, \theta_F)

Training. MegaDepth subset (135 scenes, 63k images, COLMAP poses/depth); triplets of co-visible images give three pairs per batch element; images at 768 px; Adam, lr 10410^{-4}; λfp\lambda_{\mathrm{fp}} and λkp\lambda_{\mathrm{kp}} annealed from 0 over the first 5 epochs so the randomly initialized network is not driven to detect nothing.

Results

Why it matters for SLAM

DISK proved that optimizing matching success directly beats hand-designed proxy losses, and it became one of the standard learned front-end features alongside SuperPoint and R2D2. Its uniform spatial distribution of keypoints benefits SLAM systems that need constraints across the whole image, and it is supported as a feature backbone in LightGlue, making it a plug-and-play choice in the hloc localization pipeline.