Abstract
AIS trajectories in and around ports are often incomplete because of transmission interruptions, reception failures, and infrastructure outages. In this paper, we investigate whether the Data-driven AIS Trajectory Interpolation method (DAISTIN), which reconstructs missing trajectory segments using a graph derived from historical AIS observations, can be improved by retaining local directional information that is otherwise discarded when observations are sampled to form the graph. To this end, we introduce two extensions, xDAISTIN and xDAISTOUT. The originality of the proposed approach lies in extending DAISTIN by enriching each sampled graph node with neighbourhood-level directional information from nearby historical AIS observations. Specifically, local vessel headings are encoded cyclically and modelled using kernel density estimators, allowing candidate graph transitions to be evaluated using local movement probabilities rather than only the heading of the sampled point. The methods are evaluated on real-world AIS data from the Port of Antwerp by introducing synthetic gaps into held-out trajectories and measuring how well they are reconstructed by the methods. Using 36,748 moving sub-trajectories from 5488 vessel trips, we compare the proposed methods against DAISTIN, linear interpolation, and several directed, undirected, probabilistic, and shortest-path graph variants. Across graph sizes from 100 k to 180 k nodes, DAISTIN and its undirected variant reconstructed – and – of missing segments, respectively, compared to – and – for xDAISTIN and its variants, and – and – for xDAISTOUT and its variants. Compared with undirected DAISTIN at 180 k nodes, undirected xDAISTIN at 180 k nodes achieved significantly lower mean SPD, DFD, and HD (all Holm-adjusted, ), by approximately , , and , respectively. These findings demonstrate that preserving neighbourhood-level directional behaviour during graph construction can substantially improve the interpolation completion rate and reconstruction accuracy in complex port environments.
1. Introduction
According to the automatic identification system (AIS) standards [1], AIS transponders autonomously broadcast messages at intervals ranging from 2 s to 3 min, with the update rate determined by the AIS class type as well as the vessel’s activity and speed. In practice, AIS time-series data often contain gaps, either because vessels stop transmitting or because transmitted messages are not successfully received. Reception can be degraded by very high-frequency propagation conditions and infrastructure limitations; for example, during bad weather, near tall structures, when antennas are mounted low, or in offshore areas with limited coverage [2]. Separately, receiver or network downtime can interrupt data collection and introduce additional gaps [3]. Finally, vessels may intentionally deactivate their AIS, creating discontinuities that are unrelated to reception conditions [3]. These data gaps make maritime traffic modelling more difficult and can bias statistical analyses. Their impact is particularly pronounced in port areas, where complex geography and navigational constraints shape vessel motion and complicate trajectory reconstruction, while high traffic density can also make gaps frequent due to increased communication load. Compared to open-sea movements, port trajectories are often more variable and frequently non-linear, with more frequent changes in speed and heading. Figure 1 illustrates the corresponding ambiguity in reconstructing a trajectory gap. For each example of a real AIS gap from the Port of Antwerp we show several trajectories with similar start and end points and comparable speeds; the variety and complexity of their geometries make denser representation a necessity.
Figure 1.
Examples of trajectories for selected real-world gaps in the Port of Antwerp. The left panel marks the locations of eight selected real AIS gaps (red x markers). The right panels visualize, for each gap case, trajectories with similar start and end locations and comparable speed in different colours; the dashed red segments connect the two points of a gap.
Many existing trajectory reconstruction methods are evaluated in open-sea settings, often on port-to-port or port-approaching segments. However, their effectiveness for in-port trajectory reconstruction remains less explored. In this work, we empirically examine this setting using linear interpolation, DAISTIN [4], and an undirected variant, and show that performance can degrade substantially in ports. Motivated by these observations, we introduce xDAISTIN and xDAISTOUT, two graph-based extensions of DAISTIN, together with multiple variants. Our experiments on real-world AIS data from the Port of Antwerp show that enriching graph nodes with local directional information substantially improves the interpolation completion rate relative to the original DAISTIN method, while the strongest xDAISTIN and xDAISTOUT configurations reduce reconstruction error relative to both DAISTIN and linear interpolation. Comparisons of directed, undirected, probabilistic, and shortest-path variants provide further insight into the contributions of different graph construction and traversal approaches.
Both DAISTIN and our proposed methods, xDAISTIN and xDAISTOUT, represent vessel motion using a graph in which nodes correspond to historical AIS positions and edges encode feasible transitions consistent with the historical direction of travel. Since constructing such a graph over all historical AIS data is computationally impractical, the node set is reduced via stratified geometric sampling. A limitation of DAISTIN is that sampling retains information only from the selected AIS data points, so directional information contained in nearby non-sampled data points is not incorporated into the resulting nodes. In dense and navigationally constrained traffic settings—where different vessels can follow distinct manoeuvres within a small area—we hypothesize that this loss of local directional variability can negatively affect interpolation. To address this, during sampling, our proposed methods enrich each retained node with heading information from its local neighbourhood. Concretely, for each sampled node we fit a kernel density estimator (KDE) over the headings of nearby AIS data points, yielding a local probabilistic description of directional behaviour at node level. As we show empirically, using this neighbourhood-level directional information during edge construction improves reconstruction accuracy in the port setting. At a high level, xDAISTIN and xDAISTOUT share the same node-enrichment principle, but they differ in how the local heading distributions are used when evaluating candidate transitions during interpolation.
Our contributions can be summarized as follows:
- We introduce xDAISTIN and xDAISTOUT, two graph-based extensions of DAISTIN for in-port AIS trajectory reconstruction that enrich sampled graph nodes with neighbourhood-level directional information derived from nearby AIS data points.
- We systematically evaluate multiple configurations of DAISTIN, xDAISTIN, and xDAISTOUT, including probabilistic versus shortest-path inference and directed versus undirected traversal, to isolate the impact of these design choices on the interpolation completion rate and reconstruction performance.
- Using real-world AIS data from the Port of Antwerp, we conduct a comparative analysis between linear interpolation, the proposed methods xDAISTIN and xDAISTOUT, and the original DAISTIN method, including multiple variants of each, and show clear improvements in interpolation completion rate and reconstruction performance from the proposed methods across the evaluated settings.
The remainder of this paper is organized as follows. Section 2 reviews related work. Section 3 presents the materials and methods, including data set information, preprocessing steps, DAISTIN, the proposed xDAISTIN and xDAISTOUT methods, and their variants. Section 4 reports the experimental setup and results. Section 5 discusses the main findings and limitations, and Section 6 concludes the paper.
2. Related Work
Over recent years, various numerical and data-driven methods have been proposed for reconstructing incomplete vessel trajectories from AIS time-series data. Examples of numerical methods include linear interpolation, splines, or combinations of the two [5]. Linear interpolation assumes that movement between two known points is linear, thereby generating intermediate points along a straight path; it is typically most suitable when gaps are short and vessel motion between observations is relatively steady, but it can fall short when trajectories are complex or gaps are prolonged. In contrast, spline interpolation relaxes the linearity assumption by using polynomials of a specified order, allowing the interpolated path to follow a curved trajectory. Nguyen et al. [5] introduced a method that combines both linear and spline interpolation by first assessing whether the vessel’s motion is closer to linear or turning based on curvature estimates of trajectory segments adjacent to a signal gap. Depending on the outcome, the method applies linear interpolation for steady courses and cubic Hermite interpolation for turning manoeuvres, and can interpolate multiple trajectory parameters (e.g., position, course over ground, speed over ground, and heading) in settings where such local assumptions hold [5]. However, these assumptions may be less reliable in port environments, where vessel motion can change rapidly while following strong navigational constraints. Sang et al. [6] proposed a method aimed at complex environments such as inland ports, assuming (i) straight-line motion on steady course segments and (ii) circular-arc motion during turns. While effective when these assumptions are met, performance may degrade when gaps increase in duration and when manoeuvres deviate from a single arc.
Deep learning methods have also been explored for reconstructing incomplete AIS trajectories. For example, Yuan et al. [7] employed Long Short-Term Memory (LSTM) networks to infer missing trajectory segments from historical sequences. However, as noted by Magnussen et al. [4], sequence models such as LSTMs can in some cases yield implausible reconstructions—e.g., producing paths that drift away from realistic vessel motion—particularly when training data are limited or when the motion patterns within a gap are not well constrained by surrounding observations. More recent works have extended this line of research through bidirectional recurrent, sequence-to-sequence, and attention-based architectures. Bai et al. [8] proposed a reconstruction model combining Dempster–Shafer evidence theory with a bidirectional Long Short-Term Memory (BiLSTM) network for missing AIS observations in geometrically constrained waterways. Ye et al. [9] combined an initial cubic-spline restoration with feature-correlation analysis and a Seq2Seq neural network, using the latter to refine the provisionally restored trajectory. More recently, Galdelli et al. [10] introduced a BackForward BiLSTM architecture that processes observations before and after a signal gap through separate forward and backward models. Their evaluation included conventional LSTM, CNN–LSTM, BiLSTM, GRU, BRITS, NRTSI, and Seq2Seq baselines. Gao [11] similarly combined temporal convolutions, self-attention, and BiLSTM layers for the restoration of missing and abnormal AIS trajectory observations. Transformer architectures have also more recently been considered; for example, Han et al. [12] proposed STAR, which employs a Transformer encoder and an integrated representation of temporal, spatial, directional, and velocity information to recover sparsely sampled marine trajectories. The ancestry of our ideas stretches yet further back. Related techniques have also been used with success in, among other areas, computer vision work on scene-specific motion modelling. Arandjelović, for example, represented people’s motion trajectories in crowded public spaces using local tracklet primitives, defined by position and direction, and learned normal motion patterns from the resulting sequences of primitives [13]. Although that work focused on novelty detection rather than the reconstruction of broken trajectories, it is relevant here because it illustrates the general usefulness of decomposing trajectories into local, direction-aware motion elements and using their learned contextual regularities as a prior over possible movement.
Graph-based methods have emerged as a competing alternative, as their topology is typically the result of modelling maritime traffic dynamics and structure based on historical data, which is a strong prior that avoids the construction of implausible trajectories [14]. Filipiak et al. [15] proposed a graph-based algorithm for route identification in the Baltic Sea, illustrating how AIS-derived traffic networks can be represented and traversed. The resulting paths may sometimes exhibit artefacts such as zig-zagging; prior work has addressed this using post-processing steps (e.g., smoothing) to improve geometric realism. Onyango et al. [16] similarly proposed a framework for extracting traffic networks from AIS data, further supporting the use of graph representations for modelling vessel movement patterns.
A graph-based method of particular relevance to our work is the Data-driven AIS Trajectory Interpolation (DAISTIN) method [4]. DAISTIN constructs a directed graph from historical AIS data after applying stratified geometric sampling to reduce data volume. The sampled AIS observations become nodes in the graph, characterized by spatial information (longitude, latitude), directional information (heading), and additional information from the AIS messages. Edges are defined using two criteria: a neighbourhood constraint (proximity) and a direction constraint (heading alignment), as further discussed in Section 3.5. To interpolate a signal gap, the AIS messages before and after the gap are temporarily added to the graph as auxiliary nodes. The algorithm then identifies the shortest path between them using the directed graph, which is returned once a smoothing post-processing step is applied. As with any sampled graph construction, the graph resolution (and therefore interpolation fidelity) depends on the number of sampled nodes, reflecting a trade-off between computational cost and granularity as AIS data volume increases. A limitation of DAISTIN is that directional information from non-sampled AIS messages is discarded, an issue that we hypothesize becomes more detrimental in dense and navigationally constrained settings (e.g., in ports). In response to this limitation, herein we propose two new methods, namely, xDAISTIN and xDAISTOUT.
3. Materials and Methods
3.1. AIS Data Collection
We collected AIS data using AISStream.io’s API (https://aisstream.io/, accessed on 15 June 2026). This source was selected for its open-access availability, as commercial AIS data sets often involve high costs that limit accessibility for research [17]. Messages were collected continuously between 31 December 2023 and 24 January 2024 except on 4, 6, 7, 8, and 11 January 2024 when no or fewer messages were recorded, yielding an initial data set of 5,478,552 dynamic AIS messages from 2654 unique vessels. The data set was spatially restricted to the area of Port of Antwerp. As an initial cleaning step, messages with invalid identifiers (MMSI = 0) were removed. Table 1 summarizes the data set following key processing steps which we describe in the subsequent sections.
Table 1.
Summary of the data set across processing steps. Numbers of AIS messages, unique vessels, extracted trips, and moving sub-trajectories retained after spatial restriction and cleaning, preprocessing, trip-level training/test partitioning, and the introduction of gaps in the test set. Data were collected via AISStream.io between 31 December 2023 and 24 January 2024. “–” denotes not applicable.
3.2. Trajectory Segmentation
We retained only AIS messages from moving vessels, thereby excluding stationary activities (e.g., fishing, mooring, and anchoring). For each vessel, AIS messages were first sorted chronologically and then trips were identified by introducing a new trip whenever the time gap between consecutive messages exceeded 6 h. AIS points with speed over ground (SOG) below 1 knot were classified as stopped points. Each trip was subsequently segmented into consecutive moving and stopped sub-trajectories (see Algorithm 1). Since the objective of our work was to capture vessel movement patterns within the port, the data set was filtered to retain only moving segments containing at least three AIS data points. This preprocessing step yielded 36,748 moving sub-trajectories, extracted from 5488 vessel trips, comprising 956,995 AIS messages from 2377 unique vessels.
| Algorithm 1 Moving sub-trajectory extraction |
|
3.3. Experimental Design and Evaluation Scope
The primary aim of our evaluation was to assess the effects of incorporating neighbourhood-level directional information within the DAISTIN framework specifically. We adopt DAISTIN as the principal comparative reference because of its methodological similarity to the proposed methods, facilitating a controlled analysis of node enrichment, graph construction, and traversal approaches. Because the methods discussed in Section 2 rely on different modelling assumptions, they were not included in the comparison; linear interpolation is provided as a simple non-graph baseline.
To assess the effectiveness in reconstructing incomplete trajectories, we used a hold-out evaluation approach. We randomly selected of vessel trips to serve as the test set, while the remaining were used for graph construction. The resulting training set contains 884,044 AIS messages across 4939 trips (34,124 moving sub-trajectories), and the test set contains 72,951 AIS messages across 549 trips (2624 moving sub-trajectories). Since the training/test split is performed at trip level, 355 vessels contribute trips to both sets.
To simulate incomplete AIS trajectories, synthetic gaps were introduced into the test trajectories as follows. For each moving sub-trajectory, starting from a retained observation, subsequent observations were removed until the temporal difference between two consecutive retained observations exceeded a randomly sampled threshold. This gap-duration threshold was modelled as a normally distributed random variable with mean min and standard deviation min. The resulting sparse trajectories were used as test input to the interpolation method, while the original complete trajectories served as the ground truth for evaluation. Following the introduction of gaps in the test set trajectories, the test set retains 15,189 observed AIS messages over the 2624 evaluation sub-trajectories. The trip-level hold-out evaluation workflow and the procedure used to generate the sparse test trajectories are visualized in Figure 2.
Figure 2.
Trip-level hold-out evaluation and synthetic-gap generation workflow. (A) Vessel trips were randomly assigned into training and test partitions. The training trajectories, following geometric sampling, were used for graph construction, whereas the complete test trajectories served as the ground truth for evaluation. The sparse test trajectories (see panel (B)) were used as input to the interpolation methods. (B) Given a trajectory (green dots), starting from a retained observation (black), a gap-duration threshold was sampled. Intermediate observations were removed (grey) until the first observation whose temporal difference from the retained observation exceeds was reached. That observation was retained (black), and the procedure was repeated until the end of the sub-trajectory. The last point of a given trajectory was always retained.
3.4. Feature Engineering
Each AIS message provides information on the vessels’ location (latitude and longitude), speed (SOG), and direction (course over ground (COG) and true heading). COG describes the vessel’s direction of motion over the Earth’s surface, whereas true heading reflects the direction the vessel’s bow is pointing. In practice, however, COG can be noisy—particularly at low speeds and during close-quarter manoeuvres—and true heading is frequently missing or unreliable. To obtain a single, consistently available directional feature for our methods, we therefore derive a calculated heading (CH) from consecutive observed positions (see Figure 3); where no subsequent position is available, CH falls back to the reported true heading and is left undefined when that is also unavailable. At the endpoints of a test-set gap, CH is computed using only retained observations, taking the arrival bearing at the observation preceding the gap and the departure bearing at the observation following it, so that no directional information is drawn from removed observations. Where the required neighbour is unavailable because the endpoint is the first or last retained observation of its sub-trajectory, the bearing between the two gap endpoints is used instead (20.4% and 13.0% of gaps, respectively).
Figure 3.
Difference between true heading, course over ground, and calculated heading. A sub-trajectory illustrating the directions of true heading (red line), course over ground (orange line), and calculated heading (green line).
Given two sequential points and , the calculated heading (CH) is computed as
where and are the latitudes of points A and B (in radians), are the corresponding longitudes (in radians), and .
3.5. DAISTIN
DAISTIN [4] is an interpolation method that reconstructs missing trajectory segments by leveraging a pre-constructed directed graph derived from historical AIS data. Rather than directly estimating missing points, it searches this graph to identify the most plausible intermediate locations, thereby ensuring that interpolated paths conform to real-world movement patterns.
However, as the volume of historical AIS data increases, constructing a graph directly over all AIS observations can become computationally expensive. If all N historical AIS observations are used as graph nodes, radius-based edge construction can require time in the worst case. This can occur when the spatial distribution of observations limits effective pruning of the search tree, for example, when observations are densely clustered, so that each node may have to consider up to other nodes as candidate neighbours. DAISTIN instead constructs the graph over n sampled nodes, reducing this cost to , with .
The sampling process begins by estimating the approximate neighbourhood density (AND) for each AIS point, defined as the number of neighbouring points within a specified radius (), efficiently computed using a ball-tree spatial index. The resulting AND distribution approximates a geometric distribution, with low-density points being more frequent. Based on their AND values, points are divided into quantiles and assigned density scores. Lower quantiles contain sparser regions and are preserved more fully, whereas higher-density regions are sampled more aggressively. This results in a spatially representative yet reduced data set; see Figure 4.
Figure 4.
Geometric sampling adjusts spatial density distribution in AIS data. This figure illustrates the spatial density difference following the application of geometric sampling to AIS data. In both plots, darker shades of blue indicate higher point densities, while lighter shades indicate lower densities. The left plot illustrates the spatial density of the original data from the training set. The right plot demonstrates the impact of geometric sampling.
Once the sampled nodes are selected, DAISTIN constructs a directed graph in which each node represents an AIS data point, defined by its spatial (latitude, longitude) and directional (heading) attributes. Although the original method employs true heading, initial experiments indicated that CH yielded better graph construction results in port environments (see Figure 3), and it was therefore adopted in our implementation. Edges are constructed based on two criteria:
- Neighbourhood criterion: The geodesic distance between nodes does not exceed a specified threshold .
- Direction criterion: The angular difference between the vector from the source to the candidate node and the candidate node’s CH must fall within a specified angular threshold .
To efficiently identify node pairs that satisfy both criteria, a two-step process is followed (visualized in Figure 5):
Figure 5.
Visualization of DAISTIN’s edge construction criteria. (A) Neighbourhood criterion: only nodes within a predefined spatial radius from the source node (red dot) are considered candidates. (B) Direction criterion: a candidate node is considered only if the angular difference between the vector from the source to the candidate (selected vectors visualized in (B,C)) and the candidate’s calculated heading falls within a specified angular threshold. (C) Combined criteria: only nodes that satisfy both the neighbourhood and direction criteria are connected by an edge.
- Neighbourhood criterion evaluation: Nodes are first indexed using a ball-tree data structure to enable efficient spatial queries. For each node, a radius-based query is executed to retrieve all neighbouring nodes within the predefined distance threshold .
- Direction criterion evaluation: The candidate nodes identified in the previous step are then filtered based on the direction criterion. Only those whose angular alignment with the source node meets the specified threshold are retained. Directed edges are established between source and candidate nodes that satisfy both criteria.
The sampling stage operates on all N observations. A ball tree over the original two-dimensional data is constructed in time. AND estimation then requires one fixed-radius counting query per observation. Because only counts are required, any subtree lying entirely inside or outside the query radius is resolved in constant time from its stored index range, whereas only subtrees intersecting the query boundary are searched recursively. Here, we assume effective pruning which requires the query radius to be small relative to the spatial extent of the data; otherwise, time may be required. Finally, quantile assignment needs time for sorting.
Interpolation is triggered when the time difference between two consecutive AIS points (denoted as A and B) exceeds a threshold. Since these points are unlikely to match any existing node in the graph exactly (in both location and heading), they are temporarily inserted as auxiliary nodes. Edges are then formed between these nodes and the rest of the graph based on the same neighbourhood and direction criteria.
The pathfinding algorithm is consequently used to find the shortest path, based on the Haversine distance, between A and B. If the pathfinding algorithm fails to identify a valid path, no interpolation is performed. If a path is found, a post-processing step is applied to eliminate any zig-zag patterns and evenly space the AIS data points along the path. To achieve this, the Douglas–Peucker algorithm [18] is used to identify the most significant data points in the trajectory, which are typically manoeuvring points, thus reducing zig-zag patterns. The simplified path is then re-evaluated, and any sub-segment exceeding the predefined distance threshold is densified via geodesic interpolation.
3.6. xDAISTIN
3.6.1. Stratified Sampling
As illustrated in the first plot of Figure 4, some areas exhibit higher density than others, typically corresponding to berths, common routes, or port entrances and exits. Including all data points from these dense areas would lead to an overly complex graph. Therefore, we implement stratified sampling based on the density of each point. Following the DAISTIN method [4], we measure the AND of each data point and partition the points into Q quantiles. This stratification allows us to group neighbourhoods based on their density, aiming to sample more points from less dense regions and fewer points from more dense regions, establishing an inversely proportional relationship between the number of points and spatial density.
To achieve this inversely proportional relationship, sampling rates across quantiles are defined using geometric series. This requires specifying the ratio parameter (where ), the number of quantiles Q, and the desired number of sample points . Given that , we know the sum of the geometric series is finite, allowing us to determine our sampling rates for each quantile individually. A scaling factor is computed such that the sum of the contributions across all quantiles approximates , and is given by
where represents the expected number of data points per quantile under an equal partitioning assumption. In this way, we can define the individual sampling rates and sample sizes corresponding to each quantile. The sample size extracted from each quantile () is given by
Since the sampling stage uses the same AND-based, quantile-stratified procedure as DAISTIN, its time complexity remains the same. Furthermore, since the sampling strategy may interact with the subsequent method for edge construction, the experiments we conducted are controlled insofar as the sampling method is kept constant; but this does not ensure that the ranking of methods would be preserved if a different sampling strategy were pursued.
3.6.2. Heading-Preserving Geometric Sampling
The previously described stratified sampling procedure effectively obtains a representative spatial sample by accounting for the AND of each point. However, spatial proximity between AIS messages does not necessarily imply similarity in other message attributes, such as vessel heading. Consequently, although the stratified sampling algorithm minimizes the loss of spatial information, it does not ensure that directional information is adequately preserved. To address this limitation, we incorporate the headings of neighbouring points within a predefined radius into each data point representing a node (process visualized in Figure 6). By leveraging these headings, we fit a KDE to capture the heading distribution across each node’s neighbourhood. A KDE is fitted only when at least two neighbouring headings are available.
Figure 6.
Spatial neighbourhood and directional encoding for KDE. (A) For a given radius , each sampled point (red arrow) defines a spatial neighbourhood (light-blue disc); neighbouring headings are shown as blue arrows. (B) Each heading is mapped to the unit circle by its sine and cosine, producing a point on the circle. (C) These encoded heading points are then used to fit the kernel density estimator.
To define the probabilistic heading estimator, the circular nature of headings needs to be considered. Each heading, h, can be represented as a point on the unit circle, denoted as , by employing cyclical encoding. This is implemented as follows:
Let denote the number of original AIS observations falling within of observation i, and let denote the mean of over all N observations. Heading neighbourhoods are computed for every observation prior to sampling, so a ball tree over the N observations is constructed in time and a fixed-radius query is performed for each observation. Unlike the counting queries of Section 3.5, these queries return the neighbouring headings themselves, so each contributes an additive term proportional to the number of points retrieved. Assuming traversal per radius query, as in Section 3.5, retrieving the heading neighbourhoods of all N observations therefore requires
with a worst-case cost of .
Fitting the estimator for a sampled node i stores its encoded headings, obtained from Equation (4), in a spatial index, at a cost of . Since an estimator is fitted only for nodes with at least two neighbouring headings, the total fitting cost over the sampled nodes is
3.6.3. Defining Edges
The definition of an edge follows DAISTIN and combines a neighbourhood and a direction criterion. The neighbourhood criterion is unchanged: only nodes located within a radius around the node under investigation are considered as candidates.
The direction criterion exploits the node-specific heading estimator (KDE) which, as described in Section 3.6.2, is fitted in the cyclically encoded heading space rather than directly on the scalar heading. Recall Equation (4); a heading h is encoded as the point on the unit circle, with a two-dimensional KDE fitted on these encoded points. For a destination node B, let denote this fitted two-dimensional density.
The scalar directional score used by the edge test is obtained by restricting to the unit circle and renormalizing it over the full angular domain, yielding the one-dimensional circular density:
so that .
Consider a starting node A and a candidate destination node B, and let be the bearing of and the angular half-window threshold. We define the directional compatibility score as
The edge is accepted if and only if
where is a tunable probability threshold. When a node has fewer than two neighbouring headings, the KDE is not fitted, and the implementation falls back to a deterministic angular threshold test, accepting the edge when the absolute angular difference between and the node heading is at most .
A directed edge in the graph is added only when both criteria are satisfied, as illustrated in Figure 7. Since independently assessing each criterion for every node and edge is computationally expensive, we adopt the ball-tree approach from the original DAISTIN method, modifying it to incorporate our specific criteria. We provide the pseudocode of xDAISTIN graph construction in Algorithm 2.
Figure 7.
Edge criteria of xDAISTIN. (A) Neighbourhood criterion: only nodes within a radius (light blue area) are treated as candidate neighbours (light blue nodes) of a sampled node (dark blue); nodes outside (grey) are ignored. (B) Direction criterion: for each candidate neighbour, the potential edge direction is evaluated using the heading-based KDE. Edges are created only when this direction has probability above a threshold (solid green arrows); candidates that do not satisfy this threshold are discarded (dashed grey arrow).
Let denote the number of local heading observations associated with the node whose KDE is evaluated for candidate edge e. In xDAISTIN this is the destination and in xDAISTOUT the source node of e. Because the numbers of angular samples used for local-window integration and full-circle normalization are fixed, a conservative evaluation cost for edge e is . Over all candidate edges, the KDE-based evaluation cost is therefore
where
is the average heading-neighbourhood size over the KDE evaluations performed for candidate edges.
| Algorithm 2 Construct xDAISTIN graph |
|
3.6.4. Interpolation
A gap is defined as two consecutive AIS points, points A and B, of a trajectory that are separated by a time difference that exceeds a predefined threshold (herein set to 3 min). We interpolate the gaps of trajectories using the constructed graph. Points A and B are temporarily added as nodes to the graph, and edges to neighbouring nodes are created according to the previously defined neighbourhood and direction criteria.
To bound the interpolation, we estimate the maximum distance that the vessel could have travelled between A and B. We use the speed at A and the time difference :
assuming consistent units (e.g., knots). The lower bound of 1 knot prevents points classified as stops (speed ) from implying a short distance travelled.
We then search for the most probable path from A to B using Dijkstra’s algorithm with a cumulative distance constraint. Each directed edge in the graph is assigned a weight equal to the negative logarithm of its transition probability. Dijkstra’s algorithm therefore seeks the path that minimizes the sum of these weights, i.e., the most probable path. During the search, we also track the cumulative travelled distance along each candidate path. If this distance exceeds before reaching B, the corresponding path is discarded and the algorithm continues with the remaining candidates. In contrast to the original DAISTIN method, which finds the shortest-distance path, our approach derives a maximum travel distance from the time gap and speed and then maximizes path probability—based on KDE-estimated edge transition probabilities—subject to this distance constraint.
3.7. Variants of the Methods
In addition to the original DAISTIN and the proposed xDAISTIN, we also implement xDAISTOUT, as well as several variants of all methods, and assess their performance. The undirected DAISTIN variant retains the asymptotic time complexity of the original DAISTIN, while all xDAISTIN and xDAISTOUT variants retain that of xDAISTIN.
3.7.1. xDAISTOUT
xDAISTOUT is a variant of xDAISTIN that modifies the direction criterion used to construct edges (difference visualized in Figure 8). For a candidate edge from node A to node B that already satisfies the distance criterion, we compute the bearing of the vector , apply cyclical encoding, and evaluate its likelihood under the KDE fitted at the starting node A rather than the destination node B. An edge between A and B is created only if this bearing falls within an angular window around a high-probability region of A’s KDE.
Figure 8.
Comparison of the direction criterion used by xDAISTIN and xDAISTOUT. For a candidate directed edge from node A to node B, xDAISTIN evaluates the bearing using the circular heading density fitted at the destination node B, whereas xDAISTOUT evaluates the same bearing using the circular heading density fitted at the source node A. Solid green arrows represent candidate edges whose directional compatibility is within the probability thresholds and are therefore accepted; dotted grey arrows represent candidate edges that did not meet the criterion.
Formally, the only change relative to xDAISTIN is that the candidate bearing is scored against the source node’s circular density (obtained from exactly as in Section 3.6.2) rather than the destination node’s,
and the edge is accepted if and only if and .
3.7.2. Undirected Version
Graph removes edge directionality from Graph X, turning all admissible edges into undirected connections, thereby allowing bidirectional traversal. Undirected variants are constructed for DAISTIN, xDAISTIN, and xDAISTOUT.
3.7.3. Shortest Version
Graph retains the graph topology of Graph X but changes the path selection rule: instead of maximizing path probability, it selects the path with the minimum accumulated Haversine distance. This is the original mechanism of path finding for DAISTIN [4]. We also implement it for the proposed xDAISTIN and xDAISTOUT methods.
3.7.4. Undirected-and-Shortest Version
Graph combines the two previous modifications: edges are undirected, and path finding is based on the shortest Haversine distance. This variant is implemented for both xDAISTIN and xDAISTOUT.
3.8. Post-Processing
Our approach to post-processing is the same as the original DAISTIN’s approach, which incorporates the Douglas–Peucker algorithm in conjunction with a linear interpolation algorithm [4].
Regarding the Douglas–Peucker algorithm, it begins by selecting the endpoints of the corresponding interpolated path. The algorithm then finds the point that is farthest from the line segment connecting these endpoints. If the farthest point is within a specified tolerance, it is removed, as the line segment sufficiently represents the original path within the given tolerance. If the point is outside the tolerance, it is retained, and the process is recursively applied to the segments formed by the current point and the endpoints. The result is a simplified path that approximates the original path with fewer points, effectively reducing complexity while maintaining its overall initial form.
By definition, this algorithm eliminates points that exhibit linear or near-linear behaviour to simplify the path. However, if a substantial portion of the trajectory follows a linear pattern, this can create large gaps between retained points. To address this, and in line with the original DAISTIN post-processing step, we apply linear interpolation to reconnect segments where the distance between consecutive points exceeds a predefined threshold.
Let m denote the number of points in the reconstructed path before simplification. For the standard Douglas–Peucker implementation, the running time depends on the recursive split pattern. It is when the path is accepted as a single segment, under balanced recursive splitting, and in the worst case. If densification produces d points, the subsequent densification step requires time. Because reconstructed paths typically contain substantially fewer points than the underlying graph contains nodes, post-processing is not expected to dominate the overall runtime.
3.9. Implementation Details
For the implementation of our graph-based interpolation methods, we used Python (version 3.13.5) with several packages: networkX [19], scikit-learn [20], NumPy [21], shapely [22], and rdp [23]. For data cleaning, analysis, and visualization, in addition to the previously mentioned libraries, we also utilized the following Python packages: Pandas [24], Matplotlib (version 3.10.0) [25], contextily [26], folium [27], SciPy [28], and Seaborn (version 0.13.2) [29]. For reproducibility, Table 2 summarizes the main hyperparameter values and implementation and evaluation settings used in the reported experiments.
Table 2.
Hyperparameter and evaluation-setting values. Final hyperparameter, implementation, and evaluation-setting values used in the reported experiments. The table uses “–” when a symbol is not specified for a parameter in the manuscript, and the superscript asterisk in denotes the target, rather than the actual, number of sampled graph nodes.
Lastly, we note that the proposed methods were developed with port-specific use in mind, rather than for a global maritime traffic model. Relatedly, we stress that for a specific area of interest, graph construction is performed offline, and the resulting precomputed graph then used for online interpolation queries. Extending our approach to more extensive maritime domains would involve the partitioning of the domain into separate, possibly overlapping regions, with a separate graph constructed for each region. These graphs could be periodically rebuilt as new AIS data become available or as traffic patterns change. The development of efficient and accurate incremental update methods is a viable topic for future work.
4. Results
The reconstructed trajectories in the test set were evaluated quantitatively against the complete ground truth trajectories and qualitatively through visual inspection of selected cases with respect to the port’s geometry and layout and navigational rules.
4.1. Evaluation Metrics
For quantitatively evaluating reconstructed trajectories, we investigate the use of three widely used metrics in the literature that capture complementary aspects of trajectory similarity: segmented path distance (SPD), Hausdorff distance (HD), and discrete Fréchet distance (DFD) [30]. As illustrated in Figure 9, each metric responds differently to the selected trajectory reconstructions. Herein, the SPD and HD are reported in kilometres, whereas the DFD is reported in decimal degrees.
Figure 9.
Evaluation metrics for trajectory reconstruction. Each panel shows the complete ground truth trajectory (GT, green), the sparse trajectory obtained by removing the observations inside the shaded signal gap, and two candidate interpolations of the gap, (blue, top row) and (orange, bottom row). Dots denote trajectory points, and red text highlights the metric illustrated in the corresponding panel. (A) Segmented Path Distance (SPD): an example in which SPD distinguishes between the two reconstructions, while HD and DFD assign them equal values. (B) Hausdorff Distance (HD): an example illustrating the sensitivity of HD to a large local deviation (green peak). (C) Discrete Fréchet Distance (DFD): an example in which a longer reconstruction is only penalized by DFD.
4.1.1. Segmented Path Distance
The SPD is a point-to-segment metric that captures both local deviations and structural differences between two trajectories. It is defined as
where and are the trajectories being compared, and are their numbers of points, is the -th point of , and is the -th segment of .
The point-to-segment distance is defined as
where is the orthogonal projection of onto the segment , and distances are computed using the Haversine formula.
Because the SPD aggregates deviations across points (rather than focusing on a single worst deviation), we treat the SPD as the primary evaluation metric for performance assessment.
4.1.2. Discrete Hausdorff Distance
The discrete Hausdorff distance (hereafter referred to as the Hausdorff distance (HD)) quantifies the maximum of the minimum point-to-point distances between two trajectories, with each trajectory represented as a set of points. For trajectories and , using the Haversine point-to-point distance ,
In this work, we use the directed formulation of the Hausdorff distance, which measures the largest distance from a point in to its closest point in . Since the HD is based on a maximum over all points, it is sensitive to outliers.
4.1.3. Discrete Fréchet Distance
The Fréchet distance is a measure of similarity between two curves that takes into account the location and ordering of the points along the curves. It is typically explained as the minimum “leash” length required to connect a point moving along one trajectory to a point moving along the other.
The DFD [31] quantifies the similarity between two polygonal curves, represented here as trajectories. Consider two trajectories and , where
represent the sequences of points of each trajectory. A coupling L between and is defined as a sequence of pairs
such that:
- The sequence starts and ends with the endpoints of both trajectories: , , , and ;
- For each , the indices satisfy:ensuring that the traversal respects the order of points in both trajectories.
The length of the coupling L, denoted , is defined as the maximum distance between any pair of matched points:
Given this, the DFD between and is defined as
Among the three metrics, only the DFD exhibits symmetry. This symmetry can negatively affect trajectory-level evaluation because it may under-penalize interpolation failures: when gaps remain unfilled, the predicted trajectory can become a subsequence of the ground truth, resulting in an artificially small (sometimes zero) DFD. Accordingly, while we report the DFD in selected experiments, it should be interpreted with caution, especially when the interpolation completion rate is low.
4.2. Interpolation Completion Rate
Given points A and B that define a gap, we define the interpolation completion rate of a graph method as the percentage of gaps for which the graph found a path connecting A to B. Table 3 reports the interpolation completion rate for each method.
Table 3.
Percentage of interpolated gaps across methods and number of nodes. Comparison of interpolation completion rate across all DAISTIN, xDAISTIN, and xDAISTOUT variants with varying number of graph nodes. Bold indicates the highest interpolation completion rate for a given number of nodes.
There are marked differences between the reported percentages of DAISTIN compared to its undirected variant as well as to all the proposed methods. Removing directionality substantially improves DAISTIN’s interpolation ability (from to at 100 k; and from to at 180 k). For both xDAISTIN and xDAISTOUT, certain variants exhibit higher interpolation completion rates. For xDAISTIN, the interpolation percentages range from 88 to (directed), 92 to (undirected), 91 to (shortest), and 93 to (undirected and shortest). For xDAISTOUT, across 100 k–180 k sampled nodes, the interpolation percentages range from 66 to (directed), 92 to (undirected), 72 to (shortest), and 93 to (undirected and shortest). Similar to DAISTIN, the undirected variants of both xDAISTIN and xDAISTOUT exhibit higher interpolation completion rates. Both the shortest and the undirected-and-shortest variants also exhibit higher interpolation completion rates than the original methods. The highest interpolation completion rates are achieved by the undirected-and-shortest variant, with the undirected variant close behind, for both xDAISTIN and xDAISTOUT. Notably, across all methods (rows), interpolation completion rates increase monotonically with the increase in graph nodes. Interpolation completion rates should be interpreted alongside trajectory reconstruction metrics (see Section 4.3) since a high interpolation completion rate does not guarantee accurate trajectory reconstruction.
4.3. Quantitative Evaluation
All the quantitative results, i.e., SPD, DFD, and HD, across the evaluated methods and graph sizes, are presented in Table 4, Table 5 and Table 6. In addition, we tested differences between family variants at a fixed graph size through column-wise comparisons, and differences between graph sizes for a fixed method through row-wise comparisons. Matching coloured asterisks identify pairs of variants for which no statistically significant column-wise difference was detected after Holm–Bonferroni correction (). Matching coloured crosses have the same interpretation for row-wise graph-size comparisons. Pairs that are not linked by a matching symbol and colour differed significantly ().
Table 4.
Summary of evaluation of DAISTIN variations. Comparison of the original DAISTIN and the undirected variant across different graph sizes using SPD, HD, and DFD means. Matching coloured asterisks indicate non-significant differences between variants at the same graph size, whereas matching coloured crosses indicate non-significant differences between graph sizes for the same variant (). Bold indicates the best performance under a metric for a given number of nodes (column-wise).
Table 5.
Summary of evaluation of xDAISTIN variations. Comparison of the xDAISTIN graph variations across different graph sizes using SPD, HD, and DFD means. Matching coloured asterisks indicate non-significant differences between variants at the same graph size, whereas matching coloured crosses indicate non-significant differences between graph sizes for the same variant (). Bold indicates the best performance under a metric for a given number of nodes (column-wise).
Table 6.
Summary of evaluation of xDAISTOUT. Comparison of the xDAISTOUT graph variations across different graph sizes using SPD, HD, and DFD means. Matching coloured asterisks indicate non-significant differences between variants at the same graph size, whereas matching coloured crosses indicate non-significant differences between graph sizes for the same variant (). Bold indicates the best performance under a metric for a given number of nodes (column-wise).
Pairwise comparisons were based on two-sided paired-sample t-tests applied to the 2624 test set error differences, with Holm–Bonferroni correction applied. For column-wise comparisons involving more than two variants, namely, xDAISTIN and xDAISTOUT, a Friedman repeated-measures omnibus test was conducted before the pairwise tests. For row-wise comparisons, a Friedman repeated-measures omnibus test across the five graph sizes was conducted for every variant before pairwise follow-up testing. All Friedman tests were significant after correction (). The linear baseline was included in the tables for ease of comparative analysis but was excluded from the tests.
4.3.1. Effect of Sampling Level on the Main Graph-Based Methods
The row-wise comparisons in Table 4, Table 5 and Table 6 present the effect of increasing the number of nodes for DAISTIN, xDAISTIN, and xDAISTOUT graphs. Consistent with the interpolation completion rate results, increasing the number of graph nodes generally reduced the reconstruction errors under the three metrics. The most consistent results were observed when comparing HDs; every increase between adjacent graph sizes produced a statistically significant reduction in mean HD for every evaluated method and variant. The original DAISTIN also exhibited this consistent reduction in SPD between every pair of adjacent graph sizes. For undirected DAISTIN, however, no significant SPD differences were detected between the 140 k, 160 k, and 180 k node graphs. Based on DFD, the original DAISTIN configurations with 100 k and 120 k nodes did not differ significantly, and no significant differences were detected among the 100 k, 120 k, and 160 k undirected configurations. In relation to DFD, the results from the undirected DAISTIN were notably non-monotonic: the lowest mean DFD was obtained at 140 k nodes, whereas increasing the graph size from 140 k to 160 k and from 160 k to 180 k resulted in statistically significant increases in DFD. This occurred despite the corresponding increase in interpolation completion rate (see Table 3; for ease of analysis, these are , and , respectively, for the 140 k, 160 k, and 180 k node graphs).
For xDAISTIN, the SPD decreased significantly with every adjacent increase in graph size for all four variants, with the sole non-significant graph-size comparison occurring between 100 k and 120 k for the undirected-and-shortest variant. Across all pairwise graph-size comparisons, the only additional non-significant result was for DFD between the 100 k and 140 k shortest variants. In addition, the DFD was non-monotonic for the shortest-path variants: increasing the graph size from 100 k to 120 k significantly increased the DFD for both the shortest and undirected-and-shortest variants, after which, for larger graphs (140 k, 160 k, 180 k), the DFD decreased significantly. For xDAISTOUT, under SPD, no significant differences were detected between the 160 k and 180 k shortest variant, and between the 100 k and 120 k undirected-and-shortest variant. Under DFD, the xDAISTOUT shortest variants did not differ significantly between 120 k and 140 k and between 160 k and 180 k nodes. Consequently, denser graphs consistently improved the HD and generally improved the SPD, whereas their effect on the DFD was not as clear and it was method and variant dependent.
4.3.2. Effect of Graph-Based Method
The column-wise comparisons in Table 4, Table 5 and Table 6 present the effect of the graph variants at each fixed graph size, with asterisks denoting the pairs with no significant difference. These comparisons were conducted separately within the DAISTIN, xDAISTIN, and xDAISTOUT families; consequently, the statistical results below concern differences among variants of the same method family.
For DAISTIN, the undirected variant achieved a significantly lower mean HD than the original directed variant at every evaluated graph size. Under SPD, the undirected variant also achieved significantly lower mean errors from 100 k to 160 k nodes. At 180 k nodes, original DAISTIN had a numerically lower mean SPD, although the difference was not statistically significant (). Under DFD, undirected DAISTIN achieved significantly lower mean errors at 100 k, 120 k, and 140 k nodes. No significant difference was detected at 160 k nodes (), whereas at 180 k nodes the direction was reversed, with original DAISTIN achieving a significantly lower mean DFD. Thus, for DAISTIN, removing directionality consistently improved the HD, generally improved the SPD, but had a graph-size-dependent effect on the DFD.
Within the xDAISTIN family, the undirected variant achieved the lowest mean SPD at every graph size and was significantly better than each of the other three variants in all five graph sizes. For HD, the undirected-and-shortest variant achieved the lowest mean at 100 k and 120 k nodes. At 100 k nodes, however, it did not differ significantly from the undirected variant, whereas at 120 k nodes its lower mean HD was statistically significant. From 140 k to 180 k nodes, the undirected variant achieved the lowest mean HD and was significantly better than the remaining variants. The xDAISTIN DFD results showed a different pattern. The undirected variant achieved the lowest mean DFD and was significantly better than all other variants at 100 k, 120 k, and 140 k nodes. At 160 k nodes, the shortest variant instead achieved the lowest mean DFD and was significantly better than the other three variants. At 180 k nodes, the shortest variant again had the lowest numerical mean, but it did not differ significantly from either the undirected or the undirected-and-shortest variant.
Within the xDAISTOUT family, the undirected variant consistently achieved the lowest mean SPD. It was significantly better than all other variants at 100 k, 120 k, 140 k, and 180 k nodes. At 160 k nodes, no significant difference was detected between the undirected and undirected-and-shortest variants, although both significantly outperformed the original and shortest variants. For xDAISTOUT under DFD, the undirected variant achieved the lowest mean error and was significantly better than the other variants from 100 k to 140 k nodes. At 160 k and 180 k nodes, the undirected-and-shortest variant instead achieved the lowest mean DFD and was significantly better than all remaining variants. Under HD, the undirected-and-shortest variant achieved the lowest mean at 100 k and 120 k nodes. At 140 k nodes, it did not differ significantly from the undirected variant. At 160 k and 180 k nodes, the undirected variant achieved the lowest mean HD and was significantly better than all other variants.
Overall, removing graph directionality provided the most consistent improvements, particularly for SPD and HD. The shortest-path variants produced more graph-size- and metric-dependent effects.
4.3.3. Comparison of Selected DAISTIN, xDAISTIN, and xDAISTOUT Configurations
Based on the observations from the preceding analyses, four graph configurations were selected for a focused comparison: directed DAISTIN with 160 k nodes, undirected DAISTIN with 180 k nodes, undirected xDAISTIN with 180 k nodes, and undirected xDAISTOUT with 180 k nodes. Their mean SPD, DFD, and HD values are presented in Table 7. The Friedman repeated-measures tests identified significant overall differences among the four selected configurations for SPD, DFD, and HD (). Consequently, pairwise comparisons were conducted using two-sided paired-sample t-tests with Holm–Bonferroni correction. Matching red crosses identify configuration pairs for which no statistically significant difference was detected using the Holm-adjusted paired-sample t-test.
Table 7.
Summary of selected graph configurations. Comparison of selected DAISTIN, xDAISTIN, and xDAISTOUT configurations using SPD, DFD, and HD means. Matching coloured crosses indicate pairs of configurations with no statistically significant difference for the corresponding metric (). Bold values indicate the lowest mean error for each metric.
Overall, undirected xDAISTIN with 180 k nodes provided the strongest reconstruction performance among the four selected configurations, achieving significantly lower mean errors under all three metrics. Undirected xDAISTOUT with 180 k nodes consistently ranked second, while the relative ordering of the two DAISTIN configurations was metric dependent.
4.4. Empirical Runtime and Graph Size
We measured the empirical runtimes of graph construction and graph-based interpolation. In Table 8, we report and compare the graph construction runtimes between 100 k and 180 k node graphs of DAISTIN, xDAISTIN, and xDAISTOUT. We also report the time needed to convert the graphs into their undirected variants. Table 9 reports online interpolation runtime statistics of the main methods and their undirected variants at the 100 k and the 180 k node graph size (mean, median, std, max) over a random sample of 1000 gaps.
Table 8.
Offline graph construction runtime. Directed build time denotes full graph construction from the loaded sampled nodes for DAISTIN, xDAISTIN, and xDAISTOUT. Undirected build time denotes the additional time required to derive the undirected graph from the already constructed directed graph.
Table 9.
Online interpolation runtime for the main graph-based methods. Mean, median, standard deviation (Std.), and max times are computed at the gap-level over a random sample of 1000 gaps.
4.5. Qualitative Evaluation
To perform qualitative evaluation of reconstructions we visualized the distribution of the test set trajectory gaps in terms of displacement between the two points defining the gap, and created 20 bins with similar density. We then sampled 12 random gaps from each bin, and saved interpolations by the four selected graphs (DAISTIN directed with 160 k nodes, DAISTIN undirected with 180 k, xDAISTIN undirected 180 k, and xDAISTOUT undirected 180 k) and baseline (linear interpolation) on a total of 240 cases.
Based on visual examination, the first observation that can be made concerns the nature of the reconstructed trajectories as produced by the DAISTIN graphs (both directed and undirected). More often than not, cases in which the reconstructions of the DAISTIN and DAISTIN undirected graphs are superior to the xDAISTIN graphs are ones whose ground truth favours simpler trajectories (e.g., a linear reconstruction or one with fewer intermediate points). Such examples are shown in rows A for DAISTIN undirected and B for DAISTIN directed of Figure 10. We note that the majority of cases where DAISTIN graphs surpass our proposed methods fall under this category. However, in Figure 10 we chose to illustrate more interesting examples, without claiming that the examples shown are representative of the data set. Rows C and D demonstrate cases where directed edges enabled DAISTIN (160 k) to reconstruct a fairly accurate trajectory following the right side of the lane. Rows E and F present cases for which DAISTIN undirected and directed, respectively, provided reconstructions more aligned to the ground truth trajectories.
Figure 10.
Qualitative examination of gap interpolation by DAISTIN variants. Selected cases (A–F) where gap interpolations are performed best by the DAISTIN variants according to SPD. Columns, in order, show the gap interpolation by all methods: DAISTIN (160 k), undirected DAISTIN (180 k), undirected xDAISTIN (180 k), undirected xDAISTOUT (180 k), and linear interpolation. Black trajectories denote ground truth and grey denotes the sparse observed trajectory. Asterisks denote the lowest reconstruction error for each metric within each case (row-wise).
The second observation concerns our proposed methods, xDAISTIN undirected (180 k) and xDAISTOUT undirected (180 k): we were able to identify different port areas in which each method performs better. This can be observed by comparing Figure 11 and Figure 12. Specifically, the two methods appear to perform best in different areas of the port: one in narrow navigational corridors (xDAISTOUT), and the other in confined inner-port waters, such as terminal or berthing areas (xDAISTIN). This observation is exploratory and should not be interpreted as evidence of method specialization.
Figure 11.
Qualitative examination of gap interpolation in corridors. Selected cases (A–F) where the gap is located in a corridor, with the xDAISTOUT undirected graph performing the best in most of them according to SPD. Columns, in order, show the gap interpolation by all methods: DAISTIN (160 k), undirected DAISTIN (180 k), undirected xDAISTIN (180 k), undirected xDAISTOUT (180 k), and linear interpolation. Black trajectories denote ground truth and grey denotes the sparse observed trajectory. Asterisks denote the lowest reconstruction error for each metric within each case (row-wise).
Figure 12.
Qualitative examination of gap interpolation in confined inner-port waters. Selected cases (A–E) where gap interpolations are located in confined inner-port waters such as berths and terminals, with the xDAISTIN undirected graph performing the best in most of them according to SPD. Columns, in order, show the gap interpolation by all methods: DAISTIN (160 k), undirected DAISTIN (180 k), undirected xDAISTIN (180 k), undirected xDAISTOUT (180 k), and linear interpolation. Black trajectories denote ground truth and grey denotes the sparse observed trajectory. Asterisks denote the lowest reconstruction error for each metric within each case (row-wise).
Finally, our qualitative analysis also exposed limitations of both the methods and of the ground truth in a few instances. In Figure 13, we present selected cases of DAISTIN artefacts (A–C), an xDAISTIN and xDAISTOUT artefact (D), a gap where all methods struggle (E), a gap favouring linear interpolation (F), and cases where the ground truth is insufficiently detailed (G,H).
Figure 13.
Reconstruction failures, artefacts, and incomplete ground truth cases. Selected cases illustrating directed and undirected DAISTIN artefacts (A–C), xDAISTIN and xDAISTOUT movement artefact (D), a gap where all methods struggle (E), a case favouring linear interpolation (F), and two cases with insufficiently detailed ground truth (G,H). Columns, in order, show the gap interpolation by all methods: DAISTIN (160 k), undirected DAISTIN (180 k), undirected xDAISTIN (180 k), undirected xDAISTOUT (180 k), and linear interpolation. Black trajectories denote ground truth and grey trajectories denote the sparse observed trajectory. Asterisks denote the lowest reconstruction error for each metric within each case (row-wise).
5. Discussion
The results support the central hypothesis of our work: directional information discarded during geometric sampling is consequential for graph-based trajectory reconstruction in ports. Enriching sampled nodes with local circular heading distributions improved the interpolation completion rate at every evaluated graph size and reduced reconstruction errors. Most notably, directed xDAISTIN with 100 k nodes reconstructed 88.02% of the introduced gaps, exceeding the 84.61% achieved by directed DAISTIN with 180 k nodes. In the focused comparison, undirected xDAISTIN with 180 k nodes achieved the strongest performance, reducing the mean SPD by approximately 14%, mean DFD by approximately 43%, and mean HD by approximately 36% relative to undirected DAISTIN at the same graph size. These findings suggest that preserving neighbourhood-level directional information produces graphs that are both better connected and represent real-world movement patterns more effectively.
Removing graph directionality generally improved both the interpolation completion rate and reconstruction accuracy. Importantly, the undirected variants do not discard directional information during graph construction: edges are first selected using the direction criterion of the corresponding method and are subsequently made traversable in both directions. This suggests that directional information is useful for identifying plausible connections, whereas enforcing a single traversal direction can make the graph overly restrictive during interpolation.
The core difference between xDAISTIN and xDAISTOUT is that xDAISTIN evaluates a candidate transition using the destination node’s heading distribution, whereas xDAISTOUT evaluates it using the source node’s distribution. In the focused comparison, undirected xDAISTIN achieved significantly lower errors than undirected xDAISTOUT under all three metrics. This suggests that assessing whether a candidate location is normally approached along the proposed bearing may be more informative than assessing whether the bearing is common when leaving the current location. Nevertheless, the qualitative results suggest that the methods may have complementary strengths in different port areas, an observation that requires further empirical evaluation.
The qualitative analysis broadly supports the quantitative findings. Linear interpolation remained effective for simple and approximately straight gaps, but fails when there is any deviation from a straight movement. DAISTIN and its undirected variant reconstructed some nontrivial movements more successfully than the proposed methods. However, most cases in which DAISTIN performed better involved simple, approximately linear trajectories or trajectories with few intermediate observations. Both DAISTIN variants also occasionally produced substantial detours. Overall, the proposed methods, xDAISTIN and xDAISTOUT, produced trajectories that were more closely aligned with the ground truth, including in corridors and inner-port areas. Nevertheless, artefacts remained, and in some cases the ground truth was too sparse to reliably determine which graph reconstruction was most accurate.
Several limitations should be acknowledged. First, the evaluation was conducted using AIS data from a single port and over a relatively short collection period; additional ports are needed to assess generalization across different layouts and traffic patterns. Second, the evaluation relied on synthetically introduced gaps. Although this provides ground truth from real-world data, real AIS losses may follow different temporal and spatial patterns and would require an independent reference source, such as radar or satellite remote sensing data [32], for quantitative evaluation. Finally, the methods were assessed using a fixed hyperparameter configuration and only on moving sub-trajectories.
6. Conclusions
This work introduced xDAISTIN and xDAISTOUT, two extensions of DAISTIN for reconstructing incomplete AIS trajectories in complex port environments. Both methods preserve directional information that would otherwise be lost during geometric sampling by enriching sampled graph nodes with local circular heading distributions estimated from nearby historical AIS observations. xDAISTIN evaluates candidate transitions using the destination node’s distribution, whereas xDAISTOUT uses the source node’s distribution.
Experiments on real-world AIS data from the Port of Antwerp, using synthetic gaps introduced into held-out trajectories, showed that this enrichment substantially improves the interpolation completion rate. Directed xDAISTIN with 100 k nodes reconstructed 88.02% of the introduced gaps, exceeding the 84.61% achieved by directed DAISTIN with 180 k nodes. At 180 k nodes, the undirected-and-shortest path xDAISTIN variant achieved the highest interpolation completion rate, at 99.13%, whereas undirected probabilistic xDAISTIN provided the strongest reconstruction accuracy in the focused comparison. It achieved mean SPD, DFD, and HD values of , , and , respectively, and significantly outperformed the selected DAISTIN and xDAISTOUT configurations under all three metrics. Relative to undirected DAISTIN at the same graph size, it reduced mean SPD by approximately 14%, mean DFD by approximately 43%, and mean HD by approximately 36%.
In our experiments, shortest-path graph traversal slightly improved the interpolation completion rate and sometimes reduced worst-case deviation for smaller graphs, whereas the probabilistic approach generally produced lower average reconstruction error and performed better as graph density increased. Future work should examine computational optimizations, multi-port validation, real AIS losses supported by independent ground truth, low-speed manoeuvres (<1 knot), hyperparameter sensitivity, and hybrid criteria combining source- and destination-side directional information, i.e., combining the edge construction criteria of xDAISTIN and xDAISTOUT. Overall, our findings demonstrate that preserving neighbourhood-level directional behaviour during graph construction enables more accurate reconstruction of in-port AIS trajectories. Furthermore, our cautious hypothesis is that shortest-path traversal may be preferable when it is desirable to avoid large deviations and maximize the interpolation completion rate, especially for relatively sparse graphs, whereas the probabilistic approach appears preferable when greater importance is placed on the average accuracy of the reconstructed trajectory and the graph is sufficiently dense.
Author Contributions
Conceptualization, E.Z. and N.D.; methodology, E.Z. and N.D.; software, E.Z. and N.D.; validation, E.Z., N.D. and O.A.; formal analysis, E.Z.; investigation, E.Z., N.D. and O.A.; data curation, E.Z.; writing—original draft preparation, E.Z., N.D. and O.A.; writing—review and editing, N.D. and O.A.; visualization, E.Z. and N.D.; supervision, N.D.; project administration, N.D.; funding acquisition, N.D. All authors have read and agreed to the published version of the manuscript.
Funding
This work was co-financed by the European Union—NextGenerationEU, through the Research and Innovation Foundation with grant numbers CODEVELOP-GT/0322/0096 (ADAPTATION) and the EU H2020 Research and Innovation Programmes under Grant Agreements No. 857586 (CMMI-MaRITeC-X).
Institutional Review Board Statement
Not applicable.
Informed Consent Statement
Not applicable.
Data Availability Statement
Research data for this article are made available via Mendeley Data (DOI: 10.17632/smb56stcdx.1) at https://data.mendeley.com/datasets/smb56stcdx/1 (accessed on 5 August 2026).
Acknowledgments
Our work would not be possible without the support of our colleague Charalambos Rotsides, who was instrumental in the efficient collection, processing, and storage of the data. During the preparation of this manuscript, the authors used OpenAI’s ChatGPT (model: GPT-5.6 Sol) for language editing assistance. The authors have reviewed and edited the output and take full responsibility for the content of this publication.
Conflicts of Interest
The authors declare no conflicts of interest.
Abbreviations
The following abbreviations are used in this manuscript:
| AIS | Automatic identification system |
| AND | Approximate neighbourhood density |
| CH | Calculated heading |
| COG | Course over ground |
| DAISTIN | Data-driven AIS Trajectory Interpolation |
| DFD | Discrete Fréchet distance |
| FD | Fréchet distance |
| HD | Hausdorff distance |
| KDE | Kernel density estimator |
| MMSI | Maritime Mobile Service Identity |
| SOG | Speed over ground |
| SPD | Segmented path distance |
| xDAISTIN | Extended Data-driven AIS Trajectory Interpolation with Destination-node |
| Directional Evaluation | |
| xDAISTOUT | Extended Data-driven AIS Trajectory Interpolation with Source-node |
| Directional Evaluation |
References
- International Maritime Organization. Resolution A.1106(29): Revised Guidelines for the Onboard Operational Use of Shipborne Automatic Identification Systems (AIS); International Maritime Organization: London, UK, 2015. [Google Scholar]
- Liang, M.; Su, J.; Liu, R.W.; Lam, J.S.L. AISClean: AIS data-driven vessel trajectory reconstruction under uncertain conditions. Ocean. Eng. 2024, 306, 117987. [Google Scholar] [CrossRef] [Scilit]
- MIS Marine. The Use of AIS Data to Identify Dark Activity for Marine Auditing Purposes; MIS Marine: Birmingham, UK, 2020. [Google Scholar]
- Magnussen, B.B.; Bläser, N.; Lu, H. DAISTIN: A Data-Driven AIS Trajectory Interpolation Method. In Proceedings of the 18th International Symposium on Spatial and Temporal Data, Calgary, AB, Canada, 23–25 August 2023; Association for Computing Machinery: New York, NY, USA, 2023; pp. 75–84. [Google Scholar] [CrossRef] [Scilit]
- Nguyen, V.S.; Im, N.K.; Lee, S.M. The interpolation method for the missing AIS data of ship. J. Navig. Port Res. 2015, 39, 377–384. [Google Scholar] [CrossRef] [Scilit]
- Sang, L.Z.; Wall, A.; Mao, Z.; Yan, X.P.; Wang, J. A novel method for restoring the trajectory of the inland waterway ship by using AIS data. Ocean. Eng. 2015, 110, 183–194. [Google Scholar] [CrossRef] [Scilit]
- Yuan, Z.; Liu, J.; Liu, Y.; Li, Z. A novel approach for vessel trajectory reconstruction using AIS data. In Proceedings of the ISOPE International Ocean and Polar Engineering Conference, Honolulu, HI, USA, 16–21 June 2019; ISOPE: Cupertino, CA, USA, 2019; pp. 4554–4559. [Google Scholar]
- Bai, X.; Fang, M.; Xu, X.; Xiao, Y.; Wu, Y.; Chen, N. Research on Ship AIS Trajectory Reconstruction for Narrow-Mouth Section Waters under Complex Environment. Navig. China 2024, 47, 106–113. [Google Scholar] [CrossRef]
- Ye, L.; Chen, X.; Liu, H.; Zhang, R.; Li, J.; Lu, C.; Zhao, Y. A Study of Multi-Step Sparse Vessel Trajectory Restoration Based on Feature Correlation. Appl. Sci. 2024, 14, 4057. [Google Scholar] [CrossRef] [Scilit]
- Galdelli, A.; Narang, G.; Tomassini, S.; D’Agostino, L.; Tassetti, A.N.; Mancini, A. Data Imputation in Large and Small-Scale Spatiotemporal Time Series Gaps Using BackForward Bi-LSTM. J. Big Data 2025, 12, 115. [Google Scholar] [CrossRef] [Scilit]
- Gao, Z.; Gao, J. Research on Ship Trajectory Repair Algorithm Based on AIS Data. In Proceedings of the 4th International Conference on Computer, Artificial Intelligence and Control Engineering, Hefei, China, 10–12 January 2025; Association for Computing Machinery: New York, NY, USA, 2025. [Google Scholar] [CrossRef] [Scilit]
- Han, X.; Bai, S.; Issayeva, G.; Ma, C.; Li, F.; Shang, X. STAR: Spatio-Temporal Trajectory Recovery for Sparse and Uncertain Marine Trajectories. In Proceedings of the Database Systems for Advanced Applications; Lecture Notes in Computer Science; Zhu, F., Yu, P.S., Nadamoto, A., Lim, E.P., Shim, K., Ding, W., Zhang, B., Eds.; Springer: Singapore, 2026; Volume 15991, pp. 482–486. [Google Scholar] [CrossRef] [Scilit]
- Arandjelović, O. Contextually learnt detection of unusual motion-based behaviour in crowded public spaces. In Proceedings of the Computer and Information Sciences II: 26th International Symposium on Computer and Information Sciences; Springer: London, UK, 2011; pp. 403–410. [Google Scholar]
- Dimitriou, N. Historical Knowledge Graphs for Global Maritime Estimated Time of Arrival. arXiv 2026, arXiv:2605.18408. [Google Scholar] [CrossRef] [Scilit]
- Filipiak, D.; Węcel, K.; Stróżyna, M.; Michalak, M.; Abramowicz, W. Extracting maritime traffic networks from AIS data using evolutionary algorithm. Bus. Inf. Syst. Eng. 2020, 62, 435–450. [Google Scholar] [CrossRef] [Scilit]
- Onyango, S.O.; Owiredu, S.A.; Kim, K.I.; Yoo, S.L. A quasi-intelligent maritime route extraction from AIS data. Sensors 2022, 22, 8639. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Hadjipieris, A.; Dimitriou, N.; Arandjelović, O. Unsupervised Port Berth Localization from Automatic Identification System Data. Sensors 2025, 25, 6845. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Saalfeld, A. Topologically Consistent Line Simplification with the Douglas-Peucker Algorithm. Cartogr. Geogr. Inf. Sci. 1999, 26, 7–18. [Google Scholar] [CrossRef] [Scilit]
- Hagberg, A.A.; Schult, D.A.; Swart, P.J. Exploring Network Structure, Dynamics, and Function using NetworkX. In Proceedings of the 7th Python in Science Conference; Varoquaux, G., Vaught, T., Millman, J., Eds.; SciPy Proceedings Organization: Pasadena, CA, USA, 2008; pp. 11–15. [Google Scholar]
- Pedregosa, F.; Varoquaux, G.; Gramfort, A.; Michel, V.; Thirion, B.; Grisel, O.; Blondel, M.; Prettenhofer, P.; Weiss, R.; Dubourg, V.; et al. Scikit-learn: Machine Learning in Python. J. Mach. Learn. Res. 2011, 12, 2825–2830. [Google Scholar]
- Harris, C.R.; Millman, K.J.; van der Walt, S.J.; Gommers, R.; Virtanen, P.; Cournapeau, D.; Wieser, E.; Taylor, J.; Berg, S.; Smith, N.J.; et al. Array programming with NumPy. Nature 2020, 585, 357–362. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Gillies, S. Shapely: Python Package for Manipulation and Analysis of Geometric Objects. 2007. Available online: https://github.com/Toblerity/Shapely (accessed on 5 August 2026).
- Hirschmann, F. Ramer-Douglas-Peucker Algorithm (rdp), Python Package. Available online: https://pypi.org/project/rdp/ (accessed on 5 August 2026).
- McKinney, W. Data structures for statistical computing in Python. In Proceedings of the 9th Python in Science Conference, Austin, TX, USA, 28 June–3 July 2010; Volume 445, pp. 51–56. [Google Scholar]
- Hunter, J.D. Matplotlib: A 2D graphics environment. Comput. Sci. Eng. 2007, 9, 90–95. [Google Scholar] [CrossRef] [Scilit]
- Arribas-Bel, D. Contextily: Python Package for Context Geo Tiles. 2023. Available online: https://contextily.readthedocs.io (accessed on 5 August 2026).
- Story, R. Folium, Python Package. 2025. Available online: https://pypi.org/project/folium/ (accessed on 5 August 2026).
- Virtanen, P.; Gommers, R.; Oliphant, T.E.; Haberland, M.; Reddy, T.; Cournapeau, D.; Burovski, E.; Peterson, P.; Weckesser, W.; Bright, J.; et al. SciPy 1.0: Fundamental Algorithms for Scientific Computing in Python. Nat. Methods 2020, 17, 261–272. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Waskom, M.L. Seaborn: Statistical data visualization. J. Open Source Softw. 2021, 6, 3021. [Google Scholar] [CrossRef] [Scilit]
- Besse, P.; Guillouet, B.; Loubes, J.M.; Royer, F. Review & Perspective for Distance Based Trajectory Clustering. arXiv 2015, arXiv:1508.04904. [Google Scholar]
- Eiter, T.; Mannila, H. Computing Discrete Fréchet Distance; Technical Report CD-TR 94/64; Technical University of Vienna: Vienna, Austria, 1994. [Google Scholar]
- Belmouhcine, A.; Pham, M.T.; Hadjisoteriou, A.; Dimitriou, N. Upsampling and Knowledge Distillation Improve Small-Object Detection in Satellite Remote Sensing. IEEE J. Sel. Top. Appl. Earth Obs. Remote Sens. 2026, 19, 16607–16622. [Google Scholar] [CrossRef] [Scilit]
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2026 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license.












