Verification Is Not Validation: Checking Flood Models
A flood simulator that solves the shallow-water equations on a terrain grid can take a long time for one storm over a large area. A machine-learning model trained on that simulator's runs can answer in a fraction of the time, which is the reason to build one. Fast models like this come with a reporting habit I have learned to distrust, including in my own work: a test score against the simulator presented as if it said how well the model predicts real floods.
Those are two different checks. Engineering has names for them. Verification asks whether a model reproduces the reference it was built to reproduce. Validation asks whether it matches what happened in the world. This post shows why the difference matters for a fast flood model, what evidence each check needs, how a model can pass one and fail the other, and how to word results so that neither is passed off as the other. The numbers come from a small synthetic lab you can download and run; nothing here is taken from a real flood model.
In short
- A fast model trained on simulator runs and tested on held-out simulator runs has been verified, not validated. The score says nothing about the simulator's own errors.
- In the lab, a model scores 0.988 against its simulator and 0.932 against reality, and the gap grows with physics the simulator leaves out while the verification score does not move.
- An uncertainty band sized on simulator runs covers the simulator, not the real flood: on average over ten lab seeds, 91% of cells against the simulator and 15% against reality.
- Validation evidence is incomplete by nature, and a terrain baseline belongs beside every score.
Two questions
The distinction comes from computational engineering, where it is set out in detail by Oberkampf and Roy (2010). Their short form is that verification asks whether the equations are solved right, and validation asks whether they are the right equations. A fast model adds a layer, because it learns from a simulator rather than from the world. In this series, verifying a fast model means checking it against its simulator; checking the simulator's own code against known solutions, which Oberkampf and Roy call code verification, is a separate step:
A fast model's error against what really happened splits into two parts:
observed − fast = (observed − simulated) + (simulated − fast)
The second term is the emulation error, and held-out simulator runs measure it well. The first is everything the simulator gets wrong: rainfall that differs from the storm that fell, ground data that misses a wall or a culvert, drains it does not model, roughness it guesses. A verification score sees only the second term. It can be excellent while the first is large.
A lab where the simulator is wrong
The lab makes the first term visible on purpose. A valley cross-section stands in for terrain, with a raised bank and a low hollow behind it. Water fills the valley from the channel and reaches only ground connected to it. Reality loses a quarter of the rain to drains; the simulator does not model drains and keeps all of it. The fast model learns the simulator's water level from five runs and predicts storms between them:
The score used throughout is the critical success index, the share of cells correctly marked wet among all cells marked wet by either side (Schaefer 1990):
CSI = hits / (hits + misses + false alarms)
On this index the fast model looks excellent against its simulator and noticeably weaker against reality:
The fast model even scores slightly above its own simulator against reality, 0.932 against 0.923, and it does so in all ten seeds I ran. That is not skill. The fast model interpolates the water level in straight lines between its training runs, and because a valley widens as it fills, the true level rises along a curve that the straight lines undercut: in 76 of 80 test cases the fast model's level sits below the simulator's. Reality also sits below the simulator, because of the drains, so the bias happens to point the right way. A different flaw in the simulator could point the other way. Matching the simulator more closely is not the same as matching the world more closely. The depth error says the same more plainly: 4 cm against the simulator, 16 cm against reality. The simulator itself is 20 cm from reality, five times the emulation error, and no test against the simulator can see that part:
Now make the missing physics larger. As the share of rain that real drains remove grows from none to 40%, the verification score stays where it was, and only validation notices:
Uncertainty has the same problem
A fast model should state its own error, usually as a band around each depth. The usual way to size the band is to measure how far the model's predictions fall from the reference on runs it has not seen, then widen the band until a chosen share falls inside. The share inside is the band's measured coverage. Counted per cell:
coverage = (1/N) Σi 1[ |yi − ŷi| ≤ w ]
where yi is the reference depth, ŷi the model's, and w the band's half-width. Sized on simulator runs, the band covers the simulator. Nothing in the procedure involves the real flood:
Over ten seeds the band came out 11 to 24 cm wide and covered between 74% and 99% of simulated cells, because a band is set on calibration storms before it meets the test storms. Against reality it covered between 2% and 22%. Two further points follow. Coverage per cell and coverage per run answer different questions. Someone pricing many properties wants to know what share of locations fall inside the band; an engineer judging one site wants to know whether the whole map is right, a much stricter test. And a band can be honest about the simulator while saying nothing about the world: on average 15% of real depths fall inside a band that covers 91% of simulated ones. Statements such as "certified error bounds" or "within three sigma" hide both points. The defensible form is the coverage, its level, against what reference, per cell or per run, and on which held-out runs.
Plotted against the band's width, the gap is plain. A band that covers 90% of simulated depths covers far fewer real ones, and reaching 90% against reality takes a band more than twice as wide:
This curve comes from one seed; its 20 cm for 90% against the simulator sits inside the 11 to 24 cm range above. A band is always set before the data it is judged on, and it holds only as well as the two resemble each other.
What validation evidence looks like
Validation needs observations, and every kind is partial:
| Evidence | What it checks | Kind | What it misses |
|---|---|---|---|
| Held-out simulator runs | The fast model against its simulator | Verification | Everything the simulator gets wrong |
| Benchmark tests of the simulator | The code against known solutions | Verification | Whether its inputs and physics fit a real place |
| Recorded flood outlines | The extent of a past flood | Validation | Depth, timing, and areas nobody recorded |
| Satellite radar extent | Open water at one moment | Validation | Water under trees and between buildings, and the peak if no pass caught it |
| River and level gauges | Water level over time at a point | Validation | Everything away from the gauge; needs the same height reference |
| Another model's flood map | Agreement in pattern | Neither | Its own errors: it is a model, not an observation |
Partial evidence lowers the score even of a model that is exactly right. In the lab, a recorded outline that caught 70% of the flooded cells takes a perfect model from 1.0 to about 0.7:
So a validation score needs its context: which record, what it is known to miss, and, most of all, a baseline.
Always report a baseline
Terrain alone predicts a lot about where water goes. A model that cannot beat a rule built from the ground surface has not shown that it learned anything the terrain did not already say. Two baselines are cheap to compute and often hard to beat in flat, simple terrain:
| Baseline | Rule | Source |
|---|---|---|
| Elevation threshold | Mark the lowest cells wet, as many as the model marks wet | None needed |
| Height above nearest drainage | Mark a cell wet when its height above the nearest stream is below a threshold | Nobre et al. 2011 |
Both need the same care as the model: match the wet area or the threshold the same way for every method, and say whether the threshold was fitted to the record being scored or set in advance. In the lab the elevation baseline scores 0.783 against reality, well below the fast model, because it wets the hollow behind the bank that no water reaches. In real terrain the gap can be much smaller, and in some places the baseline wins. That is worth knowing before anyone else finds it.
Words that keep the two apart
Most mix-ups happen in wording, not in analysis. The phrases on the left are common; the ones on the right say what was actually measured:
| Avoid | Say instead |
|---|---|
| "Validated", of a score against simulator runs | "Verified against held-out simulator runs" |
| "Validated against satellite" | "Compared with satellite-observed extent", with the score and the baseline beside it |
| "X% accurate against the national flood map" | "Compared with that map, model to model", naming the rainfall each used |
| "Certified error bounds", "within three sigma" | "Measured coverage of X% per cell, against the simulator, on held-out runs" |
| "Probability of flooding" from runs agreeing | "K of N model runs wet" |
| "Physics-informed", of a model trained on simulator output | "Trained on physics-based simulations" |
| "1-in-100-year flood" where the rainfall statistics were not fitted | "1.5 times the reference storm's rainfall" |
None of this makes a fast model less useful. A model that is well verified against a good simulator is a cheap way to explore many storms, as long as the simulator's own record against real floods is stated beside it, or its absence is.
When verification is all there is
For many places no flood has ever been recorded, and validation is impossible. That is not a reason to stay silent about it. A result there can still be stated precisely: the fast model reproduces this simulator to the stated accuracy, and the simulator's own record against real floods, elsewhere, is this. If the simulator has never been compared with an observed flood either, that belongs in the same sentence. A reader can work with "this is what the simulator would show for this rainfall"; a reader misled into thinking it is a forecast of what will happen cannot.
It helps to keep the two records apart in the files as well as in the text. A verification result belongs to a model release and a set of simulator runs; a validation result belongs to a model release, a place and a dated flood. Stored together under one heading such as "accuracy", they are merged again by the next person who quotes them.
A checklist for any flood-model result
Before a score leaves the team, each of these should be stated beside it:
| State | Why |
|---|---|
| The reference: simulator runs or an observed flood | Decides whether the score is verification or validation |
| How test cases were held out: random cells, whole storms or whole areas | Random cells and repeated storms leak information into the test |
| The baseline, and whether its threshold was fitted or set in advance | A score with no baseline cannot be read |
| The depth that counts as wet | The critical success index changes with it |
| The rainfall: an observed storm, a design storm or a multiple of a reference | A return period is only meaningful where the rainfall statistics behind it are real |
| Coverage: its level, per cell or per run, and against what | Per cell and per run answer different questions |
| What the record is known to miss | Part of any validation score is the record's own gaps |
The fourth row is easy to underrate. Scored against reality with different depths counted as wet, the same lab predictions score anywhere from 0.93 to 0.82:
The second row is the subject of the next post in this series: holding out random cells, or storms that are variations on one event, lets neighbouring cells and near-copies leak between training and test, and the score rises for reasons that have nothing to do with skill.
A small lab you can run
The lab is synthetic: one-dimensional valleys, a storage model of water, no real terrain or rainfall. Download the lab (zip), then run python run_all.py and python -m pytest -q. Its six experiments produce the figures above, and each of its seven tests checks a claim against the alternative it rejects, for example that reality and simulator agree exactly once the drains are removed. python seeds.py repeats experiments 1 and 4 over ten seeds; the coverage figure uses its means, and the table below shows how far each number moves.
| Quantity | One seed, in the figures | Ten seeds: mean | Lowest to highest |
|---|---|---|---|
| CSI, fast model vs simulator | 0.988 | 0.990 | 0.987 to 0.993 |
| CSI, fast model vs reality | 0.932 | 0.923 | 0.917 to 0.927 |
| CSI, simulator vs reality | 0.923 | 0.915 | 0.909 to 0.918 |
| CSI, terrain baseline vs reality | 0.783 | 0.788 | 0.760 to 0.805 |
| Depth error, fast model vs simulator | 4 cm | 4 cm | 3 to 4 cm |
| Depth error, fast model vs reality | 16 cm | 16 cm | 16 to 17 cm |
| Band half-width | 19 cm | 11 to 24 cm | |
| Coverage per cell vs simulator | 91% | 74% to 99% | |
| Coverage per cell vs reality | 15% | 2% to 22% | |
| Coverage per run vs simulator | 80% | 66% to 86% | |
| Coverage per run vs reality | 1% | 0% to 8% |
The scores barely move: a standard deviation of 0.003 or less for the fast model. Coverage moves a lot. The band rests on 80 calibration runs whose cells are far from independent, a problem the next post takes up, and that is a reason to quote coverage with its range.
Limits of this post
- The lab's water fills a valley by volume. Real floods flow, pond and drain over time, so the lab shows the logic of the checks, not realistic scores.
- The simulator in the lab has one known flaw. Real simulators have many, and most are not known in advance.
- A good validation score on one flood is one data point. Floods differ by place, season and cause, and a model needs scoring on many before its record means much.
Sources
- W. L. Oberkampf and C. J. Roy, Verification and Validation in Scientific Computing, Cambridge University Press (2010).
- J. T. Schaefer, The critical success index as an indicator of warning skill, Weather and Forecasting 5, 570 (1990).
- A. D. Nobre et al., Height Above the Nearest Drainage: a hydrologically relevant new terrain model, Journal of Hydrology 404, 13 (2011).
- Environment Agency, Recorded Flood Outlines, data.gov.uk.