Sunday, May 10, 2026
banner
Top Selling Multipurpose WP Theme

This submit is cowritten with Thomas Voss and Bernhard Hersberger from Hapag-Lloyd.

Hapag-Lloyd is likely one of the world’s main delivery corporations with greater than 308 fashionable vessels, 11.9 million TEUs (twenty-foot equal models) transported per 12 months, and 16,700 motivated workers in additional than 400 workplaces in 139 international locations. They join continents, companies, and other people by way of dependable container transportation providers on the foremost commerce routes throughout the globe.

On this submit, we share how Hapag-Lloyd developed and carried out a machine studying (ML)-powered assistant predicting vessel arrival and departure occasions that revolutionizes their schedule planning. By utilizing Amazon SageMaker AI and implementing strong MLOps practices, Hapag-Lloyd has enhanced its schedule reliability—a key efficiency indicator within the trade and high quality promise to their prospects.

For Hapag-Lloyd, correct vessel schedule predictions are essential for sustaining schedule reliability, the place schedule reliability is outlined as share of vessels arriving inside 1 calendar day (earlier or later) of their estimated arrival time, communicated round 3 to 4 weeks earlier than arrival.

Previous to growing the brand new ML answer, Hapag-Lloyd relied on easy rule-based and statistical calculations, primarily based on historic transit patterns for vessel schedule predictions. Whereas this statistical methodology offered fundamental predictions, it couldn’t successfully account for real-time situations similar to port congestion, requiring vital handbook intervention from operations groups.

Creating a brand new ML answer to exchange the present system offered a number of key challenges:

  • Dynamic delivery situations – The estimated time of arrival (ETA) prediction mannequin must account for quite a few variables that have an effect on journey period, together with climate situations, port-related delays similar to congestion, labor strikes, and surprising occasions that drive route adjustments. For instance, when the Suez Canal was blocked by the Ever Given container ship in March 2021, vessels needed to be rerouted round Africa, including roughly 10 days to their journey occasions.
  • Information integration at scale – The event of correct fashions requires integration of enormous volumes of historic voyage information with exterior real-time information sources together with port congestion info and vessel place monitoring (AIS). The answer must scale throughout 120 vessel providers or traces and 1,200 distinctive port-to-port routes.
  • Sturdy MLOps infrastructure – A strong MLOps infrastructure is required to repeatedly monitor mannequin efficiency and shortly deploy updates at any time when wanted. This consists of capabilities for normal mannequin retraining to adapt to altering patterns, complete efficiency monitoring, and sustaining real-time inference capabilities for instant schedule changes.

Hapag-Llyod’s earlier method to schedule planning couldn’t successfully tackle these challenges. A complete answer that would deal with each the complexity of vessel schedule prediction and supply the infrastructure wanted to maintain ML operations at international scale was wanted.

The Hapag-Lloyd community consists of over 308 vessels and lots of extra accomplice vessels that repeatedly circumnavigate the globe on predefined service routes, leading to greater than 3,500 port arrivals monthly. Every vessel operates on a hard and fast service line, making common spherical journeys between a sequence of ports. As an illustration, a vessel may repeatedly sail a route from Southampton to Le Havre, Rotterdam, Hamburg, New York, and Philadelphia earlier than beginning the cycle once more. For every port arrival, an ETA have to be offered a number of weeks prematurely to rearrange crucial logistics, together with berth home windows at ports and onward transportation of containers by sea, land or air transport. The next desk reveals an instance the place a vessel travels from Southampton to New York by way of Le Havre, Rotterdam, and Hamburg. The vessel’s time till arrival on the New York port will be calculated because the sum of ocean to port time to Southampton, and the respective berth occasions and port-to-port occasions for the intermediate ports known as whereas crusing to New York. If this vessel encounters a delay in Rotterdam, it impacts its arrival in Hamburg and cascades by way of your entire schedule, impacting arrivals in New York and past as proven within the following desk. This ripple impact can disrupt fastidiously deliberate transshipment connections and require intensive replanning of downstream operations.

