SEA-RAFT

Wang 2024 · Paper

One-line summary — Simple, Efficient, Accurate RAFT: a mixture-of-Laplace loss, direct regression of the initial flow, rigid-flow pre-training on TartanAir, and architectural simplifications give RAFT the best accuracy-efficiency Pareto frontier — state of the art on Spring while running at least 2.3x faster than comparable methods.

Problem

Post-RAFT progress in optical flow came mostly from heavier architectures — Transformer cost-volume encoders, larger backbones — trading away the speed that makes flow usable in real-time systems. Meanwhile RAFT’s own recipe has weaknesses: the standard L1L_1 endpoint loss is dominated by ambiguous, unpredictable pixels under heavy occlusion; zero-initialized flow forces many refinement iterations (12 in training, up to 32 in inference); and the synthetic FlyingChairs/Things data limits realism and generalization. SEA-RAFT asks how far loss, initialization, and data changes can push the original architecture.

Method & architecture

SEA-RAFT keeps RAFT’s skeleton. Feature encoder FF and context encoder CC (truncated ImageNet-pretrained ResNets replacing RAFT’s custom encoders) map I1,I2RH×W×3I_1, I_2 \in \mathbb{R}^{H\times W\times 3} to 1/81/8-resolution features; a multi-scale 4D correlation volume is built as

Vk=F(I1)AvgPool(F(I2),2k)Rh×w×h2k×w2k,k=4, (h,w)=18(H,W)V_k = F(I_1) \circ \texttt{AvgPool}(F(I_2), 2^k)^{\top} \in \mathbb{R}^{h\times w\times\frac{h}{2^k}\times\frac{w}{2^k}}, \qquad k=4,\ (h,w)=\tfrac{1}{8}(H,W)

Each iteration looks up motion features around the current flow μ\mu with radius r=4r{=}4, M=MotionEncoder(LookUp({Vk},μ,r))M = \texttt{MotionEncoder}(\texttt{LookUp}(\{V_k\},\mu,r)), and a recurrent unit (two ConvNeXt blocks replacing RAFT’s ConvGRU) updates the hidden state and regresses the residual: h=RNN(h,M,C(I1))h' = \texttt{RNN}(h, M, C(I_1)), Δμ=FlowHead(h)\Delta\mu = \texttt{FlowHead}(h'). The three main changes:

MixLap(x;α,β1,β2,μ)=αexμeβ12eβ1+(1α)exμeβ22eβ2MixLap(x;\alpha,\beta_1,\beta_2,\mu) = \alpha\cdot\frac{e^{-\frac{|x-\mu|}{e^{\beta_1}}}}{2e^{\beta_1}} + (1-\alpha)\cdot\frac{e^{-\frac{|x-\mu|}{e^{\beta_2}}}}{2e^{\beta_2}}

with β1=0\beta_1{=}0 fixed so the first component matches the L1L_1/endpoint-error metric, scales regressed in log-space for stability (β2[0,10]\beta_2 \in [0,10]), and the loss LMoL\mathcal{L}_{MoL} being the negative log-likelihood of the ground truth averaged over pixels and both flow axes, applied per iteration with the usual exponential weighting Lall=i=1NγNiLMoLi\mathcal{L}_{all}=\sum_{i=1}^{N}\gamma^{N-i}\mathcal{L}_{MoL}^{i}. The mixing weight α\alpha doubles as an uncertainty output.

Variants: SEA-RAFT(S) uses the first 6 layers of ResNet-18, (M) the first 13 of ResNet-34; (L) is (M) run with 12 inference iterations.

Results

Why it matters for SLAM

SEA-RAFT is the practical choice when a SLAM front-end needs dense flow at real-time rates: RAFT-class machinery without Transformer-class latency. Two of its ingredients align directly with SLAM needs — the rigid-motion pre-training matches the mostly rigid world SLAM assumes, and the Laplace-mixture parameters give per-pixel uncertainty that maps naturally onto measurement covariances in probabilistic estimation. It is also a case study that loss, initialization, and data design can beat architecture growth, a lesson relevant to any learned SLAM component.