Manuscript Offprint

arXiv:2609.07373

TRAIL: Trajectory-Aware Visual Place Recognition against Unordered Databases

Dominik A. Kloepfer, Patrick Wenzel

Dominik A. Kloepfer¹★ and Patrick Wenzel²

¹ Visual Geometry Group (VGG), University of Oxford ² Helsing

Figure

Fig. 1: Incorporating information from previous images in a sequence boosts Visual Place Recognition (VPR) performance in challenging settings. We compare the top-1 Recall of the state-of-the-art VPR algorithm MegaLoc [6] with our system, which makes use of previous images in the sequence (see Sec. 4 for full results).

Abstract. Modern Visual Place Recognition (VPR) methods excel on standard benchmarks yet remain brittle in feature-poor environments. By treating each query image in isolation, they discard the sequential context in any real trajectory. We formalize a task that exploits this context: given a query sequence, localize the final image against an unordered reference database—which, unlike sequence-to-sequence methods, requires no sequential structure in the database. We propose TRAIL (TRajectory-Aware Image Localization), a principled framework based on Conditional Random Fields (CRF) that combines learned functions for visual similarity and for camera-motion consistency, refining a distribution over candidate references as each query arrives. A lightweight post-processing layer atop any pre-trained VPR backbone, TRAIL improves a state-of-the-art baseline by up to 8.3 percentage points on our primary benchmark, transfers to unseen datasets without retraining, and delivers its largest gains where visual cues are scarce.

  • Work partially done during an internship at Helsing.

1 Introduction

Visual Place Recognition (VPR), the task of matching query images against a reference database to determine camera location, has seen remarkable progress in recent years. Leveraging large-scale datasets and powerful pre-trained visual encoders such as DINOv2 [33], modern methods achieve impressive performance on established benchmarks [2, 6, 21, 23].

Yet, this progress masks a fundamental brittleness. In visually challenging scenarios such as rural landscapes, forests, or uniform highway environments, performance degrades sharply due to a lack of distinctive visual cues. Recent work has further exposed fragility in seemingly robust systems, revealing sensitivity to minor variations in evaluation parameters like retrieval distance thresholds [20].

This brittleness is particularly troubling given VPR's role in many important applications: camera relocalization, loop closure detection in SLAM, and hierarchical localization systems where VPR provides the initial coarse estimate.

We observe that standard VPR formulations exacerbate this brittleness through an artificial constraint: treating each query image in isolation. This single-image paradigm, while convenient for benchmarking, discards critical information available in any real navigation scenario. Cameras follow continuous trajectories through space, and each new observation arrives with strong geometric priors from preceding frames. Such information dramatically constrains the search space, but the standard VPR formulation is unable to leverage it.

Prior sequence-based VPR methods [7, 11, 25, 31, 47] operate in a sequence-to-sequence paradigm requiring the reference database to be organized as ordered sequences covering the same routes as potential queries. This imposes a significant structural constraint: it demands exhaustive coverage of all possible trajectories through the environment. In practice, however, reference imagery is typically collected opportunistically, from mapping vehicles, crowd-sourced platforms, or satellite data, yielding unordered sets of geo-tagged images rather than structured sequences.

In this paper, we formalize a task that addresses these limitations: given a sequence of query images, the goal is to localize the final query image against an unordered reference database. This setting captures the practical scenario of an agent that needs to determine its current position, exploiting the context from its recent trajectory without imposing any structural requirements on the database. We develop TRAIL (TRjectory-Aware Image Localization), a principled probabilistic framework for this task, leveraging Bayesian filtering to maintain and update a probability distribution over reference locations as new query images arrive. Crucially, this framework operates as a post-processing step over existing VPR methods, requiring no architectural modifications and minimal computational overhead.

Specifically, our contributions are as follows:

(a) We formalize a Sequential Visual Place Recognition task that operates on unordered reference databases and targets localization of the final query image, clearly distinguishing it from the sequence-to-sequence paradigm adopted by prior work (Sec. 3.1).

(b) We introduce TRAIL, a probabilistic framework for incorporating sequential context into place recognition, designed to maximize retrieval accuracy while imposing minimal computational overhead (Sec. 3.2, Sec. 3.3, Sec. 3.4).

(c) We empirically validate our proposed framework and demonstrate its effectiveness on challenging datasets (Sec. 4).

By exploiting the temporal structure of navigation sequences, our method achieves notable improvements in both robustness and accuracy. Its simplicity and compatibility with existing systems make it well-suited for integration into real-world localization pipelines.

References (46)

  • Mixvpr: Feature mixing for visual place recognition
  • Boq: A place is worth a bag of learnable queries
  • Netvlad: Cnn architecture for weakly supervised place recognition
  • All about vlad
  • Sequence searching with cnn features for robust and fast visual place recognition
  • Megaloc: One retrieval to place them all
  • Jist: Joint image and sequence training for sequential visual place recognition
  • Robust place recognition with stereo sequences
  • Randaugment: Practical automated data augmentation with a reduced search space
  • Fab-map: Probabilistic localization and mapping in the space of appearance
  • Seqnet: Learning descriptors for sequence-based hierarchical place recognition
  • SeqMatchNet: Contrastive learning with sequence matching for place recognition & relocalization
  • Learning and calibrating per-location classifiers for visual place recognition
  • Place recognition through multiple lidar scans based on the hidden markov model (opens the publisher in a new tab)
  • Markov fields on finite graphs and lattices (1971), unpublished manuscript
  • Pair-vpr: Place-aware pre-training and contrastive pair classification for visual place recognition with vision transformers (opens the publisher in a new tab)
  • Deep residual learning for image recognition
  • A theory of steady-state activity in nerve-fiber networks: I. definitions and preliminary lemmas
  • Batch normalization: Accelerating deep network training by reducing internal covariate shift
  • Close, but not there: Boosting geographic distance sensitivity in visual place recognition
  • Optimal transport aggregation for visual place recognition
  • Aggregating local descriptors into a compact image representation
  • Anyloc: Towards universal visual place recognition
  • Conditional random fields: Probabilistic models for segmenting and labeling sequence data
  • Casevpr: Correlation-aware sequential embedding for sequence-to-frame visual place recognition
  • Decoupled weight decay regularization
  • Towards seamless adaptation of pre-trained models for visual place recognition
  • Placeless place-recognition
  • Rectifier nonlinearities improve neural network acoustic models
  • 1 Year, 1000km: The Oxford RobotCar Dataset (opens the publisher in a new tab)
  • Learning sequential descriptors for sequence-based visual place recognition
  • Seqslam: Visual route-based navigation for sunny summer days and stormy winter nights
  • DINOv2: Learning Robust Visual Features without Supervision
  • Fine-tuning cnn image retrieval with no human annotation
  • A geometry-aware hidden markov model for indoor positioning
  • Fast-seqslam: A fast appearance based place recognition algorithm
  • Are we there yet? challenging seqslam on a 3000 km journey across all four seasons
  • Brief-gist-closing the loop by simple means
  • 24/7 place recognition by view synthesis
  • Focus on local: Finding reliable discriminative regions for visual place recognition
  • Mapillary street-level sequences: A dataset for lifelong place recognition
  • Unaided stereo vision based pose estimation
  • 4Seasons: A cross-season dataset for multi-weather SLAM in autonomous driving
  • 4Seasons: Benchmarking visual SLAM and long-term localization for autonomous driving in challenging conditions
  • Probabilistic appearance-invariant topometric localization with new place awareness
  • ROVER: Robust loop closure verification with trajectory prior in repetitive environments