# Digging Into Self-Supervised Monocular Depth Estimation

Monodepth2 uses minimum reprojection loss to train depth from video

Clément Godard, Oisin Mac Aodha, Michael Firman, Gabriel Brostow · arXiv · 2018-6-4

- **Problem** Averaging photometric error over views penalizes occluded pixels with correct depth.
- **Method** Monodepth2 takes the per-pixel minimum error over source views instead of the average. It also masks out stationary pixels automatically, computed on the forward pass, and computes the loss at full input resolution.
- **Results** Monodepth2 scores 0.115 Abs Rel on the monocular Eigen split, compared with 0.183 for Zhou et al.

## Why averaging across views stalls video training

Self-supervised depth training avoids per-pixel ground truth, and monocular video is the harder of its two main forms. Video training must also learn a pose network alongside the depth network, whereas stereo turns camera pose into a one-time offline calibration. The photometric loss is where the trouble starts, because it averages the reprojection error over all source views.

A pixel visible in the target but hidden in one source view then gets a high penalty, even when its predicted depth is correct.

Averaging also blurs depth edges at disocclusions, and masking out-of-view pixels doesn't address that case. A second failure comes from the static-scene assumption, which breaks when the camera stops or an object moves with it. Such errors show up as holes of infinite depth on objects that were moving during training. A third problem is that computing the loss at every decoder scale leaves holes in low-texture regions and copies texture into the depth.

## Three changes to the photometric loss

The key idea is to keep the usual photometric training and change how the loss combines views, masks pixels and handles scales. The authors present these as three changes that together give large gains in monocular depth estimation.

The first change replaces the average over source views with a per-pixel minimum, so each pixel is matched only to views where it is visible. The final per-pixel loss is written as \\(L\_p = \\min\_{t'} pe(I\_t, I\_{t'\\to t})\\), where \\(pe\\) is the photometric error. The photometric error \\(pe\\) combines an SSIM term with an L1 term, as \\(pe(I\_a,I\_b) = \\frac{\\alpha}{2}(1-\\text{SSIM}(I\_a,I\_b)) + (1-\\alpha)\\lVert I\_a-I\_b\\rVert\_1\\), with \\(\\alpha = 0.85\\).

The authors report that this reduces artifacts at image borders and sharpens occlusion boundaries.

The second change is a binary mask \\(\\mu\\) that keeps a pixel only if its warped reprojection error is lower than its unwarped error. The mask is \\(\\mu = \[\\min\_{t'} pe(I\_t, I\_{t'\\to t}) \< \\min\_{t'} pe(I\_t, I\_{t'})\]\\), where the brackets are the Iverson bracket. It is computed on the forward pass rather than learned, so stationary pixels drop out of the loss without an extra network.

The third change moves the loss to full input resolution instead of each decoder layer's own resolution. Each intermediate depth map is upsampled to the input resolution, then reprojected and compared there, so every scale targets the same high-resolution image. The authors describe this as matching whole patches, since a low-resolution disparity moves a block of high-resolution pixels together.

The smoothness term penalizes gradients of the mean-normalized inverse depth \\(d\_t^\*\\), with the penalty weakened where image gradients are large. The total loss is \\(L = \\mu L\_p + \\lambda L\_s\\) with \\(\\lambda = 0.001\\), averaged over pixels, scales and the batch.

## Network and training setup

The sigmoid output \\(\\sigma\\) becomes depth through \\(D = 1/(a\\sigma + b)\\), with \\(a\\) and \\(b\\) chosen to keep depth between 0.1 and 100 units.

The encoder starts from ImageNet weights, which the authors say helps the compact model compared with training from scratch. The decoder uses reflection padding instead of zero padding, so samples outside the image take the nearest border pixel. The pose network is a ResNet18 that takes six stacked channels and predicts one 6-DoF relative pose, and it is used only during training.

The color augmentations touch only the images fed to the networks, not the images used to compute the loss. The monocular subset has 39,810 triplets for training after static frames are removed.

