RouteNexa AI: Autonomous Freight Intelligence & Cyber-Physical Supply Chain Digital Twin

An enterprise-grade logistics intelligence platform integrating spatiotemporal machine learning, multi-objective Pareto routing, and an interactive 3D WebGL digital twin to mitigate freight disruptions, minimize cold-chain spoilage, and abate carbon emissions.


💡 Inspiration

In modern Fast-Moving Consumer Goods (FMCG) and perishable confectionery logistics, supply chains operate on razor-thin margins and strict delivery windows. A single transit delay doesn't just trigger contractual Service Level Agreement (SLA) penalties—it risks catastrophic product spoilage due to thermal sensitivity.

Traditional logistics platforms are largely reactive: they display 2D GPS breadcrumbs after a truck is already stuck in transit, relying on static distance formulas that ignore weather, carrier tier, seasonality, and temperature vulnerability. We were inspired to build RouteNexa AI to shift logistics from reactive tracking to predictive and prescriptive intelligence—forecasting delivery delays, detecting invoice and freight anomalies, and calculating Pareto-optimal dispatches before the cargo leaves the manufacturing plant.


🚀 What It Does

RouteNexa AI is an autonomous, full-stack logistics command center powered by a decoupled machine learning pipeline and a real-time 3D digital twin:

  • Predictive ETA Forecasting: Continuously predicts exact operational transit times with an operational Mean Absolute Error of 0.892 days (R² = 0.638), with over 84.5% of deliveries predicted within ±2 calendar days.
  • Proactive SLA Disruption Detection: A cost-sensitive classifier predicting delay risks with a high sensitivity 71.4% recall, alerting dispatchers to at-risk consignments well in advance.
  • Unsupervised Freight Anomaly Sentry: An Isolation Forest surveillance engine that monitors multi-dimensional freight vectors, automatically isolating 203 operational anomalies (such as tariff invoice spikes and severe transit deviations).
  • Multi-Objective Pareto Routing: Computes the optimal shipping mode and corridor by simultaneously minimizing transit time, freight expenditure, greenhouse gas emissions (kg CO2e via the GLEC framework), and thermal perishability risk.
  • 3D Cyber-Physical Digital Twin: A hardware-accelerated 3D WebGL globe visualizing national freight corridors, Great-Circle flight trajectories, and live delivery dispatches with sub-millisecond state updates.
  • Natural-Language AI Logistics Assistant: A safe, zero-hallucination conversational interface that translates natural-language operator questions into verified SQL telemetry and KPI summaries.

🛠️ How We Built It

We engineered RouteNexa AI from the ground up as a decoupled, four-tier cyber-physical architecture:

1. Data Governance & Empirical Cohort Anchoring

We trained and calibrated our models on the enterprise Nassau Candy Distributor dataset (10,194 shipments across 196 freight corridors and 5 primary manufacturing hubs: Hicksville NY, Dallas TX, Livonia MI, Carol Stream IL, and Port Washington NY).

When auditing the raw dataset, we uncovered an artificial multi-year temporal shift (904 to 1,634 days). Rather than discarding data, we developed Empirical Same Day Cohort Anchoring:

  • Shift Calculation: Shift (Δc) = Minimum Raw Lead Time among Same Day orders in Cohort
  • Operational Calibration: True Lead Time = Raw Lead Time - Shift (Δc)

This non-destructive calibration recovered the true operational lead times (0 to 11 days, mean: 4.29 days) with zero negative lead times across all 10,194 records.

2. Machine Learning Core

  • ETA Regressor: Tuned RandomForestRegressor (100 estimators, max depth 12) minimizing Mean Squared Error on scaled categorical and spatial features.
  • Delay Classifier: RandomForestClassifier with balanced class weighting optimizing the F1 decision threshold for high recall.
  • Anomaly Detector: Unsupervised IsolationForest (contamination rate = 0.02) isolating outliers through randomized path length partitioning.
  • Time-Series Forecaster: 14-day rolling shipment demand projection with 95% confidence bounds (100% backtest interval coverage).

3. Prescriptive Multi-Objective Optimization

Freight routes are evaluated over a multigraph using a scalarized Pareto cost function that balances four real-world parameters:

  • Total Cost = (α × Transit Time) + (β × Freight Expense) + (γ × Carbon Emissions) + (δ × Thermal Perishability Risk)
  • Carbon emissions are calculated using the Global Logistics Emissions Council (GLEC) standard (0.062 kg CO2 / ton-km for road freight).
  • Perishability risk models confectionery meltage hazard based on ambient temperature exposure over time.

4. Full-Stack & 3D Kinematics

  • Backend: Python 3.9/3.11 with FastAPI, Uvicorn, and SQLAlchemy 2.0 over SQLite (routenexa.db).
  • Frontend: React 19, TypeScript, and Tailwind CSS.
  • 3D Digital Twin: Three.js and WebGL, projecting Great-Circle paths via Spherical Linear Interpolation (Slerp) with dynamic parabolic elevation curves for realistic flight and ground transport arcs.

🧗 Challenges We Ran Into

  1. The Artificial Date Shift Anomaly: Real enterprise datasets are messy. Discovering that raw timestamps spanned disconnected multi-year jumps was a significant hurdle. Resolving this required developing a statistically verified cohort calibration rule rather than arbitrary heuristic clipping.
  2. Preventing Data Leakage: In logistics prediction, post-shipment attributes (e.g., actual ship dates, carrier check-in times) frequently leak into training features. We enforced strict schema boundaries so models only consume information available at order placement time.
  3. Event-Driven Reactivity with 3D Rendering: Keeping a 60 FPS WebGL canvas synchronized with live REST dispatches without UI freezes required asynchronous state bridges and reactive event broadcasting (routenexa:order-updated).

🏆 Accomplishments That We're Proud Of

  • Zero-Defect Data Governance: Successfully validated and normalized all 10,194 shipments with 100% schema compliance and zero dropped records.
  • High Predictive Accuracy: Achieving an operational MAE of 0.892 days on shipment ETAs and 71.4% recall on SLA delay detection.
  • Full Academic Paper: Formulated and authored a comprehensive, publication-grade IEEE research paper manuscript (RouteNexa_AI_Research_Paper.pdf) documenting the entire mathematical formulation, ablation studies, and system architecture.
  • Real-Time Integration: Creating an end-to-end user experience where creating an order immediately updates KPIs, machine learning inferences, and 3D globe trajectories.

📚 What We Learned

  • Data-Centric AI Over Model Chasing: Spending time understanding dataset anomalies (like the cohort shift) provided far greater accuracy gains than hyperparameter tuning alone.
  • Cyber-Physical Systems Engineering: Bridging backend data science with real-time frontend visualization taught us how to build software that operators genuinely enjoy using.
  • Academic Rigor: Formulating the mathematics behind Slerp kinematics, GLEC emissions modeling, and isolation trees deepened our understanding of the theory behind modern AI libraries.

🔮 What's Next for RouteNexa AI

  • Turn-by-Turn Dynamic Routing (OSRM): Transitioning from geodetic Haversine distances to live road-network graph traversal with real-time traffic congestion feeds.
  • IoT Cold-Chain Telematics: Ingesting live streaming temperature logger data and vehicle GPS transponders directly into the 3D twin.
  • Agentic Multi-Turn Assistant: Expanding the conversational assistant using LangChain and LangGraph for autonomous freight negotiation and supplier inventory re-ordering.

Built With

Share this project:

Updates

Submission history