Port Terminal name Scheduled arrival Scheduled departure
SOUTHAMPTON 1 2025-07-29 07:00 2025-07-29 21:00
LE HAVRE 2 2025-07-30 16:00 2025-07-31 16:00
ROTTERDAM 3 2025-08-03 18:00 2025-08-05 03:00
HAMBURG 4 2025-08-07 07:00 2025-08-08 07:00
NEW YORK 5 2025-08-18 13:00 2025-08-21 13:00
PHILADELPHIA 6 2025-08-22 06:00 2025-08-24 16:30
SOUTHAMPTON 7 2025-09-01 08:00 2025-09-02 20:00

When a vessel departs Rotterdam with a delay, new ETAs have to be calculated for the remaining ports. For Hamburg, we solely have to estimate the remaining crusing time from the vessel’s present place. Nevertheless, for subsequent ports like New York, the prediction requires a number of elements: the remaining crusing time to Hamburg, the period of port operations in Hamburg, and the crusing time from Hamburg to New York.

Resolution overview

As an enter to the vessel ETA prediction, we course of the next two information sources:

  • Hapag-Lloyd’s inner information, which is saved in a knowledge lake. This consists of detailed vessel schedules and routes, port and terminal efficiency info, real-time port congestion and ready occasions, and vessel traits datasets. This information is ready for mannequin coaching utilizing AWS Glue jobs.
  • Computerized Identification System (AIS) information, which offers streaming updates on the vessel actions. This AIS information ingestion is batched each 20 minutes utilizing AWS Lambda and consists of essential info similar to latitude, longitude, pace, and path of vessels. New batches are processed utilizing AWS Glue and Iceberg to replace the present AIS database—at present holding round 35 million observations.

These information sources are mixed to create coaching datasets for the ML fashions. We fastidiously think about the timing of accessible information by way of temporal splitting to keep away from information leakage. Information leakage happens when utilizing info that wouldn’t be accessible at prediction time in the actual world. For instance, when coaching a mannequin to foretell arrival time in Hamburg for a vessel at present in Rotterdam, we are able to’t use precise transit occasions that have been solely identified after the vessel reached Hamburg.

A vessel’s journey will be divided into completely different legs, which led us to develop a multi-step answer utilizing specialised ML fashions for every leg, that are orchestrated as hierarchical fashions to retrieve the general ETA:

  • The Ocean to Port (O2P) mannequin predicts the time wanted for a vessel to succeed in its subsequent port from its present place at sea. The mannequin makes use of options similar to remaining distance to vacation spot, vessel pace, journey progress metrics, port congestion information, and historic sea leg durations.
  • The Port to Port (P2P) mannequin forecasts crusing time between any two ports for a given date, contemplating key options similar to ocean distance between ports, current transit time developments, climate, and seasonal patterns.
  • The Berth Time mannequin estimates how lengthy a vessel will spend at port. The mannequin makes use of vessel traits (similar to tonnage and cargo capability), deliberate container load, and historic port efficiency.
  • The Mixed mannequin takes as enter the predictions from the O2P, P2P, and Berth Time fashions, together with the unique schedule. Relatively than predicting absolute arrival occasions, it computes the anticipated deviation from the unique schedule by studying patterns in historic prediction accuracy and particular voyage situations. These computed deviations are then used to replace ETAs for the upcoming ports in a vessel’s schedule.

All 4 fashions are skilled utilizing the XGBoost algorithm constructed into SageMaker, chosen for its skill to deal with advanced relationships in tabular information and its strong efficiency with blended numerical and categorical options. Every mannequin has a devoted coaching pipeline in SageMaker Pipelines, dealing with information preprocessing steps and mannequin coaching. The next diagram reveals the information processing pipeline, which generates the enter datasets for ML coaching.

Amazon SageMaker Pipeline for data processing

For example, this diagram reveals the coaching pipeline of the Berth mannequin. The steps within the SageMaker coaching pipelines of the Berth, P2P, O2P, and Mixed fashions are an identical. Subsequently, the coaching pipeline is carried out as soon as as a blueprint and re-used throughout the opposite fashions, enabling a quick turn-around time of the implementation.

