Hydraulic model + statistics · water utilities
Night-Flow Leak Finder
Finds leaks on the public BattLeDIM benchmark network and ranks the pipes most likely to be leaking. Click any pipe to make your own leak.
Overview
L-Town is the public BattLeDIM benchmark network: a simulated town with 43 km of pipes, 33 simulated pressure sensors, three flow meters and 82 smart meters. Its 2019 data hide 19 leaks that begin that year. We built a leak finder for it with the tools a water engineer already uses: a hydraulic model, a water balance with minimum night flow, and pressure residuals. We calibrated the model on 2018 and set its detection thresholds with an automatic search on 2018 data alone.
Finding a leak and placing it use different hours. The slow-leak test reads the water balance between 01:00 and 05:00. Use is lowest then, so a leak is a larger share of what flows in. A separate burst test watches every hour. Placing the leak uses pressure across the whole day; on a March day in this model, a leak's pressure footprint at 19:00 is about 1.7 times its footprint at 04:00. Each alarm compares the pressure change at the sensors with a simulated leak at every junction (each pipe takes the mean of its two ends). The set of candidate pipes then narrows hour by hour.
On the 2019 data the method found 14 of the 19 leaks that began that year. It raised 7 false alarms, and 13 more reports landed on leaks already known: 7 on leaks it had reported itself, 6 on a leak still running from 2018. Under the BattLeDIM scoring rules, the 14 finds are worth €289,028 after crew costs, out of €355,472 for the water all 19 leaks lose. With 10 of the 33 pressure sensors (flow meters unchanged), it found 10 of the 19. L-Town is also cleaner than a real town: with a 2 % daily error in estimated household use, the same method found 8 to 12 of the 19 in two test runs. In the embed, the hydraulic solver runs in your browser: click any pipe to make a leak.
How it was tested
- The model was calibrated on 2018. The detection thresholds were set by an automatic search on 2018 data alone.
- The 2019 answers have been public since 2020, and they were open to us while we built the method. So this is a worked result on a solved benchmark, not a blind test.
- Other threshold settings that did as well on 2018 find 9 to 16 of the 19 leaks (median 13).
- Four more leaks ran on from 2018. The published 2018 leak file names them, so we do not count them.
- Scores follow the BattLeDIM scoring rules, run by us with our Python port of the organisers' scoring. The port reproduces their published example reports to the cent.
What we built
- A hydraulic model of L-Town (WNTR + EPANET), calibrated on leak-free 2018 hours. On held-out hours its pressure error is 3.7 cm RMSE, against 7.8 cm uncalibrated.
- A water balance for the two supply zones, with demand estimated from the 82 smart meters, which are all in one zone. A minimum-night-flow change test (CUSUM) and a burst test run on that balance.
- Leak location by pressure signatures: a simulated leak at every junction, compared with the measured change in pressure residuals. The result is a ranked set of candidate pipes, updated every hour.
- An evaluation under the competition's own scoring rules, with the 10-sensor test and five random sensor sets as controls.
- An in-browser EPANET solver of the calibrated model (WebAssembly). Click a pipe, set the leak size and the hours of data, and watch the candidate set form.
Tech stack
Python, WNTR, EPANET 2.2, NumPy, SciPy, pandas · epanet-js (EPANET compiled to WebAssembly), three.js
Numbers
All numbers are on L-Town, the public BattLeDIM benchmark network (a simulated town), from our own runs. "BattLeDIM rules" means the organisers' published scoring, run by us: a find counts within 300 m along the pipes and inside the leak's time window; water is valued at €0.80/m³; a false alarm costs €500; a find is charged crew time in proportion to its distance, up to €500; repeat visits are not charged.
| Number | How we measured it |
|---|---|
| 14 of 19 leaks that began in 2019 found | Leaks that ran on from 2018 are not counted. |
| €289,028 of €355,472 | Water saved by the 14 finds, minus crew costs, under the BattLeDIM rules. €355,472 is what reporting all 19 at their start would be worth. |
| 7 false alarms, plus 13 reports on known leaks | 34 reports in all. False alarms cost €500 each. 13 reports landed on leaks already known (7 on leaks the method had reported, 6 on a leak running since 2018); the BattLeDIM score does not charge them. |
| About 3 h from burst to alarm (1.6 to 24 h) | The 7 abrupt leaks found, timed to when the alarm's hour of data ends. The location is reported 24 h after the alarm, a delay chosen on 2018. |
| Alarm 5 to 53 days after onset for slow leaks (report 6 to 54 days) | The 7 incipient leaks found. They start near zero flow and grow over weeks. |
| 171 m median from our pipe to the leaking pipe (50 to 294 m) | The 14 leaks found, measured as the score measures it: along the pipes, centre to centre. |
| 17 to 77 pipes in the candidate set at report, for bursts | Pipes whose fit is within a fixed margin of the best. Residual noise (measured minus modelled pressure) was measured on 2018. For slow leaks, the set often stays the whole district. |
| 3.7 cm pressure error of the calibrated model | RMSE at the 33 sensors on 61 leak-free hours of 2018 not used for that fit; 7.8 cm uncalibrated. |
| 10 of 19 with 10 sensors, €181,058, 15 false alarms | 10 of the 33 pressure sensors, chosen by a fixed spacing rule; flow meters and smart meters unchanged. Five random sets of 10 found 4 to 12. |
| 8 to 12 of 19 with a 2 % demand error | Two test runs with a 2 % day-to-day error added to the estimated household use, all other settings unchanged. |
| 9 to 16 of 19 with other thresholds | 37 threshold settings that scored within 5 % of the best on 2018, each run on 2019 (median 13). |
| 0.5 ms per leak scenario in the browser | Median steady-state EPANET solve of the 782-junction model in the embed, on an M1 Pro laptop in Chromium. Phones will be slower. |
Stills
Try it live
An interactive view that runs in your browser. Nothing loads until you open it.