Zining Liu

UniPS

Unified patch similarity unlocks training-free visual place recognition

Timeline
Jun. – Oct. 2026
Status
ICLR 2027 submission (under review)

Abstract

Visual Place Recognition (VPR) localises an image by retrieving the geo-referenced database image that shows the same place. Most VPR methods are training-based, aiming to learn effective features from annotated data. These methods achieve strong results on standard VPR benchmarks but require millions of labelled samples, making annotation cost a significant challenge. Even with such extensive training, they still fail on other VPR benchmarks that differ from their training set, such as cross-environment benchmarks. Training-free VPR methods avoid this annotation cost and generalise better. However, these methods do not fully leverage pretrained vision models, resulting in features that lack sufficient discriminative power to achieve strong performance on standard VPR benchmarks, highlighting the challenge of effectively utilising pretrained vision models. To tackle these challenges, we propose UniPS (Unified Patch Similarity), a training-free pipeline built solely on patch similarity. Given a query or database image, only a frozen backbone is applied to extract patch features. We then perform a series of patch similarity-based comparisons for VPR: self-similarity for patch importance, followed by weighted second-moment patch feature pooling for coarse ranking, and cross-image patch similarity for reranking. Based on comprehensive evaluation on 17 benchmarks, UniPS achieves state-of-the-art results on both the 8 standard and 9 cross-environment VPR benchmarks. On standard VPR benchmarks, UniPS outperforms the best training-free baseline by +12.9% and the best trained baseline by +0.2%, despite the latter’s heavy annotation requirements. On cross-environment benchmarks, UniPS outperforms the best training-free baseline by +7.1% and the best trained baseline by +11.5%. In addition, the proposed module can be easily plugged into existing methods, improving their performance by +5.6% to up to +17.8%.

Recent advanced methods achieve large performance improvements, but these gains are largely driven by increasingly large-scale annotated training sets. Even with millions of annotated samples, however, these state-of-the-art methods tend to learn environment- or domain-specific features that do not generalise well as shown in Fig. 1A, suffering a performance drop on cross-environment benchmarks, as shown in Fig. 1D&E. Training-free VPR methods often generalise better than trained methods in the cross-environment setting, but fail on standard VPR benchmarks, as shown in Fig. 1D-E. We argue that current training-free methods, which apply various strategies to obtain prior-selected features (Fig. 1B), do not fully utilise the potential of these large vision models.

Figure 1 — Overview and performance (R@1). (A) Trained methods require large-scale labelled datasets, limiting their generalisation to cross-environment settings. (B) Prior training-free methods avoid this training cost and generalise better, but suffer a performance drop on standard VPR benchmarks. (C) Our training-free method instead applies frozen patch features directly, using patch similarity both within and across images for retrieval. (D) Training cost versus performance of our method and baselines on 17 benchmarks, averaged separately across standard and cross-environment VPR benchmarks. (E) Performance of the proposed method against the state-of-the-art trained and training-free baselines.

As illustrated in Fig. 2, the proposed method UniPS follows a training-free paradigm and requires neither model training nor annotated data. All steps of the pipeline rely on a single patch-to-patch similarity (PS) strategy, expressed in three different forms. The query and the database images are first partitioned into patches, and their patch features are extracted by a frozen pretrained vision model. Based on these features, each image computes the similarity between its own patches (PS-1), from which the weight of every patch is derived. Second-moment pooling of each image’s weighted patch features (PS-2) then yields one descriptor per image, with which the database is coarsely ranked, and patch-to-patch MaxSim matching between the query and the top-ranked database images (PS-3) refines this ranking.

Figure 2 — Overview of the proposed method. Each image is partitioned into patches, whose features are extracted by a frozen vision encoder, and the patch similarity (PS) template is applied in three forms. PS-1 computes the self-similarity of each image, which gives the weight of every patch; features and weights are computed once and stored for both stages. PS-2 pools the weighted patch features into a second-moment matrix, reduced by whitened PCA (WPCA) to one descriptor per image, and coarse ranking shortlists the K nearest database images. PS-3 performs weighted MaxSim matching between the query and each shortlisted image, and reranking sorts the shortlist by the matching score.

