A Robust Feature-Space Diffusion Prior for Place Recognition Under Unseen Conditions

A robot that has mapped a route in summer daylight must later recognize the same places at night, in snow, or behind a parked bus. This task is called visual place recognition: retrieving the stored map image taken at the same location as a new query photo. Today's strongest systems adapt large self-supervised image encoders such as DINOv2 using labeled examples of the conditions they will face. We propose a different approach. We train a diffusion model, a generator that learns to turn random noise into realistic samples by denoising in many small steps, on the encoder's patch features from the map alone. At query time we use it to pull a degraded query's features back toward what the map "looks like" before retrieval. The prior never sees the test condition. The bet comes from speech enhancement, where diffusion priors trained on the clean signal hold up under mismatched noise that breaks discriminative filters.

Two things make this harder than it sounds. First, the map is not clean: it contains cars, pedestrians, glare and odd weather, so the prior can learn transients as part of "the place." Second, when a query is only partly corrupted, forcing every patch to agree with the prior either keeps the corruption or invents structure. Both are outlier problems, so we use robust losses, penalties that grow quadratically for small errors and only linearly for large ones, at two points: when training the prior, and in the term that ties the restored features to the query.

Core Claim

The claim has three parts. A diffusion prior over foundation-model patch features, trained only on the mapping traversal with a timestep-scheduled robust loss, and applied to queries with a robust (Huber) consistency term, will improve retrieval under conditions that were held out of all training. It will do so over both zero-shot foundation features and adapter-tuned features. The gain should be largest where the whole image shifts at once, as in night or snow cover, because there a purely robust reweighting of patches has nothing clean to fall back on.

The proposal is also cheaper than earlier generative approaches. It operates on a few hundred feature tokens per image rather than on pixels, so it avoids both the per-frame image generation of translation methods and their synthetic-edge artifacts.

Relation to Prior Work

Three kinds of prior work motivate the generative half. Speech enhancement shows that diffusion models degrade gracefully under mismatched acoustic conditions while discriminative models do not (Diffusion-Based Speech Enhancement in Matched and Mismatched Conditions Using a Heun-Based Sampler). It also shows that such models, trained only on additive noise, generalize to real reverberation (Real-Time Diffusion Buffer for Speech Enhancement On A Laptop). Separately, generative classifiers have been reported to avoid the shortcut features that make discriminative ones brittle (Generative Classifiers Avoid Shortcut Solutions). None of this work touches place recognition; we test whether the same asymmetry holds for visual appearance change.

The closest generative place-recognition work splits three ways, and each differs from ours in a specific respect:

Our prior differs from all three. It is over appearance features rather than pixels or poses. It is learned from one condition. It is trained robustly.

The robust-loss half both supplies the method and constrains it. The method comes from Improving Diffusion Models's Data-Corruption Resistance using Scheduled Pseudo-Huber Loss. That paper replaces the squared denoising error with a smooth Huber variant whose threshold is scheduled across timesteps. The loss is robust at the high-noise steps that form coarse structure and near-quadratic at the low-noise steps that form detail. The paper shows this resists 15–45% poisoned training data in text-to-image and text-to-speech.

That paper also states the constraint: robust losses fail when corruption is the majority pattern rather than a minority. This tells us to use robust training only against transients in the map, and to rely on the prior, not the loss, for whole-image condition shifts.

Two further works set the context. On the theory side, Huber-type losses restore fast convergence under heavy-tailed noise, though only in convex settings (On Empirical Risk Minimization with Dependent and Heavy-Tailed Data). The only robust-norm place-recognition method in the file is a linear ℓ2,1 projection solved offline with an iterative matrix solver (ADMM) (Visual Place Recognition via Robust ℓ2-Norm Distance Based Holism and Landmark Integration). It supports treating seasonal change as outliers but has no generative model and does not reach deep features.