## KITTI Eigen results

On the Eigen split the monocular Monodepth2 model scores 0.115 Abs Rel, compared to 0.183 for Zhou et al. For monocular models, depth is scaled per image with the median of the ground truth, and depth is capped at 80m. The table marks Zhou et al. as newer results taken from the authors' GitHub, so that row is not a like-for-like rerun.

Stereo supervision alone gives 0.109 Abs Rel, and joint monocular plus stereo gives 0.106, both without median scaling. Stereo training gets its scale from the known camera baseline, so it doesn't need the median step. The authors state that the monocular model outperforms earlier self-supervised methods in the table.

Without ImageNet pretraining the monocular model scores 0.132 Abs Rel, which is still below the 0.183 for Zhou et al. Against SuperDepth at 1024x384, the stereo model is trained for 20 epochs instead of 200 epochs and uses no post-processing. The authors also report that the stereo-only results are strong, although the contributions were designed for monocular training.

## Which changes matter in the ablation

The baseline without the three changes scores 0.140 Abs Rel, and the full model scores 0.115 under the same monocular training. Adding only the minimum reprojection loss lowers the baseline to 0.122, and adding only auto-masking lowers it to 0.124. Each change helps alone, and the full combination gives the lowest Abs Rel in the ablation table.

Within the full model, removing auto-masking raises Abs Rel to 0.120, the largest rise among the three removals. Removing the minimum reprojection loss or the full-resolution multi-scale formulation gives 0.117 in each case, against 0.115 for the full model. Replacing auto-masking with the predictive mask of Zhou et al. gives 0.123, which is worse than removing auto-masking entirely.

The authors read this as the predictive mask hurting results, while their auto-masking improves them in every case.

The authors trained these models for 30 epochs to ensure convergence, so the pretraining gap is tied to that budget.

## Training on the full Eigen split

The full Eigen split keeps sequences where the data capture car is stopped, which can cause trouble for monocular training. With those frames kept, the baseline scores 0.146 Abs Rel and the full model scores 0.116. The authors say their improvement over the baseline grows in this setting, compared with the filtered subset used by Zhou et al.

## Transfer to Make3D

Models trained on KITTI are evaluated on Make3D, where Monodepth2 trained on monocular video scores 0.322 Abs Rel, compared to 0.383 for Zhou et al. The authors say they outperform the methods that do not use depth supervision under the evaluation criteria of Monodepth.

The authors warn that Make3D ground truth and input images are not well aligned, which may cause evaluation issues. The evaluation uses a center crop with a 2x1 ratio, and median scaling is applied to the monocular model.

## Limits of the approach

The main failure is objects that break the Lambertian appearance assumption, such as distorted, reflective and color-saturated regions. The authors also note that boundaries that are ambiguous or shapes that are intricate can be missed.

The depth benchmarks reported here are KITTI and Make3D, and the Make3D alignment problem limits what its numbers can show. Higher-resolution and post-processed results are kept in the supplementary material, so the main table shows results without post-processing.

## Paper info

