wikillm

Paper · 2020-07-21 · cs.CV

Feature-metric Loss for Self-supervised Learning of Depth and Egomotion

Replaces the photometric loss in self-supervised monocular depth and egomotion training with a loss on features learned by an auto-encoder. Two regularisers (a discriminative gradient term and a second-order smoothness term) shape those features. On KITTI, the best model reports delta1 0.925 with online refinement and binocular training, against 0.885 cited as the prior level in the abstract.

Monocular depth estimationSelf-supervised learningAutoencoderStructural similarity (SSIM-style comparison of maps)depth-estimationself-supervisedvisual-odometryloss-function

arXivPDFMarkdown9 min read

AI-compiled by claude-haiku-5-5 on 2026-11-05, not yet reviewed by a human. Every claim cites its source; check it when a detail matters.

In plain words

Teaching a network to estimate depth and camera motion from ordinary video, without depth sensors, works by checking whether each frame can be rebuilt from its neighbours. Pixel colours are the thing being compared. The trouble is that a plain flat wall has almost the same colour everywhere, so a wrong guess about depth still looks almost right and gives the optimiser little to go on.

This paper compares features instead of colours. A second network, an auto-encoder, learns a description of each pixel from the image alone, and the rebuilding check is made on those descriptions. Two extra rules keep the descriptions useful: one makes neighbouring pixels differ enough to be told apart, and one keeps the change between neighbours smooth so the optimiser can slide towards the right answer. The depth and motion networks are trained with this loss added to the usual colour loss.

The method is tested on the KITTI driving dataset, where it reports better depth and odometry numbers than the self-supervised methods it is compared with.

TL;DR

  • Self-supervised depth and egomotion training usually uses a photometric loss, which has flat gradients in textureless areas §3.2.
  • The paper replaces the pixel comparison with a comparison of features from a FeatureNet trained by single-view reconstruction with two regularisers §3.3.
  • Reported KITTI results are the best among self-supervised methods, and odometry on sequences 09 and 10 beats the listed deep baselines tab. 2 tab. 4.
  • Most of the depth gain at the top of the table depends on online refinement and binocular training tab. 2.
  • No official code was found (see Paper vs code).

Problem

Photometric loss is a weak signal for depth and pose. A small photometric error does not prove that depth and pose are right. In textureless regions many pixels share one value, and the gradient with respect to depth and egomotion is near zero there §3.2 eq. 4 eq. 5. The paper also notes that the image gradient can change direction locally, which makes the update direction inconsistent §3.2. Smoothness penalties on depth help only over a short range and tend to blur object boundaries §1.

Assumptions: static scene, Lambertian surfaces, no occlusion in both views §3.2. Occlusion is handled by taking a minimum over several source frames §3.4 eq. 18.

Method

Geometry. Pinhole projection and back-projection use intrinsics (f_x, f_y, c_x, c_y) §3.1 eq. 1 eq. 2. The warp maps a pixel to the other frame using depth and a rigid motion G in SE(3) §3.1 eq. 3.

Cross-view reconstruction. Target pixels are sampled from a source image at warped positions §3.2 eq. 4. The paper's cross-view loss sums a per-pixel loss over pixels §3.2 eq. 5. The proposed version replaces the image values with feature values from the same warp §3.2 eq. 8.

Single-view reconstruction (FeatureNet). An auto-encoder reconstructs its input image. Its loss has three terms §3.3 eq. 9:

  • Reconstruction, an L1 difference between input and output §3.3 eq. 10.
  • Discriminative term, the negative L1 norm of the first-order feature gradient, weighted by exp(-|∇I|) so that low-texture pixels count more §3.3 eq. 11 eq. 12.
  • Convergent term, the L1 norm of the second-order feature derivative §3.3 eq. 13.

The two regularisers are applied to the largest feature map of the encoder, which has 64 channels §3.5.

Total loss. The paper states L_total = L_s + L_{s→t} §3.4 eq. 14. The cross-view term is the feature-metric loss plus the photometric loss §3.4 eq. 15. The feature-metric loss is an L1 difference of warped and target features §3.4 eq. 16. The photometric loss is 0.15 times an L1 difference plus 0.85 times (1 - SSIM)/2 §3.4 eq. 17.

Occlusion. The cross-view loss takes the minimum over the source set V §3.4 eq. 18. V holds the previous and next frames for monocular video. For calibrated binocular video, the opposite stereo frame is added §3.4.

Pseudocode
# Feature-metric training objective  [§3.2] [§3.3] [§3.4]
# Input:  target (B, 3, 320, 1024); sources: list of (B, 3, 320, 1024)
# Output: scalar loss

