Learning Sequence Descriptor based on Spatiotemporal Attention for Visual Place Recognition

Fenglin Zhang, Junqiao Zhao, Yingfeng Cai, Gengxuan Tian, Wenjie Mu, Chen Ye · DOI

Abstract

Visual Place Recognition (VPR) aims to retrieve frames from a geotagged database that are located at the same place as the query frame. To improve the robustness of VPR in perceptually aliasing scenarios, sequence-based VPR methods are proposed. These methods are either based on matching between frame sequences or extracting sequence descriptors for direct retrieval. However, the former is usually based on the assumption of constant velocity, which is difficult to hold in practice, and is computationally expensive and subject to sequence length. Although the latter overcomes these problems, existing sequence descriptors are constructed by aggregating features of multiple frames only, without interaction on temporal information, and thus cannot obtain descriptors with spatio-temporal discrimination. In this paper, we propose a sequence descriptor that effectively incorporates spatio-temporal information. Specifically, spatial attention within the same frame is utilized to learn spatial feature patterns, while attention in corresponding local regions of different frames is utilized to learn the persistence or change of features over time. We use a sliding window to control the temporal range of attention and use relative positional encoding to construct sequential relationships between different features. This allows our descriptors to capture the intrinsic dynamics in a sequence of frames. Comprehensive experiments on challenging benchmark datasets show that the proposed approach outperforms recent state-of-the-art methods. The code is available at https://github.com/tiev-tongji/Spatio-Temporal-SeqVPR.

Introduction

Visual Place Recognition (VPR) is a critical component of robotic navigation and SLAM, serving as the "Where am I?" mechanism by matching current camera views against a database of geotagged images. While single-frame matching is effective in ideal conditions, it often fails under "perceptual aliasing"—where different locations look identical—or during drastic environmental changes in lighting, weather, and viewpoint.

To address these limitations, researchers have turned to image sequences. Traditional methods like SeqSLAM utilize sequence matching, which is computationally expensive and often relies on the unrealistic assumption of constant robot velocity. Modern "sequence descriptor" methods attempt to condense a sequence into a single vector for rapid retrieval, but they frequently lack "temporal glue"—the interaction between frames that captures how visual features evolve over time. This paper introduces a novel sequence descriptor that leverages spatio-temporal attention to capture these intrinsic dynamics.

Methodology

The proposed framework, Spatio-Temporal-SeqVPR, treats a sequence of frames as a 3D volume of information, processing it through a dual-branch Transformer architecture.

Overall architecture of the proposed Spatio-Temporal-SeqVPR framework.

As illustrated in the architecture above, the system extracts feature maps using a CNN backbone, which are then split into patches. The core processing occurs in two parallel branches:

  1. Spatial Attention Branch: A Transformer encoder learns the distribution of features within each individual frame, capturing the spatial context of the scene.
  2. Temporal Attention Branch: This branch utilizes a sliding window to focus on local regions across multiple frames. This allows the model to learn how specific patches persist or change over short temporal intervals, providing robustness against dynamic objects.
Illustration of different attention mechanisms: (a) spatial, (b) temporal, (c) local spatial, and (d) local temporal.

The model further employs Relative Positional Encoding (RPE). Unlike absolute encoding, RPE focuses on the relative spatio-temporal patterns, which remain constant even as visual content shifts due to camera motion. Finally, the outputs from both branches are fused and aggregated via a NetVLAD layer into a fixed-length sequence descriptor. The network is trained using a max-margin triplet loss to ensure high discriminative power in the feature space.

Experimental Results

The method was rigorously evaluated on major VPR benchmarks, including MSLS (urban sequences), NordLand (extreme seasonal changes), and Oxford RobotCar (day-to-night transitions).

Key Findings

  • State-of-the-Art Performance: On the NordLand dataset, the method achieved a near-perfect Recall@1 of 0.971, significantly outperforming SeqNet (0.797). On MSLS (San Francisco), it reached a Recall@1 of 0.680, nearly doubling the performance of single-frame NetVLAD (0.289).
  • Robustness to Distractors: Qualitative results demonstrate that the model is superior at ignoring transient elements like bicyclists or changing shadows by prioritizing consistent motion patterns.
  • Practical Efficiency: Although the raw descriptors are high-dimensional (24,576), they can be compressed to 4,096 dimensions using PCA with negligible loss in accuracy, making them suitable for real-time applications.

Conclusion

Spatio-Temporal-SeqVPR introduces a highly effective sequence descriptor by modeling the interaction between frames through dual-branch attention. By capturing how landmarks enter and exit the field of view and utilizing relative motion patterns, the model achieves superior robustness in challenging environments. Future work will explore adaptive handling of varying camera speeds and integration into full SLAM back-ends.

Reference: Zhao, J., Zhang, F., et al. "Learning Sequence Descriptor based on Spatio-Temporal Attention for Visual Place Recognition." IEEE Robotics and Automation Letters, 2024.

Summary updated

BibTeX
@article{zhang2024learning,
  author = {Fenglin Zhang and Junqiao Zhao and Yingfeng Cai and Gengxuan Tian and Wenjie Mu and Chen Ye},
  title = {{Learning Sequence Descriptor based on Spatiotemporal Attention for Visual Place Recognition}},
  journal = {IEEE Robotics Autom. Lett.},
  year = {2024},
  url = {https://openreview.net/forum?id=GLUscELPpO},
}
Figure