# Unsupervised Learning of Depth and Ego-Motion from Video

Depth and camera motion can be learned from unlabeled video frames

Tinghui Zhou, Matthew Brown, Noah Snavely, David G. Lowe · arXiv · 2017-4-25

- **Problem** Learning depth and ego-motion from video usually needs labels or correspondences, which fail in low-texture regions.
- **Method** The authors train a depth network and a pose network jointly, warping neighbouring frames into the target view and penalizing the photometric error without labels.
- **Results** Reaches Abs Rel 0.208 for monocular depth on the Eigen split of KITTI when trained on KITTI alone and without pose or depth labels.

## Why labels and correspondence limit depth and pose learning

Classical structure-from-motion pipelines recover structure and motion from image correspondences, and those correspondences become unreliable in low-texture regions, in areas of complex geometry or photometry, around thin structures and under occlusion. Learned alternatives have typically relied on external supervision, such as ground-truth depth or calibrated stereo pairs, and methods that need explicit depth for training form one such group.

The question this work asks is whether a network can learn both depth and camera motion from unlabeled monocular sequences, using only the prediction of how neighbouring frames should look.

The central idea is to make novel view synthesis the meta-task: if the predicted depth and camera motion are wrong, a synthesized neighbouring view will not match the observed frame. A synthesized view can look plausible with imperfect geometry on some scenes, such as textureless ones, so the authors argue that the consistency has to hold across diverse layouts and appearances before the networks settle on physically meaningful intermediate outputs.

Training uses short sequences of frames without pose labels, and the scenes are assumed to be mostly rigid so that appearance changes are dominated by camera motion. The main quantitative testbed is the KITTI benchmark, which covers single-view depth and pose estimation.

## From warped neighbours to a photometric loss

Each training window has a target frame and several source frames. The depth network sees only the target frame and produces a depth map under the target view. The pose network receives the target frame stacked with the source frames along the colour channels, and it outputs a relative transform for each source frame.

For a target pixel, the depth network's value and the intrinsics map the pixel into the source image: the target pixel is lifted with the inverse intrinsics, scaled by the predicted depth, moved by the relative transform and projected back with the intrinsics. The result is a continuous coordinate in the source image, \\\[ p\_s \\sim K\\,\\hat{T}\_{t\\to s}\\,\\hat{D}\_t(p\_t)\\,K^{-1}\\,p\_t \\\] which is why the warp has to be sampled rather than indexed.

The source value at that continuous coordinate is bilinearly interpolated from its four nearest pixel neighbours, with weights that grow with spatial proximity, so the warped image stays differentiable with respect to depth and pose. The view synthesis loss is then an L1 difference between the target frame and each warped source frame, summed over source views and pixels, \\\[ L\_{vs} = \\sum\_s \\sum\_p \\hat{E}\_s(p)\\,\|I\_t(p) - \\hat{I}\_s(p)\| \\\] where the mask \\(\\hat{E}\_s\\) is described in the next section.

## Keeping the loss honest: masks, gradients and smoothness

The warping model assumes a static scene, no occlusion or disocclusion between target and source views, and Lambertian surfaces, so that the photo-consistency error is meaningful. When those assumptions break, the gradients can be corrupted and training can stall, so an explainability prediction network is trained jointly with the depth and pose networks to output a per-pixel soft mask for each target-source pair.

Left alone, the weighted loss would be minimized by predicting a zero mask everywhere, since there is no direct supervision for the mask. A cross-entropy regularization term with constant label 1 at each pixel prevents that collapse, so the network can discount unmodeled pixels but only within a limited amount.

A second difficulty is gradient locality: the gradients come from intensity differences with the four neighbours of the projected point, so training stalls when that point falls in a low-texture region or is far from the current estimate. The authors list a convolutional encoder-decoder with a small bottleneck as one remedy, but they adopt the other option, a multi-scale smoothness loss, because it is less sensitive to architectural choices.

The smoothness term takes the L1 norm of second-order gradients of the predicted depth maps.

All terms are added into one objective, \\\[ L\_{final} = \\sum\_l L^l\_{vs} + \\lambda\_s L^l\_{smooth} + \\lambda\_e \\sum\_s L\_{reg}(\\hat{E}^l\_s) \\\] where \\(l\\) indexes image scales, \\(s\\) indexes source images, and the two weights control the smoothness and the explainability regularization. The smoothness weight is set to 0.5/l, where l is the downscaling factor of the scale, and the explainability weight is 0.2 in all experiments.

