S2DNet: Learning Image Features for Accurate Sparse-to-Dense Matching

Hugo Germain, Guillaume Bourmaud, Vincent Lepetit

Abstract

Traditional image matching relies on a "detect-then-describe" paradigm where keypoints are independently identified in two images. This approach often fails under extreme visual changes, such as day-to-night transitions, due to poor detector repeatability. S2DNet addresses this by introducing a sparse-to-dense matching pipeline. By treating correspondence as a supervised classification task rather than a metric learning problem, S2DNet achieves state-of-the-art pixel-level precision and robustness in challenging visual localization scenarios.

Introduction: The Repeatability Bottleneck

In computer vision tasks like Structure-from-Motion (SfM) and visual localization, the standard workflow involves finding keypoints in two images and matching their descriptors. However, this "sparse-to-sparse" approach is highly sensitive to detector repeatability. Under extreme illumination or viewpoint changes, feature detectors often fail to select the exact same physical point in both images. Even a small displacement of a few pixels can lead to localization errors of several meters.

Traditional detectors struggle with repeatability across extreme illumination changes, leading to increased position and angular errors.

While recent deep learning methods like D2-Net or R2D2 have improved robustness, they still rely on consistent keypoint detections in both images. S2DNet bypasses this requirement by matching asymmetrically.

Methodology: Sparse-to-Dense Matching

S2DNet shifts the paradigm by detecting keypoints only in a "source" image and performing an exhaustive search across the entire "target" image.

Asymmetric Correspondence

Instead of detecting keypoints in both images, S2DNet takes keypoints from Image A (using any detector, such as SuperPoint) and computes a dense correspondence map across the entirety of Image B. This ensures that if a point exists in the target image, it can be found regardless of whether a detector would have flagged it.

Architecture and Loss

The model utilizes a VGG-16 backbone to extract multi-level features, known as hypercolumn descriptors. By combining early layers (spatial detail) with deeper layers (semantic context), the model maintains high-frequency precision while benefiting from a wide receptive field.

The S2DNet architecture extracts multi-level features to produce a dense correspondence map, optimized via cross-entropy loss.

A key innovation is the use of softmax cross-entropy loss. Unlike metric learning approaches that encourage descriptors to be "close" in embedding space, S2DNet treats every pixel in the target image as a potential class. This forces the network to produce highly peaked probability maps, leading to significantly higher localization precision.

Evaluation and Results

S2DNet was trained on the MegaDepth dataset and evaluated across several benchmarks:

  • HPatches: S2DNet significantly outperformed baselines at tight error thresholds (1-2 pixels).
  • Aachen Day-Night: The method achieved state-of-the-art results on nighttime queries, proving its robustness to extreme lighting changes.
  • InLoc: On this indoor dataset, S2DNet surpassed all sparse baselines at the finest precision threshold (0.25m).

The authors also demonstrate that despite the "dense" search, the process is efficient on GPUs using batched 1x1 convolutions. For 1,000 detections, S2DNet is faster than D2-Net as it avoids multi-scale detection on the query image.

Conclusion and Future Work

S2DNet demonstrates that a sparse-to-dense approach combined with a classification-based loss is superior for high-precision matching. However, a primary limitation is integration with existing SfM frameworks like COLMAP, which are optimized for sparse "tracks." Future research will focus on adapting 3D reconstruction pipelines to natively leverage dense matching capabilities and optimizing memory footprints for high-resolution images.

Summary updated

BibTeX
@inproceedings{germain2020s,
  author = {Hugo Germain and Guillaume Bourmaud and Vincent Lepetit},
  title = {{S2DNet: Learning Image Features for Accurate Sparse-to-Dense Matching}},
  booktitle = {European Conference on Computer Vision},
  year = {2020},
  doi = {10.1007/978-3-030-58580-8\_37},
}
Figure