Skip to content

BhaveshBytess/PREDICTIVE-MAINTENANCE

Repository files navigation

Python FastAPI React InfluxDB Docker Vercel Render

πŸ”§ Predictive Maintenance System

Industrial Asset Health Monitoring with ML-Powered Anomaly Detection

Real-time sensor monitoring β€’ Dual Isolation Forest anomaly detection β€’ 100Hz batch feature ML β€’ Health scoring β€’ PDF/Excel reporting

πŸš€ Live Demo Β |Β  πŸ“„ API Documentation Β |Β  ❀️ Health Check


πŸ“‹ Overview

An end-to-end Predictive Maintenance system that monitors industrial assets (motors, pumps, compressors) in real-time and predicts maintenance needs before failures occur.

Key Capabilities

Feature Description
πŸ”Œ Sensor Ingestion Real-time voltage, current, power factor, vibration data via REST API
πŸ“Š Feature Engineering Rolling means, spike detection, efficiency scores, RMS calculations
πŸ€– Anomaly Detection Isolation Forest model trained on healthy baseline data
❀️ Health Assessment 0-100 health score with risk classification (LOW β†’ CRITICAL)
🎚️ Fault Simulation Configurable severity levels (MILD/MEDIUM/SEVERE) for targeted testing
πŸ’‘ Explainability Human-readable explanations: "Vibration 3.2Οƒ above normal"
πŸ“ˆ Dashboard React + Recharts real-time visualization with glassmorphism UI
πŸ“„ Reporting Role-specialized reports: Executive PDF (Plant Managers), Multi-sheet Excel (Analysts), 5-page Industrial Certificate (Engineers)
πŸ“ Operator Logs Ground-truth maintenance event logging with InfluxDB persistence for supervised ML training
🎯 Baseline Benchmarking Live status cards display baseline target values for instant comparison
πŸ”„ Purge & Re-Calibrate One-click system reset: wipes InfluxDB data + DI state, returns to IDLE
πŸ“ Keep-Alive Heartbeat 10-minute /ping heartbeat prevents Render free-tier cold starts
πŸ“‰ Cumulative Prognostics Monotonic Degradation Index (DI), Damage Rate, and Remaining Useful Life (RUL)

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                   Frontend (React + Vite)                      β”‚
β”‚                      🌐 Vercel                                 β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚ Metrics  β”‚ β”‚  Chart   β”‚ β”‚  Health  β”‚ β”‚  Explanations    β”‚  β”‚
β”‚  β”‚  Cards   β”‚ β”‚ Recharts β”‚ β”‚  Summary β”‚ β”‚     Panel        β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                             β”‚ HTTPS/JSON (Vercel Rewrites)
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                   Backend (FastAPI + Docker)                   β”‚
β”‚                      πŸš€ Render                                 β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚   Ingest     β”‚ β”‚   Features   β”‚ β”‚    ML Pipeline       β”‚   β”‚
β”‚  β”‚   /ingest    β”‚ β”‚   Engine     β”‚ β”‚  Baseline β†’ Detector β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚   Health     β”‚ β”‚  Explainer   β”‚ β”‚    Report            β”‚   β”‚
β”‚  β”‚   Assessor   β”‚ β”‚   Engine     β”‚ β”‚    Generator         β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                             β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                 InfluxDB Cloud (Time-Series)                   β”‚
β”‚              sensor_data β€’ features β€’ anomalies                β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Deployment Stack

Component Technology Hosting URL
Frontend React 18 + Vite Vercel predictive-maintenance-ten.vercel.app
Backend FastAPI + Docker Render predictive-maintenance-uhlb.onrender.com
Database InfluxDB 2.x InfluxDB Cloud AWS us-east-1

πŸš€ Quick Start

Option 1: Docker (Recommended)

# Clone the repository
git clone https://github.com/BhaveshBytess/PREDICTIVE-MAINTENANCE.git
cd PREDICTIVE-MAINTENANCE

# Start all services (backend + frontend)
docker-compose up --build

# Access the application
# Frontend: http://localhost:5173
# Backend:  http://localhost:8000
# API Docs: http://localhost:8000/docs

⚠️ Windows Users: Never commit node_modules/ to Git. Windows binaries cause permission errors on Linux servers (Vercel Error 126).

