Profile

Settings

Loading…

← Papers

Help

FAQ

Which features require signing in?

You can read the commentary, paper info, Model Structure and related papers of public papers without signing in. Sign in to manage your account or contact us about your inquiries.

Can I upload a PDF file?

Upload papers with an arXiv or DOI link; the commentary is public to everyone. Papers whose source and terms of use can't be verified, so the commentary can't be made public, can't be uploaded. Uploading PDF files and keeping papers private are for subscribers only, and a paper uploaded as a file is saved as private only. Searching for official info by title runs only when you press the button.

Are the figures and AI commentary accurate?

Figures come only from the original paper, and only those whose terms of use are verified are shown. The commentary is written by AI and may be wrong. Check important claims, numbers and figure context against the evidence in the original paper.

I want to report a copyright issue.

Terms of use and the source of the original paper are on the Paper info tab. If there's a problem, choose "Paper content, figures and copyright" under Contact us and send the paper link, the part in question, and evidence that you hold the rights. Receiving your report doesn't confirm any rights or remove anything right away. You can see the result of the review under My inquiries.

I forgot my password.

If you signed up with email, use Forgot password in the sign-in window to reset it with your verified email. If you signed up with Google, Naver or Kakao, change your password with that service.

What should I include in an inquiry?

Tell us which screen you were on and what you were doing when the problem happened, along with the paper link. Don't include personal information such as passwords, API keys, verification codes or phone numbers. Inquiries and replies are stored in Refivu and you can see them under My inquiries.

How do I delete my account?

In Settings, under My account, press Delete account. Review what will be deleted and complete identity verification to delete your account. For other requests, choose "Account" under Contact us.

Paper commentary

LoFTR: Detector-Free Local Feature Matching with Transformers

LoFTR matches image pairs without detecting interest points first

  • Problem Detector-based matchers pick interest points first, so they fail in low-texture regions where no repeatable points appear. Without points there is nothing to match, however good the descriptor is.
  • Method LoFTR skips detection and predicts dense coarse matches with self and cross attention Transformer layers over CNN features. It then refines the selected matches to sub-pixel positions.
  • Results LoFTR-DS reaches 65.9 AUC on HPatches homography estimation, versus 53.9 for SP with SuperGlue.

Why detector-based matching stalls

Detector-based pipelines first select interest points and only then describe and match them, so a region where no repeatable interest point appears gives the matcher nothing to work with, however good the descriptor is. The authors stress that this is most visible indoors, where low-texture walls and repetitive patterns can cover most of the field of view.

Dense approaches that predict matches at every pixel avoid the detection step, but their convolutional features have a limited receptive field, so they cannot tell apart regions that look alike locally. The argument is that people resolve such regions by looking at the surrounding layout, for instance by relating a textureless patch to the nearby edges, which calls for a large receptive field in the feature extractor.

Dense coarse matches followed by refinement

A convolutional backbone with a feature pyramid network produces two feature maps per image: coarse features at 1/8 of the image dimension and fine features at 1/2. Matching is carried out on the coarse level, where the grid is small enough for dense correspondences to be computed affordably, and the fine level is kept for the later refinement.

The coarse feature maps of the two images are flattened into sequences of vectors and given a positional encoding before they enter the LoFTR module. Convolution is used for the first stage because its inductive biases, translation equivariance and locality, suit local feature extraction, and because its downsampling shortens the sequence the Transformer must process.

Each match is then fixed in two steps: a coarse selection on the transformed coarse features, followed by a correlation step on the fine features around every selected coarse match.

Self and cross attention in the LoFTR module

Self-attention takes the features of one image as both input and context, while cross-attention takes the features of one image as the query side and the other image as the context, and the direction is switched between layers. The two kinds of layers are interleaved Nc times, with Nc set to 4 in the default model.

Because each output feature is a weighted combination over all positions, the transformed features can depend on the whole image pair rather than a fixed neighbourhood, and the positional encoding lets them depend on location as well. A linear variant of attention is used to keep the cost of this global operation at a manageable level.

The paper's attention visualisations show a point on a textureless region drawing on the edges of nearby objects, which is the behaviour the global context is meant to produce.

Selecting coarse matches

