How virajmote/predictive_maintenance_backend-v2 works
This backend turns industrial sensor readings into failure-mode probabilities, remaining useful life, health scores, and operator alerts. The runtime path is a client request through FastAPI into model-backed inference and a structured response; batch prediction and model-status endpoints are additional API capabilities. Offline, the training orchestrator validates the AI4I dataset, engineers features and RUL labels, trains baseline or LSTM models, and saves a package consumed by inference. Edges follow the excerpts, SOURCE INDEX references, or README; unsampled internals are not expanded.
Main entry points: train.py Training Orchestrator · inference.py Inference Engine · config.py Model Configuration · api.py FastAPI API
Components 12
API Serving
- FastAPI API
api.py - Prediction Response
api.py
Prediction
- Inference Engine
inference.py - Health and Alerts
inference.py - Model Package
models
Model Training
- Training Orchestrator
train.py - Feature Engineering
feature_engineering.py - RF and XGBoost
baseline_model.py - LSTM Models
lstm_model.py
Data and Configuration
- AI4I Dataset
data/ai4i2020.csv - Model Configuration
config.py
Other components
- API Client
Connections 17
- API Client → FastAPI API: submits readings
README.md - FastAPI API → Inference Engine: runs prediction
api.py - Model Package → Inference Engine: loads models
inference.py - Inference Engine → Health and Alerts: builds score and alerts
inference.py - Inference Engine → Feature Engineering: uses features
inference.py - Inference Engine → LSTM Models: builds sequences
inference.py - FastAPI API → Prediction Response: returns predictions
api.py - Health and Alerts → Prediction Response: supplies result fields
inference.py - AI4I Dataset → Training Orchestrator: provides training data
README.md - Training Orchestrator → Feature Engineering: engineers data
train.py - Training Orchestrator → RF and XGBoost: trains baselines
train.py - Training Orchestrator → LSTM Models: trains sequences
train.py - Training Orchestrator → Model Package: saves selected model
README.md - Training Orchestrator → Model Configuration: reads settings
train.py - Feature Engineering → Model Configuration: reads feature settings
feature_engineering.py - RF and XGBoost → Model Configuration: reads model settings
baseline_model.py - LSTM Models → Model Configuration: reads sequence settings
lstm_model.py