KeyNet

Barroso-Laguna 2019 · Paper

One-line summary — Learned keypoint detector (Key.Net) that combines handcrafted derivative filters with a few learned CNN layers in a shallow multi-scale architecture, trained to maximize keypoint repeatability across scales.

Problem

Classical detectors (Harris, DoG) are built from handcrafted derivative filters and scale-space heuristics: interpretable and cheap, but not optimized for the property that matters downstream — repeatability under real viewpoint and scale changes. Fully learned detectors go to the other extreme, and by 2019 their advantage over handcrafted ones had not been clearly demonstrated: CNN detectors struggled especially with scale, wasting capacity rediscovering gradient structure. Key.Net asks whether a small network seeded with the right handcrafted structure can beat both.

Method & architecture

Handcrafted + learned filters. The first layer is a frozen bank of 10 derivative-based filters in the spirit of Harris and Hessian: first-order maps IxI_x, IyI_y, IxIyI_x I_y, Ix2I_x^2, Iy2I_y^2 and second-order IxxI_{xx}, IyyI_{yy}, IxyI_{xy}, IxxIyyI_{xx} I_{yy}, Ixy2I_{xy}^2. These act as soft anchors; three learned blocks (each an M=8M=8-filter 5x5 convolution + batch norm + ReLU) then localize, score and rank features. The hardcoded filters cut learnable parameters and stabilize training.

Scale-space inside the network. The input is processed at three pyramid levels (blurred and downsampled by 1.2), all streams sharing weights; feature maps are upsampled, concatenated, and fused by a final learned filter into a single response map R\mathcal{R}. Ablation: one level gives 72.5 validation repeatability, three levels 79.1, more than three adds little.

Index Proposal (IP) layer. To train through keypoint extraction differentiably, each N×NN\times N window wiw_i of R\mathcal{R} is turned into soft coordinates by a spatial softmax,

mi(u,v)=ewi(u,v)j,kNewi(j,k),[xi,yi]T=u,vN[Wmi,  WTmi]T+cwm_{i}(u,v)=\frac{e^{w_{i}(u,v)}}{\sum_{j,k}^{N}e^{w_{i}(j,k)}}, \qquad [x_{i},y_{i}]^{T}=\sum_{u,v}^{N}[W\odot m_{i},\;W^{T}\odot m_{i}]^{T}+c_{w}

a differentiable stand-in for non-maximum suppression (WW holds index values, cwc_w is the window corner). With ground-truth homography Hb,aH_{b,a} between images Ia,IbI_a, I_b, the covariant-constraint loss regresses IP coordinates in one image onto NMS maxima in the other:

LIP(Ia,Ib,Ha,b,N)=iαi[xi,yi]aTHb,a[x^i,y^i]bT2,αi=Ra(xi,yi)+Rb(x^i,y^i)\mathcal{L}_{IP}(I_{a},I_{b},H_{a,b},N)=\sum_{i}\alpha_{i}\,\|[x_{i},y_{i}]^{T}_{a}-H_{b,a}[\hat{x}_{i},\hat{y}_{i}]^{T}_{b}\|^{2}, \quad \alpha_{i}=\mathcal{R}_{a}(x_{i},y_{i})+\mathcal{R}_{b}(\hat{x}_{i},\hat{y}_{i})

so only significant features contribute; losses are computed symmetrically in both directions.

Multi-Scale Index Proposal (M-SIP). The loss is averaged over window sizes Ns{8,16,24,32,40}N_s\in\{8,16,24,32,40\} with weights λs{256,64,16,4,1}\lambda_s\in\{256,64,16,4,1\}:

LMSIP(Ia,Ib,Ha,b)=sλsLIP(Ia,Ib,Ha,b,Ns)\mathcal{L}_{MSIP}(I_{a},I_{b},H_{a,b})=\sum_{s}\lambda_{s}\,\mathcal{L}_{IP}(I_{a},I_{b},H_{a,b},N_{s})

forcing the network to score highest the keypoints that stay dominant across context sizes — scoring and ranking emerge from the loss itself. Ablation: all five windows give 79.1 repeatability vs 70.5 for the 8x8 window alone.

Cheap training data. 12,000 image pairs of size 192x192 generated from ImageNet with random scale [0.5, 3.5], skew, rotation (±60°) and photometric jitter — ground-truth correspondence for free, no manual annotation. A siamese pair of Key.Nets converges in ~30 epochs (~2h on a GTX 1080 Ti).

Results

Why it matters for SLAM

SLAM front-ends live or die by detector repeatability: if the same 3D point is not re-detected across frames, no descriptor can save the match. Key.Net showed that injecting classical detector priors (handcrafted filters, scale space) into a small learned model beats both purely handcrafted and purely learned detectors on repeatability while staying light enough for real-time pipelines — a design point directly relevant to embedded SLAM.