Depth Anything
Yang 2024 · Paper
One-line summary — Depth Anything (CVPR 2024) is a foundation model for monocular depth estimation, built by scaling training to ~62M automatically annotated unlabeled images and achieving strong zero-shot generalization to any scene.
Problem
Supervised monocular depth models plateau because labeled depth data is scarce — roughly a million-plus images across public datasets, versus the effectively unlimited pool of unlabeled internet imagery. Depth Anything’s stated aim is deliberately unglamorous: “without pursuing novel technical modules”, build “a simple yet powerful foundation model dealing with any images under any circumstances” by making large-scale unlabeled data actually useful for depth.
Method & architecture
Base model. A DINOv2-initialized ViT encoder with a DPT decoder, trained in the MiDaS tradition: depth is converted to disparity and normalized to per map, and multi-dataset training uses the affine-invariant loss
with per-image alignment , , . A teacher is trained this way on 1.5M labeled images from 6 datasets (BlendedMVS, DIML, HRWSI, IRS, MegaDepth, TartanAir); sky regions are segmented and set to zero disparity.
Data engine. The teacher pseudo-labels 62M unlabeled images from 8 public sources (SA-1B, ImageNet-21K, LSUN, BDD100K, Google Landmarks, Objects365, Open Images V7, Places365): . A student is re-initialized (not fine-tuned from ) and trained on labeled + pseudo-labeled data at a 1:2 ratio per batch.
Challenging the student. Naive self-training added nothing — teacher and student share architecture and make similar errors. Two strategies unlock the unlabeled data. (1) Strong perturbations on the student’s unlabeled inputs only: heavy color jittering and Gaussian blur, plus spatial CutMix, with rectangular mask (50% probability); the unlabeled loss is the area-weighted sum of affine-invariant losses against and inside and respectively, while the teacher always sees clean images. This compels the model “to actively seek extra visual knowledge and acquire robust representations”. (2) Semantic priors via feature alignment rather than an auxiliary segmentation task (which failed — discrete masks lose too much):
aligning student features with a frozen DINOv2 encoder , but skipping pixels whose similarity already exceeds a tolerance margin — objects share semantics but not depth, so exact feature copying would hurt. The total loss averages , and .
Model family. ViT-S (24.8M), ViT-B (97.5M), ViT-L (335.3M) encoders trade accuracy against speed; metric variants fine-tune the encoder in the ZoeDepth framework on NYUv2 or KITTI.
Results
Zero-shot relative depth on six unseen datasets, versus the best MiDaS v3.1 model (ViT-L class): Depth Anything ViT-L wins everywhere — KITTI AbsRel 0.076 vs 0.127 ( 0.947 vs 0.850), NYUv2 0.043 vs 0.048, Sintel 0.458 vs 0.587, DDAD 0.230 vs 0.251, ETH3D 0.127 vs 0.139, DIODE 0.066 vs 0.075 — and MiDaS wasn’t even fully zero-shot on KITTI/NYUv2 (it trains on their images; Depth Anything does not). The ViT-B model already beats MiDaS’s larger ViT-L, and even ViT-S (<1/10 the size) wins on Sintel, DDAD and ETH3D. Fine-tuned for in-domain metric depth (ZoeDepth framework), it lifts NYUv2 from 0.964 to 0.984 and AbsRel from 0.069 to 0.056 over the previous best (VPD), and KITTI from 0.978 to 0.982; the paper also reports stronger zero-shot metric transfer, strong semantic segmentation from the same encoder, and a better depth-conditioned ControlNet.
Why it matters for SLAM
Monocular SLAM has long wanted a depth prior that works everywhere — for scale, map density, initialization, and robustness in low-parallax motion. Depth Anything made “just call a depth foundation model” a realistic design choice: a single network that yields plausible dense depth on arbitrary indoor/outdoor imagery, with variants fast enough for real-time front-ends. It cemented the data-scaling paradigm for geometric perception — diverse unlabeled data beats more supervised labels — and (with V2) became the default depth backbone plugged into dense and neural SLAM pipelines.
Related
- MiDaS — the affine-invariant multi-dataset training recipe it inherits
- DPT — the dense-prediction decoder architecture
- Depth Anything V2 — successor trained on synthetic labels
- Metric3D — camera-aware route to metric depth
- Marigold — diffusion-based alternative for zero-shot depth
- ZoeDepth — the metric fine-tuning framework used for its metric variants