Note: when cargo goes from Shanghai to Minsk, the dispatcher sees a point on the map. That's not enough: customs delays, weather conditions, traffic jams, non-standard routes — dozens of factors break the plan. For example, a sea container from Shanghai can sit at customs for up to two days without notifying the warehouse. We integrate data from the EAIS FTS and warn about status changes in advance.
We build a Track & Trace system based on machine learning that not only shows "where" but answers "when it will arrive" with 90% probability and "what could go wrong" — even before the problem occurs. Over the years, we have implemented 15+ transport monitoring projects for logistics operators and retailers. One client — a hypermarket chain — reduced downtime by 40% and saved $200,000 per year after implementation. This article covers the architecture, models, and specific tools we use for predictive analytics in freight.
ML-Powered Track & Trace with ETA Prediction for Freight
Monitoring System Architecture
Location data sources:
| Source | Accuracy | Frequency | Scenario |
|---|---|---|---|
| GPS tracker on vehicle | 3–10 m | 30 sec–5 min | Road freight |
| AIS (maritime vessels) | 100–200 m | 2–10 min | Sea transport |
| RFID on container | Control zones | On passage | Port operations |
| Carrier API (DHL, FedEx) | Scan points | On events | Courier shipments |
| Railway EDI (RZD ETRAN) | Station | On arrival | Rail transport |
Integration layer:
- Apache Kafka: receiving events from all sources into a single bus
- Stream processing (Flink/Spark Streaming): enriching events with geo-data
- PostgreSQL + TimescaleDB: storing time-series tracks
How ML Predicts ETA with Hour Accuracy?
Accurate ETA is a key value for the recipient and the warehouse (preparation for reception). Our ETA model provides a prediction 3 times more accurate than standard tracking systems: MAE 0.8–2.5 hours vs typical 3–6 hours. Compare: traditional tracking systems show "in transit" status but do not predict arrival. Our model gives a prediction with 90% probability — 3 times more accurate. This is like predicting arrival within an hour instead of half a day.
For forecasting we use LightGBM with quantile regression. Features for the ETA model:
- Current location + distance to destination
- Historical lead time of this carrier on this leg
- Day of week / holidays / season
- Current road congestion (Yandex.Maps API, HERE Traffic)
- Weather along the route (OpenWeatherMap)
- Border/customs status (historical delays)
- Cargo type (priority / standard)
import lightgbm as lgb import pandas as pd import numpy as np class ETAPredictor: def __init__(self): self.model = lgb.LGBMRegressor( n_estimators=500, learning_rate=0.03, num_leaves=64, objective='quantile', alpha=0.9 ) def predict_eta(self, shipment_features): """Returns P50 and P90 ETA in hours from current moment""" X = self._prepare_features(shipment_features) eta_p90 = self.model.predict(X)[0] eta_p50 = self.median_model.predict(X)[0] return { 'expected_hours': eta_p50, 'latest_hours': eta_p90, 'confidence_interval': (eta_p50 - 2, eta_p90) } For experiment management and model versioning we use MLflow. Models are wrapped in Docker containers and deployed via Kubernetes on GPU nodes for low latency (p99 < 50 ms).
Why Anomaly Detection is Critical?
Standard tracking shows a point on the map but does not classify the cause of a stop. Our ML model determines whether the stop is planned (e.g., driver rest) or critical (breakdown, theft). Anomalous deviations from the route — overloading or unauthorized diversion — are also detected automatically.
Anomalies in track:
- Stop in atypical location >30 min → alert (breakdown? theft? driver rest?)
- Deviation from planned route >5 km
- Signal loss >2 hours (out of coverage or tracker removed)
- Exceeded permissible temperature (reefer) — integration with sensor
ML incident classifier: Isolation Forest on movement patterns → anomalous track → categorization: planned stop, unplanned stop in city, overload, critical anomaly.
How Automatic Alerts Prevent Downtime?
The client sees tracking themselves, but more important are automatic notifications:
- "Your cargo will be delayed by 4 hours" — 3 hours before estimated arrival
- "Unusual route" — when the driver deviates
- "Arrival in 2 hours" — for the warehouse: prepare documents and personnel
Channels: SMS, Email, Telegram bot, webhook into the client's ERP.
System Implementation in 4 Steps
- Integration of data sources (GPS, AIS, carrier APIs) via Kafka.
- Development of ETA model using LightGBM with quantile regression.
- Setup of anomaly detection (Isolation Forest) and incident classification.
- Deployment of alerts (Telegram, SMS, webhook) and dashboard.
Integration with Customs and Documents
- EAIS FTS: customs clearance status by declaration number
- Electronic transport waybill (ETrN) — statuses via GIS EPD
- Certificates and permits: alert when ATP/ECMT validity expires in transit
What is Included in the Work
| Stage | Result |
|---|---|
| Analysis | Integration scheme, model specification, data requirements |
| Development | Server side (Python, Kafka, ML), client interface |
| Testing | Load testing (1000+ events/sec), unit tests of models |
| Deployment | Documentation (API, administration), operator training, 1-month support |
Timelines and Cost
Basic system with tracking and alerts — from 2 months. Full solution with ETA model and customs integration — up to 4 months. Cost is calculated individually after analyzing your data and requirements. Average savings per route amount to $10,000–$15,000 due to reduced downtime and fines. Typical payback period is 6–12 months. We will assess your project in 1 day — contact us for a consultation.
Our engineers have 10+ years of experience in ML and logistics, 20+ successful projects in CIS and Europe. We guarantee quality at every stage. Get a consultation — we will show how your logistics becomes more transparent. Order a turnkey cargo tracking system development.







