AtLoc: Attention Guided Camera Localization

Bing Wang, Changhao Chen, Chris Xiaoxuan Lu, Peijun Zhao, Niki Trigoni, Andrew Markham

Overview

AtLoc (Attention Guided Camera Localization) is a robust deep learning framework designed to achieve state-of-the-art camera pose estimation from a single image. By integrating a self-attention mechanism, the model learns to prioritize geometrically stable landmarks, such as buildings and skylines, while ignoring transient "noise" like moving vehicles or pedestrians. This approach allows AtLoc to match or exceed the performance of complex multi-image sequential methods using only a single frame.

The Challenge of Robust Localization

Determining the precise 3D position and orientation of a camera—known as camera localization—is fundamental to autonomous driving and robotics. While early deep learning models like PoseNet introduced "pose regression" (directly predicting coordinates from pixels), they often struggle with real-world variability.

Dynamic scenes present significant hurdles: a car parked in a new location or shifting lighting conditions can introduce outliers that lead to substantial errors in standard neural networks. While previous research attempted to mitigate this using temporal sequences (video) to smooth errors, these methods are computationally intensive. AtLoc addresses this by asking: Can a single-image model be trained to distinguish between reliable landmarks and temporary distractions?

Proposed Architecture: AtLoc

The AtLoc architecture is composed of three primary components designed for efficiency and accuracy:

  1. Visual Encoder: Utilizing a ResNet34 backbone pretrained on ImageNet, the system extracts high-level features. The final classification layers are replaced with a 2048-dimensional fully connected layer to adapt the features for localization.
  2. Attention Module: This core innovation utilizes a non-local self-attention mechanism. It computes relationships between all feature points to generate an "Attention Map," which re-weights features to emphasize stable structures and suppress dynamic objects.
  3. Pose Regressor: A series of Multilayer Perceptrons (MLPs) processes the attention-guided features to predict the 3D position ($p$) and orientation quaternion ($q$).
AtLoc Architecture Overview

The model utilizes an $L_1$ loss function that automatically balances the importance of position versus rotation during training, eliminating the need for manual hyperparameter tuning. An extended version, AtLoc+, further incorporates temporal constraints between image pairs for enhanced precision.

Experimental Setup and Datasets

The researchers evaluated AtLoc across two distinct benchmarks:

  • 7 Scenes: An indoor dataset of office environments featuring motion blur and textureless regions, which are traditionally difficult for AI models.
  • Oxford RobotCar: A large-scale outdoor dataset capturing a year of driving in Oxford, UK. It includes extreme weather variations (snow, rain) and heavy traffic, serving as the gold standard for testing robustness in dynamic environments.

Attention as a Geometric Filter

A key insight from the research is that the self-attention mechanism naturally evolves into a "dynamic object rejector." Saliency maps reveal that the network learns to ignore the road surface and moving cars, instead focusing on the distant, stable skyline and architectural features.

Attention Map Visualization

By focusing on these "geometrically meaningful" features without requiring hand-coded rules, AtLoc achieves high efficiency. With a downsampling ratio of $n=8$ in the attention module, the system maintains low computational overhead, processing frames in just 6.3ms.

Performance Results

AtLoc demonstrated significant improvements over existing baselines:

  • Indoor Accuracy: On the 7 Scenes dataset, AtLoc achieved a 13% improvement in position accuracy and a 7% improvement in rotation compared to previous single-image models.
  • Outdoor Robustness: On the Oxford RobotCar "FULL" tracks, AtLoc outperformed the previous state-of-the-art (PoseNet+) by 76.5%.
  • Efficiency vs. Sequential Models: Despite using only single images, AtLoc outperformed MapNet (a sequential model) by approximately 28-30% on challenging outdoor routes. Furthermore, AtLoc is significantly faster, running at ~158 FPS compared to MapNet's ~106 FPS.

Conclusion and Future Work

AtLoc proves that a well-designed single-image model can be both more accurate and more efficient than complex sequential systems. While highly robust, the authors note that as a regression-based approach, it may require retraining to generalize to entirely new cities. Future research will focus on refining the attention module for even more extreme environmental shifts and exploring the integration of this mechanism into multi-frame systems to combine the benefits of both approaches.

Summary updated

BibTeX
@inproceedings{wang2020atloc,
  author = {Bing Wang and Changhao Chen and Chris Xiaoxuan Lu and Peijun Zhao and Niki Trigoni and Andrew Markham},
  title = {{AtLoc: Attention Guided Camera Localization}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2020},
  doi = {10.1609/aaai.v34i06.6608},
}
Figure