Towards Scale Consistent Monocular Visual Odometry by Learning from the Virtual World

Sen Zhang, Jing Zhang, Dacheng Tao

Abstract

Monocular Visual Odometry (VO) is a cost-effective solution for robotic navigation but is fundamentally limited by scale ambiguity and long-term drift. Traditional methods to resolve scale require expensive real-world stereo data or ground-truth depth for training. This paper presents VRVO (Virtual-to-Real Visual Odometry), a framework that learns absolute scale from virtual environments and transfers this knowledge to real-world monocular sequences. By integrating adversarial domain adaptation with a novel mutual reinforcement pipeline between a deep neural network and a classical optimizer, VRVO achieves state-of-the-art scale consistency and accuracy on standard benchmarks.

1. Introduction

Visual Odometry (VO) is the process of estimating the trajectory of a camera by analyzing a sequence of images. While monocular VO is highly desirable due to its hardware simplicity, it suffers from a fundamental "scale ambiguity": a single camera cannot distinguish between a small object nearby and a large object far away. Over time, this leads to scale drift, where the estimated trajectory's scale fluctuates, preventing accurate localization and loop closure.

Existing deep learning approaches attempt to learn scale from data, but they typically rely on real-world stereo imagery or LiDAR ground truth, which are difficult and expensive to collect at scale. This research explores whether a system can learn the physical concept of scale entirely from a virtual simulator and successfully apply it to real-world monocular video.

2. The VRVO Framework

The proposed VRVO system bridges the gap between virtual training and real-world application through three integrated components.

2.1 Adversarial Domain Adaptation (DA)

To overcome the "reality gap"—the visual difference between simulated environments (vKITTI2) and real-world footage (KITTI)—VRVO employs a domain adaptation strategy. A shared encoder is trained using a Wasserstein GAN-like adversarial loss. This training objective forces the encoder to extract features that are domain-invariant, ensuring that the downstream depth and pose tasks can operate on real-world images even if they were trained on virtual ones.

2.2 Scale-Aware Disparity Prediction

By training on virtual stereo data, the network learns to predict disparity maps with absolute scale. Because the virtual simulator provides the exact distance between its "cameras" (the baseline), the network learns the geometric relationship between pixel displacement and physical distance. During inference on real-world monocular images, the network uses these learned features to predict scale-aware depth.

2.3 Mutual Reinforcement (MR) Pipeline

A key innovation of VRVO is the bidirectional coupling of the neural network with a classical Direct Sparse Odometry (DSO) backend.

  • Forward Reinforcement: The network provides scale-aware depth to initialize the DSO optimizer. Furthermore, it generates a "virtual stereo" constraint by hallucinating a corresponding right-eye view, effectively allowing the monocular DSO to optimize as if it were a stereo system, which locks in the absolute scale.
  • Backward Reinforcement: The DSO backend produces optimized, high-precision camera poses. These poses are then fed back to the neural network as pseudo-ground-truth to fine-tune the network via a photometric loss. This creates a self-improving loop where the optimizer corrects the network, and the network provides better initialization for the optimizer.

3. Experimental Results

The system was evaluated on the KITTI Odometry dataset, using vKITTI2 for virtual training and sequences 09 and 10 for testing.

3.1 Quantitative Performance

VRVO demonstrates superior performance compared to other monocular-trained methods that do not rely on optical flow or real-world stereo data. On KITTI Sequence 09, a challenging route with a large loop, VRVO achieved:

  • Translation Error ($t_{err}$): 1.55%
  • Rotation Error ($r_{err}$): 0.28°/100m
  • Absolute Trajectory Error (ATE): 4.39m

In contrast, standard monocular DSO fails to close the loop on Sequence 09 due to significant scale drift. VRVO’s ability to maintain absolute scale allows it to return to the starting point with high precision, demonstrating the effectiveness of the "virtual stereo" constraint.

3.2 Impact of Mutual Reinforcement

Ablation studies highlight the importance of the MR pipeline. Without the backward reinforcement (the feedback loop from the optimizer to the network), the translation error on Sequence 09 rose from 1.55% to 1.78%. This confirms that the tight coupling of learning and optimization significantly reduces the residual errors inherent in standalone neural networks.

4. Discussion and Limitations

While VRVO represents a significant step forward in scale-consistent VO, some challenges remain. The system's scale-awareness is sensitive to camera intrinsics; when tested on the Make3D dataset without retraining, the scale ratio drifted to 1.594, indicating that the network's understanding of scale is partially tied to the specific camera geometry it was trained on. Additionally, the current implementation uses fixed hyperparameters, which may not be optimal for all environments.

5. Conclusion

VRVO demonstrates that virtual simulators are a viable and powerful source for learning physical scale in monocular vision tasks. By combining adversarial domain adaptation with a mutual reinforcement loop between deep learning and classical optimization, the framework achieves state-of-the-art, scale-consistent odometry without requiring any real-world ground truth or stereo data during training.

Summary updated

BibTeX
@inproceedings{zhang2022towards,
  author = {Sen Zhang and Jing Zhang and Dacheng Tao},
  title = {{Towards Scale Consistent Monocular Visual Odometry by Learning from the Virtual World}},
  booktitle = {IEEE International Conference on Robotics and Automation},
  year = {2022},
}
Figure