Paper Notes: UnsuperPoint: End-to-end Unsupervised Interest Point Detector and Descriptor

SuperPoint was a major success, but it has one clear drawback: training and obtaining ground truth are both very difficult, even with the help of simulation. In real-world settings, manually annotating data and then fine-tuning the model is not easy. This paper therefore proposes an unsupervised learning approach that extracts both keypoints and descriptors. Despite being unsupervised, it performs well on the datasets and runs very quickly.

1 Network Design

The network design is broadly similar to SuperPoint’s, but the heads differ in several details. SuperPoint mainly uses classification to localize keypoints at discrete coordinates and determine whether a location contains a keypoint. In UnsuperPoint, the authors use a score map to represent keypoint confidence and regress offsets to localize keypoints. The network is designed as follows:

1.1 Backbone Module

As in SuperPoint, the backbone module uses an FCN architecture. Each stage consists of two conv layers followed by max pooling, with three downsampling operations in total. The channel counts are 32-32-64-64-128-128-256-256.

Each point on the final feature map therefore corresponds to an 8×8 region in the original image.

1.2 Score Module S_{map}

The score module S_{map} uses regression to assign each point a confidence score between 0 and 1 indicating how likely it is to be a keypoint. It consists of conv-256 + conv-1 and uses sigmoid as its activation function. As in traditional methods, this score is used to select the top N keypoints.

1.3 Position Module P_{map}

The position module predicts keypoint locations. Unlike SuperPoint, which uses classification (each of the 64 channels predicts whether its corresponding location contains a keypoint), this paper uses regression to predict the coordinate offsets of a keypoint within an 8×8 block, normalized to the range [0-1]. The module consists of conv-256 + conv-2 and uses sigmoid as its activation function. The figure below shows a 24×24 image. With an FCN that downsamples by a factor of 8, the position module predicts 3×3 = 9 keypoint locations:

The offsets are used to calculate the coordinates as follows:

\begin{array}{l}\mathbf{P}_{\operatorname{map}, \mathbf{x}}(r, c)=\left(c+\mathbf{P}_{\text {relative }, \mathbf{x}}(r, c)\right) \cdot f_{\text {downsample }} \\\mathbf{P}_{\text {map }, \mathbf{y}}(r, c)=\left(r+\mathbf{P}_{\text {relative,y }}(r, c)\right) \cdot f_{\text {downsample }}\tag{1}\end{array}

In this paper, f_{\text {downsample}} = 8.

1.4 Descriptor Module F_{map}

The descriptor module F_{map} encodes information about each keypoint so that their similarity can be assessed when matching them. It consists of conv256 – conv256, and each descriptor contains 256 floats. The first step produces a 256-channel feature map with a descriptor for each 8×8 block. The module then takes the keypoint locations from P_{map} and interpolates the feature map to obtain a descriptor at each location. Because P_{map} uses regression to obtain the keypoint coordinates, the interpolation makes descriptor extraction differentiable, a property used during training.

2 Self-Supervised Framework

This section explains how self-supervised training works. The overall workflow is shown below:

3

As the diagram shows, the approach is quite similar to supervised learning. The idea is to take the original image and apply the transform T to it. The original and transformed images each yield three outputs—scores, points, and features: S^A, P^A, and F^A for the original, and S^B, P^B, and F^B for the transformed image. The point locations are then mapped using the transform T into the coordinate system of P^B to identify point-pair correspondences. These matches provide the training signal without supervision.

3 Loss functions

The paper trains the three branches jointly. The total loss is given by:

\begin{aligned}\mathcal{L}_{\text {total }}=& \alpha_{\text {usp }} \mathcal{L}^{\text {usp }} \\&+\alpha_{\text {uni\_xy }} \mathcal{L}^{\text {uni\_xy }} \\&+\alpha_{\text {desc }} \mathcal{L}^{\text {desc }}+\alpha_{\text {decorr }} \mathcal{L}^{\text {decorr }}\tag{2}\end{aligned}

Each term is assigned a weight \alpha.

Point-pair correspondences

For each of the two images b \in\{A, B\}, the network outputs three tensors: \mathbf{s}^b, \mathbf{P}^b, and \mathbf{F}^b. To calculate the losses described below, we first need to define the matching point pairs between the two images. Let \mathbf{M}^A and \mathbf{M}^B denote the branch outputs for the two images, respectively. Their pairwise distances are arranged in a matrix \mathbf{G} = \mathbf{M}^A \times \mathbf{M}^B, as follows:

