Source-linked AI summary

D2-Net: A Trainable CNN for Joint Detection and Description of Local Features

Mihai Dusmanu, Ignacio Rocco, Tomas Pajdla, Marc Pollefeys, Josef Sivic, Akihiko Torii, Torsten Sattler

arXiv:1905.03561v1cs.CV

TL;DR

The paper addresses unreliable pixel-level correspondences under difficult imaging conditions, especially where early low-level keypoint detection is unstable. It proposes D2-Net, a single CNN that jointly detects and describes features using a postponed detection stage, and reports state-of-the-art localization under challenging day-night and indoor conditions. The method is also competitive for image matching and 3D reconstruction, although its dense extraction and lower localization accuracy impose efficiency and precision trade-offs.

  • Problem

    Early low-level keypoint detectors can be unstable under strong appearance changes, while dense descriptors improve robustness at higher matching-time and memory costs.

  • Method

    D2-Net uses one CNN to produce dense feature maps whose pixel descriptors and local maxima jointly provide description and detection.

  • Results

    D2-Net surpasses state-of-the-art camera localization under challenging day-night and indoor conditions and remains suitable for 3D reconstruction.

  • Takeaways & Limitations

    Postponing detection until higher-level feature information is available yields sparse features robust enough for difficult localization while retaining applicability to SfM.

  • Takeaways & Limitations

    The method is less efficient than classical sparse features because it densely extracts descriptors, and its higher-level keypoints are less accurately localized.

Abstract

from arXiv · show

In this work we address the problem of finding reliable pixel-level correspondences under difficult imaging conditions. We propose an approach where a single convolutional neural network plays a dual role: It is simultaneously a dense feature descriptor and a feature detector. By postponing the detection to a later stage, the obtained keypoints are more stable than their traditional counterparts based on early detection of low-level structures. We show that this model can be trained using pixel correspondences extracted from readily available large-scale SfM reconstructions, without any further annotations. The proposed method obtains state-of-the-art performance on both the difficult Aachen Day-Night localization dataset and the InLoc indoor localization benchmark, as well as competitive performance on other benchmarks for image matching and 3D reconstruction.

1. Introduction

Reliable pixel-level correspondences remain difficult under severe appearance changes because conventional detectors rely on unstable low-level information. D2-Net postpones detection within a CNN that jointly produces dense descriptors and keypoints, seeking robust yet efficient sparse features.

  • Motivation: Extreme illumination, seasonal, and weak-texture conditions expose a repeatability weakness in conventional sparse keypoint detectors.Their low-level image statistics change more than the higher-level information encoded by descriptors, while dense descriptors improve matching at increased memory and matching cost.
  • Approach: D2-Net computes CNN feature maps whose pixel-wise slices are descriptors and whose local maxima define keypoints.This describe-and-detect design couples detection to the descriptor representation and uses deeper, higher-level information.
  • Goals: The method targets sparse features that retain robustness under challenging conditions while reducing the memory burden of dense methods.The paper reports significantly lower memory requirements and comparable or better performance under challenging conditions.
  • Approach: A single CNN replaces the conventional two-stage detect-then-describe pipeline with dense features serving simultaneously as detectors and descriptors.The contrast is illustrated as pipeline (b) versus variants of pipeline (a).
  • Trade-offs: Higher-level detection produces more robust but less accurately localized keypoints, yet the method remains accurate enough for visual localization and SfM.This localization trade-off is an acknowledged drawback of the approach.

2. Related Work

Prior work mainly detects sparse keypoints before describing patches, or avoids detection through dense extraction. D2-Net instead shares one dense representation between detection and description, building on the identified weakness of early detection.

  • Local features: Classical sparse feature extraction detects keypoints first, then computes compact descriptors from patches centered on them.Detectors commonly provide scale, rotation, or viewpoint normalization through patch selection.
  • Dense descriptors: Dense descriptor methods forego detection and compute descriptors across the image, improving matching under strong illumination changes.Their principal costs are higher matching time and memory consumption.
  • Image retrieval: Image retrieval methods also use dense descriptors, sometimes adding attention-based keypoint selection, but target compact image-level retrieval representations.The cited related approaches are therefore conceptually close but serve a different output goal.
  • Object detection: Object-detection pipelines share dense extraction and local selection concepts with D2-Net, but address a different task.They score region proposals and apply non-maximum suppression to select salient proposals.
  • D2-Net: D2-Net combines dense extraction with simultaneous detection and description, sharing the underlying representation between both functions.This joint representation motivates the name D2 and contrasts with two-stage detect-then-describe pipelines.