The score between a location i in image A and a location j in image B is the inner product of their transformed features, scaled by a temperature, which can be written as \(S(i,j)=\frac{1}{\tau}\langle F^{tr}_A(i),F^{tr}_B(j)\rangle\). Two matching layers turn this score matrix into a confidence matrix: an optimal transport layer, which uses the negated score matrix as the cost of a partial assignment problem, or a dual-softmax, which applies softmax along both dimensions and multiplies the two results.

With dual-softmax the confidence is \(P_c(i,j)=\mathrm{softmax}(S(i,\cdot))_j\cdot\mathrm{softmax}(S(\cdot,j))_i\), which combines a row-wise and a column-wise normalisation and so favours pairs that agree in both directions. A coarse match is kept only if its confidence is at least \(\theta_c\), set to 0.2, and it is also a mutual nearest neighbour, which removes many outliers.

Sub-pixel refinement and training

For each coarse match, a window of size w by w is cropped around its position in the fine features of both images, and a smaller LoFTR module with Nf layers transforms the two windows, with Nf set to 1 and w set to 5. The centre feature of the first window is correlated with every position in the second window, and the expectation over the resulting heatmap gives the refined position with sub-pixel accuracy.

The coarse stage is trained with a negative log-likelihood over the confidence matrix, using ground-truth grid matches derived from the camera poses and depth maps, with the loss averaged over the set of ground-truth coarse matches. The formula is \(L_c=-\frac{1}{|M^{gt}_c|}\sum_{(\tilde i,\tilde j)\in M^{gt}_c}\log P_c(\tilde i,\tilde j)\), and the leading minus sign makes minimising the loss equivalent to maximising the log-likelihood of the correct grid pairs.

The fine stage uses an l2 distance between the refined position and the position warped with the ground-truth pose and depth, weighted by the inverse of the heatmap variance, and the variance is not back-propagated through. The full dual-softmax model runs at 116 ms per 640×480 pair on an RTX 2080Ti, and with the optimal transport layer and three sinkhorn iterations it runs at 130 ms.

Homography estimation on HPatches

HPatches contains 52 sequences with large illumination changes and 56 with large viewpoint changes, and every sequence pairs one reference image with five others. LoFTR was trained on MegaDepth for this test, with images resized to a shorter side of 480, and homographies were fitted with OpenCV RANSAC and scored by the corner error of the warped images.

LoFTR-DS reaches 65.9, 75.6 and 84.6 AUC at the 3, 5 and 10 pixel thresholds, while SP with SuperGlue reaches 53.9, 68.3 and 81.7, and the other detector-free and detector-based baselines are lower still. The gap to SP with SuperGlue is largest at 3 pixels and smaller at 10 pixels, and the authors describe the advantage as growing with a stricter correctness threshold.

The authors attribute the result to the larger number of candidate matches that a detector-free design yields and to the global receptive field of the Transformer, with the coarse-to-fine step adding sub-pixel precision. The comparison caps every method at 1K matches, but local features were limited to 2K features before mutual nearest neighbour matching, so the setup differs between the two groups.

Relative pose on ScanNet and MegaDepth

ScanNet contains 1613 monocular sequences, and the authors sample 230M training pairs with overlap scores between 0.4 and 0.8, then test on 1500 pairs at 640×480. Pose error is the maximum of the rotation and translation angular errors, scored as AUC at 5, 10 and 20 degrees.

On ScanNet, LoFTR-DS reaches 22.06, 40.8 and 57.62, and LoFTR-OT reaches 21.51, 40.39 and 57.96, against 16.16, 33.81 and 51.84 for SP with SuperGlue. The authors describe the two matching layers as performing comparably on ScanNet, and a DRC-Net model trained on MegaDepth scores 7.69, 17.93 and 30.49 in the same table. The LoFTR model trained on MegaDepth, marked with a dagger, reaches 16.88, 33.62 and 50.62 on ScanNet, which the authors use as the fair comparison to DRC-Net trained on MegaDepth.

On MegaDepth, LoFTR-DS reaches 52.8, 69.19 and 81.18 and LoFTR-OT reaches 50.31, 67.14 and 79.93, against 42.18, 61.16 and 75.96 for SP with SuperGlue and 27.01, 42.96 and 58.31 for DRC-Net. At AUC@10 degrees the authors report LoFTR outperforming DRC-Net by 61% and SuperGlue by 13%, and on this outdoor set LoFTR-DS is better than LoFTR-OT, which is the reverse of the indoor result.

