Introduction
Optical flow estimation—the process of determining per-pixel motion between video frames—is a fundamental task in computer vision. Traditional approaches typically rely on two consecutive frames, which often fails to capture the rich temporal context inherent in video sequences. While multi-frame methods have been proposed to address this, they frequently suffer from high computational latency due to heavy Vision Transformer (ViT) architectures or require "future" frames, making them unsuitable for real-time, online applications like autonomous driving.
MemFlow introduces a novel, real-time architecture that bridges this gap by utilizing a dedicated memory module to aggregate historical motion information. By leveraging temporal coherence without the overhead of Transformers, MemFlow achieves state-of-the-art performance on major benchmarks while maintaining the speed necessary for safety-critical systems.
Methodology: The Memory-Augmented Architecture
The core of MemFlow is its Memory Module, designed to "remember" past motion states and context efficiently. Unlike window-based multi-frame methods that re-process multiple frames for every estimate, MemFlow maintains a persistent memory buffer.
Memory Read-out and Update
The architecture consists of several key components:
- Memory Buffer: Stores keys ($k_m$) and values ($v_m$) representing historical context and motion.
- Attention Mechanism: A query ($q$) derived from the current frame's context encoder interacts with the memory buffer to extract relevant temporal features.
- Iterative Refinement: Similar to the RAFT architecture, MemFlow uses a Gated Recurrent Unit (GRU) to iteratively refine the flow estimate. However, it enhances this process by fusing current features with the aggregated memory read-out.
Resolution-Adaptive Re-scaling
A significant challenge in optical flow is generalizing from low-resolution training data to high-resolution testing environments (e.g., 1080p). MemFlow addresses this with a novel scaling factor for its attention mechanism, based on the logarithm of the sequence length and image area. This mathematical adjustment allows the model to maintain accuracy across varying resolutions without retraining.
Experimental Results
MemFlow was evaluated on standard benchmarks including Sintel, KITTI-15, and the high-resolution Spring dataset.
Accuracy and Efficiency
On the Sintel "Final" pass, MemFlow achieved an End-Point-Error (EPE) of 2.08, representing a 15.4% improvement over its 2-frame baseline, SKFlow. Notably, the model ranked 1st on the 1080p Spring dataset at the time of submission.
In terms of speed, the standard MemFlow model processes 1024x436 video at 5.6 FPS on an NVIDIA A100. A lightweight variant, MemFlow-T, utilizes fewer GRU iterations to reach 14.5 FPS while still delivering near-SOTA accuracy, demonstrating its viability for real-time applications.
Conclusion and Future Work
MemFlow demonstrates that effective historical aggregation in an "online" model can outperform complex "offline" models that require future frames. While the model shows exceptional performance in estimation and short-term prediction (MemFlow-P), challenges remain in long-term motion prediction where error accumulation becomes significant. Future research may explore distilling older features into more robust long-term memory structures to further extend the model's temporal horizon.
Summary updated