Option 2: Local Development (Manual)

Backend

cd backend
python -m venv venv
.\venv\Scripts\activate      # Windows
source venv/bin/activate     # Linux/Mac

pip install -r requirements.txt
uvicorn backend.api.main:app --reload

Frontend (separate terminal)

cd frontend
npm install
npm run dev

Option 3: Production Deployment

See DEPLOY.md for detailed instructions on deploying to:

  • Render (Backend)
  • Vercel (Frontend)
  • InfluxDB Cloud (Database)

πŸ“ Project Structure

predictive-maintenance/
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ api/                 # FastAPI routes & schemas
β”‚   β”‚   β”œβ”€β”€ main.py          # Application instance
β”‚   β”‚   β”œβ”€β”€ routes.py        # /ingest, /health endpoints
β”‚   β”‚   β”œβ”€β”€ system_routes.py # Calibration, fault injection, monitoring, purge
β”‚   β”‚   β”œβ”€β”€ integration_routes.py # Health scoring, data history, events
β”‚   β”‚   β”œβ”€β”€ operator_routes.py # Operator log endpoints
β”‚   β”‚   β”œβ”€β”€ sandbox_routes.py  # What-If analysis
β”‚   β”‚   β”œβ”€β”€ services.py      # Business logic helpers
β”‚   β”‚   └── schemas.py       # Pydantic models
β”‚   β”œβ”€β”€ database.py          # InfluxDB client wrapper
β”‚   β”œβ”€β”€ config.py            # Settings & environment loader
β”‚   β”œβ”€β”€ storage/             # Blob/file storage abstraction
β”‚   β”œβ”€β”€ models/              # Saved ML model artifacts
β”‚   β”œβ”€β”€ features/            # Feature engineering
β”‚   β”‚   β”œβ”€β”€ calculator.py    # 1Hz rolling means, spikes, RMS
β”‚   β”‚   └── engine.py        # Feature extraction orchestrator
β”‚   β”œβ”€β”€ ml/                  # Machine Learning (Dual Model)
β”‚   β”‚   β”œβ”€β”€ baseline.py      # Healthy data profiling
β”‚   β”‚   β”œβ”€β”€ detector.py      # Legacy Isolation Forest (6 features, 1Hz)
β”‚   β”‚   β”œβ”€β”€ batch_features.py # 16-D batch feature extraction (100Hz)
β”‚   β”‚   β”œβ”€β”€ batch_detector.py # Batch Isolation Forest (16 features)
β”‚   β”‚   └── validation.py    # 3-Sigma baseline validation
β”‚   β”œβ”€β”€ events/              # Event Engine
β”‚   β”‚   └── engine.py        # State machine (HEALTHY ↔ ANOMALY_DETECTED)
β”‚   β”œβ”€β”€ rules/               # Business logic
β”‚   β”‚   β”œβ”€β”€ assessor.py      # Health scoring, risk & cumulative degradation (DI)
β”‚   β”‚   └── explainer.py     # Human-readable explanations
β”‚   β”œβ”€β”€ reports/             # PDF/Excel generation
β”‚   β”‚   β”œβ”€β”€ generator.py         # Basic PDF/Excel reports
β”‚   β”‚   β”œβ”€β”€ industrial_report.py # 5-page Industrial Health Certificate
β”‚   β”‚   β”œβ”€β”€ constants.py         # Colors, costs, thresholds
β”‚   β”‚   β”œβ”€β”€ mock_data.py         # Simulated historical data
β”‚   β”‚   └── components/          # Gauge, charts, audit components
β”‚   └── generator/           # Digital Twin data generator
β”‚       β”œβ”€β”€ generator.py     # 100Hz hybrid data generator
β”‚       └── config.py        # NASA/IMS fault patterns
β”œβ”€β”€ frontend/
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/      # React components
β”‚   β”‚   β”‚   β”œβ”€β”€ Header/
β”‚   β”‚   β”‚   β”œβ”€β”€ MetricCard/
β”‚   β”‚   β”‚   β”œβ”€β”€ SignalChart/
β”‚   β”‚   β”‚   β”œβ”€β”€ HealthSummary/
β”‚   β”‚   β”‚   β”œβ”€β”€ InsightPanel/
β”‚   β”‚   β”‚   β”œβ”€β”€ OperatorLog/
β”‚   β”‚   β”‚   β”œβ”€β”€ LogWatcher/      # Real-time event feed
β”‚   β”‚   β”‚   β”œβ”€β”€ SystemControlPanel/
β”‚   β”‚   β”‚   β”œβ”€β”€ StatusCard/
β”‚   β”‚   β”‚   β”œβ”€β”€ PerformanceCard/
β”‚   β”‚   β”‚   └── SandboxModal/
β”‚   β”‚   β”œβ”€β”€ hooks/           # usePolling
β”‚   β”‚   └── api/             # API client
β”‚   └── Dockerfile           # Multi-stage nginx build
β”œβ”€β”€ scripts/
β”‚   β”œβ”€β”€ generate_data.py       # CLI data generator (healthy/faulty)
β”‚   β”œβ”€β”€ demo_pipeline.py       # End-to-end demo automation
β”‚   β”œβ”€β”€ benchmark_model.py     # Model performance benchmarking
β”‚   β”œβ”€β”€ retrain_batch_model.py # Standalone batch model retraining
β”‚   β”œβ”€β”€ setup_linux.sh         # Bare-metal Linux setup
β”‚   └── backend.service        # Systemd unit file
β”œβ”€β”€ tests/                   # 182 unit tests
β”œβ”€β”€ docker-compose.yml       # Full stack deployment
β”œβ”€β”€ Dockerfile               # Backend container
└── ENGINEERING_LOG.md       # Decision journal