3. Joint Detection and Description Pipeline

D2 uses one CNN representation as both dense descriptors and detector responses, postponing detection until after feature extraction. Detection combines spatial and channel-wise selection, with multiscale testing to improve robustness to scale changes.

  • Joint representation: D2 uses dense feature extraction to produce a representation that simultaneously serves as a detector and descriptor.This shared representation replaces the classical two-stage detect-then-describe pipeline.
  • Feature description: At each feature-map location, the descriptor is the vector obtained by traversing all n feature-map channels.Descriptors can be compared across images using Euclidean distance after L2 normalization.
  • Feature detection: Detection selects locally salient responses from multiple detector maps, requiring channel selection followed by a spatial local-maximum check.The hard procedure first identifies the most preeminent detector channel at a pixel, then verifies local maximality there.
  • Feature detection: During training, hard detection is softened using a local-maximum score and a ratio-to-maximum score before combining them into a normalized detection score.The soft procedure is designed to remain amenable to back-propagation.
  • Multiscale detection: At test time, an image pyramid with resolutions 0.5, 1, and 2 is used to improve robustness to scale changes.Feature maps are fused across resolutions, and response gating suppresses detections already selected at coarser scales.

4. Jointly optimizing detection and description

D2 is trained with a joint loss that encourages distinctive descriptors and repeatable detections from pixel correspondences. The training data are derived from large-scale SfM reconstructions, while implementation choices support dense feature extraction and higher-resolution testing.

  • Joint objective: The training objective jointly optimizes descriptor distinctiveness and detection repeatability for corresponding points under viewpoint or illumination changes.It extends a triplet margin ranking loss with a detection term.
  • Descriptor loss: The triplet loss minimizes distances between corresponding descriptors while maximizing distances from confounding descriptors outside a local neighborhood.Hard negative samples are selected from outside a square neighborhood around the correct correspondence.
  • Detection-weighted training: The loss averages margin terms over correspondences weighted by their detection scores, favoring distinctive correspondences with higher relative scores.Correspondences with lower margin terms receive greater relative weighting during optimization.
  • Training data: The correspondence extraction procedure yields 327,036 image pairs by projecting depth-supported points and removing occluded pixels with depth checks.The data are split into validation pairs from 78 scenes and training data from the remaining 118 scenes.
  • Implementation: The implementation initializes F from ImageNet-pretrained VGG16, fine-tunes its final dense-extractor layer for 50 epochs, and modifies pooling and convolutions at test time.Testing changes increase feature-map resolution to one fourth of the input resolution.

5. Experimental Evaluation

The experiments evaluate D2-Net on image matching, 3D reconstruction, and challenging visual localization. It achieves strong or state-of-the-art performance across these settings, while exposing localization, viewpoint, efficiency, and filtering trade-offs.

  • 5.1. Image Matching: On HPatches, D2-Net achieves the best overall matching performance for thresholds of 6.5 pixels or more.The evaluation uses mutual nearest-neighbor matches and reports MMA across illumination and viewpoint changes.
  • 5.1. Image Matching: Viewpoint-biased training limits performance on viewpoint-change sequences, while multiscale detection improves viewpoint robustness but harms illumination robustness.Approximately 90% of training pairs have viewpoint changes below 20°; multiscale detection introduces confounding descriptors for illumination changes.
  • 5.2. 3D Reconstruction: D2-Net performs on par with state-of-the-art local features for 3D reconstruction despite using less accurately localized keypoints.The method registers a comparable number of images, although strong ratio-test filtering removes 20%–25% of correct matches and yields fewer reconstructed 3D points.
  • 5.3. Localization under Challenging Conditions: In challenging localization, D2-Net sets the state of the art across severe illumination changes and complex indoor scenes.On Aachen Day-Night it outperforms all baselines, especially at strict pose thresholds, and exceeds DenseSfM despite using fewer features.
  • 5.3. Localization under Challenging Conditions: On InLoc, D2-Net outperforms SIFT and Dense PE alone while using less memory, and combining D2-Net with InLoc achieves a new state of the art.Dense PE surpasses the sparse approach only when using densely extracted SIFT for re-ranking, at higher computational cost.

6. Conclusions

The paper introduces describe-and-detect local features that postpone detection until reliable information is available and jointly perform description. The method surpasses state-of-the-art camera localization under challenging conditions and remains suitable for 3D reconstruction.

  • The proposed describe-and-detect methodology postpones detection until higher-level information is available and performs detection jointly with image description.
  • The method surpasses state-of-the-art camera localization performance under challenging day-night changes and indoor scenes.
  • Despite being less well-localized than classical feature detectors, the features are suitable for 3D reconstruction.
  • Increasing keypoint detection accuracy is identified as future work, including higher-resolution feature maps or more accurate pixel-position regression.

