Machine Learning Overview
The Predictive Maintenance System uses Isolation Forest anomaly detection to identify deviations from healthy baseline behavior. The ML pipeline is designed for explainability, determinism, and operational safety.Core Approach
Unsupervised Anomaly Detection
The system uses Isolation Forest, an ensemble method that identifies anomalies by measuring how easily data points can be isolated in a random decision tree.Why Isolation Forest?
- Works with unlabeled data (no need for fault examples during training)
- Fast inference (critical for real-time monitoring)
- Explainable (feature importance available)
- Handles multi-dimensional feature spaces well
Training Philosophy: Healthy Data Only
All models are trained exclusively on healthy baseline data:- The model learns “what normal looks like”
- Any significant deviation from this learned normal behavior is flagged as an anomaly
- No need to anticipate all possible failure modes upfront
Model Architecture
The system runs two Isolation Forest models in parallel (see Dual-Model Architecture):| Model | Features | Input Frequency | Use Case |
|---|---|---|---|
| Legacy (v2) | 6 engineered features | 1Hz (downsampled) | General anomaly detection |
| Batch (v3) | 16 statistical features | 100Hz windows | High-frequency fault detection |
POST /system/calibrate.
Score Semantics
All anomaly scores follow a consistent semantic:- 0.0 = Perfectly Normal (matches healthy baseline)
- 1.0 = Highly Anomalous (extreme deviation from baseline)
Score Calibration
Raw Isolation Forest decision scores are calibrated using quantile-based thresholds:- Healthy data (within the 99th percentile) maps to scores < 0.67
- True anomalies map to scores > 0.67
Deterministic Behavior
All models are trained with fixed random seeds for reproducibility:Hyperparameters
Legacy Model (detector.py)
Batch Model (batch_detector.py)
Why contamination=0.05?
Why contamination=0.05?
The
contamination parameter tells Isolation Forest what percentage of the training data might be outliers.Even “healthy” data has natural variation. Setting this to 0.05 (5%) means:- The top 5% most isolated points in training data are considered potential outliers
- This prevents overfitting to noise
- The model learns the core “normal” distribution while allowing for natural variance
One Model Per Asset
Each asset (Motor-01, Pump-02, etc.) gets its own trained model:- Each asset has unique healthy operating characteristics
- A “normal” vibration for a motor might be anomalous for a pump
- Asset-specific models improve detection accuracy
No Auto-Retraining
Models are trained once during calibration and remain static:- Prevents “drift” where the model adapts to accept degradation as normal
- Ensures audit trail (same baseline = same results)
- Re-calibration is explicit via
POST /system/calibrate
Next Steps
- Dual-Model Architecture — Legacy vs Batch models
- Feature Engineering — 6 legacy + 16 batch features
- Baseline Training — Calibration workflow
- Degradation Index — From scores to health metrics