LeakDB / README.md
eldemet's picture
Add DOI 10.57967/hf/11171 to card and Croissant
e3e2236 verified
|
Raw History Blame Contribute Delete
20.1 kB
metadata
license: eupl-1.2
pretty_name: 'LeakDB: Leakage Diagnosis Benchmark for water distribution networks'
language:
  - en
task_categories:
  - tabular-classification
  - time-series-forecasting
tags:
  - water-distribution-networks
  - leak-detection
  - leakage-diagnosis
  - anomaly-detection
  - fault-diagnosis
  - benchmark
  - time-series
  - EPANET
  - hydraulic-simulation
  - critical-infrastructure
  - synthetic
size_categories:
  - 10M<n<100M
configs:
  - config_name: net1_timeseries
    default: true
    data_files:
      - split: train
        path: data/net1_timeseries/train-*.parquet
      - split: validation
        path: data/net1_timeseries/validation-*.parquet
      - split: test
        path: data/net1_timeseries/test-*.parquet
  - config_name: hanoi_timeseries
    data_files:
      - split: train
        path: data/hanoi_timeseries/train-*.parquet
      - split: validation
        path: data/hanoi_timeseries/validation-*.parquet
      - split: test
        path: data/hanoi_timeseries/test-*.parquet
  - config_name: scenarios
    data_files:
      - split: train
        path: data/scenarios/train-*.parquet
      - split: validation
        path: data/scenarios/validation-*.parquet
      - split: test
        path: data/scenarios/test-*.parquet
  - config_name: leaks
    data_files:
      - split: train
        path: data/leaks/train-*.parquet
      - split: validation
        path: data/leaks/validation-*.parquet
      - split: test
        path: data/leaks/test-*.parquet
  - config_name: leak_demands
    data_files:
      - split: train
        path: data/leak_demands/train-*.parquet
      - split: validation
        path: data/leak_demands/validation-*.parquet
      - split: test
        path: data/leak_demands/test-*.parquet

LeakDB: Leakage Diagnosis Benchmark

LeakDB (Leakage Diagnosis Benchmark) is a dataset of artificially generated but realistic leakage scenarios in two benchmark water distribution networks, Net1 and Hanoi. Each network has 1000 one-year scenarios simulated at 30-minute steps with pressure-driven hydraulics (WNTR), randomised pipe length, diameter and roughness, synthetic consumer demands, and zero to several leaks of abrupt or incipient type. For every scenario the dataset provides node pressures, node demands, link flows, leak outflows, leak parameters and per-time-step leak labels, for training and evaluating leak detection and localisation algorithms.

DOI: 10.57967/hf/11171