## Network design and training recipe

Its prediction layers output \\(1/(\\alpha \\cdot \\mathrm{sigmoid}(x) + \\beta)\\) with \\(\\alpha = 10\\) and \\(\\beta = 0.01\\), which keeps the predicted depth positive within a bounded range. Using multiple views as input to the depth network did not improve the results in the authors' experiments.

The pose network applies 7 stride-2 convolutions, then a 1×1 convolution with 6∗(N−1) output channels, and global average pooling aggregates predictions over all spatial locations. The explainability network shares its first five encoding layers with the pose network, then uses five deconvolution layers with multi-scale side predictions, and its prediction layers output 2∗(N−1) channels that are normalized by softmax in pairs.

Training uses Adam with β1 = 0.9, β2 = 0.999, a learning rate of 0.0002 and a mini-batch size of 4, with batch normalization in all layers except the output layers. Training typically converges after about 150K iterations, and the images are resized to 128× 416 during training. For KITTI, each training window has 3 frames, with the central frame as the target, and both color cameras are used.

This gives 44,540 sequences, of which 40,109 are used for training and 4,431 for validation; static sequences whose mean optical flow is below 1 pixel and frames from the test scenes are excluded.

## Single-view depth on KITTI

Evaluation uses the 697 test images of the Eigen split, and because the depth is only defined up to scale, each predicted depth map is multiplied by a scalar matched to the median of the ground truth. The scaling is \\(\\hat{s} = \\mathrm{median}(D\_{gt}) / \\mathrm{median}(D\_{pred})\\).

With KITTI training only, the method reaches an Abs Rel of 0.208, where lower is better, which falls between the Eigen et al. coarse and fine entries of 0.214 and 0.203 and the Liu et al. entry of 0.202. Godard et al. trained with calibrated stereo and left-right consistency on CS + K reach 0.124, so the unsupervised model stays behind that stronger supervised setting.

Pre-training on Cityscapes and then fine-tuning on KITTI gives the CS + K model an Abs Rel of 0.198, compared with 0.267 for the model trained on Cityscapes only. The authors describe this pre-training as a slight improvement over the KITTI-only model, and the Cityscapes-only result reflects the domain gap rather than a limit of the loss itself.

## What explainability modeling adds

Removing explainability modeling from the KITTI-trained depth model raises Abs Rel from 0.208 to 0.221, so the mask gives only a modest gain on this split.

Qualitatively, the masks mark moving objects, objects that leave the frame in later views, and other factors as unexplainable. The same masks also flag thin structures, because the depth network has low confidence on them and tends to mask them out.

## Transfer to Make3D

The model trained on Cityscapes and KITTI is applied directly to Make3D, and errors are computed where depth is below 70 m in a central crop. Other methods in Table 2 are supervised with Make3D ground-truth depth, while Godard et al. are likewise applied without Make3D training.

The method reaches an Abs Rel of 0.383, which is below Karsch et al. at 0.428, Liu et al. at 0.475 and Godard et al. at 0.544, but above Laina et al. at 0.204. The authors say a significant gap remains with the supervised methods, while the predictions capture the global scene layout reasonably well.

## Pose against ORB-SLAM on KITTI odometry

The KITTI odometry split uses sequences 00 to 08 for training and 09 and 10 for testing, with ground-truth odometry from IMU and GPS used only for evaluation. Inputs are 5-frame sequences, and the comparison covers ORB-SLAM (full), which uses all frames with loop closure and re-localization, ORB-SLAM (short), which runs on 5-frame snippets, and the mean car motion.

Each method's scale is first fitted to the ground truth, and the Absolute Trajectory Error is then averaged over 5-frame snippets across the sequence. ORB-SLAM (full) uses 1591 frames for sequence 09 and 1201 frames for sequence 10.

On sequence 09 the method reaches 0.021 ± 0.017, against 0.014 ± 0.008 for ORB-SLAM (full), 0.064 ± 0.141 for ORB-SLAM (short) and 0.032 ± 0.026 for mean odometry, where lower is better.

The method beats both baselines that share its input setting, but it does not reach ORB-SLAM (full), which uses strictly more data.

## Limitations

