ObjectGoal Navigation · Imitation Learning

Costmap-Conditioned PIRLNav

Khushi Jaiswal1  ·  Sourav Garg2 (advisor)

1COEP Technological University    2Robotics Research Center, IIIT-Hyderabad

Summer internship at the Robotics Research Center, IIIT-Hyderabad

Does conditioning ObjectNav behavior cloning on a ground-truth geodesic costmap instead of RGB change what a policy can learn across human and shortest-path demonstrations? Basically trying to see how policy acts differently when we exchange RGB input in PIRLNav pipeline with WayPixel costmap inspired by MASt3R-Nav and eventually training a WayPixel costmap conditioned RL policy.

Costmap-conditioned agent navigating an unseen HM3D home
This is the rendered view of the agent navigating through the house from HM3D (Habitat-Matterport 3D). The left clip is the RGB image, basically what the agent can actually see and the right one is the costmap version of the same view (dark = toward the goal).

Abstract

How well an agent navigates depends heavily on the representation it acts on. PIRLNav learns ObjectNav end-to-end by behavioral cloning of RGB demonstrations of hm3d datset then finetuning with RL. MASt3R-Nav showed how "Waypixel Costmap" a dense pixel-level costmap based on relative geometry enables a highly capable navigation system by training a controller conditioned on it to predict a trajectory rollout. So we asked a simple question - If a costmap is that good to act on, what happens when PIRLNav is conditioned on one instead of RGB?

To test the input on its own, we built a costmap-conditioned PIRLNav that sees a ground-truth (oracle) geodesic costmap, and put it against an RGB baseline at a matched budget. We ran the comparison under two teachers. On human demonstrations, both inputs fail the same way on val data, the limit is the teacher(human demostrations are more exploratory so need longer training) and the budget(our 0.8 epoch vs papers 33 epochs). On shortest-path demonstrations, which are the very signal a costmap encodes, turns out the costmap beats RGB on every metric.

Absolute performance stays well below PIRLNav’s, since everything here ran on one GPU for under an epoch. But the matched-budget comparison is clean, and it points to one idea: the representation you condition on doesn’t just change how well a policy does, it changes which teachers it can learn from at all.

The rest of this page is how we got there: first the costmap sensor itself, then the two experiments which gave two very different answers.


Method

The basic idea is that instead of an RGB image, we hand the policy a picture of how far every visible point is from the goal, i.e. our costmap. Building it takes two steps. First, offline, we compute the true geodesic distance from every navigable spot in the house to the nearest goal. Second, we use the agent’s depth camera: for each pixel it already knows the distance from the camera to whatever that pixel is looking at (a wall, the floor, a chair leg), so we project every pixel back out into the world and get the exact 3D point in the house that pixel is seeing. We do this for all the pixels, turning the flat depth image into a cloud of 3D points. We then give each of those 3D points its pre-computed geodesic distance, and that becomes the pixel’s value. That is our egocentric costmap, and it is what our policy sees in place of RGB.

Costmap-conditioned PIRLNav — method overview
The full pipeline. The top row shows how we build the 2-channel costmap: calculate the geodesic distance to the goal, get the 3D coordinates of all pixels, and assign that GT distance to every pixel the agent’s depth camera is looking at. The bottom row shows the difference in training input. Our pipeline reads the costmap, the baseline reads the plain camera image. Everything after that is shared (a CNN encoder and a GRU), and out comes a single action. Diagram generated with Claude (Anthropic).
Top-down geodesic cost-to-goal field
What the costmap measures. Every point is coloured by its geodesic distance to the goal. Dark means low cost and near the goal, bright means high cost and far. We can see here the room on the left is only a few metres away in a straight line, but it still counts as far, because with the walls the only way there is back out through the doorways. Following the gradient downhill traces the shortest path (red). This is how we navigate through costmaps. (Schematic on a made-up floorplan; the real sensor computes the same thing on the HM3D navmesh.)