\mathbf{G}=\left[g_{i j}\right]_{M^{\mathrm{A}} \times M^{\mathrm{B}}}=\left[\left\|\mathbf{p}_{i}^{\mathrm{A} \rightarrow \mathrm{B}}-\mathbf{p}_{j}^{\mathrm{B}}\right\|_{2}\right]_{M^{\mathrm{A}} \times M^{\mathrm{B}}}\tag{3}

where \mathbf{p}_{i}^{\mathrm{A} \rightarrow \mathrm{B}}=T \mathbf{p}_{i}^{\mathrm{A}}\tag{4}.

Nearest Neighbors
If the distance between point i in A and point j in B satisfies g_{ij} < \epsilon_{correspond}, we call them nearest neighbors.

With this definition, given the tensors \mathbf{s}^b, \mathbf{P}^b, and \mathbf{F}^b in B, we can find K nearest-neighbor matches. We denote their scores, positions, and descriptors by \hat{\mathbf{s}^b}, \hat{\mathbf{P}^b}, and \hat{\mathbf{F}^b}, with each point indexed by k. For the kth match, the score is \hat{s_k^b}, the position is \hat{\mathbf{p}_k^b}, and the descriptor is \hat{\mathbf{f}_k^b}. The distance between the matched positions is:

d_{k}=\left\|T \hat{\mathbf{p}}_{k}^{\mathrm{A}}-\hat{\mathbf{p}}_{k}^{\mathrm{B}}\right\|=\left\|\hat{\mathbf{p}}_{k}^{\mathrm{A} \rightarrow \mathrm{B}}-\hat{\mathbf{p}}_{k}^{\mathrm{B}}\right\|\tag{5}

3.1 Unsupervised point loss \mathcal{L}^{u s p}

The unsupervised point loss \mathcal{L}^{u s p} is defined as follows:

\mathcal{L}^{u s p}=\alpha_{\text {position }} \sum_{k=1}^{K} l_{k}^{\text {position }}+\alpha_{\text {score }} \sum_{k=1}^{K} l_{k}^{\text {score }}+\sum_{k=1}^{K} l_{k}^{\text {usp }}\tag{6}

It consists of three terms, each summed over all K nearest-neighbor matches:

Position Loss
The main goal of this loss is to make the keypoint locations detected in image A line up with those detected in image B after applying the transform. This keeps keypoint locations stable across viewpoints:
l_{k}^{\text {position }}=d_{k}\tag{7}

Score Loss
The main goal of this loss is to make corresponding points in images A and B receive similar scores, so that keypoint confidence remains consistent across viewpoints:
l_{k}^{\mathrm{score}}=\left(\hat{s}_{k}^{\mathrm{A}}-\hat{s}_{k}^{\mathrm{B}}\right)^{2}\tag{8}

Unsupervised Point Loss
The main goal of this part of the loss is to ensure that the score (confidence) predicted by the network reflects the likelihood that the keypoint coordinates are repeatable. For example, points that are more consistently detected across different viewpoints should receive higher scores:
l_{k}^{\text {usp }}=\hat{s}_{k}\left(d_{k}-\bar{d}\right)\tag{9}

Here, \hat{s}_{k} is the average score for the same point in images A and B:
\hat{s}_{k}=\frac{\hat{s}_{k}^{\mathrm{A}}+\hat{s}_{k}^{\mathrm{B}}}{2}\tag{10}

And \bar{d} is the mean distance across all nearest-neighbor matches:
\bar{d}=\frac{1}{K} \sum_{k=1}^{K} d_{k}\tag{11}

3.2 Uniform point predictions \mathcal{L}^{uni\_xy}

Using only the loss above for unsupervised training can lead to artifacts in the predicted keypoints, as shown in the figure below:

The offsets of most predicted points may cluster at the edges of the block (0 and 8), as shown in (a). Adding a uniformity loss spreads them out, as shown in (b). Ideally, the point offsets should be uniformly distributed within each block.

The uniform point predictions loss \mathcal{L}^{uni\_xy} is designed to address this issue. It is defined as follows:
\begin{aligned}\mathcal{L}^{\text {uni\_xy}} &=\alpha_{\text {uni\_xy}}\left(\mathcal{L}^{\text {uni\_x}}+\mathcal{L}^{\text {uni\_y}}\right) \\\mathcal{L}^{\text {uni\_x}} &=\sum_{i=1}^{M}\left(x_{i}^{\text {sorted }}-\frac{i-1}{M-1}\right)^{2} \\\mathcal{L}^{\text {uni\_y}} &=\sum_{i=1}^{M}\left(y_{i}^{\text {sorted }}-\frac{i-1}{M-1}\right)^{2}\tag{12}\end{aligned}