- **Authors**: Clément Godard, Oisin Mac Aodha, Michael Firman, Gabriel Brostow
- **Venue**: arXiv · Preprint
- **First published**: 2018-6-4
- **Added**: 2026-11-12
- **Updated**: 2019-8-17
- **Version**: v4
- **arXiv**: 1806.01260
- **Category**: cs.CV · stat.ML
- **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/1806.01260v4) · [PDF ↗](https://arxiv.org/pdf/1806.01260v4)

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

Clément Godard, Oisin Mac Aodha, Michael Firman, Gabriel Brostow (2018). Digging Into Self-Supervised Monocular Depth Estimation. arXiv:1806.01260v4. https://arxiv.org/abs/1806.01260v4

**BibTeX**

```
@misc{godard2018digging,
  title = {{Digging Into Self-Supervised Monocular Depth Estimation}},
  author = {Clément Godard and Oisin Mac Aodha and Michael Firman and Gabriel Brostow},
  year = {2018},
  eprint = {1806.01260},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1806.01260v4}
}
```

## Other paper commentary

- [Unsupervised Representation Learning by Predicting Image Rotations](https://refivu.com/en/papers/44e2c7d7-5798-499b-99ea-bd1b30e157b3-unsupervised-representation-learning-by-predicting-image.md)
- [HuBERT: Self-Supervised Speech Representation Learning by Masked Prediction of Hidden Units](https://refivu.com/en/papers/4fe3f455-0287-4182-b603-63ebb7e4b5fc-hubert-self-supervised-speech-representation-learning-by.md)
- [Robust Recovery of Subspace Structures by Low-Rank Representation](https://refivu.com/en/papers/14c27646-6e22-4f5b-b820-67e75508bf84-robust-recovery-of-subspace-structures-by-low-rank.md)
- [Improved Baselines with Momentum Contrastive Learning](https://refivu.com/en/papers/b3c4bdf4-000b-4115-9c61-4869e9e62ccc-improved-baselines-with-momentum-contrastive-learning.md)
- [DeepSDF: Learning Continuous Signed Distance Functions for Shape Representation](https://refivu.com/en/papers/b9c76a95-d60f-4b38-98c6-45cfaa2bcd30-deepsdf-learning-continuous-signed-distance-functions-for.md)
- [SimCSE: Simple Contrastive Learning of Sentence Embeddings](https://refivu.com/en/papers/be6ac7d7-6b80-4ef3-905e-9b7eecc4765c-simcse-simple-contrastive-learning-of-sentence-embeddings.md)
- [CyCADA: Cycle-Consistent Adversarial Domain Adaptation](https://refivu.com/en/papers/86c1af43-2e3a-459f-87e6-d7c0653694a6-cycada-cycle-consistent-adversarial-domain-adaptation.md)
- [Language Models (Mostly) Know What They Know](https://refivu.com/en/papers/ffe245df-5662-4bfb-8c0b-899a38b87412-language-models-mostly-know-what-they-know.md)
- [From Local to Global: A Graph RAG Approach to Query-Focused Summarization](https://refivu.com/en/papers/b90240e0-a6fe-4297-adb6-4ebd769e9c60-from-local-to-global-a-graph-rag-approach.md)
- [The Open Images Dataset V4: Unified image classification, object detection, and visual relationship detection at scale](https://refivu.com/en/papers/a257d9ea-aed6-4a9a-9d02-5e4c50a42a90-the-open-images-dataset-v4-unified-image-classification.md)
- [Generative Image Inpainting with Contextual Attention](https://refivu.com/en/papers/aad66e29-0d9a-49ff-bbf1-91b1b036c9eb-generative-image-inpainting-with-contextual-attention.md)
- [Multimodal Unsupervised Image-to-Image Translation](https://refivu.com/en/papers/f66e468d-e3a2-4e1b-8490-2978cf3d55ff-multimodal-unsupervised-image-to-image-translation.md)

## Terms in this paper

- [SSIM](https://refivu.com/en/terms/a5c530b66e8d-ssim)
- [u-net](https://refivu.com/en/terms/f49a93d54ad5-u-net)
- [RMSE](https://refivu.com/en/terms/ad2579cf164a-rmse)
- [Monocular depth estimation](https://refivu.com/en/terms/8a2cee5cd76c-monocular-depth-estimation)
- [Abs Rel](https://refivu.com/en/terms/b60500d491d4-abs-rel)
- [Make3D](https://refivu.com/en/terms/ad3be1c06be2-make3d)
- [KITTI 2015](https://refivu.com/en/terms/5b20850923a3-kitti-2015)

---

AI-written text can contain mistakes. [Refivu](https://refivu.com/en/papers/501b9eb4-7fd4-43f0-8b68-eaaf0aab3b71-digging-into-self-supervised-monocular-depth-estimation)