What such a comparison does not say is how much each patch should count: a patch whose appearance recurs many times within its own image cannot tell one place from another. This discounts bursty content, visual elements that repeat within a single image and would otherwise dominate any similarity computed from them. Since w is the reciprocal of n, a patch that recurs frequently across the image (large n) receives a small weight, while a distinctive patch with few or no similar patches (small n) receives a large weight, up to w = 1, reflecting its higher importance (Fig. 3). The weights of an image are collected in w and applied in the coarse ranking and reranking.

Figure 3 — Patch self-similarity weighting on a Nordland pair (query left, our rank-1 retrieval right). For each image: colour clusters indicate similar patches, and grey patches are more distinctive in the image. The heat maps show the resulting weight w = 1/n. Repetitive patches such as snow, sky and track fall into large clusters and receive low weight, while sparse, distinctive content receives high weight.

In this paper, we evaluate the proposed method against a wide range of trained and training-free baselines on 17 benchmarks. Table 1 summarises these benchmarks in two groups, along with their data type. The first group includes 8 standard VPR benchmarks: 7 street-level ones, Pitts250k and Pitts30k, Tokyo 24/7, MSLS-val, St Lucia, Oxford RobotCar and AmsterTime, together with the Nordland railway benchmark. The second group consists of 9 cross-environment localisation benchmarks: 17 Places and Baidu Mall indoors, Gardens Point across day and night, VP-Air and Nardo-Air with its rotated variant in the air, Hawkins and Laurel Caverns underground, and the Mid-Atlantic Ridge underwater.

Table 1 — The 17 benchmarks with their data type.

We first compare UniPS against existing training-free baselines on all 17 benchmarks: the pooling baselines, the frozen class token and GeM, and the more recent AnyLoc, SegVLAD-PreT and EffoVPR-ZS. As shown in Table 2, on the standard benchmarks, UniPS achieves a mean of 93.2 against 80.3 for EffoVPR-ZS. The largest improvement is on the Nordland benchmark, at +38.1, where most training-free methods fail. On the cross-environment benchmarks, UniPS again achieves the best results with average performance 76.6 over 69.5 for AnyLoc, whose descriptor is 24× larger than ours. Over all 17 benchmarks, UniPS achieves 84.4, +10.3 over the best prior training-free method.

Table 2 — Comparison against training-free baselines. R@1 (%) on the 4 standard and 4 cross-environment benchmarks, with the mean over all 8 standard benchmarks, all 9 cross-environment benchmarks, and all 17 benchmarks. Dim is the dimension of the global descriptor of each method. † indicates two-stage methods. Best and second-best results are in bold and underline. Ours-D2 and Ours-D3 use a frozen DINOv2 and DINOv3 backbone.

On the standard benchmarks, UniPS achieves a mean R@1 of 93.2, surpassing the current state-of-the-art method, SAGE, at 93.0, with the best R@1 on Tokyo24/7, Nordland, and AmsterTime. On the cross-environment benchmarks, all trained methods suffer a significant performance drop, e.g., SAGE falls from 93.0 to 60.0 mean R@1, whereas UniPS drops by only 16.6 at R@1. On average, UniPS outperforms the state-of-the-art trained method, MegaLoc, with 76.6 against 65.1. Averaged over all 17 benchmarks, UniPS outperforms the second-best method, MegaLoc, by 6.8 at R@1. Notably, UniPS is training-free and requires no annotated data, while all trained methods rely on large-scale annotated training datasets. For example, as shown in Fig. 1, EigenPlaces is trained on 41.2 million images, and MegaLoc needs 45 million to reach its state-of-the-art results.

Table 3 — Comparison against trained methods. R@1 (%) on the 4 standard and 4 cross-environment benchmarks, with the mean over all 8 standard benchmarks, all 9 cross-environment benchmarks, and all 17 benchmarks. † indicates two-stage methods; ‡ indicates inductive setting. Best and second-best results are in bold and underline. Ours-D2 and Ours-D3 use a frozen DINOv2 and DINOv3 backbone.

