Profile

Settings

Loading…

← Papers

Help

FAQ

Which features require signing in?

You can read the commentary, paper info, Model Structure and related papers of public papers without signing in. Sign in to manage your account or contact us about your inquiries.

Can I upload a PDF file?

Upload papers with an arXiv or DOI link; the commentary is public to everyone. Papers whose source and terms of use can't be verified, so the commentary can't be made public, can't be uploaded. Uploading PDF files and keeping papers private are for subscribers only, and a paper uploaded as a file is saved as private only. Searching for official info by title runs only when you press the button.

Are the figures and AI commentary accurate?

Figures come only from the original paper, and only those whose terms of use are verified are shown. The commentary is written by AI and may be wrong. Check important claims, numbers and figure context against the evidence in the original paper.

I want to report a copyright issue.

Terms of use and the source of the original paper are on the Paper info tab. If there's a problem, choose "Paper content, figures and copyright" under Contact us and send the paper link, the part in question, and evidence that you hold the rights. Receiving your report doesn't confirm any rights or remove anything right away. You can see the result of the review under My inquiries.

I forgot my password.

If you signed up with email, use Forgot password in the sign-in window to reset it with your verified email. If you signed up with Google, Naver or Kakao, change your password with that service.

What should I include in an inquiry?

Tell us which screen you were on and what you were doing when the problem happened, along with the paper link. Don't include personal information such as passwords, API keys, verification codes or phone numbers. Inquiries and replies are stored in Refivu and you can see them under My inquiries.

How do I delete my account?

In Settings, under My account, press Delete account. Review what will be deleted and complete identity verification to delete your account. For other requests, choose "Account" under Contact us.

Paper commentary

Unifying Flow, Stereo and Depth Estimation

  • Problem Optical flow, rectified stereo matching and unrectified stereo depth are usually solved by separate architectures built around task-specific cost volumes and post-processing.
  • Method Casts all three tasks as softmax-weighted matching over feature similarities, with Transformer features that use cross-attention between the two views and a propagation layer for unmatched pixels.
  • Results GMFlow with one hierarchical matching refinement reaches 1.08 EPE on Sintel clean, against 1.41 for RAFT with 31 refinements, trained on Chairs and Things.

Figure 2: Overview of our unified model . We consider two images as input, which can be video frames for optical flow,
a stereo pair for rectified stereo match…

Fig. 2 : Overview of our unified model . We consider two images as input, which can be video frames for optical flow, a stereo pair for rectified stereo matching or posed images for unrectified stereo depth estimation. We first extract 8× downsampled dense features from the two input images with a weight-sharing convolutional network. The features are then fed into a Transformer for feature enhancement. Next, we perform feature matching by using parameter-free task-specific matching layers, which produce the optical flow, disparity or depth output, depending on the task. An additional task-agnostic self-attention layer is introduced to propagate the high-quality predictions to unmatched regions by measuring feature self-similarity.

Original paper · CC BY 4.0 · Haofei Xu, Jing Zhang, Jianfei Cai, Hamid Rezatofighi, Fisher Yu, Dacheng Tao, Andreas Geiger · Unifying Flow, Stereo and Depth Estimation · Original paper figure · Extracted the figure area from page 4 of the original PDF.

Why separate task networks block a shared model

Optical flow, rectified stereo matching and unrectified stereo depth estimation are normally handled by separate network designs. Each design builds a geometric prior, usually a cost volume whose shape depends on the task, and then regresses the output with convolutions that differ from task to task. Flow uses 2D correlation, stereo uses 1D correlation or feature concatenation, and the convolution types range from 2D and 3D networks to ConvGRU, so each task ends up with its own post-processing stack.

The authors treat all three problems as one dense correspondence problem, in which pixels in one image are matched against positions in the other and the output is read from those matches. Under that view the task-specific part shrinks to parameter-free matching layers, and what has to be learned is one feature extractor that serves all three tasks.

Pretrained weights can then be reused across tasks, which separately studied models do not allow.

