Predictive Breach Detection: An Isolation Forest anomaly detector and a HistGradientBoosting-based forecaster (frost_
ml.py, trained via train_
model.py) flag abnormal temperature patterns and forecast breach risk 30 seconds ahead. The trained model is serialized once (frostguard_ml.joblib) and loaded at boot rather than retrained on every startup — keeping cold starts fast on resource-limited hosts.
Nearest-Facility Rerouting: A K-Nearest Neighbors model (scikit-learn) matches an at-risk truck's GPS position to the nearest of 16 cold-storage nodes across India, so operators get an immediate reroute recommendation rather than raw coordinates.
Cached Road Routing: Driving paths between cities are fetched from the OSRM routing engine and precomputed once (precompute_
routes.py → routes_cache.json), removing a live external API dependency from the app's boot path.
Interactive Dashboard: main_
dashboard.py, built with Streamlit, gives operators a live map, fleet metrics, alerts, and a manual failure-injection tool for demoing breach scenarios.
Optional Standalone Services:
api.py (FastAPI) and
Bridge.py (Flask) provide REST endpoints for telemetry ingestion, and
Bridge.py includes a Discord webhook integration that posts an alert when a truck goes CRITICAL — opt-in via a DISCORD_WEBHOOK environment variable. These run independently of the main dashboard and aren't required for it to function.