Displacement Pairs for Few-Label Wi-Fi Localization

Wi-Fi fingerprinting locates a phone by matching the signal strengths it hears from nearby access points against a map of signals recorded at known positions. Building that map means walking a building and labeling every recording with its coordinates, and the map goes stale as hardware and environments change. Unlabeled scans, on the other hand, are cheap and plentiful. This proposal changes what the model learns from the few labeled scans. Instead of mapping each scan to an absolute position, it learns to predict the displacement between any two scans. Under that target, $N$ labeled points become roughly $N^2$ labeled pairs. The same displacement predictor then repairs a known failure of contrastive pre-training on the unlabeled scans. Contrastive learning, which learns an embedding by pulling two perturbed copies of one sample together and pushing different samples apart, normally pushes away scans recorded centimeters apart as if they were unrelated. Here the displacement predictor estimates how far apart two unlabeled scans probably are, and that estimate tells the contrastive loss which pairs it should stop pushing apart.

In two sentences: pairs of labeled fingerprints supervise a relative-position head, which turns a small survey into a quadratically larger training set and makes prediction a robust vote over labeled anchors. The head's distance estimates also down-weight the "push apart" term of a contrastive loss on unlabeled scans, so self-supervised pre-training stops tearing apart the spatial continuity it is meant to learn.

Core Claim

At 1–10% labeled data on standard Wi-Fi benchmarks, the proposal makes three predictions. First, an encoder trained jointly on labeled displacement pairs and distance-weighted contrast on unlabeled scans will localize more accurately than three alternatives: absolute-coordinate regression, semi-supervised consistency training, and masked-reconstruction pre-training. Second, much of the gain over plain contrastive pre-training will come from the distance-weighted repulsion, not from contrast itself. Third, the augmentations that make the two views must respect why an access point is missing, or the method will underperform.

The pieces exist separately, and none of them answers this question. Pairwise relative targets were introduced for video scoring by Pairwise Contrastive Learning Network for Action Quality Assessment, which trains a side branch to predict score differences and discards it at inference. In our design the relative head is the inference mechanism, and it predicts a 2D/3D displacement rather than a scalar. Pairwise Difference Learning for Classification turns classification into same-class verification over $[x_i, x_j, |x_i-x_j|]$ and aggregates over training anchors. We borrow the anchor-aggregation idea but regress continuous coordinates, and we add a representation learned from unlabeled data. In localization, pairwise ideas are either hand-engineered or heuristic. A Pairwise SSD Fingerprinting Method differences access-point strengths to cancel device gain. ProxyFAUG crosses over nearby labeled fingerprints and assigns midpoint labels. Neither learns a representation, and both need labels or inertial tracks for every point they use.

Research Program

Inputs. The encoder $f$ is a small MLP or one-dimensional CNN of the size used by CNNLoc-style models. It takes the access-point vector plus a binary mask marking access points that were not heard. Following On the Use and Construction of Wi-Fi Fingerprint Databases, which found that replacing the "100" placeholder with roughly −105 dBm helps, unheard access points are set to −105 dBm. The mask lets the model treat "below sensitivity" as information rather than as a weak reading.

Displacement head. The head $g$ is made antisymmetric by construction, $g(a,b)=h(a,b)-h(b,a)$, so that swapping the two scans flips the sign of the predicted displacement. It is trained on all labeled pairs:

$$\mathcal{L}_{\text{pair}} = \sum_{i,j \in \mathcal{L}} \big\| g(f(x_i), f(x_j)) - (p_j - p_i) \big\|_1 ,$$

Here $\mathcal{L}$ is the labeled set and $p_i$ is the surveyed coordinate of scan $x_i$. Pairs are sampled with a bias toward short true distances, because those are the pairs that fingerprint differences can actually resolve.

Distance-weighted contrast on unlabeled scans. Two views $u_i, v_i$ of each unlabeled scan are embedded. The loss is an InfoNCE-style objective in which each negative is weighted by how far the displacement head believes it is from the anchor:

$$\mathcal{L}_{\text{con}} = -\log \frac{e^{s(u_i,v_i)/\tau}}{e^{s(u_i,v_i)/\tau} + \sum_{k\neq i} w_{ik}\, e^{s(u_i,v_k)/\tau}}, \qquad w_{ik} = 1 - e^{-\hat d_{ik}^2/\sigma^2}.$$

In this objective, $s$ is cosine similarity, $\tau$ is a temperature, $\hat d_{ik} = \|g(z_i,z_k)\|$ is the predicted physical distance between scans $i$ and $k$, and $\sigma$ is a length scale of a few meters. Likely neighbors therefore receive almost no repulsion, while scans that are probably far apart are pushed apart as usual. The weights are computed with gradients stopped. During the first epochs, before the head is trained, $w_{ik}=1$. This choice is the proposal's answer to the false-negative problem: generic contrastive objectives, as surveyed in Self-supervised Learning: Generative or Contrastive, rely on uniform repulsion to prevent collapse.

Physically valid views. Data Imputation for Sparse Radio Maps in Indoor Positioning distinguishes two kinds of missing readings. Some are missing at random, for example from packet drops. Others are missing because the access point is below the receiver's sensitivity, which is "missing not at random" and carries information about location. The augmentations follow that split. Dropout is applied only to access points whose readings sit near the detection floor, since those are the ones that plausibly flicker. A strong access point is never silenced and an unheard one is never fabricated. A small per-reading jitter is added. A random global dBm offset per view imitates the antenna-gain differences that A Pairwise SSD Fingerprinting Method identifies as a major source of cross-device error.

Inference. The query is embedded, and its $K$ nearest labeled anchors in embedding space are retrieved; this addresses the anchor-cost problem noted for pairwise methods. The prediction is the coordinate-wise median of $p_a + g(z_a, z_q)$ over those anchors. The spread of the anchor votes serves as a free uncertainty estimate, in the spirit of the anchor posteriors in Uncertainty Quantification in Pairwise Difference Learning. Building and floor are predicted by a small classification head on the same embedding.

Motivating evidence for joint embedding. Joint-Embedding vs Reconstruction shows, for linear models and vision and genomics data, that reconstruction objectives spend capacity on high-variance nuisance signal. Fading-dominated RSSI readings are a natural place to test that claim. We treat it as a hypothesis to check against the masked-reconstruction baseline below, not as a settled fact for radio data.

Baselines

The naive reference is weighted k-nearest-neighbors on the labeled subset only, together with the same encoder trained by plain absolute-coordinate regression on that subset. Every other method must beat both at each label fraction to justify its complexity.

The augmentation competitors are ProxyFAUG and multi-output Gaussian process augmentation. For ProxyFAUG, crossover and midpoint labeling are applied to the same labeled subset, with the same radius sweep, feeding both kNN and the absolute regressor. On Antwerp Sigfox it reports a median error drop from 108 m to 65 m and a mean drop from 298 m to 280 m. Multi-output Gaussian process augmentation, from Multi-Dimensional Wi-Fi RSSI Data Augmentation Based on Multi-Output Gaussian Process, reports a 3D error reduction on UJIIndoorLoc from 8.62 m to 8.42 m with full labels. It is rerun on each labeled subset with the Matérn 5/2 kernel it reports as best.

The strongest semi-supervised competitor is Mean Teacher based SSL Framework for Indoor Localization. It reports 7.403% and 7.748% mean 3D error reductions for CNNLoc and SIMO-DNN, and reports that 50% labeled data with its framework beat 100% labeled supervised training on UJIIndoorLoc. Its absolute meter errors at low label fractions are not given: no reported result was found on Lacuna for Mean Teacher at 1–10% labels. It is therefore rerun with the same encoder, the same unlabeled pool and the same labeled splits.