3.3 Descriptor \mathcal{L}^{desc}

The descriptor loss is a hinge loss, defined as follows:
\begin{aligned}\mathcal{L}^{\mathrm{desc}} &=\sum_{i=1}^{M^A} \sum_{j=1}^{M^B} l_{i j}^{\mathrm{desc}} \\l_{i j}^{\mathrm{desc}} &=\lambda_{d} \cdot c_{i j} \cdot \max \left(0, m_{p}-\mathbf{f}_{i}^{\mathrm{A}^{T}} \mathbf{f}_{j}^{\mathrm{B}}\right) \\&+\left(1-c_{i j}\right) \cdot \max \left(0, \mathbf{f}_{i}^{\mathrm{A}^{T}} \mathbf{f}_{j}^{\mathrm{B}}-m_{n}\right) \\\tag{13}\end{aligned}

3.4 Decorrelate descriptor \mathcal{L}^{decorr}

The descriptor decorrelation loss \mathcal{L}^{decorr} helps prevent overfitting and makes the descriptors more compact. Given a descriptor correlation matrix \mathbf{R}^{b}=\left[r_{i j}^{b}\right]_{F \times F}, \mathcal{L}^{decorr} is defined as follows:

\mathcal{L}^{\mathrm{decorr}}=\sum_{i \neq j}^{F}\left(r_{i j}^{\mathrm{A}}\right)+\sum_{i \neq j}^{F}\left(r_{i j}^{\mathrm{B}}\right) \\\tag{14}

where:
r_{i j}^{b}=\frac{\left(\mathbf{v}_{j}^{b}-\bar{v}_{j}^{b}\right)^{T}\left(\mathbf{v}_{i}^{b}-\bar{v}_{i}^{b}\right)}{\sqrt{\left(\mathbf{v}_{j}^{b}-\bar{v}_{j}^{b}\right)^{T}\left(\mathbf{v}_{i}^{b}-\bar{v}_{i}^{b}\right)} \sqrt{\left(\mathbf{v}_{j}^{b}-\bar{v}_{j}^{b}\right)^{T}\left(\mathbf{v}_{i}^{b}-\bar{v}_{i}^{b}\right)}}\tag{15}

In the equation above, \mathbf{v}_{i}^{b} is an \mathbf{M}_b \times 1 column vector representing the i-th column of \mathbf{F}_b. \bar{v}_{i}^{b} is the mean of \mathbf{v}_{i}^{b}.

4 Experiments

The results are encouraging, of course (why publish them otherwise?). The network runs at about the same speed as SuperPoint while outperforming it and several other networks on nearly all the test sets. The paper goes into plenty of detail about the experiments, so I recommend reading it closely. Here are just a few of the main takeaways:

4.1 Parameter settings

The authors trained on a total of 118,287 images from MSCOCO. The parameters used in the experiments are listed below:

Parameter nameParameter value
Input320x240x3
normalizeSubtract 0.5, then multiply by 0.225
batch size5
optimizerAdam
\epsilon_{correspond}4
m_p1
m_n0.2
\delta_d250
\alpha_{usp}1
\alpha_{position}1
\alpha_{score}2
\alpha_{uni\_xy}100
\alpha_{desc}0.001
\alpha_{decorr}0.03

4.2 Comparative Experiments

The authors ran experiments to compare several strategies described in the paper:
C1 adds interpolation to the descriptor component, improving the matching score (see Section 1.4);
C2 adds Uniform point predictions to the detector component, improving repeatability and homography estimation accuracy while reducing localization error (see Section 3.2);
C3 adds Decorrelate to the descriptor component, improving both repeatability and overall performance.
C4 combines the C1, C2, and C3 strategies.
The results are shown in the table below:

4.3 Speed

SuperPoint, UnsuperPoint, and LF-Net were benchmarked on a GPU (GeForce Titan X), while the other methods were benchmarked on a CPU (Intel i7-7700HQ).

4.4 Repeatability and localization error

4.5 Homography estimation and matching score

Personal Takeaways

The paper’s main contribution is its unsupervised approach, which is indeed very practical in real-world settings. I’m still not quite sure how the detector is learned, though. Since the authors didn’t release the source code, I expect the results will be fairly difficult to reproduce.

Related Resources

Paper


Source Code (Third-Party Implementations)
https://github.com/791136190/UnsuperPoint_PyTorch
https://github.com/RPFey/UnsuperPoint

Add a Comment

Your email address will not be published. Required fields are marked *