def training_loss(target, sources, alpha, beta):
    # FeatureNet single-view loss: reconstruction plus two regularisers
    # applied to the largest 64-channel encoder feature  [§3.3] [eq. 9]
    feats, recon = feature_net(target)
    loss_single = (
        l1(target, recon)                             # [eq. 10]
        + alpha * discriminative(feats, target)       # [eq. 11] [eq. 12]
        + beta * convergent(feats)                    # [eq. 13]
    )

    # Depth and pose drive the warp for every source frame  [§3.4]
    depth = depth_net(target)                         # [§3.4]
    cross = []
    for source in sources:
        pose = pose_net(target, source)               # axis-angle  [§3.5]
        src_feats = feature_encoder(source)           # [§3.3]
        # Feature-metric plus photometric term for this source  [eq. 15]
        loss_fm = l1(warp(src_feats, depth, pose), feats)   # [eq. 16]
        loss_ph = photometric(warp(source, depth, pose), target)  # [eq. 17]
        cross.append(loss_fm + loss_ph)

    # Per-pixel minimum over sources handles occlusion  [eq. 18]
    loss_cross = minimum_over_sources(cross)

    # Total objective  [eq. 14]
    return loss_single + loss_cross

Notes on the pseudocode: alpha and beta are 1e-3 §3.3. The paper does not state how the L1 terms are reduced (sum or mean), and the feature resolution at which the warp is applied is not stated.

Hyperparameters

NameValueWhereNotes
alpha (discriminative weight)1e-3§3.3 eq. 9"via cross validation"; split not stated
beta (convergent weight)1e-3§3.3 eq. 9"via cross validation"; split not stated
photometric weights0.15 L1, 0.85 SSIM§3.4 eq. 17SSIM window and constants not stated
feature-metric normL1§3.4 eq. 16channel reduction not stated
regularised feature maplargest encoder map, 64 channels§3.5spatial resolution not stated
FeatureNet encoderResNet-50, no FC layer§3.5
FeatureNet decoderfive 3×3 conv, each then bilinear upsample§3.5channel widths not stated
FeatureNet outputs3×3 conv + sigmoid per scale§3.5per-scale loss weighting not stated
DepthNet encoderResNet-50, no FC layer§3.5multi-scale outputs
DepthNet decodercascaded refinement, coarse to fine§3.5per-scale 3×3 conv + sigmoid
depth output mappingnot stated§3.5the depth range used in an earlier draft is commented out
PoseNetResNet-18, concatenated pair input§3.5modifications not stated; axis-angle rotation
input size, FeatureNet and DepthNet320 × 1024§3.5
input size, PoseNet192 × 640§3.5
optimiserAdam§3.5betas and epsilon not stated
batch size2§3.5per GPU or total not stated
epochs40§3.5
warm-upto 1e-4 in 3 steps, each +1e-4/3 over 500 iterations§3.5starting learning rate not stated
learning rate schedule1e-4 for epochs 0 to 20, halved at epochs 20 and 30§3.5"halved twices" read as two halvings
hardware8 × GTX 1080Ti, PyTorch, distributed§3.5
data preprocessingas in monodepth2; static frames removed§3.5 §4.1
Eigen split39,810 train, 4,424 val, 697 test triplets§4.1
depth cap80 m§4.1
depth scalingmedian scaling for monocular models§4.1 eq. 19
odometry splittrain on 00–08, test on 09–10§4.1conflicts with §4.2 (see Pitfalls)
odometry lengths100 m to 800 m§4.2
smoothness baseline normalisationmean normalisation of depth§4.3 eq. 20
online refinementbatch 1, test frame plus two neighbours, 20 iterations, no augmentation§3.5model keeps training at test time

Results

Author-reported. Setup: KITTI, Eigen split with 697 test images §4.1. Tables 2 and 4 report the paper's results and the baselines it lists. Abs Rel and Sq Rel are lower-is-better; delta metrics are higher-is-better tab. 1 tab. 2.

Monocular depth, selected rows tab. 2:

MethodTrainingAbs RelSq RelRMSERMSE logδ1δ2δ3
Monodepth2M0.1150.8824.7010.1900.8790.9610.982
OursM0.1040.7294.4810.1790.8930.9650.984
Ours (online refinement)M*0.0880.7124.1370.1690.9150.9650.982
DepthHint (post-processed)MS†0.1000.7284.4690.1850.8850.9620.982
OursMS0.0990.6974.4270.1840.8890.9630.982
Ours (online refinement)MS*0.0790.6663.9220.1630.9250.9700.984

Codes from the tab. 2 caption: M monocular video, MS binocular video,

  • online refinement, † post-processing. Supervised baselines Dorn and BTS are listed in the same table.

Odometry, KITTI sequences 09 and 10 tab. 4:

MethodSeq. 09 t_errSeq. 09 r_errSeq. 10 t_errSeq. 10 r_err
ORB-SLAM (reference)15.300.263.680.48
Monodepth210.852.8611.605.72
SC-SfMLearner8.242.1910.704.58
NeuralBundler8.102.8112.903.17
Ours8.752.1110.674.91

Cross-view loss ablation tab. 3a:

