# SuperGlue: Learning Feature Matching with Graph Neural Networks

SuperGlue matches image keypoints by reasoning over both images jointly

Paul-Edouard Sarlin, Daniel DeTone, Tomasz Malisiewicz, Andrew Rabinovich · arXiv · 2019-11-26

- **Problem** Learned outlier filters work only on matches that nearest neighbour search has already produced. So they ignore how matches constrain one another, and they discard visual information.
- **Method** SuperGlue learns the matching step between feature detection and pose estimation. Attention over a graph of both images' keypoints predicts scores, and Sinkhorn normalisation turns them into matches.
- **Results** On ScanNet indoor pairs with SuperPoint features, SuperGlue reached AUC@20° of 51.84, against 43.85 for NN plus OANet.

## Why local feature matching is hard

Correspondences between image points are needed to estimate 3D structure and camera poses in SLAM and Structure-from-Motion, and they are usually obtained by matching local features.

The usual pipeline detects keypoints, computes descriptors, runs nearest neighbour search, filters the resulting matches and then fits a geometric model with a robust solver. Learned outlier classifiers operate on matches that nearest neighbour search has already produced, so they ignore how matches constrain one another and they discard visual information.

The authors place their network between the front-end and the back-end of a SLAM system, as a learnable middle-end that maps local features to point correspondences. It can sit after either a handcrafted or a learned detector and descriptor, and it outputs a partial assignment with a confidence value for each candidate pair.

## How keypoints become matching descriptors

Each keypoint carries its image coordinates, a detection confidence and a visual descriptor. The initial state of a keypoint is its descriptor plus an MLP embedding of its position, so appearance and location start in the same vector.

All keypoints of both images form one complete graph with two edge types: self edges inside an image and cross edges to the other image. Layers alternate between the two edge types, starting with self edges, so odd layers aggregate within each image and even layers aggregate across images.

At each layer, every keypoint adds an aggregated message to its current state through a residual update whose MLP reads the state concatenated with the message. The message is a weighted average of value vectors, with weights given by a softmax over query-key similarities, so each keypoint decides which other keypoints to draw on. Attention is multi-head, and its projections are learned per layer and shared across the keypoints of both images.

After the last layer, a linear projection turns each state into a matching descriptor. The network uses nine alternating layers with four heads each and descriptors of dimension 256, and the visual descriptor network is not trained during SuperGlue training unless stated otherwise.

## Turning scores into a partial assignment

The score for a candidate pair is the inner product of the two matching descriptors, and these scores are not normalised. Because the descriptors are unnormalised, their magnitude can carry the confidence of the prediction.

To absorb keypoints that have no counterpart, the score matrix gets an extra row and column, called dustbins, filled with one learnable value. The marginal vectors a and b state how many matches each keypoint and each dustbin should carry, so a dustbin in one image takes as many matches as the other image has keypoints.

The augmented score matrix is normalised by the Sinkhorn procedure, which alternately normalises exponentiated scores along rows and columns and approximates an entropy-regularised optimal transport solution. The procedure runs for T = 100 iterations, after which the dustbin row and column are removed to give the partial soft assignment P.

At test time a confidence threshold of 0.2 can keep only confident matches, or all matches can be passed on with their confidences to a later step such as weighted pose estimation.

## What supervises the assignment

Ground truth matches come from relative poses with depth maps, or from homographies, and keypoints without a reprojection nearby are labelled unmatched. A pair is a match when its reprojection error is minimal along both its row and its column and below 3, 5 and 3 pixels for homography, indoor and outdoor data respectively.

The loss is a negative log-likelihood of the augmented assignment: it adds the negative log probability of each ground truth match, the negative log probability of the dustbin for each unmatched keypoint in one image, and the same for the other image. The authors state that this supervision aims to maximise precision and recall of the matching at the same time.

Because the attention layers and the optimal matching layer are differentiable, gradients flow from the match loss back to the descriptors. The authors also argue that the architecture is equivariant to permutations of keypoints within an image and to swapping the two images, which they link to the symmetry of the matching problem.

## Homography estimation results

Image pairs come from sampling random homographies and applying photometric distortions to real images from the Oxford and Paris distractor set. The test set holds 1024 pairs of 640 by 480 images, and the evaluation uses the 512 top-scoring SuperPoint keypoints with a non-maximum suppression radius of 4 pixels. The baselines are the nearest neighbour matcher, the mutual check, PointCN and OANet, all applied to SuperPoint features.

