Data-driven machine learning approach for water quality anomaly detection and NPS-FM non-compliance risk prediction: A study with five New Zealand rivers
The National Policy Statement for Freshwater Management (NPS-FM) 2020 sets national water quality objectives for New Zealand's freshwater, but compliance is mostly assessed after the fact, and tools for anticipating which sites may be at greatest risk of future non-compliance remain limited. This study presents a machine learning pipeline that detects abnormal water quality events and quantifies NPS-FM non-compliance risk, applied to five South Island rivers of New Zealand spanning four land cover types. Anomaly…

In brief
Researchers built a pipeline that flags abnormal water quality readings by requiring agreement between an Isolation Forest model and seasonal interquartile range thresholds. They then combined exceedance rate, anomaly rate, severity and trend into a 0-100 risk score for five South Island rivers covering four land cover types.
Compliance with New Zealand's freshwater standards is mostly judged after the fact, so a forward-looking ranking of at-risk sites could help prioritise attention. The evidence comes from only five rivers, and one site did not pass the hold-out check, so how well the scores predict future breaches in other places is still open.
Main points
- The urban site scored 34.12, rated High risk, with 96% of total nitrogen and 72% of E. coli readings above national limits.
- Native vegetation sites scored 14.24-16.24 and were rated Medium risk, so scores followed a land cover gradient.
- A paired comparison found the pasture site's total nitrogen was 0.3-0.5 mg/L above the upstream native site.
- Anomalies at several indicators co-occurred 10.6-14.0 times more often than random noise would predict.
- Rankings and grades held when One-Class SVM or Local Outlier Factor replaced Isolation Forest.
The gain
A machine learning pipeline gave interpretable risk scores that separated one-off pollution events from persistent contamination and ranked five rivers by likelihood of failing national freshwater limits.
The rundown
The pipeline labels an observation a confirmed anomaly only when both Isolation Forest and seasonal interquartile range thresholds flag it. The risk score weights exceedance rate, confirmed anomaly rate, 90th percentile severity and Mann-Kendall trend slope.
Validation used temporal hold-out testing, literature benchmarking and seasonal pattern analysis. Stability checks varied the anomaly algorithm and the quality-control filter, and the site rankings did not change with the alternative algorithms.
The authors say the framework could be transferred to other regulatory settings where long-term monitoring data and threshold-based standards exist. This is a stated potential, not a tested result in the supplied text.
Sources
- Peer-reviewedWater Research2026-10-17
ace

The debate