πŸ”Œ API Reference

Ingest Sensor Data

POST /ingest
Content-Type: application/json

{
  "event_id": "uuid-v4",
  "timestamp": "2026-01-12T00:00:00Z",
  "asset_id": "Motor-01",
  "sensor_data": {
    "voltage_v": 230.5,
    "current_a": 12.3,
    "power_factor": 0.92,
    "vibration_g": 0.15
  }
}

Health Check

GET /health

Response: { "status": "healthy", "db_connected": true }

Keep-Alive Ping

GET /ping

Response: { "status": "ok" }

Used by the frontend's 10-minute heartbeat to keep the Render free-tier backend warm.

System Purge

POST /system/purge

Response: { "status": "purged", "message": "All data and models cleared. System reset to IDLE." }

Writes DI=0.0 to InfluxDB, clears in-memory baselines/detectors/history, and resets state to IDLE.


🧠 ML Pipeline

Dual-Model Architecture

The system runs two Isolation Forest models trained during calibration:

Model Features Input F1 @ 0.5 AUC-ROC Jitter Detection
Legacy (v2) 6 1Hz averages 78.1% 1.000 ❌
Batch (v3) 16 100Hz windows 99.6% 1.000 βœ…

The batch model is primary for inference; the legacy model is retained for backward compatibility.

Batch Feature Engineering (100:1 Reduction)

Each 1-second window of 100 raw sensor points is reduced to a 16-D statistical feature vector:

Signal mean std peak_to_peak rms
voltage_v βœ… βœ… βœ… βœ…
current_a βœ… βœ… βœ… βœ…
power_factor βœ… βœ… βœ… βœ…
vibration_g βœ… βœ… βœ… βœ…

Why it matters: A "Jitter Fault" where average vibration is 0.15g (normal) but Οƒ=0.17g (5x healthy) is invisible to 1Hz models. The batch model catches it because std and peak_to_peak are explicit features.

Legacy Feature Engineering (1Hz)

