← Playground

Adaptive ocean sampling

A robot in a fjord cannot measure everywhere. It has a few hours of battery and a question — where does the river plume end and the seawater begin — so every leg it swims is a decision about what is worth knowing next.

Truth — the field the robot cannot see. The line is the real boundary.
Belief — the posterior mean, its boundary solid, the truth dashed, and the track so far.
Expected cost of not knowing — dark is where the robot most wants to go.
Samples
0
Misclassified
Integrated Bernoulli variance

Runs every strategy over the same 12 oceans with 25 samples each, and averages. Takes a few seconds.

Try this first

Leave everything alone and press Run. Watch the misclassified figure fall, and watch where the robot chooses to go — it works the boundary rather than the map. Then set the strategy to Lawnmower, press Reset, and run it again over the same ocean. The lawnmower covers the area evenly and beautifully, and spends much of its battery confirming water that was never in doubt.

On any single ocean, though, the lawnmower will sometimes win. The fields are random and the strategies are close enough that one run settles nothing, which is why Compare all three is there: it runs the same experiment over a dozen oceans and averages, and you should trust that number and not the one race you happened to watch.

Averaged over thirty oceans at a twenty-sample budget, the adaptive run misclassifies about 14% of the map against the lawnmower's 20% — roughly a third less error for the same battery. Give every strategy sixty samples instead and the gap narrows to 8% against 10%, because by then there is enough budget to cover the map by brute force and the cleverness stops paying for itself. That is the honest shape of the result: adaptive sampling is worth most exactly when you cannot afford to look everywhere.

Why not just sample where you're least certain?

That is the Myopic option, and it is the intuition almost everyone starts with. It is a good strategy for a different question. Variance is highest wherever you have not been, so a variance-chasing robot spreads out to the corners, and it will happily spend a leg resolving a patch of open water that is obviously, unambiguously seawater.

The question here is not "what is the salinity everywhere" but "which side of the threshold is each point on". A cell whose mean sits far above the threshold contributes almost nothing to that uncertainty even if its variance is large — you already know the answer. A cell sitting right on the threshold is a coin flip no matter how confident the estimate is.

Bernoulli variance p(1 − p) captures exactly this, where p is the probability of being above the threshold. Integrate it over the map and you get a single number for how much you do not know about the boundary. That is the quantity in the third readout, and it is what the mission is actually trying to reduce.

What the robot computes

The field is a Gaussian random field: every cell is a normal random variable, and pairs of cells covary as Σᵢⱼ = σ²(1 + ηd)e−ηd, falling off with the distance between them. That covariance is what makes one measurement inform a whole neighbourhood, and the correlation-range slider sets how large a neighbourhood that is. Drag it up and each sample teaches the robot more, so fewer are needed.

Taking a measurement is a standard Gaussian update of the mean and covariance. The interesting part is choosing where: before it commits to a leg, the robot evaluates each candidate by asking what the integrated Bernoulli variance would be afterwards — the expected integrated Bernoulli variance, EIBV — and goes to the lowest. It never sees the measurement it is reasoning about, only how much that measurement would be expected to settle.

Each of those evaluations is a sum over the whole map of a bivariate normal CDF. The original implementation shipped a precomputed table for it; here it is evaluated directly by quadrature, which is why this page needs no model file and no server.

This ran on a real robot

The planner behind this went to sea. The field trial below is an AUV running it onboard in Trondheim fjord, choosing its own waypoints against a live estimate of the plume rather than following a route decided on shore.

The method is in 3-D Adaptive AUV Sampling for Classification of Water Masses (IEEE JOE, 2023) and Long-Horizon Informative Path Planning (IFAC CAMS, 2022). The original Python lives in github.com/YaolinGe/phd, alongside the defence presentation.