Matching layers as the shared output stage

For optical flow, the features of the two frames are correlated for every pair of positions in one matrix multiplication, scaled by the inverse square root of the feature dimension D. The correlation tensor is \( C_{flow} = F_1 F_2^{T} / \sqrt{D} \in \mathbb{R}^{H \times W \times H \times W} \). A softmax over the last two axes turns each position into a distribution over all positions of the second frame, and the match is the expected pixel grid under that distribution.

Flow is then the expected coordinate minus the original grid, and because the output is a weighted average rather than a discrete pick, the matching can reach sub-pixel accuracy.

For rectified stereo, the correlation is restricted to horizontal positions, which gives an H × W × W volume instead of a full 2D one. Each W × W slice has its upper triangle masked, because a match in the first image lies to the left of its reference pixel. The softmax-weighted horizontal coordinate gives the matched position, and disparity is the difference between the grid x-coordinate and that expected coordinate.

Depth from posed images follows the plane-sweep idea: known intrinsic and extrinsic parameters map pixels of the first image into the second image for each candidate depth. The depth range is discretized in inverse depth into N candidates, and each candidate gives a sampled feature map and a per-pixel correlation scaled by the feature dimension D.

The correlations over all candidates are stacked, normalized with a softmax over the candidate axis, and the depth is the weighted average of the candidate depths.

All three matching layers are differentiable and carry no learned weights, so the output stage has no task-specific parameters. The resulting models are named GMFlow, GMStereo and GMDepth for flow, stereo and depth.

Cross-attention features before matching

Fixed 2D sine and cosine positional encodings are added before the Transformer, because the convolutional features carry no explicit location. The Transformer is a stack of six blocks, and each block contains self-attention, cross-attention and a two-layer feed-forward network.

In self-attention, queries, keys and values come from one feature map, which enlarges each feature's context. In cross-attention the keys and values still come from one source, but the queries come from the other view, so each view's features can absorb evidence from the other.

Full attention over all H × W positions is quadratic in cost, so attention is restricted to local windows of the feature map. The feature map is split into a fixed 2 × 2 grid, so each window scales with the feature size, and the partition is shifted by half a window between consecutive layers to connect neighboring windows. Among the splits tried, the 2 × 2 setting gave the best speed-accuracy trade-off.

Rectified stereo correspondences lie on one horizontal line, so the stereo model uses 1D horizontal cross-attention instead of full 2D cross-attention. Only the linear projections carry learnable weights, so the choice of attention form changes no parameter count.

Propagation and upsampling for unmatched pixels

The matching step assumes corresponding pixels are visible in both images, so for occluded and out-of-boundary pixels the matched prediction is unreliable. The propagation step applies one self-attention layer over the first view's features, and its softmax weights, computed from feature self-similarity, mix the predicted values across pixels.

Matched and unmatched pixels are not labeled in advance; the layer is learned from ground-truth flow supervision.

The combination weights come from a small two-layer convolutional network whose output has 8 × 8 × 3 × 3 channels for 8× upsampling.

Hierarchical matching refinement reruns the same matching on 1/4 resolution features, so it adds no task-specific learned parameters. Local regression refinement is convolutional and task-specific, and it is applied only as optional post-processing.

Optical flow ablations and the RAFT comparison

In the Transformer component ablation on Things validation, the full model reaches 6.67 EPE. Removing cross-attention is the largest change, raising the EPE to 10.84, while removing self-attention gives 7.04, removing the feed-forward network gives 8.71 and removing positional encoding gives 8.38. The variant without cross-attention has fewer parameters, 3.8 M against 4.2 M for the full model, so it is worse while being smaller.

On Sintel clean, adding flow propagation lowers the EPE on unmatched pixels from 15.54 to 10.39. Matched-pixel EPE moves the other way, from 1.06 to 1.10, and the all-pixel EPE falls from 2.28 to 1.89. The gain is therefore concentrated on the pixels that matching alone cannot reach.