Why two channels. The costmap stores a geodesic distance at every pixel. Across a whole house those distances run from 0 m at the goal to roughly 30 m in the farthest corner. Our first version just divided every pixel by that global maximum to get a number in [0, 1], and handed this single channel to the policy. The limitation is that in any one first-person frame the agent sees only a small slice of the house, so the points in view might all be, say, 5.5 to 7 m from the goal. Divided by 30, that entire range collapses into about 0.18–0.23 which is a spread of roughly 4% of the input. To a convolutional encoder, the frame is nearly one flat colour (no gradients) which failed training encoder from scratch.

The fix is to hand the policy the same field twice, scaled two different ways which serves different purpose. Channel 0 keeps the global normalisation (distance ÷ max). It is the absolute frame (flat one). During navigation, a frame sitting near 0 says the goal is close with help of channel 0 map, which is the cue the agent needs to decide when to stop. Channel 1 is relative frame. Here, we take the smallest and largest distance visible in that single frame and rescale them to fill the whole [0, 1] range. That throws away absolute scale, but it blows the within-frame gradient up to full contrast, so descent becomes obvious. One channel says how far, the other says which way, and the policy needs both.

One real rollout frame under each costmap channel
The two channels on one real frame. On the left, the agent is looking down a hallway toward the goal. Channel 0 (raw distance ÷ 30) squashes the gradient into about 4% of the range, so it is nearly one flat colour the encoder can't see but the difference in brightness across frames helps to see how far we are from the goal. Channel 1 stretches that same frame to full contrast, hence now we can see the open doorway towards the goal in dark. Between them the policy gets both how far and which way, the same signal a shortest-path teacher already follows. (White = pixels past the 5 m depth range, where we can’t compute a cost.)

The costmap in action

Four rollouts in houses on val set. In each one, the left is the agent’s first-person view and the right is the live costmap over that same view. Dark points the way to the goal, and the agent just keeps walking downhill on it until it arrives.

find the bed
find the bed
find the tv
find the tv
find the sofa
find the sofa
find the chair
find the chair

That is what descending the costmap looks like when it is done perfectly, and it is the behaviour we want a policy to copy. So the whole project really comes down to one question: can a policy actually learn to do this? We tried it with two different teachers, both trained by behavior cloning.


Phase 1 · Human demonstrations

Reproducing PIRLNav and hitting a ceiling

We trained both arms by behavior cloning on human demos, at a matched 8M-frame budget. To hit the paper’s effective batch size of 16,320 on a single 16 GB GPU, we leaned on gradient accumulation. Both arms fit the training data well, and almost identically (about 74% action accuracy). Then we ran them on the full 1000-episode HM3D-v2 val split, and both scored 0.0% success:

InputTrain acc.SuccessSPLsoftSPL
Human demonstrations · behavior cloning
RGB0.7440.0%0.0%0.129
Costmap (2-ch)0.7440.0%0.0%0.108
PIRLNav (published, 77k human demos) — Success 64.1%, SPL 27.1%. (Train acc. and softSPL not reported by the paper, shown as “—”.)