Feature Formula Window
voltage_rolling_mean_1h Mean of voltage over 1 hour Past-only
current_spike_count Points > 3Οƒ from local mean 10-point window
power_factor_efficiency_score (PF - 0.8) / 0.2 * 100 Instantaneous
vibration_intensity_rms √(mean(vibration²)) Past-only
voltage_stability ` V - 230.0
power_vibration_ratio vibration / (PF + 0.01) Instantaneous

Fault Types

Type Description Detectable By
SPIKE Voltage/current surges Both models
DRIFT Gradual degradation Both models
JITTER Normal means, high variance Batch model only
DEFAULT General fault pattern Both models

Health Assessment

Health is derived from the Cumulative Degradation Index (DI), a monotonically increasing damage accumulator:

# Dead-zone: healthy noise produces zero damage
HEALTHY_FLOOR = 0.65
if batch_score < HEALTHY_FLOOR:
    effective_severity = 0.0
else:
    effective_severity = (batch_score - HEALTHY_FLOOR) / (1.0 - HEALTHY_FLOOR)

# Cumulative damage increment
SENSITIVITY_CONSTANT = 0.005
DI_increment = (effective_severity ** 2) * SENSITIVITY_CONSTANT * dt
DI = min(DI + DI_increment, 1.0)   # monotonic, capped at 1.0

# Health & RUL derived from DI
health_score = round(100 * (1.0 - DI))
RUL_hours = (1.0 - DI) / max(damage_rate, 1e-9)

# Risk Classification
if health_score < 25:  risk = CRITICAL
elif health_score < 50: risk = HIGH
elif health_score < 75: risk = MODERATE
else:                   risk = LOW

Key properties:

  • Monotonic: DI never decreases (except on explicit purge). A quiet minute doesn't erase past damage.
  • Dead-Zone: Batch scores below 0.65 (healthy noise) accumulate zero damage.
  • Hydration: On restart, DI is recovered from InfluxDB (|> last()), so state survives process restarts.
  • Purge Reset: POST /system/purge writes DI=0.0 to InfluxDB and clears in-memory state.

πŸ“Š Dashboard

Dark theme with glassmorphism β€’ Real-time charts β€’ Color-coded risk levels

Core Features:

  • 🟒 STATUS: LIVE badge with real-time connection indicator
  • πŸ“Š Real-time Power Signature chart with Recharts
  • οΏ½ Multi-signal streaming chart β€” Voltage (V), Current (A), Vibration (g) with fixed Y-axis domains and 60s right-anchored sliding window
  • πŸ”΄ Red shaded regions for anomaly spans (noise-suppressed: majority-rules aggregation)
  • 🎯 Health Score ring (0-100) with color coding:
    • Green (75-100): LOW risk
    • Yellow/Orange (50-74): MODERATE risk
    • Orange (25-49): HIGH risk
    • Red (0-24): CRITICAL risk
  • ⏰ Maintenance Window estimation (days until recommended service)
  • πŸ’‘ Insight panel with batch-feature explanations (e.g., "High vibration variance: Οƒ=0.17g")
  • πŸ“œ Log Watcher β€” real-time event feed with transition-based state machine events
  • πŸ“₯ Download options:
    • Executive PDF β€” 1-page summary with Health Grade (A/B/C/D/F) for Plant Managers
    • Multi-sheet Excel β€” Summary, Operator Logs, Raw Sensor Data for Data Analysts
    • Industrial PDF β€” 5-page technical report with Maintenance Correlation Analysis for Engineers
  • πŸ“ Operator Log Panel β€” Real-time maintenance event logging with severity levels
  • 🎯 Baseline Target Display β€” Status cards show calibrated baseline targets alongside live readings
  • πŸ”„ Purge & Re-Calibrate β€” Purple button to wipe all data and restart calibration from scratch
  • πŸ“ Keep-Alive Heartbeat β€” Automatic 10-minute /ping to prevent Render free-tier cold starts

Anomaly Visualization Logic:

  • Red dashed lines appear only when risk β‰  LOW
  • When system is healthy, no anomaly markers shown

Fault Injection Controls:

  • 🎯 Fault Type: Spike, Drift, Jitter, or Default patterns
  • 🏚️ Severity Levels:
    • 🟑 MILD β†’ Targets MODERATE risk (health 50-74)
    • 🟠 MEDIUM β†’ Targets HIGH risk (health 25-49)
    • πŸ”΄ SEVERE β†’ Targets CRITICAL risk (health 0-24)
  • Jitter fault: Normal means, abnormal variance β€” specifically tests batch model advantage

βœ… E2E Verification

All risk levels have been tested with real sensor data:

Risk Level Health Score Red Lines Maintenance Window Test Status
LOW 75+ ❌ None ~60 days βœ… Pass
MODERATE 50-74 βœ… Yes + ⚠️ ~19 days βœ… Pass
HIGH 25-49 βœ… Yes + ⚠️ ~4 days βœ… Pass
CRITICAL 0-24 βœ… Yes + ⚠️ < 1 day βœ… Pass

πŸ§ͺ Testing

# Run all tests
pytest tests/ -v

# Run specific test module
pytest tests/test_features.py -v
pytest tests/test_detector.py -v
pytest tests/test_assessor.py -v
pytest tests/test_degradation.py -v
pytest tests/test_reports.py -v

# Coverage report
pytest tests/ --cov=backend --cov-report=html

Test coverage by module (182 total):

Module Tests Coverage
Cumulative Degradation 37 βœ…
Health Assessment 21 βœ…
Data Generator 21 βœ…
Feature Engineering 20 βœ…
API Validation 17 βœ…
Reporting (PDF/Excel) 15 βœ…
Baseline Construction 14 βœ…
Anomaly Detection 14 βœ…
Explainability 13 βœ…
Storage 10 βœ…

βš™οΈ Configuration

Environment Variables (Production)

Backend (backend/.env):

ENVIRONMENT=production
PORT=8000
INFLUX_URL=https://us-east-1-1.aws.cloud2.influxdata.com
INFLUX_TOKEN=<your-influxdb-token>
INFLUX_ORG=<your-org-id>
INFLUX_BUCKET=sensor_data

Frontend (Vercel Dashboard or local .env):

VITE_API_URL=https://predictive-maintenance-uhlb.onrender.com

Docker Compose Services (Local Development)

Service Port Description
backend 8000 FastAPI application
frontend 5173 React dashboard (nginx, production build)

All services have restart: unless-stopped for resilience.


πŸ“– Engineering Decisions

Key architectural decisions are documented in ENGINEERING_LOG.md:

  • Phase 4: NaN for cold-start windows (prevents false zeros)
  • Phase 6: Inverted sigmoid for anomaly score semantics
  • Phase 7: Deterministic health formula with named thresholds
  • Phase 8: Epsilon rule for practical significance
  • Phase 9: Pure renderer pattern (frontend displays, backend computes)
  • Phase 10: Snapshot rule for auditable reports; 5-page Industrial Certificate
  • Phase 11: Dual deployment (Docker + systemd)
  • Phase 13: Operator Log feature with InfluxDB persistence; role-specialized reports
  • Phase 14: 100Hz high-frequency pipeline with server-side aggregation; event engine state machine
  • Phase 15: Batch ML retraining β€” 16-D features from 100Hz windows; JITTER fault type; F1=99.6%
  • Phase 16: Temporal anchoring β€” 60s right-anchored sliding window, fixed Y-axis domains, multi-signal chart
  • Phase 17: Noise suppression β€” 25% tolerance, majority-rules aggregation (β‰₯15/100), 2s event debounce
  • Phase 18: Cloud recovery β€” lazy-loaded ML imports to prevent Render 503, /ping endpoint, from __future__ import annotations for deferred type evaluation
  • Phase 19: Baseline benchmarking on status cards, deep system purge (/system/purge), report refinement (real anomaly scores, sanitized operator logs)
  • Phase 20: Cumulative Degradation Index (DI) engine with dead-zone (HEALTHY_FLOOR=0.65), sensitivity tuning (SENSITIVITY_CONSTANT=0.005), DI hydration from InfluxDB, purge DI-reset, CORS hardening, report enrichment with DI/Damage-Rate/RUL
  • Scoring: Batch-feature inference (primary) with legacy model fallback

πŸ›‘οΈ Production Deployment

Docker

docker-compose up -d

Systemd (Linux)

sudo ./scripts/setup_linux.sh
sudo systemctl status predictive-maintenance

Resilience features:

  • Docker: restart: unless-stopped
  • Systemd: Restart=always, RestartSec=5
  • Health checks on all services

πŸ“œ License

This project is for educational and demonstration purposes.


🀝 Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing)
  3. Commit changes (git commit -m 'feat: add amazing feature')
  4. Push to branch (git push origin feature/amazing)
  5. Open a Pull Request

Built with ❀️ for Industrial IoT

Releases

No releases published

Packages

 
 
 

Contributors