This repository is a Parquet re-packaging of the original LeakDB CSV release (https://github.com/KIOS-Research/LeakDB) for the Hugging Face Hub. Values are copied unchanged; the conversion only restructures files, adds types and timestamps, and adds quality-control flags.

Quick start

from datasets import load_dataset
import pandas as pd

train = load_dataset("KIOSCoE/LeakDB", "net1_timeseries", split="train")     # also "validation", "test"; or "hanoi_timeseries"
scen  = load_dataset("KIOSCoE/LeakDB", "scenarios", split="train").to_pandas()
leaks = load_dataset("KIOSCoE/LeakDB", "leaks", split="train").to_pandas()
leaks = leaks[~leaks.stale_file]                                          # leaks that belong to each simulation

# one scenario as a (time x sensors) frame, reading only that scenario's row group
df = pd.read_parquet("hf://datasets/KIOSCoE/LeakDB/data/net1_timeseries", filters=[("scenario", "==", 42)])

Each Parquet row group holds exactly one scenario, so filtering by scenario reads only that scenario. splits.csv lists the split of every scenario.

Networks and simulation

Net1_CMH Hanoi_CMH
Scenarios 1000 1000
Nodes with pressure/demand series 11 32
Links with flow series 13 34
Sources reservoir 9, tank 2 reservoir 1
  • Duration: one year per scenario (17,520 steps of 30 min; time stamps use the synthetic year 2017).
  • Simulator: WNTR, pressure-driven demand; EPANET units CMH (pressures in m, demands and flows in m³/h).
  • Per scenario: pipe length, diameter and roughness perturbed within 5–20 %; synthetic demands; 0–2 leaks (abrupt or incipient) at random nodes, start and end times.
  • Base network models are in networks/. Each scenario’s perturbed EPANET model is in models/<network>/ (gzipped .inp).

Data structure

Every config has the splits train, validation and test, assigned at scenario level: all rows of a scenario (time steps, leaks, leak demands) are in the same split, so no information leaks between splits. Assignment is 70/15/15 per network, stratified by the scenario's valid leaks (none / abrupt / incipient / two leaks), seed 42; the full list is in splits.csv and in the assigned_split column of scenarios.

network train validation test
Net1_CMH 700 (514 with leaks) 151 (111 with leaks) 149 (109 with leaks)
Hanoi_CMH 700 (534 with leaks) 150 (115 with leaks) 150 (114 with leaks)

Use train to fit models, validation to tune thresholds and hyper-parameters, and report results on test. For comparability with the original 2018 benchmark (which scored detectors on all scenarios), also report scores on the concatenation of all three splits.

net1_timeseries

Net1_CMH: one row per scenario and 30-min time step with the leak label and all node pressures, node demands and link flows. 17,520,000 rows, 21 file(s), 0.99 GB.

column type description
scenario int16 Scenario number (1-1000) within the network.
time_index int32 1-based time-step index as in the original CSV files (1-17520).
timestamp timestamp[ms] Simulation time stamp (synthetic year 2017, 30-min steps, no time zone).
label int8 1 if at least one leak is active at this time step, else 0 (original Labels.csv).
pressure_node_<id> (11 columns) double Pressure head at each node, m. IDs: 2, 9, 10, 11, 12, 13, 21, 22, 23, 31, 32.
demand_node_<id> (11 columns) double Actual (pressure-driven) demand at each node, m^3/h; negative at reservoirs/tanks supplying the network. IDs: 2, 9, 10, 11, 12, 13, 21, 22, 23, 31, 32.
flow_link_<id> (13 columns) double Flow at each link, m^3/h; sign gives direction relative to the link's start node. IDs: 9, 10, 11, 12, 21, 22, 31, 110, 111, 112, 113, 121, 122.

hanoi_timeseries

Hanoi_CMH: one row per scenario and 30-min time step with the leak label and all node pressures, node demands and link flows. 17,520,000 rows, 20 file(s), 2.96 GB.

column type description
scenario int16 Scenario number (1-1000) within the network.
time_index int32 1-based time-step index as in the original CSV files (1-17520).
timestamp timestamp[ms] Simulation time stamp (synthetic year 2017, 30-min steps, no time zone).
label int8 1 if at least one leak is active at this time step, else 0 (original Labels.csv).
pressure_node_<id> (32 columns) double Pressure head at each node, m. IDs: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32.
demand_node_<id> (32 columns) double Actual (pressure-driven) demand at each node, m^3/h; negative at reservoirs/tanks supplying the network. IDs: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32.
flow_link_<id> (34 columns) double Flow at each link, m^3/h; sign gives direction relative to the link's start node. IDs: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34.

scenarios

One row per scenario: parameter-uncertainty settings, leak counts and quality-control flags. 2,000 rows, 3 file(s), 0.00 GB.

column type description
network string Network name: Net1_CMH or Hanoi_CMH.
scenario int16 Scenario number (1-1000) within the network.
assigned_split string Split this scenario belongs to (train, validation or test); same as splits.csv.
duration_hours int32 Simulated duration in hours.
time_step_min int32 Hydraulic and reporting time step in minutes.
uncertainty_topology string Topology uncertainty setting (NO for all scenarios).
uncertainty_length_pct double Maximum relative perturbation of pipe lengths, percent.
uncertainty_diameter_pct double Maximum relative perturbation of pipe diameters, percent.
uncertainty_roughness_pct double Maximum relative perturbation of pipe roughness coefficients, percent.
scenario_label int8 1 if any time step of the scenario is labelled as leaking.
n_labelled_steps int32 Number of time steps with label 1.
n_label_events int32 Number of contiguous runs of label 1.
n_leak_files int32 Number of leak info files in the original Leaks folder.
n_valid_leaks int32 Leak info files that belong to this scenario's simulation (n_leak_files minus stale files).
n_stale_leak_files int32 Leak info files left over from an earlier simulation run (see stale_file).
labels_explained_by_leaks bool True if the label series equals the union of the valid leak windows.
qc_notes string Human-readable quality-control notes added during conversion.

leaks

One row per leak info file: location, type, size, start/peak/end and quality-control flags. 1,993 rows, 3 file(s), 0.00 GB.

column type description
network string Network name: Net1_CMH or Hanoi_CMH.
scenario int16 Scenario number (1-1000) within the network.
leak_node string Node ID where the leak is located.
leak_type string abrupt (constant size from onset) or incipient (growing until peak time).
leak_area_m2 double Leak (orifice) area at its maximum size, m^2.
leak_diameter_m double Leak (orifice) equivalent diameter at its maximum size, m.
start_index int32 Original 'Leak Start' time-step index. Abrupt leaks start one step later (start_index + 1).
end_index int32 Original 'Leak End' time-step index (last labelled step).
peak_index int32 Original 'Peak Time' index: step at which an incipient leak reaches its maximum size.
start_time timestamp[ms] Timestamp of start_index.
end_time timestamp[ms] Timestamp of end_index.
peak_time timestamp[ms] Timestamp of peak_index.
first_outflow_index int32 First time step with non-zero leak outflow in the leak demand series (derived).
last_outflow_index int32 Last time step with non-zero leak outflow in the leak demand series (derived).
max_outflow_m3h double Maximum leak outflow, m^3/h (derived).
label_coverage double Fraction of the leak window that is labelled 1 in Labels.csv (derived).
stale_file bool True if this leak file is older than the scenario's simulation output, i.e. left over from an earlier run and not part of the simulated scenario.

leak_demands

Leak outflow time series, one row per leak and time step. 34,917,360 rows, 41 file(s), 0.32 GB.

column type description
network string Network name: Net1_CMH or Hanoi_CMH.
scenario int16 Scenario number (1-1000) within the network.
leak_node string Node ID where the leak is located.
time_index int32 1-based time-step index as in the original CSV files (1-17520).
timestamp timestamp[ms] Simulation time stamp (synthetic year 2017, 30-min steps, no time zone).
leak_demand_m3h double Leak outflow at the leak node, m^3/h.

Evaluation and baselines

label is the per-time-step ground truth (1 while any leak is active). Detectors are scored with the LeakDB metrics, computed over all time steps of all scenarios of a split: true-positive rate (RTP), true-negative rate (RTN), F1 and the early-detection score (SED), which rewards detecting each leak event soon after it starts (within the leak plus 5 h) and only counts detections that persist. scripts/leakdb_score.py is a Python port of the original MATLAB scoring function (identical results with --matlab-compat, checked in GNU Octave), and scripts/leakdb_baselines.py contains the paper's reference detectors.

pip install pandas pyarrow huggingface_hub
# predictions: Parquet/CSV with columns scenario, time_index, prediction (0/1), for every scenario of the split
python scripts/leakdb_score.py --predictions my_preds.parquet --network hanoi --split test --data hf://datasets/KIOSCoE/LeakDB
# reference baselines (MNF tuned on validation) for both networks
python scripts/leakdb_baselines.py benchmark --data hf://datasets/KIOSCoE/LeakDB

Baseline results (baselines/baseline_results.json; MNF λ and w tuned for F1 on validation):

Net1_CMH — test split (149 scenarios) and all 1000 scenarios; scores in %.

detector RTP RTN F1 SED RTP (all) RTN (all) F1 (all) SED (all)
Ideal 100.00 100.00 100.00 97.73 100.00 100.00 100.00 98.15
Null 0.00 100.00 0.00 0.00 0.00 100.00 0.00 0.00
Random 50.07 49.99 30.79 0.00 50.02 50.00 30.31 0.10
MNF λ=0.10, w=10 (paper) 84.67 40.90 43.23 69.58 86.50 42.61 44.01 69.55
MNF λ=0.20, w=10 (paper) 53.95 98.67 68.03 44.86 58.76 99.01 72.40 46.61
MNF λ=0.30, w=10 (paper) 51.83 99.87 68.07 44.84 56.81 99.90 72.28 46.10
MNF λ=0.25, w=7 (tuned on validation) 52.49 99.68 68.33 45.02 57.33 99.82 72.57 46.57

Hanoi_CMH — test split (150 scenarios) and all 1000 scenarios; scores in %.

detector RTP RTN F1 SED RTP (all) RTN (all) F1 (all) SED (all)
Ideal 100.00 100.00 100.00 97.62 100.00 100.00 100.00 98.77
Null 0.00 100.00 0.00 0.00 0.00 100.00 0.00 0.00
Random 50.06 49.99 32.45 0.00 49.98 49.99 31.37 0.07
MNF λ=0.10, w=10 (paper) 76.36 68.26 55.14 52.09 69.99 67.59 50.12 43.60
MNF λ=0.20, w=10 (paper) 49.12 99.77 65.56 33.96 40.92 99.78 57.78 29.73
MNF λ=0.30, w=10 (paper) 41.88 99.89 58.90 29.99 33.40 99.94 50.00 25.04
MNF λ=0.20, w=21 (tuned on validation) 53.26 97.67 66.32 36.59 45.78 97.36 59.19 31.81

The Minimum Night Flow (MNF) detector flags a day when its minimum inflow exceeds the lowest minimum of the previous w unflagged days by more than λ; inflow is flow_link_1 for Hanoi and -(demand_node_9 + demand_node_2) for Net1. Like the reference code, it labels the whole day from 00:00, i.e. it looks ahead by up to one day. SED is normalised by the number of leak events, as in the MATLAB code; the ideal detector scores below 100 because it is silent during the 5-h extension window. leakdb_score.py also reports SED_ideal_normalised (paper eq. 6).

Known issues in the source data (flagged, not altered)

network scenarios with leak label with stale leak files labels not explained by leak info
Net1_CMH 1000 734 24 26
Hanoi_CMH 1000 763 0 9
  • Synthetic data from two small benchmark networks; real sensor noise, missing data and sensor faults are not modelled.
  • Net1_CMH: 31 leak files in 24 scenarios are left over from an earlier generator run (flagged stale_file); the time-step labels do not include them.
  • Some scenarios had two leaks at the same node; only the later leak's info file survived, so labels contain events with no leak info row (labels_explained_by_leaks = false).
  • For abrupt leaks, outflow and labels start one step after start_index.
  • For incipient leaks the leak outflow series is intermittent and reaches zero at or before peak_index, while labels remain 1 until end_index.
  • Time stamps are a synthetic calendar year (2017) at 30-minute resolution.

Use stale_file == False in leaks (and leak_demands joined on network/scenario/leak_node) to get the leaks that belong to each simulation; qc_notes in scenarios explains every flagged scenario. The time-step label is consistent with the valid leaks in all other cases.

Provenance and processing

Fully synthetic. Each scenario was generated by the LeakDB toolkit (Python, WNTR WNTRSimulator, pressure-driven demand mode) on the Net1 and Hanoi EPANET benchmark networks: pipe length, diameter and roughness were perturbed uniformly within a scenario-specific percentage, consumer demands were synthesised from weekly and yearly patterns with noise, and leaks were inserted as orifice emitters at randomly chosen nodes and times.

  • Original per-series CSV files (Index,Value) were merged into one wide table per network, one row per scenario and time step; values are copied unchanged as float64.
  • Labels were cast from 0.0/1.0 to int8; time indices were joined to Timestamps.csv.
  • Leak and scenario info files (key/value CSV) were parsed into typed tables.
  • Quality-control flags were derived (stale leak files, labels not explained by leak info files); no records were removed.

Intended uses and limitations

Training and benchmarking leak detection, localisation and anomaly detection algorithms on water distribution networks; scoring with the LeakDB metrics (F1, true-positive/negative rate, early detection score). Leak sizes, locations and timings are sampled from uniform distributions and do not reflect real failure statistics.

Personal and sensitive information

None. The data are simulated and contain no personal information.

Authors and contact

KIOS Research and Innovation Center of Excellence, University of Cyprus, Nicosia, Cyprus.

Questions and issues: Stelios G. Vrachimis (corresponding author), vrachimis.stelios@ucy.ac.cy; KIOS Research and Innovation Center of Excellence, kios@ucy.ac.cy. You can also open a discussion on this dataset's Community tab.

Funding

  • European Union Horizon 2020 programme, grant agreement no. 739551 (KIOS CoE).
  • Interreg V-A Greece-Cyprus 2014-2020 programme, project SmartWater2020, co-financed by the European Regional Development Fund (ERDF) and national funds of Greece and Cyprus.

Related resources

License

European Union Public Licence v1.2 (EUPL-1.2), as in the original release.

Citation

If you use LeakDB, please cite both this dataset release (DOI 10.57967/hf/11171) and the paper that introduced the benchmark:

@misc{kioscoe2026leakdb,
  author    = {{KIOS Research and Innovation Center of Excellence, University of Cyprus} and Eliades, Demetrios and Vrachimis, Stelios and Kyriakou, Marios and Polycarpou, Marios},
  title     = {{LeakDB} (Revision 059b043)},
  year      = {2026},
  url       = {https://huggingface.co/datasets/KIOSCoE/LeakDB},
  doi       = {10.57967/hf/11171},
  publisher = {Hugging Face}
}

@inproceedings{vrachimis2018leakdb,
  title     = {{LeakDB}: a benchmark dataset for leakage diagnosis in water distribution networks},
  author    = {Vrachimis, Stelios G. and Kyriakou, Marios S. and Eliades, Demetrios G. and Polycarpou, Marios M.},
  booktitle = {Proceedings of the 1st International WDSA/CCWI 2018 Joint Conference},
  address   = {Kingston, Ontario, Canada},
  year      = {2018},
  doi       = {10.5281/zenodo.1313116}
}