Transformer guided geometry model for flow-based unsupervised visual odometry

Xiangyu Li, Yonghong Hou, Pichao Wang, Zhimin Gao, Mingliang Xu, Wanqing Li

TL;DR

This paper introduces a novel unsupervised visual odometry (VO) framework that mitigates the error accumulation common in recurrent neural network (RNN) based methods. By combining a Transformer-based estimator for local temporal windows with a flow-based estimator for pairwise frames, the model learns robust camera poses. A consistency loss bridges the two during training, allowing the system to achieve state-of-the-art unsupervised performance on the KITTI dataset while remaining fast and lightweight during inference.

What Problem Does This Paper Address?

Visual Odometry (VO) is the process of estimating a camera's trajectory (ego-motion) from a sequence of images. While supervised deep learning methods have shown great promise for VO, they require massive datasets with expensive ground-truth pose data (like LiDAR or high-precision GPS). Unsupervised methods bypass this by jointly training depth and pose networks to minimize a photometric warping loss (essentially checking if the predicted movement correctly maps one image to the next).

However, existing unsupervised methods face a dilemma. If they only look at pairs of images, they ignore long-term temporal context and drift over time. If they use RNNs or LSTMs to integrate temporal information, they suffer from severe error accumulation because historical information is compressed into a single, lossy hidden state. The authors tackle this gap by asking: How can we leverage temporal information over a short window without the error accumulation of RNNs, while still exploiting the strong spatial relationships found in pairwise optical flow?

Methods

The authors propose a dual-branch framework consisting of two distinct pose estimators that guide each other during training:

  1. TAPE (Transformer-based Auxiliary Pose Estimator): Instead of an RNN, the authors use a Transformer to model temporal and geometric correlations over a short sequence of frames (e.g., 3 to 5 frames). TAPE doesn't process raw RGB images; it takes "DF-Groups" (concatenated depth maps and optical flow) as input. By using self-attention, TAPE processes these frames in parallel, treating pose estimation almost like a machine translation task.
  2. F2FPE (Flow-to-Flow Pose Estimator): This branch focuses strictly on pairwise consecutive frames. It uses an initial flow generator (like PWC-Net) and refines it through an encoder-decoder structure to predict the relative camera pose between just two images.
  3. Pose Consistency Constraint: The magic happens during training. The authors apply a consistency loss that forces the poses predicted by F2FPE to match the temporally-aware poses predicted by TAPE.

What's new? Using a Transformer to explicitly model the geometric dependence between depth, flow, and pose over a local window is novel for unsupervised VO. Furthermore, TAPE is strictly an auxiliary module. During inference, TAPE is dropped entirely. Only F2FPE is used, resulting in fast inference that still benefits from the temporal context TAPE provided during training.

Datasets

  • KITTI Odometry Split: The standard benchmark for VO. Used for training (sequences 00-08) and evaluation (sequences 09, 10).
  • KITTI Eigen Split: Used specifically to evaluate the auxiliary depth estimation performance.
  • Malaga Urban Dataset: A challenging dataset with diverse illumination conditions and different camera parameters, used to test the model's robustness and ability to generalize without ground-truth fine-tuning.

Key Insights and Ideas

  • Transformers beat RNNs for local VO: By processing a local window of frames in parallel using self-attention, Transformers avoid the sequential error drift inherent in LSTMs. Ablation studies clearly showed ConvLSTMs accumulating error over longer paths, whereas the Transformer maintained stability.
  • Cross-modality inputs force geometric learning: By feeding TAPE "DF-Groups" (depth + flow) rather than raw pixels, the network is forced to learn the inherent mathematical dependencies between 3D structure (depth), 2D motion (flow), and camera movement (pose).
  • Teacher-Student dynamics for inference speed: By using TAPE to guide F2FPE via a consistency loss, the pairwise estimator "absorbs" temporal awareness. Dropping TAPE at inference gives the best of both worlds: the accuracy of a temporal model with the computational speed of a pairwise model.

Key Results

  • State-of-the-Art Unsupervised Performance: On the KITTI benchmark, the method outperformed existing unsupervised SOTA models by a large margin. On Sequence 09, it achieved a translation error ($t_{err}$) of 2.36% and a rotation error ($r_{err}$) of 1.06°/100m. On Sequence 10, it hit 3.00% $t_{err}$ and 1.28°/100m $r_{err}$.
  • Rivaling Supervised Methods: The unsupervised results are highly competitive with supervised deep learning methods (like DeepVO) and traditional geometry-based systems (like ORB-SLAM2 without loop closure).
  • Robustness: On the Malaga dataset, traditional monocular SLAM often failed due to low-texture frames or extreme lighting changes. The proposed method maintained robust tracking, proving its ability to generalize to unlabelled driving scenes.

Limitations and Future Work

  • Static Scenes: The model struggles when the camera stops moving (e.g., waiting at a traffic light, as seen in KITTI Sequence 07). Because unsupervised VO relies on photometric loss (which requires pixel movement between frames to calculate gradients), static frames introduce erroneous pose predictions.
  • Depth Estimation Limits: While depth estimation is used to help train the system, its standalone performance is limited since it is treated purely as an auxiliary task without dedicated optimization.
  • Future Work: The authors plan to address the static scene errors, explore cross-attention structures to better fuse the depth, flow, and pose modalities, and eventually extend this VO framework into a full unsupervised SLAM system complete with backend optimization and mapping modules.

Summary updated

BibTeX
@article{li2021transformer,
  author = {Xiangyu Li and Yonghong Hou and Pichao Wang and Zhimin Gao and Mingliang Xu and Wanqing Li},
  title = {{Transformer guided geometry model for flow-based unsupervised visual odometry}},
  journal = {Neural Computing and Applications},
  year = {2021},
  url = {https://openreview.net/forum?id=8DhLUjGFGD9},
}
Figure