
raft_small
Depth estimation1,348 ops990.2K params
Iterative optical flow from all-pairs correlation volumes and a convolutional GRU, traced as torchvision's large and small builds over 12 updates.
Depth estimation · 1,633 operations Checked
Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.
The file opened in a new tab. Use your browser's Save command there to keep it.
The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.
About this model's family
RAFT, Recurrent All-Pairs Field Transforms, is Zachary Teed and Jia Deng's optical flow network: given two frames it predicts, for every pixel of the first, where that pixel went in the second. It is worth a close look because it replaced the coarse-to-fine pyramids of earlier flow networks with a single iterative loop, and the paper reports state-of-the-art performance with it. On KITTI RAFT reaches an F1-all error of 5.10%, a 16% error reduction from the best published result (6.10%), and on Sintel (final pass) an end-point-error of 2.855 pixels, a 30% error reduction from the best published result (4.098 pixels).
The design has three main components: a feature encoder that extracts a feature vector for each pixel, a correlation layer that produces a 4D correlation volume for all pairs of pixels, with subsequent pooling to produce lower resolution volumes, and a recurrent GRU-based update operator that retrieves values from the correlation volumes and iteratively updates a flow field initialized at zero. The encoder outputs features at 1/8 resolution with D = 256 channels, built from 6 residual blocks, 2 at 1/2 resolution, 2 at 1/4 resolution, and 2 at 1/8 resolution, and a separate context network extracts features only from the first input image. The update step is a gated activation unit based on the GRU cell, with fully connected layers replaced with convolutions, and the authors adopt from TrellisNet and DEQ the core idea of using a large number of weight-tied units. That operator has only 2.7M parameters and can be applied 100+ times during inference without divergence.
Because the network outputs optical flow at 1/8 resolution, a final upsampling step takes the full resolution flow at each pixel to be the convex combination of a 3x3 grid of its coarse resolution neighbours, which is why each traced member emits a stack of full-size two-channel flow fields, one per update iteration. Two members are captured, the full model and the small one: a smaller version of RAFT with 1/5 of the parameters runs at 20 frames per second while still outperforming all prior methods on Sintel. The authors' repository also offers an alternate correlation implementation that is somewhat slower than all-pairs, but uses significantly less GPU memory.
Key idea. A single-resolution iterative design: all-pairs 4D correlation volumes read by a convolutional GRU that refines a flow field over many weight-tied updates, instead of a coarse-to-fine pyramid.
AI-written summary, checked automatically against its sources; not reviewed by a person. Corrections welcome.
@misc{teed2020raftrecurrentallpairsfield,
title={RAFT: Recurrent All-Pairs Field Transforms for Optical Flow},
author={Zachary Teed and Jia Deng},
year={2020},
eprint={2003.12039},
archivePrefix={arXiv},
primaryClass={cs.CV},
url={https://arxiv.org/abs/2003.12039},
}