Introduction
Unsupervised Structure-from-Motion (SfM) represents a significant milestone for robotics and autonomous driving, enabling systems to derive 3D scene structures and ego-motion from monocular video without the need for expensive LiDAR or GPS ground truth. Historically, this domain has been dominated by Convolutional Neural Networks (CNNs). However, CNNs are inherently limited by their local receptive fields, often struggling with global scene consistency and robustness against out-of-distribution data such as heavy weather or adversarial noise.
This paper introduces MT-SfMLearner (Monocular Transformer SfMLearner), the first comprehensive framework to leverage Vision Transformers (ViTs) for unsupervised monocular SfM. By utilizing global attention mechanisms, the proposed model addresses the consistency and robustness issues prevalent in traditional CNN-based architectures.
Methodology
The MT-SfMLearner architecture replaces standard CNN encoders with Transformer backbones, specifically DeiT and PVT. The framework consists of two primary components:
- Depth Network: This network utilizes a Transformer encoder to capture global context. It is paired with a specialized decoder that employs "Reassemble" and "Fusion" modules to project 1D sequences back into 2D depth maps at multiple scales.
- Pose & Intrinsics Network: A shared Transformer-based encoder predicts the relative motion (rotation and translation) between frames. A modular path is included to estimate camera intrinsics (focal length and principal point) directly from pixels, allowing for a "plug-and-play" application on uncalibrated cameras.
The model is trained via "view synthesis," where the difference between a warped image (based on predicted depth and motion) and the actual subsequent frame—known as photometric loss—serves as the primary training signal.
Technical Implementation
To bridge the gap between 1D Transformer tokens and 2D spatial maps, the authors developed specific operations for the encoders. These operations, such as transposing, unflattening, and strided convolutions, are essential for maintaining spatial hierarchy within the Transformer framework.
Experimental Setup
The researchers evaluated MT-SfMLearner on two major benchmarks:
- KITTI: The standard for autonomous driving, featuring rural and highway scenes.
- DDAD (Dense Depth for Autonomous Driving): A high-resolution dataset with long-range depth (up to 250m) and diverse urban environments.
To test robustness, the team generated 15 corrupted versions of the KITTI test set (simulating noise, weather, and digital artifacts) and applied Projected Gradient Descent (PGD) for adversarial testing.
Key Results and Insights
- Global Context and Consistency: Transformers demonstrated superior performance in producing uniform depth estimates for large objects (e.g., trucks, buildings) and handling reflective surfaces. While CNNs excel at thin structures due to their local bias, Transformers provide a more stable global "mental model" of the 3D scene.
- Superior Robustness: The most significant finding was the resilience of Transformers. In tests involving 15 types of natural corruption, MT-SfMLearner showed a significant improvement in Root Mean Square Error (RMSE) over CNN counterparts. They were also notably more resistant to adversarial attacks.
- Performance Benchmarks: MT-SfMLearner achieved state-of-the-art accuracy, outperforming the 3D-convolutional PackNet on the challenging DDAD dataset. Additionally, the model successfully learned camera intrinsics with less than 2% error for focal length.
- The Efficiency Trade-off: The primary drawback is the "Transformer tax." MT-SfMLearner ran at approximately 40 FPS compared to 84 FPS for CNNs on an NVIDIA RTX 2080 Ti, while consuming roughly twice the energy per frame.
Conclusion
MT-SfMLearner proves that Vision Transformers can significantly enhance the robustness and global consistency of unsupervised SfM. While computational efficiency remains a challenge for deployment on low-power edge devices, the gains in reliability under adverse conditions suggest that hybridizing Transformers with efficient local convolutional features is a promising path for future research.
Summary updated