GeoNeural
Can a small neural network store terrain in fewer bytes than the best standard codecs, and still tell water where to flow?
Methods
Overview
Can a small neural network store terrain in fewer bytes than the best standard codecs?
And does the smaller file still send water the same way?
Loading the terrain map (about 0.5 MB)…
A digital elevation model is a map of heights: one number for every point on a grid. Built from airborne laser scans and satellite data, these maps show where rivers run, where floods spread and how landscapes change. They are also very large: the 1 m terrain model of North Rhine-Westphalia alone holds about 34 billion heights.
GeoNeural asks whether a small neural network can store such maps in fewer bytes, with every height still within a fixed error, say 25 cm. It competes against standard codecs, the programs that pack scientific data into files and unpack them again. The map above shows one of the thirteen regions, Essen-Ruhr: southern Essen and the Ruhr valley.
The neural predictor made smaller files on seven new regions
On seven regions the coder had never seen, it was 17 to 26% smaller on average for errors from 5 to 50 cm, and 14 to 27% per region. At 1 m the gain shrinks to 6%, and not every region is smaller.
7 new regions
6 development regions
- each region
- fixed predictor, average
- neural predictor, average
Is a smaller file automatically a better file?
The smaller files kept fewer streams in some regions
No. Trace where water would flow on the decoded map: in some regions the neural file kept fewer of the original streams than the best standard codec, and at 50 cm and 1 m in all seven. By the rule written down before the test, the answer to the main question is no. The Drainage part explains why.
Six questions, and where they stand
Four questions are about storing terrain, two about the physics that shapes it. Each had a yes-or-no rule set in advance, and a no counts as an answer. A side study asks whether a network can sharpen coarse maps.
- Q1Can a neural predictor make terrain files smaller and keep the streams?smaller: up to 50 cmstreams: no
- Q2Does a geological map help?a little, does not payfirst test
- Q3Does spending precision near streams keep them?nodevelopment regions
- Q4Does training on simulated landscapes help?in progress
- Q5Can a neural network replace part of a landscape simulation and stay accurate?yessimulation
- Q6Can a landscape's shape tell how fast it formed, and for how long?only with two surveysin progress
To be continued
This project is actively worked on. The compression test is complete. Next: a coder that also keeps the streams, then the full geology, physics and reconstruction studies.
References
- Liang et al. (2023): SZ3: a modular framework for composing prediction-based error-bounded lossy compressors
- Lindstrom (2014): Fixed-rate compressed floating-point arrays (zfp)
- Li, Lindstrom & Clyne (2023): Lossy scientific data compression with SPERR · IPDPS 2023
- Duda (2013): Asymmetric numeral systems: entropy coding combining speed of Huffman coding with compression rate of arithmetic coding
- Ballé, Laparra & Simoncelli (2017): End-to-end optimized image compression
- Dupont et al. (2022): COIN++: neural compression across modalities
Novelty scope: The codecs, the entropy coder, flow routing and the landscape model are established tools. What is new is the test: every byte a decoder needs is counted, the bar is the best of five standard codecs, keeping the streams counts as much as saving bytes, and the rules were written down before the new regions were picked.
Part 01 of 06Compression
How can a file get smaller, if every height must stay within a fixed error?
1Keep a coarse grid
A few heights are stored as they are.
2Predict the points in between
Each new height is guessed from its neighbors. This is where the neural predictor works.
3Store only the prediction error
Only how far each guess is off goes into the file. Then halve the spacing and repeat.
The coder works like SZ3, a standard tool for scientific data, in the three steps above. Unlike photo compression, it promises a largest error for every single height. The better the guess, the smaller the file.
The neural predictor is a network of just 3.7 kB. It sharpens each guess and says how sure it is, which lets the coder pack the prediction errors tighter. It travels inside every file, so no byte is left uncounted.
Every region got smaller
At a largest error of 25 cm, the neural predictor beat SZ3 and SPERR, the two strongest standard codecs, in every region: the six development regions, each coded by a model that never saw it, and the seven new ones.
- SPERR
- SZ3, best setting
- Fixed predictor
- Neural predictor, model inside
Is the saving really the neural network, or the coder around it?
About half the gain is the coder, half the network
Both. With the fixed predictor, a fixed formula in place of the network, the same coder is already 7 to 13% smaller than the best standard codec. The network takes off another 11 to 15%.
Why not train a network for each map, so that it fits perfectly?
A network for every map does not pay off
That is how a neural field works: one network learns one map by heart. With every byte counted, it costs far more than it saves: on one region at 50 cm, it took 29 kB to store and saved 4.4 kB. One small network, trained once and shared, is the version that pays.
Almost every byte is a coded prediction error
A file is mostly coded prediction errors. The network is about 2% of a 25 cm file. At coarse errors of 1 m and more, the files get so small that the network becomes a large share, and the gain fades.
Compared against the best of five standard codecs
The first version of this project measured neural models against q32, a simple baseline, and did not count every byte. SZ3 needs only a quarter to two thirds of q32's bytes for the same largest error, so those early comparisons were too easy. This version takes the smallest file of five standard codecs, with SZ3 also tuned over 14 settings.
- zfp
- LERC
- q32 (first comparison)
- SPERR
- SZ3
What does the smaller file cost?
Smaller files take longer to open
The neural decoder runs its small network once for every height. In a browser it opens a 10 by 10 km region in about 0.7 s, where SZ3 needs about 0.01 s. The bytes are paid for with time.
Try it in your browser
Compare the three files on two regions: their size, where their errors fall, and which streams they keep. The neural file is decoded right here by a Rust decoder compiled to WebAssembly, and checked bit for bit.
Loading the compression microscope (about 1.5 MB)…
Part 02 of 06Drainage
At the same error, does the smaller file keep the streams?
Water flows downhill, so a terrain map decides where streams form, which land drains into which river, and where a flood would spread. Flood maps, erosion and soil models, and hydrological forecasts all start from these flow paths. On flat ground, a few centimeters can send water the other way.
To test this, the same routing runs on the original map and on every decoded one: small pits are filled, water flows to whichever of the eight neighbors is steepest downhill, and a stream starts where water from at least 5 hectares collects. Then the two stream maps are compared, allowing a shift of one cell: missing streams and new, false ones both lower the share of streams found again.
The streams check failed at every error
At the same largest error, the best standard codec kept a few more streams, in some regions at every error and in all seven at 50 cm and 1 m. The rule allowed the neural file to find at most 1 percentage point fewer streams; in the worst region it found 2 to 8 points fewer, depending on the error. So the answer is no.
Streams found again, 7 new regions
- SPERR
- Fixed predictor
- Best standard codec
- Neural predictor
Neural minus best standard codec, per region
- rough regions
- moderate regions
- flat regions
Why would a smaller file lose streams, if every height stays within the limit?
The largest error is not the typical error
The limit only caps the largest error; most heights are much closer. At coarse errors this coder spreads its errors more evenly over the allowed room, so its typical error (the root-mean-square error) is larger: at 50 cm it is 20 to 32% higher than the best standard codec's.
Streams follow the typical error, not the largest one. The first version of the project already found that at a fixed largest error, the codec with the lowest typical error keeps the most streams. The same coder with the fixed predictor keeps about as many streams as with the network, so the cause is the coder, not the network.
Could the coder spend more precision where water runs?
Extra precision near streams did not help
The decoder can find likely streams on the coarse levels it already has, so no extra map is needed. On the development regions, no rule (tighter near streams or on gentle slopes) raised the share of streams found again by the required 5 points at the same file size. The answer is no.
- Fixed predictor, one region and error
- Neural predictor, one region and error
- average
To be continued
This part is actively worked on. Next: a coder that keeps the typical error low at the same limit, tested on the development regions and then on a fresh set of new regions, since the seven are used up.
References
Part 03 of 06Geology
Rock shapes the land. Does a geological map help store the terrain?
- map shifted (control)
- blank map (control)
- real map, plus storing it
- real map
Hard rock tends to form steep ridges, soft rock wide valleys. So the geological map of North Rhine-Westphalia (scale 1:100,000) went into the network as an extra input, one rock unit per 40 m cell. As controls, the network also got a blank map and the real map shifted by 2.56 km. If these help as much, the gain is not geology.
In a first test on two regions, the real map saved up to 1.5% of the coded terrain, more than either control, though in one of eight runs it saved nothing. That hints at real information, but storing the map (1.8 to 3.9 kB) costs more than it saves.
Can simulated landscapes teach the network what terrain looks like?
Training on simulated landscapes has started
A second idea: train the network first on landscapes made by the physics simulation, and compare it with look-alike terrain made without physics. The 48 simulated and 48 look-alike maps are ready, and training has started.
To be continued
This part is actively worked on. The full geology study (six regions, four controls) and the test of training on simulated landscapes are running and have no result yet. Next: finish both.
Part 04 of 06Physics
Can a neural network take over part of a landscape simulation and stay accurate for thousands of years?
Can a landscape's shape alone tell how fast it formed, and for how long?
- selected
- passes the physics checks
- breaks a physics rule, excluded
Landscapes form slowly: tectonics lifts the land, rivers cut into it, and soil creeps down the slopes. Simulations step this forward in time. A plain creep law misses how creep speeds up on steep slopes; a network could learn that from data. Here a small network replaces the soil-creep step, learned first from a known simulation, and has to stay accurate over 64 steps of 200 years on surfaces it has never seen.
What keeps a learned step from drifting over thousands of years?
Built-in physics keeps the network on track
Six network designs were trained the same way. The best one cannot break two basic rules: flat ground stays flat, and no soil appears or vanishes. Averaged over the run, its height error is 1.34 m, close to the 1.11 m that even a perfect copy of the simulation's 200-year step would have. A plain straight-line creep law is off by 3.91 m. Without its floor, a lower limit on the creep rate, the network's error grows to 3.45 m. Three of the six designs break one of the two rules and were left out.
If every process ran twice as fast for half the time, would the landscape look different?
Checked whether one survey can tell rate from age
No, not in this model. Speed up every process and shorten the time to match, and the final landscape is exactly the same. Inferring causes from a result is an inverse problem, and here one survey can never settle it. In simulations, two surveys a fixed number of years apart can, as long as the landscape is still changing (not yet in steady state).
Young, 0.5 million years
Older, 2 million years
Near steady state, 5 million years
- one survey today
- two surveys, gap grows with age
- two surveys 20,000 years apart
- two surveys 50,000 years apart
A fixed time-step cap made up information
A shortcut, a fixed cap on the simulation's time step, made fast and slow landscapes look different, as if the surface held real information about its age. It is an artifact of the numerics, and it disappears when the steps are scaled correctly.
- one survey today
- two surveys, gap grows with age
How sure can a speed estimate be?
Honest error bars need the right noise model
Survey errors are correlated in space: neighboring points tend to be off in the same direction. In a first test, error bars from a model that knows this caught the true speed in 95 to 97% of cases, as 95% error bars should. Treating every point as independent caught it in only 37 to 50%.
- noise treated as independent
- noise treated as correlated
Run the simulation yourself
The simulation core, written in Rust and compiled to WebAssembly, runs here in your browser. Compare the selected network with the simulation, and with an early design that lets flat ground drift.
Loading the lab…
To be continued
This part is actively worked on. Next: repeat the error-bar test on about 100 simulated landscapes, compare it with networks that read the speed straight from the map, test what happens when the simulation does not match reality.
References
Part 05 of 06Reconstruction
Can a network turn a coarse 40 m map into a sharp 10 m map, better than standard methods?
Many elevation models, especially those from satellites, are coarse. Here a U‑Net, a common image network, learned to turn 40 m averages into 10 m heights. It was trained on four regions and tested on two others, and every result is corrected so that it averages back to the coarse input.
In a first test its mean error was 16 to 19% lower than that of the best method without a network. Given single points instead of averages, it did worse than plain (bicubic) interpolation: much of what it learned was how the coarse map had been made.
To be continued
This part is actively worked on. Next: the full study with gaps, sparse points and 1 m data, run once on the seven new regions.
Part 06 of 06How it was tested
How do you make sure a result is not tuned to its own test?
- new region, flat (height spread under 8 m)
- moderate
- rough (over 30 m)
- development region, 15 km gap kept
- skipped, enough of this relief type
- ×skipped, missing data (state border)
- grid every 50 km
By writing the rules down first. Before the final test, a protocol fixed the codecs, the error limits, the measures and the pass marks. Then a fixed rule picked seven new regions across the state, from flat to rough terrain, and the models were frozen. The final test ran once, and its result is reported as it came out.
Each result is an average over regions, with a range that shows how much it varies from region to region. One codec setting, the tuned SZ3, was added after the rules were set; it can only make the neural result harder to reach.
The rule, condition by condition
File size passed at every error from 5 to 50 cm and failed at 1 m. The streams condition failed at every error. One failed condition is enough for a no.
Limits
Thirteen regions from one German state, all at 10 m; some new regions are neighbors, so they are not fully independent. The stream test compares maps; it does not simulate water. The physics runs on simulated landscapes, and at its default step the simulation's own error is larger than the rules allow for estimating rates. Timings come from a shared workstation.
Data
Terrain from the DGM1 of Geobasis NRW (DL-DE-Zero-2.0). Geology from the GK100 of the Geological Survey of North Rhine-Westphalia (DL-DE-BY-2.0).