Instructions to use alirezaaminzadeh/refineryguard-lstm-ae with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Scikit-learn
How to use alirezaaminzadeh/refineryguard-lstm-ae with Scikit-learn:
from huggingface_hub import hf_hub_download import joblib model = joblib.load( hf_hub_download("alirezaaminzadeh/refineryguard-lstm-ae", "sklearn_model.joblib") ) # only load pickle files from sources you trust # read more about it here https://skops.readthedocs.io/en/stable/persistence.html - Notebooks
- Google Colab
- Kaggle
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
- Downloads last month
- -
Dataset used to train alirezaaminzadeh/refineryguard-lstm-ae
Space using alirezaaminzadeh/refineryguard-lstm-ae 1
Collection including alirezaaminzadeh/refineryguard-lstm-ae
Evaluation results
- pca_detection_rate on Tennessee Eastman Process (Braatz files)self-reported1.000
- pca_mean_ttd_hours on Tennessee Eastman Process (Braatz files)self-reported1.510
- pca_mean_far_pre_fault on Tennessee Eastman Process (Braatz files)self-reported0.025
- mean_alarm_reduction_rate on Tennessee Eastman Process (Braatz files)self-reported0.930
from huggingface_hub import hf_hub_download import joblib model = joblib.load( hf_hub_download("alirezaaminzadeh/refineryguard-lstm-ae", "sklearn_model.joblib") ) # only load pickle files from sources you trust # read more about it here https://skops.readthedocs.io/en/stable/persistence.html