Cross-view lossOnline refinementAbs Relδ1
L_ph + L_ds^1 + L_ds^2no0.1030.883
L_ph + L_ds^1 + L_ds^2yes0.0880.905
L_ph + L_fmno0.0990.889
L_ph + L_fmyes0.0790.925

Single-view loss ablation, with odometry tab. 3b. The training setting is not stated in the caption:

Single-view lossAbs Relδ1Seq. 09 t_errSeq. 10 t_err
L_rec0.1050.8834.308.50
L_rec + L_dis0.1030.8844.108.03
L_rec + L_cvt0.1000.8853.295.91
L_rec + L_dis + L_cvt0.0990.8893.073.83

Qualitative comparison with Monodepth2 is in fig. 2. The feature visualisations are in fig. 3 tab. 3.

Paper vs code

No official code. The paper and abstract contain no code link. The arXiv metadata has no comments field that names a repository. The paper links no project page. A GitHub repository search for the title words returned one hit, sconlyshootery/FeatDepth (MIT), whose README calls itself the official code. Its owner is not one of the authors and the page does not show a link to them, so the repository is not treated as the authors' own and is not cited. The DeepMotionAIResearch organisation (the authors' affiliation) lists only DenseASPP and DenseMatchingBenchmark. A web search was not run because the permission was not granted.

Pitfalls

  • Odometry training set conflicts within the paper. §4.1 says the model is trained on sequences 00 to 08. §4.2 says the model was trained on KITTI raw data and applied to sequences 09 and 10. An implementer has to pick one, and the odometry numbers depend on which.
  • Headline δ1 comparison. The abstract's 0.885 to 0.925 uses a baseline row (DepthHint, MS†) that includes post-processing, and the 0.925 result uses online refinement and binocular training tab. 2. The plain monocular model reports δ1 0.893 tab. 2.
  • Joint or separate training of FeatureNet. §3.4 says FeatureNet is supervised by the single-view loss and that its features define the cross-view loss. The text does not say whether the cross-view gradient updates FeatureNet. The conclusion calls the framework end-to-end trainable §5. Both readings are consistent with the text.
  • Gradient definitions. ∇¹ is defined as ∂x + ∂y and ∇² as ∂xx + 2∂xy + ∂yy §3.3. These are not the usual norm or Laplacian. Whether the derivatives are applied per channel, and how they are discretised, is not stated. A signed sum of partials can cancel, so the implementation choice matters.
  • Feature-channel norm. Eqs. 11 to 13 use an L1 norm of the feature gradients, but the reduction across the 64 channels is not stated.
  • Discriminative sign. The term enters the loss with a minus sign so that feature gradients are pushed up §3.3 eq. 11. The paper reports that the discriminative term alone can give a zig-zag feature landscape §4.3.
  • Convergent term is unweighted. The image-weighted version of the second term appears only in commented-out text. The paper's active equation uses the plain L1 norm §3.3 eq. 13.
  • Learning-rate schedule. The starting learning rate of the warm-up is not stated. The phrase "halved twices" is read as two halvings, at epochs 20 and 30 §3.5. The resulting step size after epoch 30 is inferred, not stated.
  • Batch size. Batch size 2 on 8 GPUs can mean 2 per GPU or 2 in total §3.5. This doubles or divides the effective batch.
  • Depth output. The network output is a sigmoid map §3.5. The mapping to metric depth, and any clamping, is not stated in the active text.
  • Occlusion minimum. Eq. 18 takes the minimum of L_{s→t} over sources, but the text does not say whether the minimum is taken before or after the feature and photometric terms are summed. Eq. 15 sums them per source, so the summed form is read here.
  • Scale ambiguity in odometry. For methods that suffer from scale ambiguity the paper uses one global scale per sequence §4.2. Whether this paper's reported numbers use that alignment is not stated.
  • Ablation coverage. No row tests the feature-metric loss without the photometric loss. Every row of tab. 3a includes L_ph.
  • Equation numbers. Equation numbers here were counted from the LaTeX source in order, because the compiled PDF in the source archive is the venue template and not the paper. If a number does not match the rendered page, cite the section.

Lineage

  • Builds on: photometric loss and its SSIM term from Monodepth §3.4; occlusion handling by taking the minimum over source frames from Monodepth2 §3.4; online refinement from struct2depth and GLNet §3.5; auto-encoder reconstruction §2.
  • Compared against: Monodepth2, DepthHint, DFR, SC-SfMLearner, NeuralBundler, DNC, LEGO, and other self-supervised and supervised methods tab. 2 tab. 4.
  • Superseded by: not stated in this wiki.

Source and license

Adapted from “Feature-metric Loss for Self-supervised Learning of Depth and Egomotion” by Chang Shu, Kun Yu, Zhixiang Duan, Kuiyuan Yang (arXiv:2007.10603), used under CC BY 4.0. Changes: condensed and restructured for implementation, with tables, equations and algorithms taken from the paper and its code, each cited to its source. Not affiliated with or endorsed by the authors.