MAMo: Leveraging Memory and Attention for Monocular Video Depth Estimation

Rajeev Yasarla, Hong Cai, Jisoo Jeong, Yunxiao Shi, Risheek Garrepalli, Fatih Porikli

TL;DR

MAMo is a novel "plug-and-play" framework that upgrades standard single-image depth estimation models into high-performance video depth estimators using a specialized memory and attention mechanism. By capturing temporal context without the heavy computational burden of traditional cost volumes, MAMo achieves state-of-the-art accuracy on major benchmarks while running significantly faster.

What Problem Does This Paper Address?

Depth estimation—calculating how far objects are from a camera—is a cornerstone of autonomous driving, robotics, and AR/VR. While monocular depth estimation (MDE) using a single image has improved vastly, it fundamentally ignores the temporal cues present in video.

Existing video-based methods often rely on cost volumes, which involve warping multiple frames to find geometric correspondences. While accurate, cost volumes are computationally expensive, memory-intensive, and slow. The authors of MAMo sought a way to leverage temporal information efficiently, enabling models to "remember" the past to better predict the present without the latency overhead of cost volumes.

Comparison of MDE, cost-volume VDE, and the proposed MAMo approach.

Methods

MAMo (Memory and Attention for Monocular video depth) introduces three key components that can be integrated into existing encoder-decoder depth networks:

  1. Spatio-Temporal Memory: The model maintains a set of "tokens" representing visual information and relative displacements from previous frames.
  2. Novel Memory Update (MU) Scheme: This is the "secret sauce." Instead of just appending new data, MAMo updates its memory by comparing the depth prediction of the current frame with a warped version of the previous frame. By minimizing the difference between these two (with the main network weights frozen), the memory is forced to learn equivariant features—information that remains consistent across motion and time.
  3. Memory Attention (MA): The system uses self-attention to organize the memory tokens (guided by displacement data) and cross-attention to fuse these "remembered" features with the current frame's visual features before passing them to the decoder.
Figure 2. Overview of proposed MAMo method.

The authors also implement a "decoder carry-over" strategy, where features from the previous time step's decoder are passed forward to provide additional continuity.

Datasets

The authors evaluated MAMo on three major benchmarks:

  • KITTI: The standard for outdoor autonomous driving scenes.
  • NYU Depth V2 (Video): A standard indoor dataset, adapted here for video sequences.
  • DDAD (Dense Depth for Autonomous Driving): A challenging dataset with long-range depth (up to 250m). The authors specifically used this for "zero-shot" transfer testing to see how well a model trained on KITTI generalizes to new environments.

Key Insights and Ideas

  • Equivariance is Key: The most significant innovation is the memory update mechanism. By using a loss function to update memory tokens rather than just storing raw features, the model learns to filter out noise and focus on features that are geometrically consistent across frames.
  • Efficiency over Brute Force: Unlike cost-volume methods that require heavy image warping and massive 4D tensors, MAMo uses attention to "look back" at compressed memory tokens. This results in a massive reduction in latency.
  • Architectural Agnosticism: MAMo isn't a standalone model; it's a framework. The authors proved its effectiveness by applying it to several different state-of-the-art monocular architectures (like PixelFormer and NeWCRFs), consistently improving their performance.

Key Results

MAMo sets new state-of-the-art (SOTA) records across multiple metrics:

  • Accuracy: On KITTI, MAMo combined with PixelFormer achieved an Absolute Relative Error (Abs Rel) of 0.049, outperforming all existing monocular and multi-frame methods.
  • Generalization: In zero-shot tests on the DDAD dataset, MAMo significantly reduced squared relative error (from 4.041 to 2.990 for NeWCRFs), proving that temporal memory helps models adapt to unfamiliar scenes.
  • Speed: MAMo is remarkably efficient. For example, PixelFormer + MAMo has a latency of roughly 66ms, whereas the SOTA cost-volume-based method, ManyDepth, takes over 450ms on the same hardware.
Qualitative results on KITTI showing sharper and more accurate depth maps compared to baselines.

Limitations and Future Work

While MAMo is highly efficient, it still relies on an external optical flow model (like RAFT) to estimate motion between frames. Although the authors showed that MAMo works well even with lightweight flow models, the overall system's performance is still tethered to the quality of these flow estimates.

Future work might involve end-to-end learning of the flow and depth components or exploring how the memory mechanism handles extremely long-term dependencies or very rapid, erratic camera movements that might challenge current optical flow algorithms.

Summary updated

Abstract

We propose MAMo, a novel memory and attention frame-work for monocular video depth estimation. MAMo can augment and improve any single-image depth estimation networks into video depth estimation models, enabling them to take advantage of the temporal information to predict more accurate depth. In MAMo, we augment model with memory which aids the depth prediction as the model streams through the video. Specifically, the memory stores learned visual and displacement tokens of the previous time instances. This allows the depth network to cross-reference relevant features from the past when predicting depth on the current frame. We introduce a novel scheme to continuously update the memory, optimizing it to keep tokens that correspond with both the past and the present visual information. We adopt attention-based approach to process memory features where we first learn the spatio-temporal relation among the resultant visual and displacement memory tokens using self-attention module. Further, the output features of self-attention are aggregated with the current visual features through cross-attention. The cross-attended features are finally given to a decoder to predict depth on the current frame. Through extensive experiments on several benchmarks, including KITTI, NYU-Depth V2, and DDAD, we show that MAMo consistently improves monocular depth estimation networks and sets new state-of-the-art (SOTA) accuracy. Notably, our MAMo video depth estimation provides higher accuracy with lower latency, when omparing to SOTA cost-volume-based video depth models.
BibTeX
@inproceedings{yasarla2023mamo,
  author = {Rajeev Yasarla and Hong Cai and Jisoo Jeong and Yunxiao Shi and Risheek Garrepalli and Fatih Porikli},
  title = {{MAMo: Leveraging Memory and Attention for Monocular Video Depth Estimation}},
  booktitle = {IEEE/CVF International Conference on Computer Vision},
  year = {2023},
}
Figure