So the oracle costmap did not help here. Both inputs failed the exact same way on scenes they had not seen. Human demonstrations wander, so the policy was held back by the training budget and the teacher, not by what the policy sees. Behavior cloning punishes doing anything the teacher did not do, and at only ~0.8 of an epoch (compared to PIRLNav's 33) neither arm has really learned to generalize.

But The not so favorable numbers lead us to our second experiment. Here we ask question What if the teacher, not the input, was the thing holding both arms back?


Phase 2 · Shortest-path demonstrations

A sharper test and the costmap wins

Shortest-path (SP) demos take the straight route to the goal, using privileged geodesic information a normal agent never gets to see. PIRLNav found they make a terrible teacher for RGB (6.4% vs 64.1%), and the reason is simple: the policy can’t see the privileged signal the teacher is following. But our costmap is that signal. So we expected this: SP demos should stay bad for RGB, yet become learnable once the policy can actually see the cost-to-goal. We retrained both arms on SP demos at the same 8M-frame budget and evaluated on the same held-out split.

Costmap+SP vs RGB+SP on Success, SPL and softSPL
Costmap+SP comes out ahead on all three metrics: 1.5× the success, 1.8× the SPL, 1.35× the softSPL. And its last checkpoint is its best one (25k > 20k > 15k updates), so it never overfit and started to collapse. So, with longer training ,it would keep climbing.

Results

The takeaway. Changing the input doesn’t raise the ceiling, but it gave us the idea that changing the teacher makes a difference in how the policy learns. With shortest-path demos the costmap beats RGB on every metric (3.2% vs 2.1% success, 2.0% vs 1.1% SPL, 0.225 vs 0.166 softSPL). With human demos both sit at 0%, which is a budget and perception limit the costmap can’t fix on its own.

Full 1000-episode HM3D-v2 val, deterministic actions, matched 8M-frame budget (~0.8 epoch). Best checkpoint per arm.

Success rate across all arms, both phases
Held-out val success across every arm. Human demos pin both inputs at zero. Under shortest-path demos, the costmap pulls clear of RGB.
InputSuccessSPLsoftSPL
Phase 1 · Human demonstrations
RGB0.0%0.0%0.129
Costmap (2-ch)0.0%0.0%0.108
Phase 2 · Shortest-path demonstrations
RGB (lr 1e-3)1.8%0.86%0.176
RGB (matched 5e-4)2.1%1.10%0.166
Costmap (2-ch) · ours3.2%2.01%0.225
Reference — PIRLNav paper: human demos 64.1% / 27.1%; shortest-path demos 6.4% / 5.0%.

Phase 1 is the ceiling: both inputs hit 0% on human demos. Phase 2 gives the costmap a cleaner teacher, and it wins on every metric.


Why absolute performance is capped

The costmap-vs-RGB comparison is clear, but the numbers are significantly lower than paper's reported numbers. These are the three reasons and none of them is something the costmap can fix by itself.

1 · Undertraining

We trained for about 0.8 of an epoch. The paper did roughly 33 (~500M steps across 64 GPUs vs our 8M steps on single GPU). Our learning rate decays to near zero by 8M steps, so learning basically stops before the policy has seen the data before one complete epoch.

2 · The teacher

Human demos wander, so even perfect imitation only reaches about SPL 0.47. Behavior cloning also punishes beating the teacher, hence even privileged input couldn't work. While in SP demos costmap input shows edge.

3 · Representation

The camera is limited: narrow field of view, 5 m depth, low resolution. Our costmap is built from that same depth camera, so it inherits those limits. It simply can’t show a goal that is beyond the horizon.

Training budgetPIRLNav (BC)This work
Steps / frames~500M8M
GPUs641
Demos77k human~64k SP / human
Epochs over demos~33~0.8

Same learning rate (1e-3, linearly decayed), same budget for both arms. So whatever the ceiling is, the costmap-vs-RGB comparison is still valid.


Future work

The obvious next step is to train at a longer budget, as PIRLNav did, to measure how much of the gap is just undertraining. Another is to lift the ceiling (a wider field of view, deeper depth, a higher-resolution costmap, maybe a proper spatial map) and run the same comparison again. Also, our costmap encoder trains from scratch, while the RGB baseline gets a pretrained encoder. That asymmetry works against the costmap, so if anything its win here is understated.


References

@inproceedings{ramrakhya2023pirlnav,
  title     = {PIRLNav: Pretraining with Imitation and RL Finetuning for ObjectNav},
  author    = {Ramrakhya, Ram and Batra, Dhruv and Wijmans, Erik and Das, Abhishek},
  booktitle = {CVPR},
  year      = {2023}
}

@misc{mast3rnav,
  title  = {MASt3R-Nav: WayPixel Costmaps for Navigation},
  note   = {https://mast3r-nav.github.io/}
}

All code, scripts, eval logs and per-checkpoint results are in the repository (exp2_sp_costmap/); every metric is logged to Weights & Biases.