Shipper & Receiver Facility Dwell Time Risk Scoring via Gradient Boosted Trees | Strong Tower Consulting
Detention Modeling

Shipper & Receiver Facility Dwell Time Risk Scoring via Gradient Boosted Trees

Predictive dwell time modeling using historical geofence entry/exit pings, commodity codes, and appointment windows to price detention upfront.

Detention continues to be one of the most volatile and poorly priced components of motor carrier profitability. Traditional approaches rely on flat hourly rates after two hours free time or simple business-rule thresholds. These methods ignore the massive variance that exists across individual shipper and receiver facilities, days of week, commodity types, and appointment compliance. Strong Tower Consulting has developed production-grade predictive models that score the detention risk of every facility using gradient boosted trees (XGBoost) trained on telematics breadcrumb clusters, historical load events, and operational context.

Why Facility-Level Dwell Time Modeling Matters

Analysis of millions of geofence entry and exit events across North American freight lanes shows that 80 percent of detention variance is explained by the specific facility rather than the carrier, driver, or lane. A distribution center in Joliet, Illinois may average 47 minutes of dwell on Tuesdays but 4.8 hours on Fridays. A food-grade plant in rural Pennsylvania may consistently turn trucks in under 90 minutes when the appointment window is honored but generate 6+ hour dwells when the carrier arrives 15 minutes late. These patterns are invisible to rule-based systems but are readily learned by properly engineered tree ensembles.

Data Foundation and Feature Engineering

The foundation of the model is a clean SQL schema that joins telematics pings, EDI 214 status messages, EDI 204 load tenders, driver settlement records, and facility master data. Key feature groups include:

  • Telematics breadcrumb clusters: Historical dwell distributions calculated from geofence entry/exit pairs at each facility, segmented by hour of day and day of week.
  • Facility load curves: Rolling 30-day and 90-day average dwell times by facility, normalized by season and day-of-week.
  • Commodity and equipment features: NMFC commodity class, temperature-controlled vs dry van, hazmat flags, and load type (live load vs drop).
  • Appointment compliance: Minutes early or late relative to the scheduled window extracted from the EDI 204 and validated against actual arrival pings.
  • External context: Weather, port congestion indices, and known construction events near the facility.

These features are engineered inside the carrier's existing TMS (Truckmate, McLeod, or TMW) using SQL Server or PostgreSQL stored procedures. The resulting training table contains one row per historical load with the target variable defined as total dwell minutes beyond free time.

Sample Feature Set for XGBoost Dwell Time Model
Feature Type Description Importance Rank (typical)
facility_dwell_90d_mean_dow numeric 90-day mean dwell for this facility on this day-of-week 1
appointment_deviation_minutes numeric Minutes from scheduled window (negative = early) 2
commodity_class categorical NMFC class or product category code 3
breadcrumbs_last_30d_count numeric Number of observed dwells at this facility in last 30 days 4
is_live_load boolean Whether the load requires live loading/unloading 5
hour_of_arrival categorical Hour of planned arrival (0-23) 6
weather_precipitation_in numeric Inches of precipitation forecast for arrival day 9

Model Training and Risk Scoring

We train an XGBoost regressor to predict total detention minutes, then convert the point prediction and its uncertainty into a risk tier (Low, Medium, High, Extreme). The model is retrained monthly on a rolling window of the most recent 24 months of data to capture changes in facility behavior, staffing, or process improvements. SHAP values are used to explain each prediction back to operations teams so they understand why a particular facility received an Extreme risk score on a given day.

The output risk score is written back to the carrier's rate matrix and load record. When a new EDI 204 arrives, the system instantly calculates the expected detention exposure and either:

  • Applies an appropriate dynamic accessorial surcharge, or
  • Rejects the load if the risk-adjusted margin falls below the carrier's threshold.

Integration with Carrier Systems

The complete solution integrates with existing TMS platforms through SQL views and stored procedures. For carriers running McLeod, TMW, or Truckmate, we create a dedicated detention_risk_score table that is joined to the load and order tables. The Exspeedite platform (a sister company under common ownership with Strong Tower Consulting) can surface these scores in real time through its API layer without requiring the carrier to purchase additional software licenses.

Driver settlement records are also updated automatically. When a high-risk facility generates detention that was already priced into the rate, the driver receives the full accessorial without manual dispute processing. This reduces driver turnover and improves fuel surcharge and detention recovery rates.

Business Impact

Carriers who have deployed this architecture report detention recovery rates increasing from the industry average of 38 percent to over 76 percent. More importantly, they avoid loading high-risk facilities without proper compensation, which protects both driver hours-of-service compliance and equipment utilization. The model also provides actionable intelligence to sales teams negotiating annual contracts with shippers that have chronically high dwell facilities.

Frequently Asked Questions

How does XGBoost improve detention risk scoring compared to traditional rule-based methods?

XGBoost captures complex non-linear interactions between features such as facility-specific load curves, day-of-week effects, commodity type, appointment window compliance, and historical dwell distributions. Traditional rule-based systems cannot model these interactions at scale, resulting in under-priced or over-priced detention accessorials.

What data sources are required to build a facility dwell time risk model?

The model is trained on historical telematics breadcrumb data (geofence entry and exit pings), EDI 214 status updates, commodity codes from the EDI 204, appointment windows, driver ELD logs, facility business hours, and weather data. SQL schemas in Truckmate, McLeod, or TMW provide the backbone for feature engineering.

How can carriers use dwell time risk scores in rate matrices?

Risk scores are converted into dynamic detention surcharges that are automatically applied at load tender acceptance. The carrier-rate-matrix-optimization practice integrates these scores into the pricing engine so that high-risk facilities automatically generate higher accessorial rates or stricter appointment requirements.

Can this model be deployed inside an existing TMS?

Yes. The trained XGBoost model can be exported to ONNX or PMML format and called from within Truckmate, McLeod, or TMW via stored procedures or through the Exspeedite integration layer. Strong Tower Consulting provides the architecture and implementation guidance.

Next Steps

Strong Tower Consulting, LLC and Exspeedite LLC are separately organized sister companies under common ownership. Founded in Minnesota in 2008 by Scott Elliott, we have spent more than 18 years helping motor carriers turn their operational data into better pricing, capacity, and profitability decisions. Our only product is better decisions.

If your organization struggles with unpredictable detention, inconsistent accessorial recovery, or driver frustration over unpaid wait time, we can perform a rapid assessment of your current TMS data model and telematics integration to determine the feasibility and expected ROI of a facility-level dwell time risk scoring engine.

Contact us today to schedule a no-obligation technical assessment.

Get a Systems Assessment or call 763-244-1373.