Amazon SageMaker Pipeline for berth model training

As a result of the Mixed mannequin is determined by outputs from the opposite three specialised fashions, we use AWS Step Features to orchestrate the SageMaker pipelines for coaching. This helps make sure that the person fashions are up to date within the appropriate sequence and maintains prediction consistency throughout the system. The orchestration of the coaching pipelines is proven within the following pipeline structure.

ETA model orchestration
The person workflow begins with a knowledge processing pipeline that prepares the enter information (vessel schedules, AIS information, port congestion, and port efficiency metrics) and splits it into devoted datasets. This feeds into three parallel SageMaker coaching pipelines for our base fashions (O2P, P2P, and Berth), every following a standardized technique of characteristic encoding, hyperparameter optimization, mannequin analysis, and registration utilizing SageMaker Processing and hyperparameter turning jobs and SageMaker Mannequin Registry. After coaching, every base mannequin runs a SageMaker batch rework job to generate predictions that function enter options for the mixed mannequin coaching. The efficiency of the newest Mixed mannequin model is examined on the final 3 months of information with identified ETAs, and efficiency metrics (R², imply absolute error (MAE)) are computed. If the mannequin’s efficiency is beneath a set MAE threshold, your entire coaching course of fails and the mannequin model is robotically discarded, stopping the deployment of fashions that don’t meet the minimal efficiency threshold.

All 4 fashions are versioned and saved as separate mannequin bundle teams within the SageMaker Mannequin Registry, enabling systematic model management and deployment. This orchestrated method helps make sure that our fashions are skilled within the appropriate sequence utilizing parallel processing, leading to an environment friendly and maintainable coaching course of.The hierarchical mannequin method helps additional make sure that a level of explainability similar to the present statistical and rule-based answer is maintained—avoiding ML black field conduct. For instance, it turns into attainable to focus on unusually lengthy berthing time predictions when discussing predictions outcomes with enterprise specialists. This helps improve transparency and construct belief, which in flip will increase acceptance throughout the firm.

Inference answer walkthrough

The inference infrastructure implements a hybrid method combining batch processing with real-time API capabilities as proven in Determine 5. As a result of most information sources replace every day and require intensive preprocessing, the core predictions are generated by way of nightly batch inference runs. These pre-computed predictions are complemented by a real-time API that implements enterprise logic for schedule adjustments and ETA updates.

  1. Each day batch Inference:
    • Amazon EventBridge triggers a Step Features workflow day by day.
    • The Step Features workflow orchestrates the information and inference course of:
      • Lambda copies inner Hapag-Lloyd information from the information lake to Amazon Easy Storage Service (Amazon S3).
      • AWS Glue jobs mix the completely different information sources and put together inference inputs
      • SageMaker inference executes in sequence:
        • Fallback predictions are computed from historic averages and written to Amazon Relational Database Service (Amazon RDS). Fallback predictions are utilized in case of lacking information or a downstream inference failure.
        • Preprocessing information for the 4 specialised ML fashions.
        • O2P, P2P, and Berth mannequin batch transforms.
        • The Mixed mannequin batch rework generates ultimate ETA predictions, that are written to Amazon RDS.
        • Enter options and output recordsdata are saved in Amazon S3 for analytics and monitoring.
    • For operational reliability, any failures within the inference pipeline set off instant e mail notifications to the on-call operations group by way of Amazon Easy Electronic mail Service (Amazon SES).
  2. Actual-time API:
    • Amazon API Gateway receives consumer requests containing the present schedule and a sign for which vessel-port combos an ETA replace is required. By receiving the present schedule by way of the consumer request, we are able to handle intraday schedule updates whereas doing every day batch rework updates.
    • The API Gateway triggers a Lambda perform calculating the response. The Lambda perform constructs the response by linking the ETA predictions (saved in Amazon RDS) with the present schedule utilizing customized enterprise logic, in order that we are able to handle short-term schedule adjustments unknown at inference time. Typical examples of short-term schedule adjustments are port omissions (for instance, resulting from port congestion) and one-time port calls.