Quality is measured with match precision and recall, and with homography AUC, which is computed from the mean reprojection error of the four image corners up to 10 pixels. Table 1 reports AUC values for RANSAC and DLT alongside precision and recall, and the text describes SuperGlue as reaching 98% recall.

The authors report that SuperGlue correspondences are accurate enough for DLT, a least-squares estimate without a robustness mechanism, to work better than RANSAC. Outlier rejectors such as PointCN and OANet do not predict more correct matches than the nearest neighbour matcher itself, which the authors attribute to their overreliance on the initial descriptors.

## Indoor pose estimation on ScanNet

The indoor experiments use ScanNet, and pairs are selected with an overlap score computed from ground truth poses and depth rather than from time difference or SfM covisibility. This yields 230M training pairs and 1500 test pairs, which the authors describe as wider-baseline pairs than those used in earlier work.

Pose error is the maximum of the rotation and translation angular errors, summarised as AUC at 5, 10 and 20 degrees, and a match counts as correct by its epipolar distance. Against NN plus OANet on SuperPoint, SuperGlue raised AUC@20° from 43.85 to 51.84, precision from 74.0 to 84.4 and matching score from 25.7 to 31.5. On SIFT features, SuperGlue reached AUC@20° of 28.67, against 22.47 for NN with the ratio test.

The authors say SuperGlue yields up to 10 times more correct matches than the ratio test on SIFT, because it scores the full set of candidate pairs rather than only the nearest neighbours.

## Outdoor pose estimation on PhotoTourism

The outdoor evaluation uses PhotoTourism, with SuperGlue trained on MegaDepth and scenes that appear in the PhotoTourism test set removed from training. Pairs are chosen with an overlap score, and the evaluation covers all 11 PhotoTourism scenes.

With SuperPoint, SuperGlue reached AUC values of 34.18, 50.32 and 64.16 at 5, 10 and 20 degrees, against 21.03, 34.08 and 46.88 for NN plus OANet. Its match precision was 84.9, against 52.4 for NN plus OANet.

With SIFT, SuperGlue reached 23.68, 36.44 and 49.44, above the 18.02, 28.76 and 40.31 of NN plus OANet. The authors read the high precision as evidence that SuperGlue glues local features together.

## What the ablations isolate

The ablations keep the indoor SuperPoint setting and change one component at a time: the graph neural network, cross-attention, the positional encoding or the depth of the network. The variant without the graph neural network replaces it with a single linear projection while keeping the keypoint encoder and the matching layer, and it reaches AUC@20° of 38.56 with precision 66.0.

Removing cross-attention gives AUC@20° of 42.57 and precision of 74.0, and removing positional encoding gives 47.12 and 75.8, against 51.84 and 84.4 for the full model. A three-layer version reaches 46.93 AUC@20° and precision 79.9.

Backpropagating through the SuperPoint descriptor network raised AUC@20° from 51.84 to 53.38, and the authors take this as evidence that SuperGlue suits end-to-end learning. In that experiment the detection network is frozen and only the descriptor network receives gradients from SuperGlue. The ablation tables list one value per variant and report no spread across seeds.

## Runtime and model size

The model has 12M parameters and is implemented in PyTorch. A forward pass on an indoor image pair takes 69 ms on average on an NVIDIA GTX 1080, which corresponds to 15 FPS.

At 512 and 1024 keypoints per image the figure gives 14.5 and 11.5 FPS.

The appendix counts 18 layers in total, while the main text sets the number of alternating layers to 9; the sources do not explain how the two counts correspond.

## Limitations

Graph matching methods were not compared, because the authors judged them orders of magnitude too slow for more than about 500 keypoints per image. The main accuracy tables give one value per configuration and no confidence intervals; confidence intervals are reported only for the attention spans.

The outdoor model was initialised from the homography model because the number of training scenes is limited.

Real-image generalisation was checked only on the viewpoint and illumination subsets of HPatches. The last row of the outdoor examples shows a failure case in which SuperGlue focuses on an incorrect self-similarity.

The authors expect a deep front-end combined with SuperGlue to lead toward end-to-end deep SLAM, but the reported experiments are two-view pose and homography estimation rather than a full SLAM system.

## Paper info