The framework does not estimate scene dynamics or occlusions explicitly, although the explainability masks account for them implicitly. It assumes the camera intrinsics are given, so random Internet videos with unknown calibration are out of scope for now, and depth maps are a simplified representation of the scene.

The training scenes are assumed to be mostly rigid, and the Lambertian and no-occlusion assumptions are only partly handled by the mask. The depth results are reported up to a per-image scale, which evaluation resolves with the median ratio.

The cross-dataset result on Make3D is only tested with a single Cityscapes plus KITTI model, and the authors leave open whether a cycle consistency loss would further improve the KITTI results.

## Paper info

- **Authors**: Tinghui Zhou, Matthew Brown, Noah Snavely, David G. Lowe
- **Venue**: arXiv · Preprint
- **First published**: 2017-4-25
- **Added**: 2026-11-12
- **Updated**: 2017-8-1
- **Version**: v2
- **arXiv**: 1704.07813
- **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/1704.07813v2) · [PDF ↗](https://arxiv.org/pdf/1704.07813v2)

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

Tinghui Zhou, Matthew Brown, Noah Snavely, David G. Lowe (2017). Unsupervised Learning of Depth and Ego-Motion from Video. arXiv:1704.07813v2. https://arxiv.org/abs/1704.07813v2

**BibTeX**

```
@misc{zhou2017unsupervised,
  title = {{Unsupervised Learning of Depth and Ego-Motion from Video}},
  author = {Tinghui Zhou and Matthew Brown and Noah Snavely and David G. Lowe},
  year = {2017},
  eprint = {1704.07813},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1704.07813v2}
}
```

## Other paper commentary

- [YOLOv11: An Overview of the Key Architectural Enhancements](https://refivu.com/en/papers/d7fa1568-31c6-4ca5-a11e-c69df2a96ef2-yolov11-an-overview-of-the-key-architectural-enhancements.md)
- [Convolutional Pose Machines](https://refivu.com/en/papers/544048ce-4f7c-4027-9775-b611791faf11-convolutional-pose-machines.md)
- [Generalised Dice overlap as a deep learning loss function for highly unbalanced segmentations](https://refivu.com/en/papers/869196db-2d4b-43e8-8320-840073c6640c-generalised-dice-overlap-as-a-deep-learning-loss.md)
- [Learning Visual Reasoning Without Strong Priors](https://refivu.com/en/papers/4dde7e07-b53e-4acd-bcd2-ad4fb1847fa7-learning-visual-reasoning-without-strong-priors.md)
- [Deformable ConvNets v2: More Deformable, Better Results](https://refivu.com/en/papers/35e56c2e-a121-4396-98bf-2215bb94b651-deformable-convnets-v2-more-deformable-better-results.md)
- [Swin Transformer V2: Scaling Up Capacity and Resolution](https://refivu.com/en/papers/376ea342-9ea9-46f8-8c71-84f23e529d90-swin-transformer-v2-scaling-up-capacity-and-resolution.md)
- [Efficient Inference in Fully Connected CRFs with Gaussian Edge Potentials](https://refivu.com/en/papers/bfc0169f-9d85-4375-8194-0b11713c1836-efficient-inference-in-fully-connected-crfs-with-gaussian.md)
- [Semantic Similarity Based on Corpus Statistics and Lexical Taxonomy](https://refivu.com/en/papers/fc160cc9-5a90-432c-8808-b3a1a431f015-semantic-similarity-based-on-corpus-statistics-and-lexical.md)
- [The Pile: An 800GB Dataset of Diverse Text for Language Modeling](https://refivu.com/en/papers/1672f861-b9aa-408b-8aba-b2d5d642c8c9-the-pile-an-800gb-dataset-of-diverse-text.md)

## Terms in this paper

- [Cityscapes](https://refivu.com/en/terms/1067bb006500-cityscapes)
- [Abs Rel](https://refivu.com/en/terms/b60500d491d4-abs-rel)
- [Make3D](https://refivu.com/en/terms/ad3be1c06be2-make3d)
- [novel view synthesis](https://refivu.com/en/terms/f246687402e5-novel-view-synthesis)
- [bilinear sampling](https://refivu.com/en/terms/a7fa35b6c245-bilinear-sampling)

---

AI-written text can contain mistakes. [Refivu](https://refivu.com/en/papers/c545cc84-bdea-4ac2-ba9d-bf5f4a19568c-unsupervised-learning-of-depth-and-ego-motion-from)
