Predictive Sensor Analytics Summary (Manufacturing ML Pipeline)
Michael Okafor
Published
End-to-end anomaly detection system for high-frequency manufacturing sensor data (pressure/force/acceleration/temperature at 10ms sampling). Processes streams through signal filtering, feature extraction, and hybrid ML models (Isolation Forest baseline + Autoencoder/LSTM). Served via FastAPI /predict endpoint with PostgreSQL persistence and optional AWS SageMaker deployment.
Architecture Flow
Sensor Streams → Preprocessing (Butterworth LPF, optional Kalman, 50ms resampling)
Windowing (1s windows, 250ms stride)
Feature Extraction (RMS, kurtosis, spectral energy, ZCR, moving avg, peak-to-peak)
Anomaly Models ↔ PostgreSQL (Isolation Forest + AE/LSTM reconstruction)
FastAPI Service → MES/UI clients
Production Deployment
Local: pip install -e . then uvicorn psa.api.main:app --reload
Docker: docker compose up --build (API + Postgres)
API Payload: 10s sensor batches via POST /predict
Response: anomaly_score (0-1), is_anomaly (bool), per-window details
SageMaker-ready: Training (sagemaker/train.py), inference (sagemaker/serve.py), model artifacts in /opt/ml/model/iforest.joblib
Key Engineering
Real-time capable (50ms resampled windows)
Redis caching, rate limiting, immutable audit trails
Hybrid ML: Isolation Forest (fast baseline) + deep learning (temporal patterns)
Cloud-agnostic: Local/Docker or AWS S3→SageMaker pipeline