A defensible demonstration of data validation and event detection.
A defensible demonstration of data validation and event detection.
The Problem: Oil & gas treatment facilities face a silent threat. Equipment failures and high-load events can cause environmental breaches before operators notice. The data is noisy, alerts are frequent, and the cost of a missed failure is catastrophic.
The Solution: We built a synthetic lab to simulate 6,570 daily measurements (730 facility-days) across two facilities. We planted known events (an April high-load, an August equipment failure) and challenged our analytics to find them using only the observed data.
The Result: Our statistical detector successfully identified both real elevation events with a 3–4 day latency, and we honestly documented the 2 false alarms (which occurred during a sustained February fluctuation).
Event Recall
100.0%
95% CI: 43.9% – 100.0%
Event Precision
60.0%
95% CI: 23.1% – 88.2%
Detection Latency
3–4 days
From event onset
Day Recall
49.0%
(Accuracy is 95.2% across all days)
Note: The following figures are illustrative, not measured field data.
For a facility processing roughly 100 alerts per year, a precision of 60.0% translates to approximately 40 false alarms annually. Assuming a manual inspection cost of $500 per alert, the annual false-alarm cost is roughly $20,000. This is significantly lower than the cost of a single missed equipment failure (estimated at $50,000+).
Before analyzing results, we must trust the data. The synthetic dataset was validated against 8 physical gates. The chart below shows where the remaining uncertainty in our metrics originates.
We apply a 7-day rolling median to the daily effluent oil & grease measurements. A day is flagged as an anomaly if the rolling median exceeds the facility's full-year baseline by both a statistically significant margin (2 standard deviations) and a practical margin (50% increase).
This matrix shows how many distinct events were detected, ignoring how long they lasted.
Event Precision
60.0%
Event Recall
100.0%
This matrix shows how many individual days were correctly classified out of the 730 total facility-days.
Day Accuracy
95.2%
Day Recall
49.0%
The synthetic data must pass 8 physical validation gates before analysis. A failure in any gate invalidates the entire dataset.
| Gate | Validation Objective | Evidence / Criterion | Result |
|---|---|---|---|
| G1 | Schema & Relational Integrity | 7 tables, exact column names, no duplicate keys | ✓ PASS |
| G2 | Physical Consistency | Mass balance, positive flows, load accounting | ✓ PASS |
| G3 | Statistical Signatures | AR(1) persistence, shared-driver correlation | ✓ PASS |
| G4 | Planted Scenarios | Event multipliers, recovery logic, PW-B isolation | ✓ PASS |
| G5 | Measurement & Leakage | Log-normal noise, no truth leakage into analyst tables | ✓ PASS |
| G6 | Reproducibility | Same seed yields same hash, config matches | ✓ PASS |
| G7 | Analytical Usability | Joins, plots, and expected contrast without truth | ✓ PASS |
| G8 | Documentation Completeness | Data dictionary, references, and project card | ✓ PASS |
Every metric in the main report is generated by the evaluation script and saved to JSON.
| Metric | Value | Source / Calculation | Verification Method |
|---|---|---|---|
| Event Precision | 60.0% | 3 TP, 2 FP | Manual review vs. planted truth |
| Event Recall | 100.0% | 3 TP, 0 FN | Manual review vs. planted truth |
| Day-Level Accuracy | 95.2% | (671 TN + 24 TP) / 730 | Automated confusion matrix |
| Day-Level Recall | 49.0% | 24 TP / (24 TP + 25 FN) | Automated confusion matrix |
| Baseline | Full-Year Median | Robust to single events | Cross-checked against Q1 baseline |
Because we only have 3 true elevation events, the 95% Wilson Confidence Intervals are very wide:
Why the uncertainty chart shows baseline as the biggest risk: Because using a full-year median includes the April high-load event in the baseline calculation, which slightly inflates the mean and lowers sensitivity. A causal (trailing) baseline would be more sensitive but would miss the first few days of any new event.
I, Hadi Farahani, PhD, certify that the analysis and metrics presented in this report are accurate to the best of my knowledge. The limitations and uncertainties have been disclosed. The code is available for audit.
We help industrial organizations prove their measurement data is accurate, traceable, and audit-ready.
Contact KANON for Data Projects