Heterogeneous mixture-of-experts for long-horizon vessel trajectory prediction across regional datasets
Figures
Abstract
Long-horizon vessel trajectory prediction for maritime traffic monitoring and route planning requires both a prompt response to manoeuvres and control of error accumulation. UnifiedInternalMoE combines a motion-prior residual expert with four temporal predictors in a separate checkpoint for each region and seed. Convex weights are fitted to validation predictions at 5, 10, and 60 min and interpolated to produce the complete future trajectory. A ten-seed comparison across four regions, together with capacity controls, learned gating, and internal ablations, evaluates the benefit of the heterogeneous combination and its sources. In a five-seed evaluation on an independent Finnish AIS subset, the fusion has the lowest mean average displacement error (ADE) at all six horizons, with ADE@60 of 1719.5325.80 m; it does not consistently lead in long-horizon final displacement error (FDE) or frozen source-to-target transfer. These results support the applicability of the same architecture when retrained for different regions and its use as a forecasting reference for shore-based analysis of long-horizon motion trends. Its applicability remains limited by the number of independent vessels, regional distribution differences, and computational cost.
Citation: Tan Y, Cai Y, Fan K, Li X, Qiu G (2026) Heterogeneous mixture-of-experts for long-horizon vessel trajectory prediction across regional datasets. PLoS One 21(11): e0363079. https://doi.org/10.1371/journal.pone.0363079
Editor: Jinhao Liang, National University of Singapore, SINGAPORE
Received: September 7, 2026; Accepted: November 2, 2026; Published: November 20, 2026
Copyright: © 2026 Tan et al. This is an open access article distributed under the terms of the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original author and source are credited.
Data Availability: Code, configurations, seed-level result tables, and reproduction instructions for this study are publicly available from the GitHub repository (https://github.com/yusonTan/UnifiedInternalMoE-vessel-forecasting). S1 Code provides the code snapshot and executable reproduction scripts. S1 Data provides numerical tables and experimental records. S2 Data provides paired per-window error differences, vessel-cluster codes, and random-generator seeds for reproducing the statistical comparisons. S3 Data and S4 Data jointly provide derived per-window ADE/FDE values for the 200 Finnish AIS model evaluations. These Supporting Information files support reproduction of the reported summary tables, paired intervals, and adjusted tests without redistributing raw vessel coordinates. EnvShip v2 Track B is available from the Hugging Face repository (https://huggingface.co/datasets/mark000071/envship_v2_datasets). The independent Finnish AIS dataset is publicly available from the Zenodo repository (https://doi.org/10.5281/zenodo.8112336). This study uses quality-screened records from 19–25 April 2021.
Funding: This work was supported by the National Natural Science Foundation of China (grant 52405270) and the Natural Science Foundation of Fujian Province (grant 2026J001790). The funders had no role in study design, data collection and analysis, decision to publish, or preparation of the manuscript.
Competing interests: The authors have declared that no competing interests exist.
1. Introduction
Automatic Identification System (AIS) messages provide a continuous record of vessel position, speed, and course. They underpin maritime traffic monitoring, conflict warning, and decision support for intelligent navigation. Vessel trajectory forecasting has moved beyond recurrent networks to include Transformer architectures, graph models, probabilistic generators, and physics-informed learning [1–6]. For operational use, however, low error in one waterway or at one forecast instant is not enough. A forecasting framework should retain repeatable performance across regions, traffic conditions, and horizons from 5 to 60 min. Recent velocity and turning dominate short-term prediction, whereas error accumulation, route branching, and regional traffic structure become more important at longer horizons. One inductive bias rarely captures all these mechanisms.
Long short-term memory (LSTM) and other recurrent networks model temporal dependence in vessel trajectories [7–11]. Auxiliary tasks and convolutional networks [12], hybrid temporal models [13], reference-trajectory correction [14], and marine data fusion [15] address different limitations of a single temporal backbone. Later studies incorporate spatio-temporal multi-graph relations [16]. Physics-based information has been used for vessel attitude and motion prediction [17], as well as kinematic constraints on AIS trajectories [18]. Motion-inspired Transformers [19], collision-risk priors [20], uncertainty-aware graph models [21], and diffusion models [22] extend forecasting in complex scenarios. iTransformer-FA models cross-variable relations through inverted attention and feature augmentation [23]. These approaches place different emphasis on near-term smoothness, manoeuvre response, and long-term trends. A fixed average cannot express complementarity that changes with the forecast horizon. We therefore examine whether a common architecture and validation rule can combine these modelling approaches when each regional task is trained separately and parameter fitting and model selection use training and validation data.
We use four regions from EnvShip v2 Track B [24], comprising 106,857 sample windows. The main comparison includes ten random seeds, with five-seed internal ablations and probabilistic controls, and a five-seed evaluation on independent Finnish AIS data. All methods share a 906 historical input and a 1802 future output. The experiments examine accuracy after regional training, the roles of routing and individual components, and the limits of transfer with frozen source models.
The study focuses on complementarity between modelling approaches over a long forecast horizon. Five experts share the same trajectory interface. Nonnegative weights fitted at 5, 10, and 60 min are interpolated to obtain the full prediction. The four-region, ten-seed comparison assesses overall performance; capacity controls, learned gates, and internal ablations investigate the sources of the gains. Independent AIS validation tests the same procedure on a new data source. Parameters are fitted separately for each region; the architecture and training procedure are shared.
2. The unifiedInternalMoE predictor
2.1. Problem formulation and overall architecture
For a batch of windows, the historical input is . Its six channels are local metric coordinates x and y, sine of time of day, speed over ground (SOG), and sine and cosine of course over ground (COG). The target contains 180 future two-dimensional positions. With 20-s sampling, the input spans 30 min and the output spans 60 min. Each expert produces a complete trajectory , . Long horizon here refers specifically to the maximum 60-min forecast range of EnvShip v2 Track B.
(1)At anchor horizons min, the router assigns nonnegative expert weights that sum to one. Interpolation gives weights at each future step, and the final prediction is:
(2)Fig 1 summarizes candidate generation, validation fitting, and frozen fusion.
Five frozen experts produce full-horizon candidate trajectories. Validation predictions determine the compact subset and ridge coefficient; validation results across seeds in the same region determine the short-horizon specialist override. Weights at 5, 10, and 60 min are interpolated over 180 steps. Experts, scalers, and routing states are stored in a self-contained checkpoint for each region and seed.
The term internal has a precise implementation meaning here: the routing weights and all five experts for each region–seed run are stored in one PyTorch checkpoint and loaded together for inference. No external meta-learner or second-stage model is required. Deployment still requires the checkpoint corresponding to the regional task. Region identity is not an input to the forward pass or a routing feature. The term does not imply that routing is mathematically endogenous to the experts, or that the four regions share fitted parameters.
2.2. SA-Repair motion-prior residual expert
SA-Repair (SA in equations and variant labels) learns trajectory corrections around a motion prior. Historical positions are translated to the final observation and rotated into a local frame aligned with recent displacement. A two-layer LSTM encodes the six-channel history. Projected convolutional summaries of the last 15, 30, and 90 observations are added to the encoded state and concatenated with motion descriptors. The resulting representation determines weights for CV3, CV6, CV15, and AdaptiveDCA at six horizon nodes, together with the damping time and acceleration-clipping parameters of AdaptiveDCA. CV3, CV6, and CV15 extrapolate the mean displacement between the last 3, 6, and 15 observed positions, respectively. AdaptiveDCA allows recent acceleration to decay with forecast distance. SA-Repair retains its implementation name; the branch uses LSTM and multiscale convolution and contains no global temporal self-attention.
(3)Eq (3) gives the basic relation between the prior and residual. The implementation also includes a six-node control-point correction and a separate endpoint correction. The former is linearly interpolated between nodes; the latter is released in proportion to the square of normalized forecast time. The internal router and correction branches are trained jointly with position and auxiliary motion losses. Section A in S1 Appendix specifies the architecture and loss weights. The design preserves motion continuity while allowing corrections for longer-term changes in course and speed.
2.3. Heterogeneous data-driven experts
Table 1 summarizes the inductive biases of the four data-driven experts.
Transformer-CV encodes the history with a Transformer and predicts residuals around a constant-velocity base. iTransformer-FA adapts inverted attention and feature augmentation [23], treating variables as tokens. MSTFormer adapts a motion-inspired spatio-temporal Transformer [19] to the common task. Direct-GRU directly predicts future two-dimensional positions. Every branch uses the same 906 input and 1802 output, without vessel type, weather, neighbouring vessels, or waterway information. Published methods are structurally adapted to this shared input–output specification. Each region has independently trained checkpoints; region identity is not a forward-pass input or routing feature within a checkpoint.
2.4. Validation-initialized horizon-dependent routing
Experts are first optimized on each regional training set, with checkpoints selected using the validation criteria in Table 2. Three folds grouped by Maritime Mobile Service Identity (MMSI) are then formed within that region’s published validation set. Unique MMSIs are shuffled using the seed and assigned by index modulo three, without vessel-type stratification. Two folds fit the weights and the remaining fold evaluates them. All three folds are MMSI-disjoint from the training set. Compact subset selection considers SA-Repair with at most two other experts; a short-horizon specialist override is applied subsequently. At anchor r, fitting uses the complete prediction error up to that horizon, with a ridge penalty shrinking weights towards the SA-only vertex. Expert early stopping has already used the full validation set, so these folds evaluate routing selection rather than out-of-fold performance of the entire training pipeline.
(4)Candidate subsets and ridge coefficients are selected jointly using the three-fold objective relative to SA, between-fold variability, and subset complexity. SA alone is retained if the score is not below 0.998; otherwise, the selected subset is refitted on the full validation set. The first 15 steps use the 5-min weights. Steps 16–30 and 31–180 interpolate between adjacent anchors. The formal procedure also selects a shared short-horizon specialist rule from validation results across seeds in the same region. Independent selection within each seed is reported separately as a sensitivity analysis.
(5)2.5. Theoretical properties of three-anchor convex routing
Theorem 1 (Convex-hull stability and error–disagreement decomposition). For a given regional task, let M frozen experts predict at step t. Suppose that the weights at all three anchors lie in the probability simplex , that is obtained by piecewise-linear interpolation between neighbouring anchors, and that Eq (2) defines the fused prediction. The following properties then hold for every sample and forecast step. They specialize classical mixture gating and ensemble ambiguity decomposition [25,26] to horizon-interpolated trajectory prediction. The assumptions do not involve parameter sharing or distribution transfer between regions.
(6a)Let and denote weighted disagreement between experts by . The squared displacement error has the exact decomposition:
(6b)(6c)The fused squared error is therefore no greater than the weighted mean of expert squared errors at the same step. The disagreement term is strictly positive when two experts with positive weights make different predictions. For the nonsquared displacement metrics reported here, convexity of the norm also gives:
(6d)(6e)With expert predictions and routing weights fixed, nonnegative normalized weights and their interpolation keep the prediction within the convex hull of the expert trajectories. Eq (6b) expresses the fused squared error as the weighted mean expert error minus disagreement; Eqs (6d) and (6e) give the corresponding norm bounds. These relations describe the geometry of convex fusion. The improvement in practice still depends on expert errors and validation-derived weights. Section B in S1 Appendix provides the proof.
2.6. Training, model selection, and frozen evaluation
Scalers are fitted on training data only: position scales use training histories and targets, while the remaining channels use training histories. Recurrent baselines, TCN-CV, and Transformer-CV use a Huber loss with double weight on the first 30 forecast steps, selecting checkpoints by validation ADE@60 + 2ADE@10. iTransformer-FA and MSTFormer use the adapted configurations in Table 2. SA-Repair has two training stages, both selecting checkpoints by validation ADE@60, with additional motion and endpoint losses. Inputs and evaluation are shared, while optimization budgets are recorded by architecture. Testing follows expert and router freezing. EnvShip test results were inspected during development; the independent Finnish test set was evaluated jointly only after all additional training and routing choices had been locked.
(7)3. Experimental design
3.1. Datasets and evaluation protocol
Experiments use the DMA, NOAA, Norway, and Piraeus regional datasets from EnvShip v2 Track B. Each sample contains 30 min of history and up to 60 min of future positions, corresponding to 90 and 180 steps at 20-s intervals. We retain the released training, validation, and test splits, which are disjoint at the MMSI level. All regions use the same architecture and training procedure, with parameters fitted independently. The experiments therefore test repeatability across sample sizes and motion distributions rather than zero-shot cross-region transfer. Table 3 gives window and vessel counts.
Fig 2 shows dataset scale and trajectory shapes in the four regions.
Panels show local metric shapes of 30-min histories and 60-min futures relative to the last observed position, logarithmic point density, geographic coverage, and training/validation/test sizes. Large regions use deterministic stratified sampling; all Piraeus windows are plotted.
Fig 2 illustrates differences in sample size, geographic coverage, and trajectory shape. DMA and NOAA are larger, with more dispersed course changes in NOAA. Norway mainly reflects fjord and southern coastal traffic, whereas Piraeus includes more port entry, exit, and turning manoeuvres. Track B provides local metric coordinates centred on the final historical point. Point density therefore compares trajectory shapes rather than reconstructing absolute shipping routes; latitude and longitude ranges only indicate geographic coverage.
To compare motion distributions, we separately describe realized future trajectory shapes and historical motion states. Median historical speeds are 3.20, 4.80, 6.15, and 4.04 kn for DMA, NOAA, Norway, and Piraeus, respectively. The corresponding proportions of complex future manoeuvres are 17.65%, 37.17%, 12.67%, and 63.64%. The left panels of Fig 3 describe motion over the realized 60-min future; the right panels use only observations preceding the forecast. Both groupings describe distributions and serve neither as additional model inputs nor as criteria for expert selection or routing fitting.
Left: post-hoc shape categories calculated from the realized 60-min future. Right: pre-forecast motion states calculated from historical observations only. The categories are descriptive.
Fig 3 compares these two motion distributions.
Evaluation horizons are 5, 10, 20, 30, 45, and 60 min. Average displacement error (ADE) averages displacement errors from the forecast origin through the specified horizon; final displacement error (FDE) measures error at its endpoint. Both use denormalized metric coordinates. In the equations, h is a step count: 5 and 60 min correspond to 15 and 180 steps. The four regions and the 5-, 10-, and 60-min horizons define the 12 primary ADE units. Main tables report ten-seed meanssample standard deviations (ddof = 1); five-seed additional experiments appear separately. Equal-region, window-weighted, and MMSI-weighted aggregation assess sensitivity to the choice of summary.
(8)3.2. Comparators and reproduction scope
Main tables include UnifiedInternalMoE, SA-Repair, six learned comparators, and deterministic CV15. All share the same six channels, window sets, and metric implementation. Table 4 specifies the scope of structural adaptation. A separate four-region, five-seed BLSTM-MDN control compares the conditional mean using ADE/FDE and reports negative log-likelihood (NLL), energy score, and coordinate-marginal coverage. Min-of-20 is a supplementary sampling oracle. Inputs describe the history of one vessel. Comparisons with neighbouring-vessel, weather, and chart-context models require matched information and are left for future work.
3.3. Parameter count and inference cost
The capacity control Wide-GRU has hidden width 1376 and 17.527 M parameters, 0.73% fewer than the fusion model’s 17.656 M. Width is chosen by parameter count rather than test accuracy. Other settings follow the Direct-GRU optimization procedure, so the control does not simultaneously match training computation, convergence difficulty, or latency. Timing uses an RTX 3060 Laptop GPU, DMA seed 42, FP32, and four CPU threads. After 50 warm-up iterations, three rounds of 200 iterations are timed with synchronization. Model-only forward passes and cached-window-to-metric-output processing are measured separately; raw AIS decoding and network delay are excluded. Table 5 reports costs under this common timing protocol.
3.4. Training repetitions and statistical analysis
The main comparison uses ten fixed seeds: 42, 52, 62, 72, 82, 92, 102, 112, 122, and 132. It comprises 280 backbone runs and 40 fused checkpoints. Existing runs under the same protocol are reused after verification, with provenance distinguished from new training. Internal ablations cover eight variants, four regions, and five seeds, giving 160 SA models. Probabilistic controls and independent Finnish validation also use five seeds. CV15 is deterministic and is listed separately.
For each region and metric, a comparator is selected from the seven backbone classes and CV15 using mean validation error across seeds. Error differences are defined as comparator minus fusion. We separately examine seed variation, whole-vessel MMSI resampling, and crossed seedMMSI resampling, using 10,000 resamples and a centred wild-cluster bootstrap-t test. The 12 primary ADE units form one Holm correction family; anchor FDE and other horizons form separate families. Intervals conditional on shared validation selection are interpreted for the given routing choices. Regions with few clusters also report vessel counts and influence concentration.
The macro objective J = (ADE@5/20 + ADE@10/50 + 2ADE@60/600)/4 summarizes errors on different scales and is dimensionless. The 20/50/600-m values are study-specific scaling constants. Sensitivity analyses also normalize by validation CV15 error, the best expert, and median expert error; compare horizon weights of 1:1:1 and 1:1:4; and vary regional aggregation. Rescoring fixed predictions and reselecting routing under an alternative objective are recorded separately.
3.5. Independent Finnish raw-AIS validation
Independent validation uses publicly released Finnish AIS records (DOI 10.5281/zenodo.8112336, CC BY 4.0) [27]. Before model evaluation, we fix the earliest available consecutive seven days, 19–25 April 2021. Each raw daily file is a headerless, 12-column CSV. Latitude and longitude, SOG, and COG are decoded in degrees, knots, and degrees, respectively; absolute reception timestamps are in milliseconds. Directory CRC, extracted length, and byte-level SHA-256 are checked for each of the seven downloaded daily members. Evaluation concerns quality-screened moving-vessel windows within this interval.
Of 22,082,347 records inspected, 806,418 valid records associated with 44 MMSIs overlapping EnvShip are excluded. After geographic and valid speed/course filtering, tracks are segmented at raw gaps exceeding 120 s or position jumps exceeding 40 m/s. A 20-s grid is anchored at actual received messages. History interpolation reads only messages at or before the anchor; COG is unwrapped before interpolation. Historical median SOG must be at least 1 kn and displacement at least 200 m. In the history and future separately, no more than 20% of grid points may lie more than 10 s from the nearest message. Each vessel contributes at most 24 windows selected by a fixed hash, without selection by difficulty or prediction performance.
A fixed MD5(MMSI) modulo-10 split assigns 0 to validation, 1 to test, and the remaining values to training. Training/validation/test comprise 12,560/1,561/1,461 windows from 641/81/76 vessels. Standardization is fitted on training data only. Coordinates are local east/north metric positions from a spherical equidistant approximation centred on the anchor, with Earth radius 6,371,000 m. Setting A replays frozen source models directly. Setting B trains each of seven backbone classes with five seeds under fixed configurations, giving 35 backbone runs and five fitted fusion checkpoints. The external test set is evaluated after all checkpoints, routing states, and comparator selections are frozen. This isolation of the independent test does not remove the limitations of historical development choices on EnvShip.
3.6. Ethics and data use
This study analyses publicly released vessel-motion records and involves no intervention on humans or animals. MMSI identifies a vessel; these records are not described as fully anonymized personal data. Processing follows the conditions of each source and uses only information needed for forecasting. Vessel trajectories are not used to infer personal identity or behaviour.
4. Comparative results
4.1. Four-region ten-seed results
Tables 6–9 report ADE@5, ADE@10, ADE@60, and FDE@60 for each region as ten-seed meanssample standard deviations. CV15 has deterministic values. S1 Data gives ADE/FDE at all six horizons and individual-seed results.
The equal-region macro J is 1.76000.0072. Primary ADE gains in DMA and NOAA are relatively consistent under seed and vessel resampling, whereas the 60-min Norway result and small Piraeus set show greater uncertainty. Regional tables and the macro objective present these differences together.
Fig 4 shows ADE over all six forecast horizons.
Shading represents the sample standard deviation across training seeds, not a confidence interval.
4.2. Training variation and vessel-sampling uncertainty
Table 10 reports primary ADE differences against validation-selected comparators, crossed intervals, and adjusted p-values. All six primary ADE comparisons in DMA and NOAA meet the adjusted significance criterion. Piraeus predictions at 5 and 10 min coincide with MSTFormer; the 60-min point estimate improves but has a wide interval. Norway differs little from SA-Repair at 60 min. Fig 5 shows effect sizes and uncertainty for each unit.
An interval crossing zero indicates insufficient evidence to determine the direction of improvement.
Fig 5 illustrates how uncertainty differs between regions and horizons.
4.3. Probabilistic prediction and maritime error directions
BLSTM-MDN adapts the probabilistic trajectory method in Sensors 2022 [9] to the shared input–output specification. Across four regions and five seeds, its conditional-mean error exceeds fusion in all 12 primary ADE units; ten meet Holm-adjusted p < 0.05, whereas the 60-min Norway and Piraeus comparisons do not. S1 Data provides NLL, energy score, and coordinate-marginal coverage; min-of-20 is reported separately as a sampling oracle. Energy scores for deterministic forecasts use Dirac distributions, while coverage is evaluated only for the probabilistic model.
Along-track and cross-track diagnostics project displacement errors onto the local tangent and normal of the true trajectory, separating distance and directional deviations. Historical three-seed analyses of operating conditions, error direction, and simulated missing observations are supplementary diagnostics, distinct from the ten-seed comparison. These metrics describe trajectory geometry. Evaluating collision risk and route feasibility would require synchronized neighbouring-vessel and chart information.
5. Routing, component, and cost analysis
5.1. Static and learned outer gates
Table 11 compares outer routing with the same fixed five-expert candidate set. Refitted three-anchor fusion has macro J = 1.7511, below single-vector convex fusion and uniform averaging. A GRU gate with disagreement features further reduces J to 1.7446. Static horizon weights offer a simple accuracy–complexity trade-off, while input-dependent gating provides scope for improvement. Full-expert refitting is reported separately from the formal compact-subset and short-horizon override procedure.
The formal model has zero sample-level outer correction: weights vary with horizon within a regional task. The SA motion-candidate router remains input dependent. Outer selection permits fallback. On Finnish data, seeds 42 and 52 use SA alone; the other three activate 3, 2, and 3 experts, respectively, and all assign zero weight to MSTFormer. Complementarity thus varies with the task and training run. The five branches define a candidate set rather than a fixed number of active contributors.
5.2. Anchor and normalization sensitivity
Table 12 compares anchor locations and densities. The macro results for 5/10/60 and denser configurations are close, and 5/30/60 has slightly lower J. A small number of anchors therefore captures the main horizon dependence, although the preferred locations depend on the data distribution. We retain the predefined 5/10/60 setting and report all tested configurations.
S1 Data reports alternative normalization and horizon/regional weights. Ablation effects change with the evaluation scale and outer refitting. The next section therefore reports SA alone alongside the complete system to separate a module’s direct effect from compensation by other experts.
5.3. Five-seed matched internal SA ablations
Table 13 compares eight SA variants using five seeds. Each variant changes only the corresponding computation or output, retaining registered parameter counts as recorded by the implementation. The full row belongs to the five-seed paired cohort; the formal model mean in Table 14 uses ten seeds.
Uniform internal routing increases the SA objective by about 1.81%, supporting input-dependent selection among motion candidates. Removing the dense and control-point residuals reduces the SA objective by about 0.56%; removing the residual gate reduces the complete fusion objective by about 0.59%. Component effects depend on the evaluation level, and the full structure does not attain the lowest objective in every control. The no-residual variant retains the separate endpoint correction, distinguishing the roles of these two correction branches.
Fig 6 shows how component effects change between the two evaluation levels.
Left: SA output alone. Right: the refitted complete fusion. Negative values indicate a lower objective after removal.
5.4. Capacity matching and runtime
Table 14 compares four-region, ten-seed capacity controls. Wide-GRU has nearly as many parameters as fusion, but its macro J exceeds ordinary Direct-GRU under the inherited optimization settings. Widening one recurrent backbone does not recover the gains of heterogeneous combination under this configuration. Parameter matching controls model size; optimization difficulty and training budgets remain separately recorded.
Fusion has a GPU batch-1 median forward latency of 36.01 ms, compared with about 0.729 ms for Direct-GRU. Fusion CPU batch-1 latency is 83.47 ms, and GPU batch-32 throughput is about 597 samples/s. Median cached-window-to-metric-output time is 36.25 ms, covering standardization, device transfer, inference, and output reconstruction. Reception, decoding, communication, and data-service overheads belong to the online system and are excluded. This computation time is short relative to minute-scale shore-based applications, but usefulness also depends on data timeliness and forecast error.
6. Distribution limits and independent AIS validation
6.1. Norway and CV15 protection
The 60-min validation and test rankings of CV15 reverse in Norway. Although CV15 is an internal SA candidate, its contribution can be changed by internal weights, residuals, and outer fusion. Table 15 adds raw CV15 as a sixth candidate and compares minimum-weight constraints using the same anchor interface. Each seed selects its ridge coefficient independently; validation-selected also chooses protection strength on validation data. Stronger protection raises the four-region macro error, whereas validation-selected strength yields a lower point estimate. The amount of motion-prior protection depends on the validation distribution; imposing more weight is not beneficial in every region.
6.2. Statistical limits in small regions
The 394 Piraeus validation windows come from 15 vessels, and the 132 test windows from 22 vessels. Unequal window counts give a cluster-size concentration measure of about 11.285. Leave-one-MMSI-out analysis and 25/50/75% validation-vessel subsampling show that some vessels strongly influence long-horizon error and routing weights. Equal-region weighting expresses equal importance of regional tasks; window- and vessel-weighted results show the effect of this choice.
6.3. Frozen source-to-target transfer
Frozen transfer covers 12 directions between four regions, ten seeds, and eight learned predictors, giving 960 evaluations. Models retain source experts, scalers, and routing; target labels are used only to calculate error. Results depend on the source and target, and fusion does not consistently outperform individual experts. Excluding region identity from forward inputs does not remove the dependence of fitted parameters on the training distribution. S1 Data contains the full transfer matrix.
6.4. Results on the independent Finnish subset
Table 16 reports five-seed local retraining on Finnish data. Fusion has the lowest mean at all six ADE horizons and in ten of the 12 ADE/FDE units; Direct-GRU is better at FDE@45 and FDE@60. Relative to SA-Repair, fusion reduces ADE@60 by 20.08 m (1.15%), FDE@60 by 55.21 m (1.35%), and macro J by about 0.73%. On this independent source, SA supplies most predictive performance, with horizon-dependent fusion adding a smaller improvement.
Fig 7 compares long-horizon error on the independent source.
Error bars represent the sample standard deviation across five training seeds.
Holm-adjusted p-values from the centred wild-cluster bootstrap-t test for the three primary Finnish ADE comparisons are approximately 0.0020, 0.0150, and 0.0003. In crossed seedvessel intervals, ADE@5 includes zero, ADE@10 touches zero, and ADE@60 remains positive. Short-term gains are thus more sensitive to resampling. The two analyses address vessel sampling conditional on the fitted training results and uncertainty that additionally includes seed variation, respectively.
Table 17 retains all four frozen source-fusion transfers to Finland. Each has higher ADE@60 than the strongest individual expert from the same source. Together with Table 16, these results distinguish the applicability of a retrained architecture from direct transfer of source weights.
Recalculation from 200 saved independent prediction groups reproduces 2,600 scalar metrics and 40 rows of means and sample standard deviations. One actual window from each split is reconstructed from raw messages and agrees with its cache; changing positions after the anchor leaves the history input unchanged. Nine daily-file records have reception times 30–48 ms before the named date, but all retained windows lie within the corresponding dates. Row-level date and MMSI checks also confirm temporal and vessel separation from EnvShip.
7. Discussion
7.1. Benefits and limits of heterogeneous fusion
SA-Repair supplies a motion-continuous base, while other experts correct some of its horizon-specific errors. Convex constraints allow multiple branches to contribute or a single branch to remain; validation predictions determine participation. Differences between internal ablations and complete-system results show that outer refitting can compensate for some module changes. Three anchors organize these differences with relatively few weight parameters. Learned gates and simpler structures identify directions for further improvement.
7.2. Maritime information and operational interpretation
Forecasts at 5–10 min can inform near-term motion-trend analysis, while 30–60-min forecasts can provide a reference for shore-based traffic organization. A single vessel’s history cannot fully describe give-way interactions, channel constraints, weather, depth, or destination changes. ADE/FDE and along/cross-track errors measure prediction geometry; they do not establish collision reduction or route optimization. Offline grouping by realized future motion is not an online input. Testing operational benefit requires synchronized context and field evaluation. Satellite-image ship detection and ocean-monitoring research [28] provides another source of traffic observations, complementary to forecasting future positions from AIS history.
7.3. Limitations
The scope is limited mainly by distribution shifts, independent vessel counts, and available context. Regional models are trained separately, and frozen source-to-target transfer remains inconsistent. Norway and Piraeus have few test vessels, so vessel-sampling uncertainty persists after additional training seeds. Shared validation selection and historical inspection of EnvShip test results during development also condition the interpretation of the statistics. Finnish validation broadens the data source but covers only one week of quality-screened moving-vessel records. Further evaluation with neighbouring vessels, charts, and live AIS processing is needed before extending the framework to more complex operating conditions. Domain-generalized aerial perception [29] also addresses distribution shift, but its image-perception inputs and objectives differ from AIS trajectory regression. Regional retraining and frozen source-to-target transfer are therefore evaluated separately.
8. Conclusions
This study combines a motion-prior residual expert with four temporal branches under a common trajectory interface, fitting weights at three horizon anchors on validation data. Four-region, ten-seed comparisons, capacity controls, and routing/component experiments show that heterogeneous combination can improve some long-horizon errors, with gains depending on expert complementarity and weight estimation. Retraining on independent Finnish AIS gives the lowest mean ADE at all six horizons, while exceptions remain in long-horizon FDE and frozen transfer. The results support applying the same architecture through separate regional training. Contextual information and online data conditions remain necessary to establish maritime operational value.
Supporting information
S1 Code. Source code and reproduction instructions.
Code snapshot, experimental configurations, portable entry points, and executable scripts for reproducing the numerical tables and statistical analyses. Extract this archive together with S1–S4 Data into one directory and follow STATISTICAL_README.md
https://doi.org/10.1371/journal.pone.0363079.s001
(ZIP)
S1 Data. Numerical results and experimental records.
Seed-level and aggregated tables for the ten-seed main comparisons, routing, capacity, and transfer experiments; five-seed internal ablations, probabilistic controls, and independent validation; and historical three-seed diagnostics.
https://doi.org/10.1371/journal.pone.0363079.s002
(ZIP)
S2 Data. Paired error records for statistical reproduction.
Paired per-window error differences, vessel-cluster codes, and statistical metadata for recomputing the main, independent-data, and probabilistic comparisons using the scripts and random-generator seeds supplied in S1 Code.
https://doi.org/10.1371/journal.pone.0363079.s003
(ZIP)
S3 Data. Independent Finnish AIS per-window errors part 1.
Derived per-window ADE/FDE values for evaluation groups 000–099 of the 200 Finnish AIS model evaluations. Group identifiers and evaluation metadata are supplied in S1 Code. Use together with S4 Data to reproduce all independent-data metrics.
https://doi.org/10.1371/journal.pone.0363079.s004
(ZIP)
S4 Data. Independent Finnish AIS per-window errors part 2.
Derived per-window ADE/FDE values for evaluation groups 100–199 of the 200 Finnish AIS model evaluations. Group identifiers and evaluation metadata are supplied in S1 Code. Together, S3 Data and S4 Data provide the derived error records for all 200 evaluations.
https://doi.org/10.1371/journal.pone.0363079.s005
(ZIP)
S1 Appendix. Output components, reproduction procedures, and proof of fixed convex fusion.
Section A provides the SA-Repair output equations, loss weights, and Algorithms A1–A2 for frozen-checkpoint inference and training/routing selection. Section B provides the proof and scope of the fixed convex-fusion relations.
https://doi.org/10.1371/journal.pone.0363079.s006
(PDF)
References
- 1. Jiang Y, Chang Y, Zhang B, Ge Y, Zhao X. A review of vessel trajectory prediction research: Methodological evolution, current challenges, and future directions. International Journal of Naval Architecture and Ocean Engineering. 2026;18:100754.
- 2. Zhang X, Fu X, Xiao Z, Xu H, Qin Z. Vessel trajectory prediction in maritime transportation: current approaches and beyond. IEEE Trans Intell Transport Syst. 2022;23(11):19980–98.
- 3. Li H, Jiao H, Yang Z. Ship trajectory prediction based on machine learning and deep learning: A systematic review and methods analysis. Engineering Applications of Artificial Intelligence. 2023;126:107062.
- 4. Bai X, Ye K, Xu X. Research progress on ship trajectory prediction in marine transportation. Journal of Marine Science and Technology. 2024;32(4).
- 5. Raj N, Kumar P. Navigating the Future: A Comprehensive Review of Vessel Trajectory Prediction Techniques. Def Sc J. 2025;75(1):129–38.
- 6. Troupiotis-Kapeliaris A, Kastrisios C, Zissis D. Vessel trajectory data mining: A review. IEEE Access. 2025;13:4827–56.
- 7. Capobianco S, Millefiori LM, Forti N, Braca P, Willett P. Deep learning methods for vessel trajectory prediction based on recurrent neural networks. IEEE Trans Aerosp Electron Syst. 2021;57(6):4329–46.
- 8. Billah MM, Zhang J, Zhang T. A Method for Vessel’s Trajectory Prediction Based on Encoder Decoder Architecture. JMSE. 2022;10(10):1529.
- 9. Sørensen KA, Heiselberg P, Heiselberg H. Probabilistic Maritime Trajectory Prediction in Complex Scenarios Using Deep Learning. Sensors (Basel). 2022;22(5):2058. pmid:35271206
- 10. Liu RW, Hu K, Liang M, Li Y, Liu X, Yang D. QSD-LSTM: Vessel trajectory prediction using long short-term memory with quaternion ship domain. Applied Ocean Research. 2023;136:103592.
- 11. Zhang J, Wang H, Cui F, Liu Y, Liu Z, Dong J. Research into Ship Trajectory Prediction Based on An Improved LSTM Network. JMSE. 2023;11(7):1268.
- 12. Shin Y, Kim N, Lee H, In SY, Hansen M, Yoon Y. Deep learning framework for vessel trajectory prediction using auxiliary tasks and convolutional networks. Engineering Applications of Artificial Intelligence. 2024;132:107936.
- 13. Liu Z, Qi W, Zhou S, Zhang W, Jiang C, Jie Y, et al. Hybrid deep learning models for ship trajectory prediction in complex scenarios based on AIS data. Applied Ocean Research. 2024;153:104231.
- 14. Li X, Liu C, Li J, Zhao L, Du Z. Advancing ship trajectory prediction: Integrating deep learning with enhanced reference trajectory correction techniques. Ocean Engineering. 2024;311:118880.
- 15. Bi J, Gao M, Bao K, Zhang W, Zhang X, Cheng H. A CNNGRU-MHA method for ship trajectory prediction based on marine fusion data. Ocean Engineering. 2024;310:118701.
- 16. Liu RW, Zheng W, Liang M. Spatio-temporal multi-graph transformer network for joint prediction of multiple vessel trajectories. Engineering Applications of Artificial Intelligence. 2024;129:107625.
- 17. Schirmann ML, Collette MD, Gose JW. Data-driven models for vessel motion prediction and the benefits of physics-based information. Applied Ocean Research. 2022;120:102916.
- 18.
Alam MM, Soares A, Rodrigues-Jr JF, Spadon G. Physics-Informed Neural Networks for Vessel Trajectory Prediction: Learning Time-Discretized Kinematic Dynamics via Finite Differences. In: Proceedings of the 19th International Symposium on Spatial and Temporal Data, 2025. 55–65. https://doi.org/10.1145/3748777.3748779
- 19. Qiang H, Guo Z, Chu Z, Xie S, Peng X. Motion-Inspired Spatial–Temporal Transformer for accurate vessel trajectory prediction. Engineering Applications of Artificial Intelligence. 2025;148:110391.
- 20. Zhang Y, Tu P, Zhao Z, Chen X-Y. Incorporating prior knowledge of collision risk into deep learning networks for ship trajectory prediction in the maritime Internet of Things industry. Engineering Applications of Artificial Intelligence. 2025;146:110311.
- 21. Gong J, Li H, Jiao H, Yang Z. Uncertainty-aware ship trajectory prediction via Spatio-Temporal Graph Transformer. Transportation Research Part E: Logistics and Transportation Review. 2025;203:104315.
- 22. Sheng X, Shi B, Wang D, Xiu X, Wang Y, Yang Y. Ship trajectory prediction based on dual attention diffusion model. Ocean Engineering. 2025;342:122853.
- 23. Lee S, Lee HJ, Lee W. Long-term ship trajectory prediction using a transformer with inverted attention and feature augmentation. International Journal of Naval Architecture and Ocean Engineering. 2026;18:100744.
- 24. Ma K, Han Q, Song C, Yao J, Wang H, Wu C. EnvShip: A unified framework for context-aware and cross-region vessel trajectory forecasting. 2026.
- 25. Jacobs RA, Jordan MI, Nowlan SJ, Hinton GE. Adaptive Mixtures of Local Experts. Neural Comput. 1991;3(1):79–87. pmid:31141872
- 26. Krogh A, Vedelsby J. Neural network ensembles, cross validation, and active learning. Advances in Neural Information Processing Systems. 1994;7:231–8.
- 27.
Bhattacharya D, Ul Haq I, Pichardo Vicencio C, Lafond S. A Large-Scale AIS Dataset from Finnish Water. Zenodo. 2023. https://doi.org/10.5281/zenodo.8112336
- 28. Bakirci M. Advanced ship detection and ocean monitoring with satellite imagery and deep learning for marine science applications. Regional Studies in Marine Science. 2025;81:103975.
- 29.
Ozpinar NN, Bakirci M. Domain-generalized aerial perception via diffusion-driven data synthesis and adversarial–contrastive feature fusion. In: 2026. 182–7. https://doi.org/10.1109/IISEC69317.2026.11418502