Figure 4 compares UniPS with other baselines on samples across different benchmarks. The state-of-the-art trained methods can also handle hard samples within the standard benchmarks, but fail beyond them. For example, SAGE correctly retrieves the right place under seasonal change on Nordland, and MegaLoc succeeds on AmsterTime, but both fail in the degraded Hawkins corridor. The state-of-the-art training-free method shows the opposite pattern: AnyLoc succeeds on Hawkins but fails on the 3 standard benchmarks. The proposed UniPS, however, is robust across all cases.

Figure 4 — Rank-1 retrievals on 4 benchmarks among the proposed method and other baselines. Green indicates a correct result, and red ones are incorrect results.

In addition to achieving state-of-the-art performance on its own, the proposed re-ranking module can be easily plugged into other baselines to improve their generalisation. For two-stage methods such as SelaVPR and R2Former, we simply replace their re-ranker with our patch similarity-based re-ranking, keeping the rest of the pipeline unchanged. As shown in Table 4, both methods improve their mean R@1 over the 9 cross-environment benchmarks, by +9.7% and +5.6%, respectively. For methods with no re-ranking stage (single-stage methods), our re-ranking module can be attached to the original pipeline, which is modified to return top-K candidates instead of only the top-1 result. With our re-ranking module attached, 8 single-stage methods improve their generalisation, with mean R@1 over the 9 cross-environment benchmarks increasing by +9.1% for MegaLoc to up to +17.8% for SuperVLAD. In particular, none of these improvements requires additional annotated data or further training.

Table 4 — Robustness of the proposed reranking module. The module is plugged into different baselines and tested on 9 cross-environment benchmarks, on both two-stage and one-stage methods. All methods are with their default settings. ‡ indicates inductive setting.

We test alternative ways to obtain the patch weights w. Table 5 reports the mean results across all benchmark groups. Our self-similarity signal leads in both groups, reaching 90.3% and 76.3% mean R@1, an improvement of +8.7% and +2.0% over unweighted MaxSim, and outperforming patch-graph centrality (88.2%, 75.4%) and class-token attention (87.8%, 71.7%). Beyond accuracy, self-similarity is also simpler to obtain: it requires only the patch features themselves, whereas the alternatives depend on an attention map from a dedicated network layer.

Table 5 — Alternatives to obtain the patch importance: mean R@1 over the 8 standard (Std.), the 9 cross-environment and all 17 benchmarks.

We conduct an ablation study to examine the contribution of each component in UniPS: patch weighting (PS1), coarse ranking (PS2), and re-ranking (PS3). Starting from an unweighted second-moment pooling baseline, we add each component in turn, and report the resulting R@1 on 2 example benchmarks, Nordland (standard) and VP-Air (cross-environment), in Fig. 5. Patch weighting (PS1) provides the largest gain on Nordland (+34.9%), while MaxSim re-ranking (PS3) provides the largest gain on VP-Air (+12.1%), and adding patch weighting to the re-ranking stage further improves both benchmarks (+6.2% and +10.8%, respectively). These results show that every component of UniPS contributes to the final performance, though their relative importance differs between standard and cross-environment settings.

Figure 5 — Contribution of each component: performance at R@1 as each component is added.

As most of the advanced baselines are built on DINOv2, we retrain three representative baselines, SALAD, BoQ, and CliqueMining, on DINOv3 using their released implementations and compare them against UniPS under the same backbone. Table 6 reports per-benchmark results. UniPS achieve a mean R@1 of 84.4% across all 17 benchmarks, outperforming BoQ, the best retrained baseline, at 77.3%. Combined with the DINOv2 results in Table 3, this shows that UniPS outperforms all tested baselines with the same backbone, while requiring no annotated data and using at least 8× fewer feature dimensions.

Table 6 — Same backbone (DINOv3) tests across 17 benchmarks including three trained methods and the proposed UniPS. Best and second-best results are in bold and underline.