One paper points the other way. Reverse Huber loss penalizes large errors more, to protect 3D structure in depth prediction (Deeper Depth Prediction with Fully Convolutional Residual Networks). This seems to contradict our choice. Our reading is that the two losses target different error sources: large errors from transients should be capped, while large errors on persistent structure should not. We test this directly by swapping in a reverse-Huber schedule.

Research Program

Features. We extract DINOv2 intermediate "value" patch features, which AnyLoc showed are condition-robust for place recognition (AnyLoc: Towards Universal Visual Place Recognition), from every map image.

Prior. We train a small transformer diffusion model on sets of these patch tokens. The training objective is

$$\mathcal{L} = \mathbb{E}_{z,t,\epsilon}\left[\rho_{\delta(t)}\big(\epsilon - \epsilon_\theta(z_t, t)\big)\right].$$

Here $z$ is a map image's patch-feature set and $z_t$ its noised version at timestep $t$. The term $\epsilon$ is the injected Gaussian noise, and $\epsilon_\theta$ is the network's estimate of that noise. The function $\rho_\delta$ is the pseudo-Huber penalty with threshold $\delta$, and $\delta(t)$ is the scheduled threshold from the scheduled Pseudo-Huber paper. The prior is trained per region on map data only, plus optionally generic unrelated routes. No test-condition images are used.

Query restoration. At query time we partially noise the query features $q$ to an intermediate level $t^*$ and run a few reverse steps. At each step we add a guidance gradient from a robust consistency term that keeps the result near the query. This amounts to approximately solving

$$\hat z = \arg\min_z \; -\log p_\theta(z) + \lambda \sum_i \rho_{\delta_q}\big(\lVert z_i - q_i\rVert\big).$$

Here $i$ indexes patches, $\lambda$ weights consistency against the prior, and $\delta_q$ sets which patch disagreements count as outliers. The effect is that glare-covered or occluded patches are allowed to depart from the query, while clean patches are held to it.