Replacing global matching with local windows raises the Things validation clean EPE to 31.78 for a 3 × 3 window, 26.51 for 5 × 5 and 19.88 for 9 × 9, against 6.67 for global matching. Changing the number of window splits trades accuracy for time: 1 × 1 gives 6.34 at 105 ms, 2 × 2 gives 6.67 at 53 ms and 4 × 4 gives 7.32 at 35 ms.

On Sintel clean training, with models trained on Chairs and Things, GMFlow with one hierarchical matching refinement reaches 1.08 EPE, against 1.41 for RAFT with 31 refinements. On Sintel final the same comparison gives 2.48 for GMFlow and 2.69 for RAFT. Without any refinement, GMFlow reaches 3.48 on Things validation, lower than the 4.31 that RAFT reaches with 11 refinements.

RAFT with 31 refinements takes 170 ms on a V100 and 91 ms on an A100 at the same resolution. The authors relate the larger speedup on the A100 to GMFlow needing fewer sequential computations, and report 2.29× against 1.87×.

Against Perceiver IO, which regresses flow without a geometric matching step, the authors report 8× fewer parameters and 4× faster inference.

Stereo and depth: ablations and cross-task transfer

For rectified stereo, 1D cross-attention gives Things EPE 1.22 and KITTI D1 10.53 at 50 ms, against 1.25 and 13.66 at 61 ms for 2D cross-attention. In this comparison the 1D variant is both faster and more accurate.

On stereo, removing cross-attention raises Things EPE from 1.22 to 1.96 and KITTI D1 from 10.53 to 31.97. Removing propagation gives a Things EPE of 2.33, while its KITTI D1 of 10.09 is slightly below the 10.53 of the full model.

For depth, flow initialization lowers Abs Rel from 0.074 to 0.066 after 50K finetuning steps. The authors report that starting from the flow model also gives faster training for stereo and depth.

On the Scene Flow test set, RAFT's x-flow used as disparity reaches EPE 8.10 with no refinement and 1.93 with 31. GMFlow with 1D cross-attention and 1D matching reaches EPE 2.58 with no refinement and 1.38 with one, while the finetuned GMStereo reaches 1.00 and 0.89. At zero refinements RAFT takes 15 ms and the GMFlow variant takes 23 ms.

On ScanNet, RAFT's optical flow converted to depth by triangulation reaches Abs Rel 0.271 with no refinement and 0.117 with 31. GMFlow with depth matching and no finetuning reaches Abs Rel 0.198 with no refinement, which is worse than the 31-refinement triangulation result. The authors attribute the weaker unfinetuned depth result to the depth matching layer differing from the flow matching layer.

Benchmark results across flow, stereo and depth

The additional local regression refinements add six steps on top of GMFlow, which the authors use to improve unmatched regions and fine detail. On the Sintel test set, GMFlow+ reaches 1.03 EPE on the clean pass and 2.37 on the final pass, both over all pixels. On the clean pass this is the lowest value in the table, while on the final pass FlowFormer reaches 2.12, which is lower.

On the KITTI test set, GMFlow+ reaches 2.40 on non-occluded pixels and 4.49 on all pixels.

Trained on Chairs, Things and Virtual KITTI 2, GMFlow+ reaches 2.25 EPE on KITTI 2015 training, against 2.45 for RAFT, while GMFlow alone reaches 2.85. Without Virtual KITTI 2, GMFlow is well behind RAFT, at 7.77 against 5.32. The authors attribute this gap to the inductive biases of convolutional networks helping RAFT on small training sets, and report that the gap narrows when more data is added.

GMStereo reaches D1-all 1.77 over all pixels and 1.61 on non-occluded pixels on the KITTI 2015 test set, at 0.17 s. LEAStereo and CREStereo score lower on D1-all over all pixels, at 1.65 and 1.69, and AANet+ runs in 0.06 s.