This structure allows millisecond response occasions to customized requests whereas attaining a 99.5% availability (a most 3.5 hours downtime monthly).

Inference architecture

Conclusion

Hapag Lloyd’s ML powered vessel scheduling assistant outperforms the present answer in each accuracy and response time. Typical API response occasions are within the order of tons of of milliseconds, serving to to make sure a real-time person expertise and outperforming the present answer by greater than 80%. Low response occasions are essential as a result of, along with absolutely automated schedule updates, enterprise specialists require low response occasions to work with the schedule assistant interactively. By way of accuracy, the MAE of the ML-powered ETA predictions outperform the present answer by roughly 12%, which interprets into climbing by two positions within the worldwide rating of schedule reliability on common. This is likely one of the key efficiency metrics in liner delivery, and this can be a vital enchancment throughout the trade.

To be taught extra about architecting and governing ML workloads at scale on AWS, see the AWS weblog submit Governing the ML lifecycle at scale, Half 1: A framework for architecting ML workloads utilizing Amazon SageMaker and the accompanying AWS workshop AWS Multi-Account Data & ML Governance Workshop.

Acknowledgement

We acknowledge the numerous and useful work of Michal Papaj and Piotr Zielinski from Hapag-Lloyd within the information science and information engineering areas of the challenge.

Concerning the authors

Thomas Voss
Thomas Voss works at Hapag-Lloyd as a knowledge scientist. Together with his background in academia and logistics, he takes delight in leveraging information science experience to drive enterprise innovation and progress by way of the sensible design and modeling of AI options.

Bernhard Hersberger
Bernhard Hersberger works as a knowledge scientist at Hapag-Lloyd, the place he heads the AI Hub group in Hamburg. He’s captivated with integrating AI options throughout the corporate, taking complete duty from figuring out enterprise points to deploying and scaling AI options worldwide.

Gabija Pasiunaite
At AWS, Gabija Pasiunaite was a Machine Studying Engineer at AWS Skilled Companies primarily based in Zurich. She specialised in constructing scalable ML and information options for AWS Enterprise prospects, combining experience in information engineering, ML automation and cloud infrastructure. Gabija has contributed to the AWS MLOps Framework utilized by AWS prospects globally. Outdoors work, Gabija enjoys exploring new locations and staying energetic by way of mountaineering, snowboarding, and working.

Jean-Michel Lourier
Jean-Michel Lourier is a Senior Information Scientist inside AWS Skilled Companies. He leads groups implementing information pushed functions facet by facet with AWS prospects to generate enterprise worth out of their information. He’s obsessed with diving into tech and studying about AI, machine studying, and their enterprise functions. He’s additionally an enthusiastic bicycle owner.

Mousam Majhi
Mousam Majhi is a Senior ProServe Cloud Architect specializing in Information & AI inside AWS Skilled Companies. He works with Manufacturing and Journey, Transportation & Logistics prospects in DACH to attain their enterprise outcomes by leveraging information and AI powered options. Outdoors of labor, Mousam enjoys mountaineering within the Bavarian Alps.

banner
Top Selling Multipurpose WP Theme

Converter

Top Selling Multipurpose WP Theme

Newsletter

Subscribe my Newsletter for new blog posts, tips & new photos. Let's stay updated!

banner
Top Selling Multipurpose WP Theme

Leave a Comment

banner
Top Selling Multipurpose WP Theme

Latest

Best selling

22000,00 $
16000,00 $
6500,00 $

Top rated

6500,00 $
22000,00 $
900000,00 $

Products

Knowledge Unleashed
Knowledge Unleashed

Welcome to Ivugangingo!

At Ivugangingo, we're passionate about delivering insightful content that empowers and informs our readers across a spectrum of crucial topics. Whether you're delving into the world of insurance, navigating the complexities of cryptocurrency, or seeking wellness tips in health and fitness, we've got you covered.