You stand in a church with a hundred phone photos and a scan of its floorplan. Where did each camera stand? SceneAligner lifts the photos into 3D, flattens them into a density map, and pins that map to the floorplan. Its combined recall on the paper's test set is 73.58%, where the best earlier method reaches 32.96%.
Press Align next scene and watch the teal density map settle onto the orange floorplan. Pick another method to compare. Then we build, piece by piece, how a pile of photos becomes a pose on a floorplan.
You need what a camera pose is and the idea of a neural network feature. We build the rest from zero.
Each square is one test case. A case counts as aligned when the camera lands within 30 degrees and 20% of the floorplan diagonal.
The three rates are the paper's real combined angular and positional recall on the clean C3 test set (Table 1, at 30 degrees and 20% of the floorplan diagonal): C3Po 32.96, pretrained DINOv3 18.28, SceneAligner 73.58. Each square is one illustrative case out of 100, so each rate is rounded to whole cases. Which case fails, the cross-shaped church and the dot clouds are illustrative toys. Paper: Junhyeong Cho, Ruojin Cai and Hadar Averbuch-Elor (Cornell University, Kempner Institute at Harvard), arXiv 2605.22581.
Chapter 0
See why placing a photo on a floorplan is hard, and why trying every possible position stops working
You walk into a medieval church. On the wall hangs a map of the building with a red dot that says you are here. Your phone holds a hundred photos of this church, taken by you and other visitors over a week. Now you ask the reverse question: for each photo, where on that map did the camera stand, and which way did it face?
That question has a name. Floorplan localization means finding where a photo was taken inside a floorplan, a flat drawing of a building seen from above. The answer is a pose: a position on the map plus a facing direction. On a flat map a pose is three numbers: x, y and the yaw, the angle you face.
People do this without effort. A computer finds it hard, for two reasons. A photo looks sideways, at walls and doors in perspective. A floorplan looks straight down, and it shows lines, not surfaces. The two pictures share almost no pixels.
Earlier methods (the paper names LASER, F3Loc and UnLoc) treat the map as a board of cells. They discretize the pose: they cut the continuous space of poses into a finite grid. Then they score each grid pose. The score asks: if the camera stood here and faced this way, would it see what the photo shows?
Count the grid for a small room. The paper's own example is an 8 m by 10 m floorplan, cut every 0.1 m and every 10 degrees. That gives 80 positions across, 100 positions down and 36 headings:
Every candidate needs a score. Now picture a cathedral, ten times wider and ten times deeper. The positions grow by 100 times, so the grid holds 28,800,000 candidates. Drag the building size below and watch the count climb.
The bar is the number of poses a grid search must score, on a log scale. Drag the size of the building, the step between positions, or the step between headings.
The 8 m by 10 m room at 0.1 m and 10 degrees (288,000 poses) is the paper's own example. The larger buildings, and the other step sizes, are an illustrative extension: the count is positions across times positions down times headings.
Two more problems hide behind the count. First, these methods need a vectorized floorplan: a list of exact wall lines with coordinates. Most historic monuments have only a rasterized floorplan, a plain image of a drawing, often with symbols and hand-drawn walls. Second, the methods are tested on small, tidy buildings. Real photo collections are messy: many cameras, many lighting conditions, indoor and outdoor shots mixed together. The paper calls this setting in the wild.
A recent method, C3Po, skips the grid. It learns to match points in one photo to points on the floorplan directly. This helps, but the gap is huge. One photo shows one view, and the map shows the whole floor from above. The network must guess the 3D shape that connects the two. With one photo, that guess is under-constrained.
The authors change the question. Do not compare a photo to a map. Build a top-down picture from the photos, then compare two top-down pictures. This idea is possible now because 3D foundation models (large networks that turn a set of photos into 3D points and camera poses, such as VGGT and π3) work on messy photo sets.
Now the search disappears. The system solves for four numbers from a set of matches. The headline result is in the hero: its combined recall is 73.58%, where C3Po reaches 32.96%. It also works with as little as one input image, a case we examine in Chapter 9.
Chapter 1
Learn the one transform SceneAligner solves for, and how two matched points and a vote find it
Picture a sheet of tracing paper. On it you have drawn the outline of a church. Under the sheet lies a printed floorplan of the same church, in a different size and a different turn. You may slide the sheet, spin it and shrink or stretch it evenly. You may not bend it. When the two drawings agree, the sheet is aligned.
Those three moves are the whole job of SceneAligner's last step. The mathematical name for them is a similarity transform. Three words are worth fixing now. Translation slides the drawing. Rotation turns it. Scale resizes it by the same factor in every direction. Together they have four numbers: one scale, one angle, and a slide in x and a slide in y.
A 3D reconstruction built from photos has no real-world size. The model can say that a wall is twice as long as a door, but not how many meters long it is. So the density map needs a free scale. It also has an unknown turn and an unknown place on the floorplan.
A fancier transform could also skew the drawing. That would be wrong here. Real walls meet at the same angles in the building and on the map. A similarity keeps angles and keeps ratios of distances. Chapter 7 turns this fact into two training losses.
The paper writes the transform as M in the set Sim(2), the similarity transforms of the plane. It has a scale s (a positive number), a rotation R (a 2×2 turning matrix, from the set SO(2)) and a translation t (two numbers). A point p lands at:
Writing a point as one complex number z = x + iy makes the transform short. Multiplying by a complex number a turns and scales at once: its length is the scale, its angle is the turn. Adding b slides. So the whole transform is:
The transform has four unknowns. One matched pair, point z1 on the density map and w1 on the floorplan, gives two equations: one for x and one for y. So two pairs give four equations, and they fix all four unknowns. Subtract the equations to remove b:
Worked example. Two points on the density map are z1 = 1 + 1i and z2 = 3 + 1i. Their partners on the floorplan are w1 = 2 + 3i and w2 = 2 + 7i.
| Step | Work | Result |
|---|---|---|
| map arrow | z2 − z1 | 2 + 0i |
| plan arrow | w2 − w1 | 0 + 4i |
| a | 4i / 2 | 2i |
| scale s | length of 2i | 2 |
| angle θ | angle of 2i | 90° |
| b | (2 + 3i) − 2i(1 + i) | 4 + 1i |
| check z2 | 2i(3 + i) + 4 + i | 2 + 7i = w2 |
The map is doubled, turned a quarter circle and slid by (4, 1). Try it with your own hands. Drag the two numbered handles onto their orange target rings.
Left: the density map with two marked corners. Right: the floorplan with two target rings. Drag handles 1 and 2 onto the rings. The teal drawing is the density map under the transform that two matches fix.
The cross-shaped church is an illustrative toy. The two-pair solution is the formula above, applied live to the handle positions.
Real matches come from a neural network, and some are wrong. If one of your two pairs is wrong, the transform is wrong, and nothing in two pairs tells you. The fix is a vote called RANSAC (random sample consensus, from Fischler and Bolles, 1981). The loop has four steps:
Worked inlier check. Take the transform we just solved: a = 2i, b = 4 + 1i. A third density point sits at z3 = 2 + 2i. The transform sends it to 2i(2 + 2i) + 4 + i = −4 + 4i + 4 + i = 0 + 5i, which is the position (0, 5). If the network claims this point matches (0, 5), the third match agrees: it is an inlier. If the network claims (6, 0), the distance from (0, 5) is about 7.8, far above any small threshold, so the match is an outlier. One transform can vote on every other match in this way.
How many draws do we need? Say half of the matches are right. One draw picks two right matches with chance 0.5 × 0.5 = 0.25. The chance that every one of n draws fails is 0.75n. To be 99% sure of one good draw we need 0.75n ≤ 0.01. That gives n ≥ ln 0.01 / ln 0.75 = 4.605 / 0.2877 = 16.0, so about 17 draws. That is a few microseconds of arithmetic, not 288,000 poses to score.
import numpy as np
def sim2_from_two(z1, z2, w1, w2):
"""z, w are complex numbers. Returns a (scale and turn) and b (slide)."""
a = (w2 - w1) / (z2 - z1)
b = w1 - a * z1
return a, b
a, b = sim2_from_two(1+1j, 3+1j, 2+3j, 2+7j)
print(abs(a), np.degrees(np.angle(a)), b) # 2.0 90.0 (4+1j)
Chapter 2
Turn a pile of photos into 3D points, then use gravity to make the floor flat
Take a hundred photos of a church. Spread them on a table. You can see that they belong to one building, but you cannot say where each camera stood. A 3D foundation model does that job. It is a large network, trained on many scenes, that reads a set of photos and writes out 3D points and camera poses in one forward pass. SceneAligner uses π3 by default. VGGT also works, and our VGGT lesson shows how such a model is built.
Call the photos I1 to IN. Photo Ii has Hi rows and Wi columns of pixels. For every pixel the model guesses a 3D point. So image i yields a table of points:
The sizes are large. A 518 × 518 photo (the size the paper feeds the model during training) gives 518 × 518 = 268,324 rows. A set of 150 photos gives 40,248,600 points. The model also returns, for each camera, a relative pose: a rotation and a shift that map that camera's frame into the reference frame, which is the frame of photo I1. After this step all points live in one shared space.
Here is the catch. The shared space is tied to camera 1, not to the Earth. If the first photographer tilted the phone, the whole church leans. A floorplan is drawn looking straight down along gravity. So we must find which way is down and rotate the cloud until down points the same way as in the floorplan.
The paper does this in three moves. First, a separate model called GeoCalib reads each photo alone and predicts a gravity direction: a unit arrow that points down, in that camera's frame. Second, each arrow is carried into the reference frame by the camera's relative rotation. Third, the paper picks one arrow with the medoid.
A medoid is the member of a set that is closest to all the others. For each candidate, add up its distances to every other member. The candidate with the smallest sum wins. Unlike a mean, the medoid is always one of the real estimates, and a few wild values cannot drag it far.
Worked example. Five photos give gravity tilts of 2°, 3°, 4°, 5° and 40°. The last photo is a bad estimate. The mean is (2 + 3 + 4 + 5 + 40) / 5 = 10.8°, well off. The medoid sums are:
| Candidate | Distances to the other four | Sum |
|---|---|---|
| 2° | 1 + 2 + 3 + 38 | 44 |
| 3° | 1 + 1 + 2 + 37 | 41 |
| 4° | 2 + 1 + 1 + 36 | 40 |
| 5° | 3 + 2 + 1 + 35 | 41 |
| 40° | 38 + 37 + 36 + 35 | 146 |
The medoid is 4°, inside the good cluster. Try it on seven noisy estimates.
Left: seven gravity votes, one arrow per photo. Right: the room after we rotate the cloud so the chosen arrow points down. Add bad votes, then switch between the mean and the medoid.
An illustrative toy in 2D: the true tilt is 20 degrees, good votes carry a few degrees of noise, and bad votes are 48 to 70 degrees off. The paper uses the medoid of per-image GeoCalib gravity vectors in 3D; the choice of the medoid is the paper's, the numbers here are not.
Now we have one unit arrow g. We want a rotation that sends g to the vertical y-axis. The paper builds it with Gram-Schmidt orthogonalization: a recipe that turns one arrow plus any helper arrow into three arrows at right angles. The steps:
Worked example. Let g = (0, 0.6, 0.8) and v = (1, 0, 0). Then v·g = 0, so e1 = (1, 0, 0). The cross product e1 × g = (0·0.8 − 0·0.6, 0·0 − 1·0.8, 1·0.6 − 0·0) = (0, −0.8, 0.6). Check the length: 0.64 + 0.36 = 1. Check R g = (e1·g, g·g, e3·g) = (0, 1, 0). The church now stands upright.
Applying R to every table Pi gives the gravity-aligned points Pig, the same shape as before. As the paper says, this makes the reconstruction and the floorplan share one horizontal plane. The remaining job is flat: slide, turn and scale in that plane.
One engineering detail: a transformer-based reconstruction model costs more than linearly as photos are added. The paper therefore splits a scene of N > 150 photos into ⌈N / 150⌉ chunks. A scene of 400 photos becomes 3 chunks. Smaller scenes run whole.
Chapter 3
Filter the 3D points, look straight down, and count: walls show up as bright lines
Imagine the church as a cloud of tens of millions of 3D points, now standing upright. Hold a sheet of paper under it and let every point fall straight down onto the sheet. Where does the paper get dark? Under the walls. A wall is a thin vertical slab. Every point on it, from floor to ceiling, falls on the same thin line. A floor does the opposite. It spreads its points evenly over the whole room.
That is the idea of the density map. Cut the room into a grid of cells on the floor. Count the points that fall into each cell. Cells under walls hold large counts. The picture looks like a line drawing of the floorplan, and it lives in the same top-down medium. The paper calls it a floorplan proxy.
The look-down step is an orthographic projection. A camera takes a perspective view, where far things shrink. An orthographic view drops the height coordinate and keeps the other two, so distances on the floor stay true. In the gravity-aligned frame of Chapter 2, height is y, so we keep (x, z).
If we project every point, the density map is full of junk. The paper names the culprits: faraway backgrounds and sky, plus floors and ceilings. A photo of a church exterior sees hills and clouds. The model puts those points far away, where they smear the map. So the paper keeps only points that are:
A percentile threshold says "cut at the value below which this share of points falls". Percentiles adapt to the scene, so a model that reconstructs a church at arbitrary scale needs no meter-based setting.
After filtering, the paper counts the points in each cell of a grid. The raw counts are very uneven. A wall that appears in thirty photos gets a huge count. A wall seen in two photos gets a tiny one. If we divide by the largest count, the faint wall almost vanishes. So the paper applies gamma correction: raise each normalized value to the power γ. With γ = 0.5 that is a square root, which lifts small values more than large ones.
Worked example. Five cells hold the counts 0, 1, 4, 16 and 100. The largest is 100. After division the values are 0, 0.01, 0.04, 0.16 and 1. The square root gives:
| Count n | n / 100 | D with γ = 1 | D with γ = 0.5 |
|---|---|---|---|
| 0 | 0.00 | 0.00 | 0.00 |
| 1 | 0.01 | 0.01 | 0.10 |
| 4 | 0.04 | 0.04 | 0.20 |
| 16 | 0.16 | 0.16 | 0.40 |
| 100 | 1.00 | 1.00 | 1.00 |
The cell with one point goes from 0.01 (invisible) to 0.10 (visible). The result is the paper's density map D, one channel of H × W values. The floorplan F has three color channels (H × W × 3). Both are line-drawing pictures seen from above. Try the filters on the toy church below and watch the wall lines emerge.
Left: a side view of the points, with height up. Right: the top-down density map. Turn each filter on and off, and drag gamma.
A toy cloud of about 5,500 points around a cross-shaped church: walls, floor, ceiling, and far-away junk. The cutoffs here are fixed numbers, where the paper uses percentiles (confidence 45%, trimming 2.5%, height 20% to 95%, gamma 0.5). The contrast is the mean brightness of wall cells divided by the mean brightness of all other cells.
Each choice answers a failure. Percentiles, not meters: a reconstruction has no real scale, so a cut at "2 meters" would mean nothing. A percentile cut keeps the same share of points whatever the scale. Counts, not a yes or no per cell: a count tells the matcher how sure the evidence is. A wall seen in thirty photos is brighter than a wall seen in two, and the brightness is a free confidence signal. Orthographic, not perspective: the floorplan has no vanishing point, so the density map must not have one either.
The settings also have two failure modes. Set the confidence cut too low, and sky and far hills stay in the map and smear the walls. Set it too high, and thin walls seen in few photos disappear. Exterior scenes are the hard case, because the model puts distant background points far from the building. The training recipe in Chapter 7 draws these settings at random for that reason: the matcher must cope with a whole range of maps, not one.
The paper tested how fragile these settings are (Appendix E.2). It varied ρconf, ρxz and γ. The method kept beating the baselines at every setting it tried. It needs no careful search. Later, Chapter 7 shows the paper turns this variation into a training trick.
Chapter 4
Turn the density map and the floorplan into feature grids, and adapt a vision foundation model with a tiny add-on
Look at two images. One is a clean architectural drawing: thin black walls, a door symbol, a label. The other is a fuzzy top-down count of points, with speckle and gaps. Are they the same building? You say yes by spotting shared shapes: the long nave, the crossing. A computer needs to do the same, and that is the hard core of the method. The paper calls the gap between the two pictures the appearance gap.
A network cannot compare raw pixels here, because the pixels look nothing alike. It compares features: vectors of numbers that describe what is at a spot, such as "corner of a wall" or "end of a long hall". Two spots that mean the same thing should get similar vectors, even if one is a drawing and one is a count.
The network that makes the vectors is the encoder. SceneAligner uses DINOv3 ViT-B/16, a vision foundation model trained on natural images without labels. Its name tells the layout. A ViT (vision transformer) cuts an image into square patches, here 16 × 16 pixels, and reads each patch as one token. It outputs one feature vector of C = 768 numbers per patch.
Shapes. At inference the paper feeds both pictures at 512 × 512 pixels. That is 512 / 16 = 32 patches per side, or 1,024 patches. The two outputs are feature maps:
The same encoder E, with the same weights, reads both pictures. That is what shared means. Because both maps come out of one function, their features live in one space, and we can compare a vector from the density map with a vector from the floorplan directly.
The authors tested the plain pretrained DINOv3. They colored each patch by a projection of its feature (a PCA plot, Figure 3). Matching spots on the density map and the floorplan got different colors. The model had never seen a drawing of walls next to a count of points. In Table 1 this baseline reaches only 18.28 on the combined recall. So it needs training.
Retraining a whole foundation model on a modest dataset is risky and slow. The model may forget what makes it good. The paper freezes all pretrained weights and adds LoRA (low-rank adaptation, Hu et al., 2022). Take one weight matrix W of size d × d. Instead of changing W, learn two thin matrices whose product is the change:
Worked example. Take a 768 × 768 matrix, one square matrix in the encoder. Training it fully means 768 × 768 = 589,824 numbers. With r = 16, B has 768 × 16 and A has 16 × 768. That is 2 × 16 × 768 = 24,576 trainable numbers, or 24,576 / 589,824 = 4.17% of the full count. With α = r = 16, the factor α / r is 1. The paper adds LoRA layers to the attention and MLP modules of every transformer block, with a dropout rate of 0.1.
The big square is one frozen 768 by 768 matrix. The thin strips are the matrices LoRA trains, drawn to scale. Choose a rank and read the paper's accuracy for it.
Accuracy is the paper's combined angular and positional recall at (30 degrees, 20%) on C3 from Table E.3, with α = r in each row. The size of a single 768 by 768 matrix is an illustration: the paper does not list the total number of trainable parameters.
There were three options. Train a matcher from scratch: a drawing-to-count network would need far more data than the roughly 280,000 augmented samples the paper trains on. Fine-tune every weight: the model may forget the general visual skill that made it a useful start. Freeze everything: Figure 3 shows the result, features that cannot bridge the gap. LoRA sits between them. It keeps the general skill and learns only the shift needed for this pair of pictures. The paper tests LoRA settings, not these two other options, so the argument for them is our reading.
The size of the encoder matters for speed too. The earlier method C3Po runs a heavy ViT-L backbone on every single photograph. SceneAligner uses the lighter ViT-B, and it runs once per density map, not once per photo. If a scene has 66 photos in a chunk, that one pass is shared by all of them. Chapter 9 shows the effect: the matching step costs 0.4 ms per image for chunks of 150.
Rank 4 is too weak: the combined recall drops to 62.40. Rank 32 is not better than rank 16 (71.00). The paper keeps r = α = 16. In code, a LoRA layer is a few lines:
class LoRALinear(nn.Module):
def __init__(self, base, r=16, alpha=16, p=0.1):
super().__init__()
self.base = base # frozen W: d_out x d_in
for q in self.base.parameters(): q.requires_grad = False
self.A = nn.Parameter(torch.randn(r, base.in_features) * 0.01) # r x d_in
self.B = nn.Parameter(torch.zeros(base.out_features, r)) # d_out x r
self.scale, self.drop = alpha / r, nn.Dropout(p)
def forward(self, x): # x: (..., d_in)
return self.base(x) + self.scale * (self.drop(x) @ self.A.T) @ self.B.T
B starts at zero, so at the start the layer equals the pretrained one. Training then bends it toward the new task and leaves the frozen weights untouched.
Chapter 5
Pull the features of true partner spots together and push every other pair apart
Play a memory game with two decks. One deck has cards cut from the density map. The other has cards cut from the floorplan. Each density card has exactly one partner card in the floorplan deck. You win a round when, for every density card, the most similar floorplan card is its partner. Training the encoder is practice at this game.
The game needs the answers. A ground-truth correspondence is a pair of pixel locations, one on the density map and one on the floorplan, that mark the same spot of the building. The paper builds its training data from the C3 dataset, whose photos come with annotations that register their 3D reconstructions to floorplans. At each training step the paper samples Q = 1,024 such pairs.
For each pair i we read the feature vector at that pixel from the feature maps of Chapter 4. A feature map has one vector per 16 × 16 patch, but a pair sits at an exact pixel. So the paper uses bilinear interpolation: it blends the four nearest patch vectors with weights set by distance. It then divides each vector by its length (ℓ2-normalization), so every vector f has length 1.
With unit vectors, the dot product is the cosine similarity: 1 if the vectors point the same way, 0 if they are at right angles, −1 if opposite. Compare every density vector with every floorplan vector and you get a Q × Q table:
We want the diagonal to be the largest number in every row and every column. A row says: "which floorplan spot does density spot i like best?" A column asks the reverse. The loss measures how far each row and column is from that goal.
The paper uses the InfoNCE loss (van den Oord et al., 2018) in both directions. Turn each row into probabilities with a softmax, and ask how much probability lands on the true partner. The loss is the negative log of that probability.
The symbol τ is the temperature. Dividing similarities by a small τ stretches the gaps between them, so the softmax gets sharper. The paper sets τ = 0.07. The other Q − 1 = 1,023 spots in each row are the negatives: the wrong cards the true partner must beat. Many of them are other walls of the same church, which is the right kind of hard.
Worked example. Use Q = 3 and τ = 0.1 (larger than the paper's, to keep the arithmetic short). The matrix is S = [[0.8, 0.3, 0.1], [0.2, 0.7, 0.4], [0.0, 0.5, 0.6]]. The row softmax of row 1 uses exp(8) = 2,981, exp(3) = 20.1 and exp(1) = 2.7:
| Spot i | Row prob. | Row loss | Column prob. | Column loss |
|---|---|---|---|---|
| 1 | 2981 / 3004 = 0.992 | 0.0076 | 2981 / 2989 = 0.997 | 0.0028 |
| 2 | 1097 / 1159 = 0.947 | 0.0550 | 1097 / 1265 = 0.867 | 0.1429 |
| 3 | 403 / 553 = 0.730 | 0.3151 | 403 / 461 = 0.876 | 0.1328 |
The row losses sum to 0.3777. The column losses sum to 0.2786. So Lfeat = (0.3777 + 0.2786) / (2 × 3) = 0.109. Spot 3 hurts most: its true score is 0.6, but density spot 3 also scores 0.5 with floorplan spot 2, which is close. Drag the toy below from untrained to trained.
Rows are five density spots, columns are five floorplan spots. The diagonal holds the true partners. Slide from untrained to trained, then change the temperature.
The 5 by 5 matrices are an illustrative toy, not the paper's data: the untrained matrix has no clear diagonal, and the trained one has 0.85 on the diagonal. The loss formula, the symmetric form and tau = 0.07 are the paper's (Equation 2 and Section C.3).
Why both directions? A one-way loss only teaches each density spot to find its partner. It never stops two density spots from choosing the same floorplan spot. The column term closes that hole: every floorplan spot must also pick exactly one density spot. This is close in spirit to the mutual nearest neighbor filter we use at test time (Chapter 8).
What does the temperature do in practice? A large τ flattens the softmax, so every candidate gets some probability and the gradients push on all negatives gently. A small τ sharpens it, so the loss focuses on the hardest negatives, the spots that look most like the right answer. For a building, those are the other walls: a nave wall looks a lot like the opposite nave wall. A small temperature is how the network learns to tell them apart. If τ is too small, a single mislabeled pair dominates the batch, which is why the value is a compromise.
The loss does a lot by itself. In the paper's ablation (Table E.1), training with Lfeat alone lifts the combined recall from the pretrained model's 18.28 to 69.10. The rest of the loss terms add the last few points, as the next two chapters show. In code the whole term is five lines:
def info_nce(fD, fF, tau=0.07):
"""fD, fF: (Q, 768) unit vectors for the Q true pairs."""
S = fD @ fF.T # (Q, Q) cosine similarities
y = torch.arange(S.shape[0]) # the diagonal is the right answer
return 0.5 * (F.cross_entropy(S / tau, y) + F.cross_entropy(S.T / tau, y))
Chapter 6
Read a match position to a fraction of a patch, with a weighted average and a loss that forgives outliers
A friend says: "I am in square C4 of the map." That is useful. It is not a position. You still do not know whether your friend stands in the corner of the square or in the middle. The patch-level features of Chapter 4 give the same kind of answer. The map has 16 × 16 pixel patches, and each match names a patch.
The usual recipe is to find the floorplan patch with the highest similarity and use its center as the match. Then every match is rounded to a patch center. A point can sit anywhere in a 16-pixel patch, so the worst error is half a patch: 8 pixels in each direction. The paper writes this as the ±8 pixel quantization error.
Compare it with the scoring. Chapter 9 uses PCK@1%: a match counts as correct if it lands within 1% of the floorplan resolution. On a 512 × 512 floorplan, 1% is 5.12 pixels. A rounding error of up to 8 pixels can fail that test even when the network is right about the patch. We need sub-patch precision.
An argmax picks the single best patch. A soft-argmax averages all patch centers, and each patch counts in proportion to its probability. Take density spot i, with its feature vector. Compute its similarity with all H′W′ patch features of the floorplan, row i of a matrix S ∈ ℝQ×H′W′. Turn the row into probabilities with a softmax. The predicted position is the expectation over patch centers cj:
Worked example in one dimension. Four patches have centers at 8, 24, 40 and 56 pixels. For a density spot the softmax gives 0.05, 0.60, 0.30 and 0.05. The argmax patch is the second, so argmax answers 24. The soft-argmax answers:
If the true position is 30, argmax is 6 pixels off and soft-argmax is 0.4 pixels off. The probabilities of the neighbors pull the answer toward where the truth is. Because it is a smooth formula, it is differentiable: we can send a gradient through it to the encoder. Hard argmax has no gradient. Move the true point in the toy and watch.
A 6 by 6 patch grid of the floorplan. Drag the green point, the true match. Purple shading is the match probability. Compare the argmax square with the soft-argmax dot.
An illustrative toy: patches are 16 pixels wide, probabilities come from a softmax of a blurred bump around the true point plus a small fixed bias per patch, and the blur slider sets how wide the bump is. The 16-pixel patch and the plus or minus 8 pixel quantization error are the paper's.
This matters for training. With hard argmax, the loss cannot tell a nearly right answer from a badly wrong one inside the same patch. With soft-argmax, the gradient shifts probability toward the patches nearer the truth, even when the best patch was already correct. The encoder learns to place features so that the blend of neighbors lands on the exact spot.
Now we compare the prediction with the ground truth piF using a Huber loss Hδ. For an error e it is ½e2 when |e| ≤ δ, and δ(|e| − ½δ) when the error is larger. Small errors are squared, which gives smooth, small steps. Large errors grow only in a straight line, so one wild or mislabeled pair cannot dominate. The paper also weights each pair by wi, the highest softmax probability in its row, a measure of how sharp the prediction is:
A quick check shows what the Huber loss buys. Use δ = 1 for illustration. An error of 0.4 pixels costs ½ × 0.42 = 0.08. An error of 6 pixels costs 6 − 0.5 = 5.5. A pure squared loss would charge ½ × 36 = 18 for the same error, more than three times as much. One wrongly labeled pair would then outweigh dozens of good ones. With Huber, it adds a bounded push.
The weights have a second job. At test time they rank matches, so the sharpest, most trusted ones are kept for the transform (Chapter 8). Training with them makes the confidence meaningful. Equation 3 is trained with a weight λregr = 50, and the paper switches it on after the first 10% of training (Chapter 7).
def soft_argmax(fD, Fbar, centers, tau=0.07):
"""fD: (Q, C) density features. Fbar: (H'W', C). centers: (H'W', 2) pixels."""
S = fD @ Fbar.T # (Q, H'W') similarities
pi = torch.softmax(S / tau, dim=-1) # tau here is our assumption: cosine values alone are too flat
p_hat = pi @ centers # (Q, 2) expected position, sub-patch
w = pi.max(dim=-1).values # (Q,) confidence = peak probability
return p_hat, w
def regr_loss(p_hat, p_gt, w, delta=1.0): # delta is not given in the text we used
e = (p_hat - p_gt).norm(dim=-1)
return (w * F.huber_loss(e, torch.zeros_like(e), delta=delta, reduction="none")).sum() / w.sum()
The ablation is honest about the size of the gain. Adding Lregr to Lfeat moves the combined recall from 69.10 to 70.60, and PCK@1% from 20.01 to 21.12 (Table E.1). RMSE rises a little, from 0.0900 to 0.0938. The structural losses of the next chapter recover that.
Chapter 7
Add two losses that punish matches that no similarity transform could produce, then see the full recipe
Pin four points of a paper map to a corkboard. If you press each pin to within a hair of its target, the map lies flat. Now imagine each pin is placed by a different person who cannot see the others. Every pin lands near its target, but near is not exact, and the little errors point in random directions. The map bubbles. The result no longer looks like a map that was only slid, turned and resized.
The point-wise losses of the last two chapters behave like those separate people. Each match is judged on its own. The paper warns that such objectives "can lead to degenerate similarity transforms when the spatial structure of correspondences collapses". Matches may satisfy each loss while being structurally inconsistent. So the paper adds a prior that sees all matches together.
Recall Chapter 1. A similarity transform slides, turns and uniformly resizes. Two things never change under it. Angles between lines stay the same. Ratios of distances stay the same: if one wall is twice as long as another before, it is twice as long after. A match set that breaks either rule cannot come from any one similarity. The paper turns each rule into a loss. Neither needs extra labels: both compare the predicted floorplan points p̂F with the known density map points pD.
Sample triplets of matches (i, j, k). Each triplet forms a triangle in the density map and a triangle in the floorplan. Measure an angle of each triangle, and ask that the two agree. Comparing the angle number directly has trouble near 0° and 360°. So the paper compares its cosine and its sine, each with a Huber loss:
Worked example. A density triangle has corners i = (0, 0), j = (4, 0), k = (0, 3). The angle at i is 90°, so cos = 0 and sin = 1. A prediction doubles the triangle and turns it: the angle is still 90°, and L = 0. Now a bad prediction bends the angle at i to 70°: cos = 0.342, sin = 0.940. The differences are 0.342 and −0.060. With δ = 1 the Huber loss is ½e2, so the term is ½(0.342)2 + ½(0.060)2 = 0.0585 + 0.0018 = 0.060.
The second loss uses distances. For a pair (i, j) take the log of how much the pair stretched: Δij = log (‖p̂iF − p̂jF‖ / ‖piD − pjD‖). Under a similarity with scale s, every pair stretches by the same factor s, so every Δij equals log s. We do not know s, so the loss does not fix it. It asks that all Δij agree with their own weighted mean Δ̄:
Worked example. A density triangle has side lengths 4, 3 and 5. A similarity with s = 2 gives 8, 6 and 10: every Δ is log 2 = 0.693, and Lgeo = 0. Suppose a bad prediction gives sides 8, 9 and 10. The ratios are 2, 3 and 2, so Δ = 0.693, 1.099 and 0.693. The mean is 0.828. The deviations are −0.135, +0.270 and −0.135. With δ = 1 the loss is the mean of ½e2: (0.0091 + 0.0366 + 0.0091) / 3 = 0.018. Drag a pin below to see both losses react.
Four matches. Left: the density map points. Right: the floorplan, with dashed rings where a perfect similarity would put the pins. Drag a pin off its ring and watch both losses.
An illustrative toy with four matches, every weight set to 1 and delta set to 1. The 12 corner angles and 6 pair distances are all used. The two loss formulas are the paper's Equations 4 and 5.
The paper uses a curriculum: it turns the losses on in stages. For the first 10% of iterations only Lfeat trains. From 10% to 20%, Lregr joins. After that the structural terms join. The reason is stability: the structure losses only make sense once the matches are roughly right.
| Part | The paper's setting |
|---|---|
| Training maps | about 140K density maps from varied reconstructions, plus about 140K from single images |
| Reconstruction models used to make them | π3 and VGGT, crop and pad preprocessing, 50 to 150 photos per scene |
| Randomized map settings | ρconf in {30, 45, 60, 75, 90}%, ρxz in {0, 2.5, 5}%, γ in {0.25, 0.5, 0.75, 1} |
| Pairs per step | Q = 1,024; temperature τ = 0.07 |
| Augmentation | rotations of 0, 90, 180, 270°; random crop at scale 0.7 to 1.0; color jitter |
| Mixed resolution | each batch at 512, 768, 1024 or 1280 pixels (RoPE allows it) |
| Optimizer | AdamW, learning rate 10−4, batch size 4, gradient clip 1.0 |
| Budget | 1 epoch over about 280K samples, about 2 days on one RTX A6000 |
Two details tie to earlier chapters. The random map settings teach the encoder to cope with the noise of real reconstructions. The mixed resolution works because DINOv3 uses rotary positional embeddings (RoPE), which let it accept different image sizes without changes. Table E.4 shows the combined recall rises from 71.88 to 73.58 with it.
The structural losses earn their place. In Table E.1 the combined recall goes 70.60 with Lfeat and Lregr, then 70.54 with Ltopo added, then 73.58 with Lgeo added. Look closely: the first structural loss moves the strict angular recall (@5°) from 60.50 to 64.18 and PCK@30% from 86.39 to 89.40, while the combined number stays flat. Judge a loss by all the columns.
def topo_geo(p_hat, p_d, w, tri, pair, delta=1.0):
"""p_hat, p_d: (Q, 2). w: (Q,). tri: (T, 3) index triplets. pair: (P, 2)."""
def cs(Pt): # cos and sin of the angle at vertex i
a, b = Pt[tri[:, 1]] - Pt[tri[:, 0]], Pt[tri[:, 2]] - Pt[tri[:, 0]]
n = a.norm(dim=-1) * b.norm(dim=-1) + 1e-8
return (a * b).sum(-1) / n, (a[:, 0] * b[:, 1] - a[:, 1] * b[:, 0]) / n
(ch, sh), (cd, sd) = cs(p_hat), cs(p_d)
wt = w[tri].prod(-1)
L_topo = (wt * (huber(ch - cd) + huber(sh - sd))).sum() / wt.sum()
d = (p_hat[pair[:, 0]] - p_hat[pair[:, 1]]).norm(dim=-1) / (p_d[pair[:, 0]] - p_d[pair[:, 1]]).norm(dim=-1)
D = d.log(); wp = w[pair].prod(-1)
Dbar = ((wp * D).sum() / wp.sum()).detach() # sg(.): stop-gradient
L_geo = (wp * huber(D - Dbar)).sum() / wp.sum()
return L_topo, L_geo
Chapter 8
Follow one scene through the whole pipeline, and see how a vote turns noisy matches into one transform
You hand the system 80 photos of a church (an illustrative number) and a scan of its floorplan. It tells you where each photo was taken. Let us follow the data, step by step, with the shapes at each stage. Chapters 2 and 3 gave the first half. This chapter is the second half.
Step 6 has two parts. The first, top-50% by confidence, drops the matches whose softmax peak is low. Recall that w is the highest probability in the row. A low w means the network could not decide, as in the split peak we met in Chapter 6.
The second, mutual nearest neighbor (MNN) matching, asks for agreement in both directions. A match from density spot i to floorplan spot j is kept only if spot j's own best density match is spot i. It is like a handshake: both must pick each other.
Worked example. Three density spots a, b, c pick floorplan spots x, x and y. Looking back, spot x's best density match is a, and spot y's best density match is c. Spot a picked x, and x picked a: a mutual pair, kept. Spot b also picked x, but x picked a, not b: dropped. Spot c picked y and y picked c: kept. Two of three matches survive, and the dropped one was the one that clashed with another.
The paper tests both (Table E.2). Neither filter gives a combined recall of 70.19. Top 50% alone gives 71.96. MNN alone gives 71.67. Both together give 73.58, and the best RMSE of 0.0776.
Even after filtering, some matches are wrong. RANSAC (Chapter 1) turns the leftovers into one transform. Formally it looks for the M that is the best explanation for the most matches:
Try it. The toy holds 24 matches. Some are wrong. Each draw picks two matches at random, solves a transform from them, and counts the matches that agree.
Orange: the floorplan. Dots: where the network says each density spot belongs; green if the best transform agrees, red if not. Grey outline: the current candidate. Teal outline: the best so far.
An illustrative toy: 24 matches on a cross-shaped church, wrong ones placed at random positions, good ones with small noise, inlier distance 0.03 of the panel width. The procedure (random pairs, a closed-form solve, keep the most inliers) is RANSAC as the paper uses it.
Sampling queries in proportion to density puts the effort where the evidence is. Empty floor cells hold no structure to match. Keeping a fixed top share, and not a fixed confidence threshold, means the filter still returns matches in a scene where all confidences are low. (That reason is our reading; the paper states only the settings.) And a similarity transform has a closed-form solution from two matches, so the vote is cheap: the cost of this stage in Table F.4 rounds to 0.0 ms per image for chunks of 10 or more.
The last step uses M on the 3D scene. The points have coordinates (x, y, z), with y vertical. The paper applies M to the horizontal pair (x, z), and it multiplies the vertical coordinate y by the scale s. Without that, a building that doubles in plan would keep its old height. Camera poses move with the same M, which gives each photo a position and a facing direction on the floorplan.
Worked example. Reuse the transform of Chapter 1: s = 2, a 90° turn, slide t = (4, 1). A camera stands at (1, 1) in the density map and faces along +x (yaw 0°). Its new position is 2 · R90(1, 1) + (4, 1) = 2 · (−1, 1) + (4, 1) = (2, 3). Its new yaw is 0° + 90° = 90°. One transform, applied to every camera, places the whole collection at once.
That is also why the method works from a single photo. The network never needs to see the photo. It needs only a density map, and one photo already gives a small density map. The fewer the photos, the less wall the map shows, and the more that map looks like several places. Chapter 9 measures this.
def localize(images, floorplan, model3d, geocalib, encoder, topk=0.5):
P_c, T_rel = model3d(images) # points (N, H*W, 3), poses to frame 1
g = medoid([T_rel[i].R @ geocalib(im) for i, im in enumerate(images)])
Rg = gram_schmidt_up(g) # sends g to the y axis
P_g = P_c @ Rg.T # gravity-aligned points
D = density_map(P_g, conf_pct=45, xz_pct=2.5, y_pct=(20, 95), gamma=0.5) # (512, 512, 1)
FD, FF = encoder(D), encoder(floorplan) # each (32, 32, 768)
q = sample_by_density(D) # query pixels, favour walls
p_hat, w = soft_argmax(FD.at(q), FF.flat, centers)
keep = topk_by(w, topk) & mutual_nn(FD.at(q), FF.flat)
M = ransac_sim2(q[keep], p_hat[keep]) # scale s, rotation R, shift t
P_f = apply_xz(M, P_g); P_f[..., 1] *= M.s # move (x, z); scale height
return transform_cameras(M, T_rel), P_f
Chapter 9
Read each table for what it measures, then test the claims on sparse views, indoor scenes and speed
A result table is a claim with numbers. Before we read the numbers, we need to know what was tested and how it was scored. This chapter goes through three tests: photos in the wild, photos of synthetic rooms, and photos in short supply.
C3 is a large collection of tourist-style photos paired with floorplans. Its labels come from registering 3D reconstructions to the floorplans, so some labels are wrong. The authors cleaned it: they removed fisheye photos, blueprints and badly registered scenes, using rules, a vision-language model (Qwen2.5-VL) and two rounds of human checking. They kept 574 of 597 scenes (96.15%). The test split holds 111 scenes, with 5,659 interior and 6,555 exterior images.
Structured3D holds rendered rooms with precise vector floorplans. It is the standard benchmark for the older grid-search methods, so it allows a direct comparison with them.
Angular recall @ a is the share of cameras whose facing direction (yaw) is within a degrees of the truth. Positional recall @ p is the share whose position is within p% of the floorplan diagonal. The combined score (30°, 20%) requires both. PCK @ x (percentage of correct keypoints) is the share of density-to-floorplan matches within x% of the floorplan resolution. RMSE is the root mean square position error (lower is better).
Worked example. A floorplan image is 512 × 512, so its diagonal is 512 × 1.414 = 724 pixels, and 20% of it is 145 pixels. A camera that lands 100 pixels from the truth and faces 12° off passes the combined test. A camera 100 pixels away and 40° off fails it. The combined number is the strictest of the camera-level scores.
Choose a table, then a metric. Each bar is one method's score. For RMSE, lower is better.
Every number is from the paper: Table 1 (camera pose on the clean C3 subset), Table 2 (correspondences on C3) and Table 3 (single-view indoor localization on Structured3D). Scores are percentages, except RMSE.
On camera pose, SceneAligner reaches a combined recall of 73.58. C3Po reaches 32.96, which makes SceneAligner 123.24% higher. The older matchers LoFTR and DUSt3R stay below 5. The pretrained DINOv3 baseline, our own pipeline with no fine-tuning, reaches 18.28. The gap between 18.28 and 73.58 is the value of the training in Chapters 4 to 7. The gap between 32.96 and 73.58 is the value of the whole design.
On matches, PCK@5% is 69.87, against 34.91 for C3Po. The RMSE is 0.0776 against 0.1780. The authors say the 3D-grounded approach "enforces spatial rigidity": when C3Po predicts matches one photo at a time, some come out physically impossible, and a reconstruction cannot produce those.
On Structured3D, SceneAligner reaches 51.6 on the combined (30°, 1 m) recall, against 37.6 for UnLoc. It does so with no discretized pose space and no floorplan preprocessing. Read the whole row, though. At the strictest threshold, 0.1 m, UnLoc leads with 5.3 against 3.5. The new method wins at 0.5 m and 1 m. It is a better global localizer here, not a finer one.
A method that needs a reconstruction might need many photos. The paper tests this. In its Figure 5, a single photo already beats C3Po by a large margin, and 10 to 30 photos match the accuracy of 150. The paper gives the plot, not a table, so we show what it does tabulate: how close a sparse reconstruction is to the dense one (Table F.1).
Pick how many photos go in. Bars show what share of the reconstructed points lie within 1%, 3%, 5% and 10% of the scene size of the dense reconstruction.
Numbers are the paper's Table F.1: F-score of points reconstructed from sparse photos against the dense (up to 150 photo) reconstruction as pseudo ground truth, after ICP alignment and scaling by the dense bounding box, and the Overall (Chamfer) distance.
With 10 photos the reconstruction is close to the dense one: an Overall distance of 0.0317. With one photo it is far: 1.0346. That fits the failure the paper reports for one photo: a single wall segment can match several places in a floorplan.
Interior scenes are easier. The combined recall is 84.89 for interior and 69.36 for exterior images (Table F.2). The authors point to exterior reconstructions being noisier, with far-away background points leaking into the density map.
Speed is measured per image, amortized, on one RTX A6000 (Table F.4). The correspondence net runs once per density map, so its cost is shared by all photos in the chunk.
| Method | 3D scene | Density | Match | Pose | Total |
|---|---|---|---|---|---|
| C3Po | none | none | 59.6 ms | 135.8 ms | 195.4 ms |
| Ours, 1 photo | 158.8 | 20.2 | 17.2 | 0.2 | 196.4 ms |
| Ours, up to 10 | 121.8 | 20.0 | 1.9 | 0.0 | 143.7 ms |
| Ours, up to 150 | 200.2 | 22.8 | 0.4 | 0.0 | 223.4 ms |
Chunks of 10 are the sweet spot. With one photo per chunk the GPU idles. With 150 the quadratic cost of attention in the 3D model dominates. The matching step falls from 17.2 ms to 0.4 ms per image as the cost is shared.
The floorplan is a shared reference, and that gives a new power. A 3D foundation model often fails when it gets indoor and outdoor photos of the same building together. The views barely overlap, so there is nothing to tie them to each other. SceneAligner aligns each collection to the floorplan on its own, and so the two reconstructions land in one shared coordinate system. The paper shows this for a medieval monastery (Figure 7) and also for disjoint photo sets of a church with no overlap at all (Figure H.2). It reports these as demonstrations, with no table.
Chapter 10
Find out which parts earn their keep, where the method breaks, and what the authors leave open
An ablation removes or adds one part and measures what changes. It answers a plain question: did this piece of the design matter? The paper's appendix runs several. We go through them, then through the failures the authors show, and we end with what stays open.
Table E.1 adds the losses one at a time, in the order of Chapters 5 to 7. Step through the ladder.
Choose how much of the training objective is switched on. The bars show four of the paper's metrics.
All numbers are the paper's Table E.1 on the clean C3 subset. Each step adds one loss to the steps before it, so a step's gain depends on the order.
Worked calculation. From the pretrained model (18.28) to the full model (73.58) the combined recall rises by 55.30 points. The contrastive loss alone gets to 69.10, which is a rise of 50.82 points, or 91.9% of the total. The next three losses add 1.50, then −0.06, then 3.04 points to the combined score.
Does that mean Ltopo is useless? No. It raised the strict angular recall (@5°) from 60.50 to 64.18, and PCK@30% from 86.39 to 89.40. The combined number is one view. And because the losses were added in order, we cannot split credit between Ltopo and Lgeo. The paper states the purpose of both: to keep matches from becoming non-rigid.
| What changed | Combined recall | Source |
|---|---|---|
| No filter → top 50% → MNN → both | 70.19, 71.96, 71.67, 73.58 | Table E.2 |
| LoRA rank 4, 8, 16, 32 | 62.40, 71.01, 73.58, 71.00 | Table E.3 |
| Fixed resolution → mixed resolution | 71.88 → 73.58 | Table E.4 |
| VGGT → π3 as the 3D model | 71.52 → 73.58 | Table E.5 |
Two readings stand out. First, no single trick is decisive after the contrastive loss: each of the rest moves the combined number by one to three points. Second, the 3D model matters. Swapping π3 for VGGT costs 2.06 points, because everything downstream is built on its points.
Table E.6 tests the filter and the fine-tuning together on the density-to-floorplan matches. PCK@5% is 9.13 with neither, 15.64 with the confidence filter alone, 61.67 with fine-tuning alone, and 70.24 with both. The filter helps a little with bad features and a lot with good ones. Confidence is only useful once it means something.
One caution when reading all of these tables. Each row lists a single number, and the paper reports no error bars or repeated runs for them. A gain of 0.06 points, or a loss of 0.06 as for Ltopo, is well inside what a rerun could change. Only the large steps, the contrastive loss and the final geometry term, are safe to call real. The same holds for the other tables: trust the order of magnitude and the pattern across columns, and hold small differences loosely.
The authors show two failure types (Figure G.1), both when the density map lacks global context. In structural ambiguity the map shows only a doorway, and the floorplan has several similar doorways. In symmetrical ambiguity the map shows part of a symmetric shape, such as three arms of a cross, and the model may pick an orientation 180° off. They are most common with few photos.
Teal dots are the part of the building the photos saw. Choose a floorplan and shrink the visible share. Purple dashed dots show other turns of 90 degrees that fit the floorplan just as well.
An illustrative toy, not the paper's data. A turn "fits" when at least 95% of the visible dots land within 0.02 of the outline after turning about the building's centre. The two failure types it shows, a partial view that fits several places and a symmetric shape that fits at 180 degrees, are the ones in the paper's Figure G.1.
Why do few photos hurt? Table F.1 gives the cause. Reconstruction from one photo has an Overall distance of 1.0346 to the dense result, and the share of points within 5% is 38.87%. With 10 photos the distance is 0.0317 and the share is 85.20%. A thin, wobbly density map shows only a wall segment, and a wall segment fits many places. The failure is not in the matcher. It is in how little the map shows.
The authors list two directions: robustness to imperfect reconstructions, and reasoning about the scene geometry and the floorplan jointly, so that the map can correct the reconstruction and not only the other way. We add questions of our own. Could the method return several candidate alignments, with scores, when the density map is ambiguous, and let a user pick? Could a second pass use the floorplan to repair the reconstruction after the first alignment? And the paper's own note on broader impact asks for responsible use when this is applied to private spaces.
Chapter 11
Keep the numbers, the terms and the core code on one page, and find where to read next
SceneAligner places a collection of photos on a floorplan in four moves. It lifts the photos into a level 3D scene with a 3D foundation model and gravity. It flattens the scene into a density map. It matches that map to the floorplan with a DINOv3 encoder adapted by LoRA and trained with four losses. It fits one similarity transform with RANSAC and moves every camera with it. The win comes from the order: build a map first, then compare map to map.
| Measurement | Value | Source |
|---|---|---|
| Combined recall (30°, 20%) on clean C3: LoFTR, DUSt3R, C3Po, DINOv3, SceneAligner | 3.07, 4.64, 32.96, 18.28, 73.58 | Table 1 |
| PCK@5% and RMSE: C3Po against SceneAligner | 34.91 and 0.1780 against 69.87 and 0.0776 | Table 2 |
| Structured3D combined (30°, 1 m): LASER, F3Loc, UnLoc, SceneAligner | 8.7, 21.3, 37.6, 51.6 | Table 3 |
| Combined recall, interior against exterior | 84.89 against 69.36 | Table F.2 |
| Amortized time per image: C3Po, SceneAligner (up to 10 photos) | 195.4 ms, 143.7 ms | Table F.4 |
| Loss weights (feat, regr, topo, geo); temperature | 1, 50, 10, 10; 0.07 | Section C.3 |
| LoRA rank and alpha; learning rate; batch size | 16 and 16; 10−4; 4 | Sections C.1, C.3 |
| Density map defaults: confidence, trim, height slice, gamma | 45%, 2.5%, 20% to 95%, 0.5 | Section C.4 |
| Training data and budget | about 280K maps; 1 epoch; about 2 days on one RTX A6000 | Section C.3 |
| Clean C3 subset | 574 of 597 scenes (96.15%) | Section 4.2 |
| Term | Plain meaning | Chapter |
|---|---|---|
| Floorplan localization | Find where a photo was taken on a floorplan | 0 |
| Rasterized floorplan | A floorplan stored as an image, not as exact lines | 0 |
| Similarity transform, Sim(2) | Slide, turn and resize evenly: four numbers | 1 |
| RANSAC | Vote over random pairs of matches; keep the transform most matches support | 1, 8 |
| Medoid | The member closest to all others; resists wild values | 2 |
| Density map | A top-down count of filtered 3D points, like a line drawing of the walls | 3 |
| Appearance gap | The difference between a density map and a drawn floorplan | 4 |
| LoRA | Two thin trainable matrices added next to a frozen weight matrix | 4 |
| InfoNCE | A loss that makes each true partner win a softmax over all candidates | 5 |
| Soft-argmax | A probability-weighted average of positions | 6 |
| Huber loss | Squared for small errors, linear for large ones | 6, 7 |
| Mutual nearest neighbor | Keep a match only if both sides choose each other | 8 |
| Recall, PCK | The share of cameras or matches that pass a threshold | 9 |
# training: one step on a (density map, floorplan, Q ground-truth pairs) sample
FD, FF = E(density_map), E(floorplan) # shared frozen DINOv3 + LoRA, (32, 32, 768) each
fD = normalize(bilinear(FD, pairs.D)) # (Q, 768), unit length
fF = normalize(bilinear(FF, pairs.F))
L_feat = info_nce(fD, fF, tau=0.07) # Chapter 5
p_hat, w = soft_argmax(fD, FF.flatten(), centers) # Chapter 6
L_regr = huber_weighted(p_hat, pairs.F, w)
L_topo, L_geo = topo_geo(p_hat, pairs.D, w, tri, pr) # Chapter 7
loss = 1 * L_feat + 50 * L_regr + 10 * L_topo + 10 * L_geo # staged: feat, then regr at 10%, then all at 20%
loss.backward(); clip_grad_norm_(lora_params, 1.0); adamw.step() # only LoRA trains
# inference: see Chapter 8
cams, pts = localize(images, floorplan, model3d, geocalib, E)
Locating a camera on a map has an old lineage. Early robots kept many guesses of their pose and scored each one, which is the same shape as the grid search of Chapter 0. Our particle filter lesson shows that idea at its best. Place recognition asks the neighboring question, which known place a photo shows. Bag-of-words place recognition and NetVLAD cover it. SceneAligner takes a different route: it first builds geometry, then aligns it.
The geometry step stands on 3D foundation models. VGGT is one of the two the paper tests. The background for such reconstruction is in multi-view geometry, and modern SLAM shows how learned geometry meets classic mapping.
Junhyeong Cho, Ruojin Cai and Hadar Averbuch-Elor (Cornell University and the Kempner Institute at Harvard University). SceneAligner: 3D-Grounded Floorplan Localization in the Wild. arXiv:2605.22581, May 2026. Read the paper. The authors' project page is at Cornell-VAILab.github.io/SceneAligner; the paper says code and data will be public.