On Middlebury, the authors report first place in the RMS disparity error, with 5× and 15× speedups over CREStereo and RAFT-Stereo. On ETH3D they report second place on bad 1.0 and bad 2.0, and first place on bad 4.0.

On ScanNet, GMDepth reaches Abs Rel 0.059 and RMSE log 0.082 at 0.04 s per sample. DeepV2D reaches Abs Rel 0.057 at 0.69 s, BA-Net reaches 0.161 at 0.38 s, and DeMoN reaches 0.231 at 0.69 s. The authors describe the performance as comparable to DeepV2D and report 10× faster than BA-Net and 15× faster than DeepV2D.

Trained on the mixed RGBD-SLAM, SUN3D and Scenes11 sets, GMDepth reaches Abs Rel 0.101, 0.112 and 0.050 on the three test sets. IIB reaches 0.095 on RGBD-SLAM and 0.099 on SUN3D, slightly lower Abs Rel than GMDepth, while on Scenes11 DPSNet and IIB both reach 0.056, above GMDepth's 0.050. The authors describe performance as similar to IIB, with a more lightweight and faster model.

Limitations

On Sintel, matched pixels reach 0.34 EPE on clean and 1.10 on final, but errors on unmatched pixels are considerably larger, and the authors leave this for future work. The formulation assumes corresponding pixels are visible in both images, so occluded and out-of-boundary pixels depend on the propagation step.

The model still relies on RAFT's iterative refinement as a post-processing step, and the authors consider a lighter alternative future work. The full model does not reach real-time speed, and the authors name 20 FPS or more as the target. The experiments cover two-frame tasks only, training one model on all three tasks was not tested, and questions such as balancing the tasks during joint training remain open.

On KITTI, GMFlow without extra training data does not beat RAFT, and the generalization results come from one training setup.

Paper info

Authors
Haofei Xu, Jing Zhang, Jianfei Cai, Hamid Rezatofighi, Fisher Yu, Dacheng Tao, Andreas Geiger
Venue
arXiv · Preprint
First published
2022-11-10
Added
2026-11-6
Updated
2023-7-26
Version
v3
arXiv
2211.05783
Category
cs.CV
Original paper terms
CC BY 4.0
What we show
Paper info, commentary and permitted figures from the original paper

AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.

Abstract

We present a unified formulation and model for three motion and 3D perception tasks: optical flow, rectified stereo matching and unrectified stereo depth estimation from posed images. Unlike previous specialized architectures for each specific task, we formulate all three tasks as a unified dense correspondence matching problem, which can be solved with a single model by directly comparing feature similarities. Such a formulation calls for discriminative feature representations, which we achieve using a Transformer, in particular the cross-attention mechanism. We demonstrate that cross-attention enables integration of knowledge from another image via cross-view interactions, which greatly improves the quality of the extracted features. Our unified model naturally enables cross-task transfer since the model architecture and parameters are shared across tasks. We outperform RAFT with our unified model on the challenging Sintel dataset, and our final model that uses a few additional task-specific refinement steps outperforms or compares favorably to recent state-of-the-art methods on 10 popular flow, stereo and depth datasets, while being simpler and more efficient in terms of model design and inference speed.

Quote from the paper

Haofei Xu, Jing Zhang, Jianfei Cai, Hamid Rezatofighi, Fisher Yu, Dacheng Tao, Andreas Geiger (2022). Unifying Flow, Stereo and Depth Estimation. arXiv:2211.05783v3. https://arxiv.org/abs/2211.05783v3

BibTeX
@misc{xu2022unifying,
  title = {{Unifying Flow, Stereo and Depth Estimation}},
  author = {Haofei Xu and Jing Zhang and Jianfei Cai and Hamid Rezatofighi and Fisher Yu and Dacheng Tao and Andreas Geiger},
  year = {2022},
  eprint = {2211.05783},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2211.05783v3}
}

See related papersBrowse other papers

Paper preview
Account security

Connect Google account

If you connect a Google account, you can sign in with it too.

Refivu

Delete account

Refivu
Refivu

Sign up