- **Authors**: Paul-Edouard Sarlin, Daniel DeTone, Tomasz Malisiewicz, Andrew Rabinovich
- **Venue**: arXiv · Preprint
- **First published**: 2019-11-26
- **Added**: 2026-11-12
- **Updated**: 2020-3-28
- **Version**: v2
- **arXiv**: 1911.11763
- **Category**: cs.CV
- **Original paper terms**: [arXiv non-exclusive 1.0](https://arxiv.org/licenses/nonexclusive-distrib/1.0/)
- **What we show**: Paper info and commentary

[Original paper ↗](https://arxiv.org/abs/1911.11763v2) · [PDF ↗](https://arxiv.org/pdf/1911.11763v2)

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

Paul-Edouard Sarlin, Daniel DeTone, Tomasz Malisiewicz, Andrew Rabinovich (2019). SuperGlue: Learning Feature Matching with Graph Neural Networks. arXiv:1911.11763v2. https://arxiv.org/abs/1911.11763v2

**BibTeX**

```
@misc{sarlin2019superglue,
  title = {{SuperGlue: Learning Feature Matching with Graph Neural Networks}},
  author = {Paul-Edouard Sarlin and Daniel DeTone and Tomasz Malisiewicz and Andrew Rabinovich},
  year = {2019},
  eprint = {1911.11763},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1911.11763v2}
}
```

## Other paper commentary

- [Graph Convolutional Neural Networks for Web-Scale Recommender Systems](https://refivu.com/en/papers/2394eca5-706d-42e6-999b-3126c2b38eb9-graph-convolutional-neural-networks-for-web-scale.md)
- [Neural Graph Collaborative Filtering](https://refivu.com/en/papers/4bffd668-ba3b-4e03-a2f5-71dbd5311182-neural-graph-collaborative-filtering.md)
- [Fast Graph Representation Learning with PyTorch Geometric](https://refivu.com/en/papers/52635461-7e10-4f67-b534-f791859538e1-fast-graph-representation-learning-with-pytorch-geometric.md)
- [Spatial Temporal Graph Convolutional Networks for Skeleton-Based Action Recognition](https://refivu.com/en/papers/bbd98e39-133a-4c51-b43b-84aa4583b3aa-spatial-temporal-graph-convolutional-networks-for-skeleton.md)
- [How Powerful are Graph Neural Networks?](https://refivu.com/en/papers/290a3c63-2393-4f40-9947-61fb2d0b7f7a-how-powerful-are-graph-neural-networks.md)
- [Modeling Relational Data with Graph Convolutional Networks](https://refivu.com/en/papers/0f5e1839-5aad-4ffe-b183-7d735f8896a8-modeling-relational-data-with-graph-convolutional-networks.md)
- [Progressive Neural Networks](https://refivu.com/en/papers/312c9749-ed9b-42c3-9bf3-bb139310d4dd-progressive-neural-networks.md)
- [Cyclical Learning Rates for Training Neural Networks](https://refivu.com/en/papers/922235f3-8c7b-4983-9a6d-b6a3d0b4a72e-cyclical-learning-rates-for-training-neural-networks.md)
- [NTU RGB+D: A Large Scale Dataset for 3D Human Activity Analysis](https://refivu.com/en/papers/5edff39c-c403-4be6-ac6f-5fbcfa1ca3f7-ntu-rgb-d-a-large-scale-dataset-for.md)
- [Improved Baselines with Visual Instruction Tuning](https://refivu.com/en/papers/3cfdbdfa-775a-4f66-9c2e-f6fc6c4b4e96-improved-baselines-with-visual-instruction-tuning.md)
- [CCNet: Criss-Cross Attention for Semantic Segmentation](https://refivu.com/en/papers/0b5bae85-f19c-40ec-85a8-6d588ce0497b-ccnet-criss-cross-attention-for-semantic-segmentation.md)
- [Semantics derived automatically from language corpora contain human-like biases](https://refivu.com/en/papers/abf5bfd6-5402-457c-958c-81fe475605f3-semantics-derived-automatically-from-language-corpora.md)

## Terms in this paper

- [optimal transport](https://refivu.com/en/terms/ce65c388d297-optimal-transport)

---

AI-written text can contain mistakes. [Refivu](https://refivu.com/en/papers/9343403c-486b-4202-af8a-3329d26b1dad-superglue-learning-feature-matching-with-graph-neural)
