Hydro-SaaS
Menu
Reference case on real public data: daily records of an urban wastewater treatment plant, 1990–1991, studied at the Universitat Autònoma de Barcelona (UCI Machine Learning Repository, CC BY 4.0). Every estimate is checked against the real lab result.

KAI engine · reference case

Effluent BOD on the day, not five days later

BOD5 is the number on most discharge permits, and the lab needs five days to measure it. By then the water is long gone. A soft sensor estimates it from what can be measured at once, and keeps learning as each lab result comes in. Here it runs on 504 real lab results.

← BOD and COD at a bottling plant outlet (factory demo)

Typical error, one probe
4.4 mg/L
TSS probe only · last lab result: 7.5 mg/L
Warning days caught
3 of 3
on the day · last lab result: 0 of 3 · 1 false alarm
Within 25 % of the lab
69 %
of days · last lab result: 52 %
Blind test
226 days
1991, real lab results, not used to build or choose the model

Outlet BOD5: soft sensor against the real lab results

Each day the soft sensor estimates BOD5 from that day's measurements, using a model trained only on lab results that had arrived by then (5 days late). Dots are the lab results, which came 5 days later. The dashed line is what the operator would have known on the day without a soft sensor: the last lab result.

  • Lab result (arrives 5 days later)
  • Soft sensor, on the day
  • Its 90 % band
  • Last lab result known on the day
  • NEMA 2020 limit, 50 mg/L
  • Warning level, 40 mg/L

The day the secondary settler failed

From 17 Jul 1991 the outlet BOD5 jumped to about 105 mg/L for 3 days (the dataset's authors classify these days as secondary-settler problems). The lab results said so 5 days later. On the first day, the last result the operator had was 31 mg/L: nothing to act on.

DaySoft sensor, on the dayLast lab result knownLab result (5 days later)
17 Jul 199161 mg/L over limit31 mg/L105 mg/L
18 Jul 199147 mg/L warning31 mg/L101 mg/L
19 Jul 199149 mg/L warning14 mg/L101 mg/L

The soft sensor raised the alarm on the first day but underestimated the size of the failure: it had never seen one this large in its training data. For an alarm that is enough; for reporting the actual value, the lab result is still needed.

What each set of inputs achieves

1991 blind test, 226 days with a lab result. Warning days: lab BOD5 above 40 mg/L (80 % of the NEMA limit). A false alarm is a day flagged above 40 that was not.

InputsTypical errorRMSER²Within 25 %Warning days caughtFalse alarms90 % band held
Turbidity / TSS probeOutlet suspended solids only · power law4.4 mg/L7.60.5369 %3 of 3188 % of days
Four online probesOutlet TSS, pH, conductivity and inflow · power law4.5 mg/L7.80.5169 %3 of 3087 % of days
TSS probe + 2-hour CODOutlet TSS and the same day's COD · power law4.3 mg/L7.00.6066 %3 of 3088 % of days
Last lab result (5+ days old)What the operator knows today without a soft sensor7.5 mg/L15.5−0.9652 %0 of 34—
Typical value (median of past results)A guess that never changes5.5 mg/L11.2−0.0161 %0 of 30—

With only 3 warning days in the test, the “caught” figures show the alarm works on this event, not a rate. The 90 % band held on 88 %–87 % of days, slightly under its target: it is learnt from the sensor's own past errors, and the plant's worst days were larger than anything before them. Typical value of outlet BOD5: 18 mg/L.

What is real, and the limits

  • Real: 527 days of records from an urban wastewater treatment plant (1 Jan 1990 – 30 Oct 1991), with 504 outlet BOD5 lab results. Every number on this page compares a prediction with one of those results.
  • Stand-in: outlet suspended solids were measured in the lab at this plant. A turbidity or TSS probe gives the same quantity continuously, after a site calibration; here the lab value plays the probe. pH, conductivity and flow are standard online probes; COD takes about two hours in the lab (or a UV probe).
  • Limit: a soft sensor learns one plant. At a park's outlet it is trained on that outlet's own lab results, keeps learning as each result arrives, and does not replace the lab results the permit requires.
  • Rule of thumb on these data: outlet BOD5 ≈ 0.94 × TSS (correlation 0.87). Most of the BOD leaving a plant like this is carried by solids that escape the settler.

How it was tested

  1. Walk forward one day at a time from 1 Apr 1990. On each day, use only lab results dated at least 5 days earlier.
  2. Retrain once a week. The 90 % band comes from the soft sensor's own past errors on days whose lab result has arrived.
  3. The model form (straight line, robust straight line or power law) was chosen on 1 Apr 1990 – 31 Dec 1990 only. 1991 was not looked at until the choice was made.
  4. Compare with what an operator has without a soft sensor: the last lab result, and the typical value.

Data: UCI Water Treatment Plant (dataset 106), M. Poch, Universitat Autònoma de Barcelona; licence CC BY 4.0. archive.ics.uci.edu. File used unchanged (SHA-256 af2e632b3706…). Built 2026-10-21T05:49Z by the KAI engine.

Reproduce this case yourselfStep-by-step notebooks, the real data and these results, open on GitHub (code MIT, text and results CC BY 4.0).Notebooks on GitHub ↗