Visual localization on Aachen and InLoc

The evaluation covers the Aachen Day-Night benchmark and the InLoc dataset, and it has two tracks: a full pipeline using HLoc with LoFTR matches, and a local feature track in which the matcher is evaluated alone.

On the night queries of the local feature track, LoFTR-DS reaches 72.8, 88.5 and 99.0, while SP with SuperGlue reaches 73.3, 88.0 and 98.4, so the baseline is higher at the tightest threshold. In the full localization track, LoFTR-OT reaches 88.7, 95.6 and 99.0 on day queries and 78.5, 90.6 and 99.0 on night queries, against 89.8, 96.1 and 99.4 and 77.0, 90.6 and 100.0 for SP with SuperGlue, which the authors describe as on par on night queries and slightly worse on day queries.

On the first InLoc column, HLoc with LoFTR-OT reaches 47.5, 72.2 and 84.8, against 49.0, 68.7 and 80.8 for HLoc with SuperPoint and SuperGlue, so LoFTR-OT is higher at the 0.5 m and 1.0 m thresholds and lower at 0.25 m. The authors credit the Transformer, the optimal transport layer and the detector-free design for the gain on InLoc, which they describe as containing appearance changes, more textureless areas and repetitive elements.

What the ablations isolate

Replacing the LoFTR module with convolution of comparable size lowers the 10 degree AUC to 32.04, against 40.8 for the full model, and the 5 degree AUC to 14.98, against 20.06. The full row of the ablation table is its own measurement and is not the same row as the LoFTR-OT entry of the main ScanNet table, so the two should not be compared directly.

A smaller model with 1/16 coarse and 1/4 fine resolution reaches 16.75, 34.82 and 54.0, and the authors report a running time of 104 ms with a degraded accuracy. Placing positional encoding at every layer, as in a DETR-style Transformer, reaches 18.02, 35.64 and 52.77, which the authors describe as a noticeable decline.

Doubling the layers to Nc = 8 and Nf = 2 gives 20.87, 40.23 and 57.56, which the authors describe as barely changing the results. Each variant was trained and evaluated with the same ScanNet protocol and an optimal transport layer, so the variants differ only in the stated component.

Limitations

Matching precision was not compared with detector-based methods, because no well-defined metric exists for evaluating detector-free matchers. The comparisons therefore rest on pose, homography and localization accuracy, not on matching precision or recall.

The ablation table covers five variants, all trained and evaluated on ScanNet, and no ablation on MegaDepth or the visual localization benchmarks is reported. The conclusion names matching under severe seasonal changes as a direction for extension, and that setting is not evaluated in the paper.

The reported running times are for one RTX 2080Ti, at 116 ms for dual-softmax and 130 ms for the optimal transport setup on 640×480 pairs.

Paper info

Authors
Jiaming Sun, Zehong Shen, Yuang Wang, Hujun Bao, Xiaowei Zhou
Venue
arXiv · Preprint
First published
2021-4-1
Added
2026-11-12
Updated
2021-4-1
Version
v1
arXiv
2104.00680
Category
cs.CV · cs.RO
Original paper terms
CC BY 4.0
What we show
Paper info and commentary

AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.

Quote from the paper

Jiaming Sun, Zehong Shen, Yuang Wang, Hujun Bao, Xiaowei Zhou (2021). LoFTR: Detector-Free Local Feature Matching with Transformers. arXiv:2104.00680v1. https://arxiv.org/abs/2104.00680v1

BibTeX
@misc{sun2021loftr,
  title = {{LoFTR: Detector-Free Local Feature Matching with Transformers}},
  author = {Jiaming Sun and Zehong Shen and Yuang Wang and Hujun Bao and Xiaowei Zhou},
  year = {2021},
  eprint = {2104.00680},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2104.00680v1}
}

See related papersBrowse other papers

Paper preview
Account security

Connect Google account

If you connect a Google account, you can sign in with it too.

Refivu

Delete account

Refivu
Refivu

Sign up