🎯 Problem Statement
Predicting the Next-Step Motor Fault From Live Telemetry
On production lines and in HVAC systems, electric motors fail for reasons like bearing wear, rotor imbalance, insulation breakdown, or overload. These failures are often preceded by subtle shifts in current, temperature, and vibration. The operational need is simple and urgent:
Can we predict—one step ahead—if the motor will enter a fault state, using the latest sensor window?
This demo solves exactly that. You upload a CSV of motor telemetry (e.g., RMS current, winding temperature, vibration RMS/crest, load), pick your inputs and the fault flag column, and the tool trains a classifier that predicts the next time step’s fault state. It then generates a decision-grade report (confusion matrix, ROC/AUC, feature importance) plus a PDF and CSV you can share with maintenance teams.
⚙️ Methodology
Data Ingest & Column Selection (Gradio UI)
Load a CSV, then select input telemetry columns and the fault/health column (e.g., fault_flag). The app auto-loads choices and validates numeric fields.
Time Alignment to Predict the Future
The target label is constructed as the output column shifted by −1 row, so the model learns to predict the next-step condition (impending fault vs normal) from the current sensor readings. This turns the task into actionable early warning, not mere hindsight.
Preprocessing
- Attempts to parse object columns as datetimes and then drops datetime fields (keeps only numerics for modeling).
- Filters the selected inputs to numeric-only; any non-numeric chosen are reported as skipped to the user.
Stratified Train/Test Split
Uses StratifiedShuffleSplit (80/20) to preserve class balance (fault vs normal) between train and test sets.
Modeling
Trains a Random Forest Classifier (300 trees, fixed seed for reproducibility) to capture nonlinear relationships between telemetry and the next-step fault state. Outputs predictions and class probabilities.
Evaluation & Reporting
- Confusion Matrix (CM) (PNG)
- Receiver Operating Characteristic (ROC) with Area Under the Curve (AUC)
- Feature Importance bar chart (which signals the most predictive sensors for the impending fault)
- Classification report (precision/recall/F1) exported to CSV
- A polished PDF report that includes accuracy, CM, ROC, and feature importance — ready to circulate.
💡 Key Features
- ⚡ Concrete target: Predict next-step motor fault (vs normal) from current telemetry.
- 🧩 Flexible inputs: Choose any numeric sensor channels (current, temp, vibration, load, voltage harmonics, etc.). Non-numeric selections are safely skipped and listed.
- 🧠 Robust classifier: Random Forest handles nonlinearities and mixed-scale features without heavy tuning.
- 📊 Operator-ready visuals: Confusion matrix, ROC/AUC, and feature importance to explain decisions.
- 📝 One-click deliverables: Downloadable CSV (metrics) and a PDF report for maintenance sign-off.
- 🖥️ No-code workflow: Entirely Gradio—upload, select, run, and export in minutes.
Demo File
Disclaimer: This tool is provided ‘as is’ without any warranties, and is intended for illustrative purposes only. Please verify all calculations independently before using them to make decisions.