Retrieval. The restored $\hat z$ is aggregated exactly as in the baseline (VLAD pooling for AnyLoc-style descriptors, or SelaVPR's head when stacked on it) and used for retrieval.

Cost. Because the prior acts on roughly a few hundred tokens with a small number of steps, we expect per-query cost in the tens of milliseconds rather than full image generation. We will measure it rather than assume it.

Analysis. Beyond accuracy, we track a failure mode specific to generative restoration: "aliasing flips." These are queries that were correct before restoration and become wrong after it because the prior pulled them toward a similar-looking but different place. Repetitive rural stretches such as those in Nordland make this risk real.

Baselines

Naive reference. Zero-shot AnyLoc on the same DINOv2 features, with no prior and no adaptation. It is the natural floor because our method changes only what happens to the features before aggregation. The file lists no RobotCar or Nordland number for AnyLoc (no reported result found on Lacuna for AnyLoc on these benchmarks), so we run it ourselves. "Beating it" means a consistent Recall@1 gain on held-out conditions across at least three of our four datasets.

Strongest existing method. SelaVPR inserts small trainable adapters into a frozen DINOv2 and trains them with a mutual-nearest-neighbor loss (Towards Seamless Adaptation of Pre-trained Models for Visual Place Recognition). It reports 94.0% Recall@1 on Tokyo 24/7 and ranked first on the MSLS challenge; no reported result found on Lacuna for SelaVPR on Nordland. We use the released training recipe on MSLS and Pittsburgh30k, matching the GPU-hours we spend training all priors across regions. We then test on conditions absent from both methods' training.

Beating SelaVPR means one of two things. Either our method alone exceeds it on held-out conditions, or stacking our prior on SelaVPR features improves it. Because Tokyo 24/7 is near ceiling, we treat it as a no-regression check rather than the main contest.

Condition-specific generative translation. ToDayGAN is the older generative competitor, with a reported 52.9% of RobotCar night queries localized within 5 m and 10°. We compare on its own RobotCar protocol, with the retrieval descriptor held fixed, and report per-query latency alongside accuracy.

Disentanglement and matching reference points. On CMU-Seasons we cite PROCA's reported 19.5% at 0.25 m and 2° in overcast conditions. On 4Seasons we cite the reported hloc (SuperPoint + SuperGlue) figure of 40.3% high-precision localization and NetVLAD's 34.8% (4Seasons: Benchmarking Visual SLAM and Long-Term Localization for Autonomous Driving in Challenging Conditions). On Nordland we cite MDFL's reported 0.912 average AUC. We note which of these rely on fine pose estimation that our retrieval stage feeds into rather than replaces.

Ablations isolating the key ingredient. First, the same prior trained with plain squared error. Second, the prior with a non-robust (squared) consistency term. Third, a reverse-Huber schedule. Fourth, and most important, the robust consistency term alone with no prior: an iteratively reweighted patch matching that downweights outlier patches but never generates anything.

Why not just…?

Why not just fine-tune adapters on more conditions, as SelaVPR does? If labeled data for the deployment conditions exists, adapters are very strong, as the 94.0% Tokyo 24/7 result shows. Our claim is limited to conditions that are absent from training, which is the common case for a newly mapped route. The held-out-condition protocol settles whether adapters trained on MSLS and Pittsburgh already transfer to Nordland winter or RobotCar night. If they do and the stacked prior adds nothing, the proposal fails on its main claim, and we will report that.

Why not just downweight bad patches with a robust matching loss and skip the generative model? This is the most serious threat, because it may capture most of the gain for occlusion and glare. The ℓ2,1 place-recognition paper already shows robust norms help with seasonal outliers. Our argument is that reweighting cannot help when nearly every patch has shifted, as at night, since then there is no clean majority, which is the failure mode the scheduled Pseudo-Huber paper itself names. The robust-only ablation tests this directly: we split results by the fraction of patches flagged as outliers. If robust-only matches the full method even on whole-image shifts, we drop the prior and publish the simpler method.

Why not just translate queries in pixel space with a diffusion model, a modern ToDayGAN? Pixel generation is expensive per frame, and it can invent edges that retrieval then matches. Both problems are documented for GAN translation. We run a pixel-space diffusion translator trained on the same map images as a comparison, reporting accuracy, latency and aliasing flips. If it wins on accuracy at acceptable cost, the case for feature space rests only on speed.

Why not just use AnyLoc zero-shot? AnyLoc is our floor, not a strawman; it shows these features are already fairly condition-robust. The question is whether a map-specific prior recovers what remains, and the paired per-query comparison answers it.

Proposed Experiments

Main protocol. We build maps from a single condition and hold all other conditions out: Nordland summer as map with winter, spring and fall as queries; Oxford RobotCar day map with night and rain queries; CMU-Seasons; and 4Seasons, where retrieval feeds hloc for high-precision localization. We report Recall@1 and Recall@5, the benchmarks' pose-accuracy thresholds, aliasing-flip rate, and per-query latency.

First decisive check. Does the restoration gain grow with condition severity, and is it larger than the robust-only ablation specifically on night and snow? This separates what the prior contributes from what the loss contributes.

Second decisive check: contaminated maps. We paste occluders and flare into 15%, 30% and 45% of map frames, mirroring the poisoning rates used for scheduled Pseudo-Huber. We then compare priors trained with squared error, fixed Huber and scheduled Huber. The prediction is that the squared-error prior degrades sharply as contamination rises while the scheduled one does not. If the reverse-Huber schedule does better, our reading of the Huber/reverse-Huber tension is wrong.

Third decisive check: aliasing. On repetitive Nordland stretches we check that aliasing flips stay below corrections. We sweep the noising level $t^*$ and consistency weight $\lambda$ on a validation region, to show whether a setting exists where the prior helps without pulling queries toward the wrong place.