Forecasting of depth and ego-motion with transformers and self-supervision

Houssem Eddine Boulahbal, Adrian Voicila, Andrew I. Comport

Introduction

For autonomous vehicles and mobile robots, perception is not just about understanding the present; it is about anticipating the future. While significant progress has been made in monocular depth estimation—the ability to infer 3D geometry from a single 2D image—the task of depth forecasting remains a formidable challenge. Depth forecasting requires a system to predict the geometry of a future scene and the agent's own motion (ego-motion) based solely on a sequence of past observations.

Traditionally, this has required expensive sensors like LiDAR or dense manual labels. This paper introduces an end-to-end, self-supervised framework that bridges this gap, using only raw, unlabeled image sequences to learn the complex dynamics of the world.

The Architecture: CNNs Meet Transformers

The proposed model employs a hybrid architecture designed to exploit the complementary strengths of two major neural network paradigms: spatial feature extraction and temporal reasoning.

1. Spatial Encoding (CNN)

The framework begins with a ResNet-34 backbone. This encoder processes a sequence of $k$ context frames (the past) to extract high-level spatial features. CNNs are particularly effective here due to their strong inductive bias, allowing the model to recognize local patterns and spatial relationships within individual frames.

2. Temporal Aggregation (Transformer)

The core innovation lies in the use of a Transformer encoder for temporal reasoning. While previous attempts often relied on Recurrent Neural Networks (like LSTMs) or simple feature concatenation, the authors found these methods lacking. By projecting spatial features into an embedding space and applying multi-head self-attention, the Transformer can correlate information across all past frames simultaneously. This allows the model to capture long-range temporal dependencies and complex scene dynamics more effectively than sequential processing.

3. Decoding and Forecasting

The spatio-temporal features are passed to a convolutional decoder with skip connections. This decoder outputs a disparity (depth) map for a future time step $t+n$. Crucially, at test time, the model generates this prediction without ever seeing the target frame.

Self-Supervised Learning via Photometric Loss

To eliminate the need for ground-truth depth data, the model is trained using a photometric loss mechanism. During the training phase, the model predicts both the future depth and the relative pose (ego-motion) between the past and the future.

Using these predictions, the system "warps" the past images to synthesize a predicted version of the future frame. The difference between this synthesized image and the actual future image (which is available during training) serves as the supervisory signal. This allows the model to learn the laws of geometry and motion simply by watching videos.

Experimental Results

The model was rigorously evaluated on the industry-standard KITTI benchmark, specifically the Eigen split for depth and the KITTI Odometry sequences for ego-motion.

  • The Power of Attention: The transition from simple feature concatenation to a Transformer-based aggregation resulted in a significant performance boost, reducing the Absolute Relative (Abs Rel) error from 0.205 to 0.178.
  • Forecasting Accuracy: At a 0.5-second forecast horizon, the model achieves results comparable to early "non-forecasting" models that actually had access to the target frame. While performance naturally degrades as the horizon extends to 1.0 second (Abs Rel: 0.208), it remains significantly more accurate than naive baselines like projecting the last known LiDAR scan.
  • Dynamic Object Handling: By reasoning over sequences, the model learns to account for the movement of other agents in the scene, such as cars or cyclists, rather than assuming a static world.
  • Ego-Motion: The forecasted ego-motion proved competitive with established self-supervised odometry methods, confirming that the model successfully internalizes the physics of vehicle movement.

Discussion and Limitations

While the framework represents a significant step forward, several challenges remain:

  • Deterministic Predictions: The current model is deterministic, predicting a single "most likely" future. In reality, the future is stochastic; a car at an intersection might turn or go straight. Future iterations could benefit from probabilistic frameworks like Variational Autoencoders (VAEs) to model multiple potential outcomes.
  • Boundary Blurriness: The forecasted depth maps often exhibit blurry edges around dynamic objects, a common side effect of the Laplacian distribution assumptions used in the loss function.
  • Scale and Distance: Like most monocular systems, the model suffers from scale ambiguity (not knowing the absolute distance in meters without a reference) and struggles with very distant objects where the change in perspective (parallax) is negligible.

Conclusion

By combining the spatial prowess of CNNs with the temporal intelligence of Transformers, this research demonstrates that it is possible to "see into the future" using nothing more than a standard camera. This self-supervised approach offers a scalable path toward safer autonomous systems that can anticipate environmental changes before they happen.

Summary updated

BibTeX
@inproceedings{boulahbal2022forecasting,
  author = {Houssem Eddine Boulahbal and Adrian Voicila and Andrew I. Comport},
  title = {{Forecasting of depth and ego-motion with transformers and self-supervision}},
  booktitle = {ICPR},
  year = {2022},
  url = {https://openreview.net/forum?id=9BytNmSvie},
}
Figure