The strongest self-supervised competitor is masked-reconstruction pre-training in the style of Radio Foundation Models. That work reports a 10× labeled-data reduction and a CE90 of 0.532 m on 5G channel data with 10k labels. We adapt it to access-point vectors by masking heard access points and reconstructing them, and we also include the autoencoder of CAE-CNNLoc, which reports 9.5 m mean error on UJIIndoorLoc. We further include standard SCARF-style contrastive pre-training (A Survey on Self-Supervised Learning for Non-Sequential Tabular Data) with uniform repulsion and generic feature corruption. As a full-label reference for UJIIndoorLoc, FasterKAN reports 3.56 m mean position error; its evaluation protocol may differ, so it is reported but not used as the target.

Ablations isolate each ingredient. The first uses the displacement head alone, with no unlabeled data. The second uses the displacement head plus contrast with $w_{ik}\equiv 1$. The third uses the full method but with naive dropout that ignores the missing-not-at-random mask. The fourth replaces the displacement head with an absolute head while keeping the contrastive pre-training.

Fairness rules. Every method uses the same encoder, the same five random labeled splits per fraction, the same unlabeled pool, the same number of gradient steps for pre-training, and the same hyperparameter budget of 30 trials tuned on a labeled validation split.

What counts as winning. At 5% labels, our mean 2D error within each floor must be below the best of Mean Teacher, masked reconstruction and SCARF by more than two seed standard deviations. We also expect the full method at 10% labels to match absolute regression at 100% labels; this is a stronger version of the Mean Teacher claim.

Why not just…?

Why not just use weighted kNN with the few labels you have? With a sparse survey, kNN can only predict positions inside the convex hulls of its neighbors, and it has no way to use unlabeled scans. The displacement head can extrapolate beyond a single anchor. This is a real threat at moderate label fractions, where kNN is notoriously strong on UJIIndoorLoc. If our method does not beat kNN at 1–5% labels, the claim fails.

Why not just augment with ProxyFAUG crossover? Midpoint labeling assumes signals vary linearly between two parents. Its own Sigfox result shows a large median gain but only a 6% mean gain, which suggests that tail errors survive. It also needs both parents to be labeled, so the unlabeled pool goes unused. The baseline comparison measures exactly this, and we report error at the 90th percentile as well as mean and median.

Why not just learn displacements and skip contrastive pre-training? This is the most serious alternative, because quadratic pairing alone may capture most of the gain. The pair-only ablation settles it. If adding unlabeled contrast improves error by less than the seed noise at 1–10% labels, we will report the method as purely supervised displacement learning and drop the contrastive claim.

Why not just use masked reconstruction or Mean Teacher, which already work on radio data? Both have published gains. However, reconstruction may spend capacity modeling fading, as the variance-bias argument of Joint-Embedding vs Reconstruction predicts. Mean Teacher's Gaussian noise ignores the reasons readings go missing. A head-to-head comparison under added-noise conditions tests the variance-bias prediction directly: we use 10 dBm of added noise, the condition under which CAE-CNNLoc reports degrading to 12.4 m.

Proposed Experiments

The primary benchmark is UJIIndoorLoc, subsampled to 1%, 5%, 10% and 50% labeled scans, with the remaining training scans treated as unlabeled. We report building and floor accuracy, mean and 90th-percentile 2D error within each floor, and 3D error, averaged over five splits. Transfer is checked on SODIndoorLoc across its three buildings and on SBUK-D, where CAE-CNNLoc reports 1.73 m. Antwerp Sigfox gives a like-for-like comparison with ProxyFAUG at its published operating point.

Three checks are decisive. The first compares distance-weighted against uniform repulsion; we expect the gap to grow as label fractions fall and the survey thins. The second measures how well embedding distance correlates with physical distance on held-out scans, which directly tests whether spatial continuity was preserved. The third evaluates on test scans from devices held out during training, using per-record device information where the database provides it, to see whether the random gain-offset views buy device invariance without paired calibration data. A final sanity check examines the anchor-vote spread: if it does not predict actual error, the uncertainty claim is dropped.