RefineryGuard LSTM-AE
CPU-friendly process-anomaly bundle for the Tennessee Eastman Process:
lstm_ae.onnx— LSTM autoencoder (reconstruction error = anomaly score)isolation_forest.joblib— window mean/std baselinepca.joblib— 90% variance reconstruction baseline (operational primary detector)fault_classifier.joblib— 22-class TEP fault id (HistGradientBoosting)scaler.joblib/normal_stats.joblib/thresholds.joblibeval_results.json— held-out Braatz test protocol
Data honesty
Trained only on TEP simulation (Downs & Vogel 1993; Braatz evaluation files). Not a live refinery model. Thresholds are 99th percentiles of normal reconstruction / IF scores on IDV(0) train windows. Recalibrate on each plant before any operational use.
Operational alerts use PCA reconstruction (lowest usable false-alarm rate among LSTM / PCA / Isolation Forest). LSTM-AE is kept for scoring and per-tag attribution; it is not the primary alarm because its pre-fault FAR on this protocol is high (~0.58).
Held-out protocol (fault after 8 h)
| Detector | Detection (21 faults) | Mean TTD (h) | Mean FAR (pre-fault / IDV0) |
|---|---|---|---|
| PCA reconstruction (primary) | 100% | 1.51 | 0.025 |
| Isolation Forest | 100% | 1.02 | 0.126 |
| LSTM-AE | 100% | 0.06 | 0.585 |
| Univariate 3σ baseline | 100% | 1.07 | 0.072 |
Mean alarm reduction (PCA incidents vs raw 3σ tag alarms): 93%. IDV(3), IDV(9), IDV(15) are weakly observable in the TEP literature.
How to score a window
import joblib, numpy as np, onnxruntime as ort
scaler = joblib.load("scaler.joblib")
thr = joblib.load("thresholds.joblib")
sess = ort.InferenceSession("lstm_ae.onnx")
# x: (T, 52) raw tags in xmeas_1..xmv_11 order, T>=20
from numpy.lib.stride_tricks import sliding_window_view
scaled = scaler.transform(x)
windows = sliding_window_view(scaled, (20, 52))[:, 0]
recon = sess.run(None, {"window": windows.astype("float32")})[0]
score = ((windows - recon) ** 2).mean(axis=(1, 2))
alert = score > thr["lstm"]
Related
- Dataset: alirezaaminzadeh/refineryguard-tep-features
- Space: alirezaaminzadeh/refineryguard-process-anomaly
- Collection: RefineryGuard
- Product: aria-ai.ir
MIT · Aria AI Engineering Team