Supplementary material

The supplementary material documents the ratio-test threshold selection, network architecture, training loss, and additional backbone evaluations.

  • The supplementary material details threshold selection for Lowe’s ratio test used in the paper’s 3D reconstructions.
  • It provides implementation details for the architecture and evaluates an alternative ResNet backbone.
  • It also gives additional details on the loss function used to train the method.

A. Impact of the ratio test on D2 features

The ratio test is useful for filtering incorrect matches but is poorly aligned with D2’s correct-versus-incorrect match ratios. The authors therefore discourage it for difficult camera localization and recommend safeguards for 3D reconstruction.

  • Lowe’s ratio test reduces wrong registrations caused by repetitive structures and semantically similar scenes in local-feature evaluation.
  • D2’s ratio PDFs show that correct and incorrect matches have similar mean ratios, limiting the effectiveness of ratio filtering.
  • Thresholds of 0.90 for off-the-shelf and 0.95 for fine-tuned descriptors filter 79.9% and 74.4% of incorrect matches, respectively.
  • Those thresholds also discard 23.3% and 21.9% of correct matches, potentially reducing registered images and sparse points.
  • The authors suggest avoiding the ratio test for camera localization under difficult conditions such as day-night changes and indoor scenes.
  • For 3D reconstruction, the suggested threshold or a higher minimum inlier count should avoid most wrong registrations, although the latter can slow geometric verification.

B. Details of the backbone architecture

The method uses VGG16 during training and modifies the test-time architecture to obtain higher-resolution feature maps; dilated convolutions improve detections, especially for viewpoint changes. ResNet50 offers a robustness trade-off across illumination and viewpoint changes.

  • Backbone comparison: The backbone comparison evaluates VGG16 against ResNet50 using the same HPatches image-pair protocol, with both architectures initialized from ImageNet weights.
  • Training architecture: Training uses the default VGG16 architecture through conv4_3 while fine-tuning its last layer.
  • Dilated convolutions: At test time, dilated convolutions increase detections and D2 performance, especially on viewpoint-change sequences.
  • Backbone comparison: ResNet50 features are slightly more robust to illumination changes and outperform VGG16 above 6.5-pixel thresholds, but are less robust to viewpoint changes.
  • Testing architecture: Testing replaces pool3 with stride-1 average pooling and dilates later convolutions by a factor of 2, preserving receptive field while increasing feature-map resolution.

C. Details of the training loss

The training-loss analysis describes symmetric in-image-pair negative mining, with margins and exclusion neighborhoods controlling negative selection. Fine-tuning increases scores for salient points while suppressing repetitive structures, and backbone choice affects keypoint quantity and viewpoint performance.

  • Negative mining: K = 0 allows every feature-map pixel except the correspondence itself as a possible negative and supports mutual-nearest-neighbor matching under symmetric selection.The passage describes this setting as too restrictive in practice because adjacent pixels have overlapping receptive fields.
  • Fine-tuning effects: Fine-tuning raises scores for salient points and downweights repetitive structures, with similar observations reported for indoor images.Most training data comes from outdoor scenes, yet the qualitative effect appears to transfer indoors.
  • Backbone architectures: Dilated convolutions produce more keypoints and better viewpoint-sequence performance, while VGG16 significantly outperforms ResNet50 at similar feature-map resolution.Figure 7 compares original backbones with variants that remove deep-layer stride and add subsequent dilations.
  • Negative mining: Negative mining selects the hardest negative from either image while excluding locations within K pixels of the ground-truth correspondence.The procedure is designed around correspondence c : A ↔B and compensates for overlapping receptive fields.

D. Qualitative examples

Qualitative examples cover successful and failed D2 matches across challenging indoor and outdoor localization conditions. The indoor failures center on repeated objects or patterns.

  • InLoc: InLoc examples include good matches despite significant viewpoint changes and textureless areas.These examples illustrate successful matching under challenging indoor conditions.
  • InLoc: Additional InLoc examples illustrate D2 feature failure modes involving repeated objects and patterns.The passage identifies repetition as the main indoor failure mode shown.
  • Aachen Day-Night: Aachen Day-Night examples show matches on difficult scenes from the camera localization challenge.The figure set extends the qualitative evaluation beyond indoor scenes.
Loading 1905.03561v1…