[Paper Review] FlowFormer: A Transformer Architecture for Optical Flow
FlowFormer proposes a novel Transformer-based architecture for optical flow estimation that encodes a 4D cost volume into compact, globally aware latent tokens using alternate-group self-attention, then decodes flow predictions via a recurrent Transformer with dynamic positional queries. It achieves state-of-the-art performance on Sintel (1.159 AEPE on clean pass) and strong zero-shot generalization, outperforming prior methods by 15.5% error reduction without Sintel fine-tuning.
We introduce optical Flow transFormer, dubbed as FlowFormer, a transformer-based neural network architecture for learning optical flow. FlowFormer tokenizes the 4D cost volume built from an image pair, encodes the cost tokens into a cost memory with alternate-group transformer (AGT) layers in a novel latent space, and decodes the cost memory via a recurrent transformer decoder with dynamic positional cost queries. On the Sintel benchmark, FlowFormer achieves 1.159 and 2.088 average end-point-error (AEPE) on the clean and final pass, a 16.5% and 15.5% error reduction from the best published result (1.388 and 2.47). Besides, FlowFormer also achieves strong generalization performance. Without being trained on Sintel, FlowFormer achieves 1.01 AEPE on the clean pass of Sintel training set, outperforming the best published result (1.29) by 21.7%.
Motivation & Objective
- To design a Transformer-based optical flow network that effectively leverages the well-established cost volume representation used in prior methods.
- To overcome the computational infeasibility of applying standard Transformers directly to 4D cost volumes by introducing a compact, efficient tokenization and attention mechanism.
- To improve flow estimation accuracy and generalization by modeling long-range dependencies in cost features through a novel alternate-group attention mechanism.
- To demonstrate that integrating Transformers with cost volumes—rather than processing raw pixels—leads to superior performance and parameter efficiency.
Proposed method
- The method tokenizes each 2D cost map in the 4D cost volume into patches, then projects each patch into K latent tokens, reducing the 4D volume to H×W×K tokens.
- It employs an alternate-group Transformer (AGT) layer that alternately applies self-attention within the same source pixel’s cost map and across different source pixels, enabling global context modeling.
- The cost memory, generated by AGT layers, is a compact, globally aware representation of the full cost volume, preserving essential flow-related information.
- A recurrent Transformer decoder uses dynamic positional cost queries that are updated based on current flow estimates to guide cross-attention over the cost memory.
- The decoder uses a shared gated recurrent unit (GRU) head to regress flow residuals iteratively, improving flow accuracy through refinement.
- The image feature encoder is optionally replaced with an ImageNet-pretrained Vision Transformer (Twins-SVT), which boosts performance compared to standard CNNs.
Experimental results
Research questions
- RQ1Can a Transformer-based architecture effectively process 4D cost volumes for optical flow estimation while maintaining computational efficiency?
- RQ2Does modeling long-range dependencies in cost features via a novel attention mechanism improve flow estimation accuracy compared to local window-based methods?
- RQ3Can a compact latent representation of the cost volume preserve sufficient information for accurate flow prediction, reducing the need for large-scale parameterization?
- RQ4Does integrating Transformers with cost volumes lead to better zero-shot generalization across datasets compared to prior methods?
Key findings
- FlowFormer achieves 1.159 average end-point error (AEPE) on the Sintel clean pass, a 16.5% error reduction over the previous best result (1.388).
- On the Sintel final pass, FlowFormer achieves 2.088 AEPE, a 15.5% error reduction compared to the prior state-of-the-art (2.47).
- Without any fine-tuning on Sintel, FlowFormer achieves 1.01 AEPE on the Sintel clean pass, outperforming the best published result (1.29) by 21.7%.
- Even with a smaller configuration (K=4, D=32, AGT×1), FlowFormer outperforms GMA across all metrics, demonstrating architectural superiority beyond parameter count.
- Replacing GMA’s CNN encoder with the same ImageNet-pretrained Twins-SVT used in FlowFormer leads to only a 15% error reduction on Sintel clean, while FlowFormer still achieves a 15% lower error, proving its design is more effective.
- The ablation study confirms that AGT layers and the cost memory representation significantly improve performance, with AEPE decreasing as the number of AGT layers increases from 0 to 3.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.