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.
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.
| Day | Soft sensor, on the day | Last lab result known | Lab result (5 days later) |
|---|---|---|---|
| 17 Jul 1991 | 61 mg/L over limit | 31 mg/L | 105 mg/L |
| 18 Jul 1991 | 47 mg/L warning | 31 mg/L | 101 mg/L |
| 19 Jul 1991 | 49 mg/L warning | 14 mg/L | 101 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.
| Inputs | Typical error | RMSE | R² | Within 25 % | Warning days caught | False alarms | 90 % band held |
|---|---|---|---|---|---|---|---|
| Turbidity / TSS probeOutlet suspended solids only · power law | 4.4 mg/L | 7.6 | 0.53 | 69 % | 3 of 3 | 1 | 88 % of days |
| Four online probesOutlet TSS, pH, conductivity and inflow · power law | 4.5 mg/L | 7.8 | 0.51 | 69 % | 3 of 3 | 0 | 87 % of days |
| TSS probe + 2-hour CODOutlet TSS and the same day's COD · power law | 4.3 mg/L | 7.0 | 0.60 | 66 % | 3 of 3 | 0 | 88 % of days |
| Last lab result (5+ days old)What the operator knows today without a soft sensor | 7.5 mg/L | 15.5 | −0.96 | 52 % | 0 of 3 | 4 | — |
| Typical value (median of past results)A guess that never changes | 5.5 mg/L | 11.2 | −0.01 | 61 % | 0 of 3 | 0 | — |
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
- Walk forward one day at a time from 1 Apr 1990. On each day, use only lab results dated at least 5 days earlier.
- Retrain once a week. The 90 % band comes from the soft sensor's own past errors on days whose lab result has arrived.
- 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.
- 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.