1. Introduction
With the growth of international trade, maritime transportation has become one of the most critical trade transportation modes. However, in the waterways where the navigation environment is complex and high traffic density occurs, the behavior of ships tended to be complicated and poses an increasing risk of maritime accidents. Navigation safety is one of the challenges faced by smart ship applications [
1]. To prevent and manage potential risks, it is essential to employ intelligent ship management and monitoring strategies that enable reliable identification of ship behavior and intentions in specific areas, within which the accurate prediction of ship behavior and trajectories have been drawing much attention from both academia and industry.
At present, various scholars have carried out research work on ship trajectory prediction. Rong et al. [
2] proposed a probabilistic trajectory prediction model, which decomposed ship motion prediction into two directions, horizontal and vertical, and calculated position probabilities along these two directions. There are also studies, e.g., [
3], which applied machine learning technique to infer commonalities of related trajectory segments. Subsequently, the trajectory associated with that pattern was predicted. Yang et al. [
4] combined Density-Based Spatial Clustering of Applications with Noise (DBSCAN) and Long Short-Term Memory (LSTM) models for trajectory prediction. In general, the research on ship trajectory prediction based on AIS data could be divided into methods based on statistics and methods based on Neural Networks and Deep Learning.
The ship trajectory prediction method based on statistics constructs the mathematical model of the trajectory through the historical data of the ship. According to the literature following this approach, the major statistic methods for trajectory prediction are as follows: Kalman filter [
5,
6], hidden Markov model [
7,
8], Bayesian network [
9,
10], Gaussian process [
2], and Gaussian mixture model [
11]. Most of the ship trajectory prediction methods based on statistics have the advantages of simplicity, unbiasedness, and fast calculation, such as Kalman filter and GMM models. However, in non-linear mid-to-long-term scenarios, statistical-based forecasting methods no longer have good applicability, and there is a problem of low forecasting accuracy. For example, the Kalman filter has linear characteristics and cannot achieve the optimal estimation effect in non-linear scenarios. On the other hand, HMM can only utilize contextual information by building a high-level model. Therefore, it is necessary to find more suitable prediction methods for non-linear scenarios.
The emergence of deep learning (DL) provides a promising solution to precisely address this problem. From the research framework of trajectory prediction based on neural networks and deep learning, trajectory prediction research involves three major procedures: Data Processing, Model Structure design, and Model Optimization.
In terms of data processing, data filtering can use machine learning methods such as clustering and filtering to process ship trajectory data to obtain training data sets. For example, Suo et al. [
12] used the DBSCAN algorithm to cluster trajectories to construct a training dataset for ship trajectory prediction. Some scholars have carried out more detailed research on the basis of dividing the data into four datasets: straight line, turning, acceleration, and deceleration; Gao et al. [
13] used cubic spline interpolation and median filtering to process AIS data to eliminate the measurement error and time interval inconsistency of AIS data. These machine-learning-based practices help to build reliable datasets for deep learning models and improve the prediction accuracy of the models. In addition, semantic representation is also used to divide ship trajectories. Semantic representation of ship behavior using autoencoding and other methods, e.g., [
14], have been used in the construction of training data sets. From the work aforementioned, one can see that constructing a trajectory set with rich and significant ship behavior characteristics is a necessary basis for ship trajectory prediction.
In terms of model structure design, Zhang et al. [
15] used recurrent neural networks, a variant of LSTM networks, to model ship trajectories. And Suo et al. [
12] used GRU for modeling. Although ship trajectory points all have behavioral characteristics, trajectory points such as turning, acceleration, and deceleration have a greater impact on subsequent trajectory behavior than ordinary straight-line points. Sekhon and Fleming [
16] used spatial attention and temporal attention to optimize the model on the LSTM model so that the model could consider the influence of historical trajectory space and time on the future trajectory. In [
17], a ship trajectory prediction model based on a multi-head attention mechanism and bidirectional gated recurrent unit (MHA-Bi-GRU) was proposed. In addition, due to the need to maintain a large distance between ships, many researchers believe that the behavior of other ships will also affect the prediction of ship behavior. Liu et al. [
18] used the ship traffic conflict situation model generated by dynamic AIS data and social force concept to embed it into the LSTM network.
In order to obtain the good performance of different models, some researchers have combined the models for trajectory prediction research. In [
19], a method of combining GRU with AM by a multi-scale convolutional neural network (MSCNN) and performing parallel collection with an autoregressive (AR) model is proposed. Abebe et al. [
20] decomposed the AIS data into linear and nonlinear by using the moving average filter (MA) and applied ARIMA and LSTM to model the ship trajectory, respectively. To enhance the accuracy of long-term trajectory prediction, Forti et al. [
21] employed a sequence-to-sequence neural network underpinned by a long short-term memory (LSTM) encoder-decoder framework to model the temporal dependencies in longer ship trajectory sequences. In [
22], Wang proposed a generative adversarial network with an attention module and an interaction module, which could simultaneously infer the future trajectories of all ships in the same area. Considering the advantages of the attention mechanism and the Seq2Seq model, [
23] used the Transformer model to build a ship trajectory prediction model, which consisted of self-attention to form a codec, making the model more efficient and accurate.
With the development of the graph convolutional neural network, Liu et al. [
24] proposed a trajectory prediction framework based on spatio-temporal, multi-graph convolutional networks. The graphs used in the framework included the time to the nearest point and the size of surrounding ships according to the social force model.
The optimization of models can be categorized into parameter optimization and output optimization. Parameter optimization refers to the tuning of neural network hyperparameters through heuristic algorithms and other techniques [
25]. In [
26], a Genetic Algorithm (GA) was used to optimize the hyper-parameters of the trajectory prediction framework LSTM. Model output optimization uses other models to optimize the output results of the neural network model to obtain a more accurate and realistic ship prediction trajectory. Ref. [
27] cascades the data-driven predictor through the Kalman filter and the motion estimation model and uses the output of the data-driven predictor as the input of the filter to optimize the predicted trajectory. In [
28], model predictive control is used to modify the output of the trajectory prediction model to ensure that the predicted trajectory satisfies the kinematic constraints.
While many machine learning methods have been used in the data processing part, researchers have found that the conventional ship trajectory processing methods are insufficient in integrating trajectory characteristics for ship trajectories in densely navigated waters. At the same time, due to the significant temporal relationship in the context of trajectory sequences, most studies focus more on extracting temporal features of ship trajectories while ignoring the spatial connections between trajectory points. Although some researchers have introduced graph convolution methods from roads to extract the spatial features of ship trajectories, the application of graph convolutional networks to ship trajectory prediction is not without challenges. One such difficulty is the inherent difficulty in modeling ship trajectories with graph networks as road networks possess well-defined nodes and edges, unlike the complex spatial features of ship trajectories.
All in all, extracting the spatio-temporal features of ship trajectories to obtain more accurate trajectories is of great significance for the identification of ship navigation intention and, therefore, improving the intelligent supervision of ships. The purpose of this study is to propose an accurate prediction method for ship trajectory in complex waters based on the spatio-temporal characteristics of ship trajectory. Compared with previous work, this paper uses different data repair and cluster analysis methods and tries to use a ConvLSTM unit to simultaneously extract temporal and spatial features of ship trajectories, rather than a spatial attention mechanism or graph neural network. The contribution of this work is as follows: 1. After data processing steps such as kinematics-based anomaly detection and Hierarchical Density-Based Spatial Clustering of Applications with Noise (HDBSCAN), ship trajectory clusters with stronger correlations are obtained. It helps to improve the accuracy of trajectory prediction; 2. Expand the ship trajectory into a graph-like format and use the Seq2Seq model based on ConvLSTM to model the ship trajectory so that the model can extract the temporal and spatial characteristics of the trajectory.
The rest of the paper is organized as follows:
Section 2 introduces the basic principles of related methods and models;
Section 3 introduces data preparation and model details;
Section 4 uses real-world trajectory data as a case to experiment with the model;
Section 5 discusses the results of the proposed model;
Section 6 summarizes and discusses the main innovations of this study and suggests possible directions for further research.
3. Model Design
3.1. Ship Trajectory
The ship trajectory sequence is generally represented as a space-time sequence, which consists of multiple tuples such as spatial coordinates and timestamps. A space-time sequence can be formally expressed as:
Among them, , N is the total number of ship trajectories, representing the j-th sub-trajectory; , n is the total number of trajectory points, indicating the i-th timestamp of the j-th sub-trajectory; and indicates the j-th sub-trajectory. The longitude and latitude of the ship at the moment.
3.2. Trajectory Data Preprocessing
This step is mainly to preprocess the trajectory data obtained from AIS and screen out trajectory clusters with the same characteristics. The first step is to eliminate abnormal data.
- (1)
Trajectory anomaly detection method based on kinematics information to process trajectory data.
- (1.1)
Estimate the data points of the ship’s trajectory according to the kinematic characteristics of the ship’s speed and heading.
- (1.2)
A modified k-means method is used to identify the details of the anomalies estimated by the AIS kinematics.
- (1.3)
All outliers in the trajectory data are detected by repeating the motion estimation and error clustering process, and the clustering performance is evaluated with the silhouette coefficient as the termination condition.
- (2)
Mercator transformation, using the Mercator projection to transform the latitude and longitude of the spherical coordinates into Mercator projection coordinates.
- (3)
Trim the trajectory using a threshold. By analyzing the AIS data with abnormal points removed, the following three phenomena can be found in the trajectory data. For example, although the time difference between two trajectory points of a ship is relatively large, they are considered as one trajectory. A ship with a short trajectory is not meaningful for research. A ship’s Speed Over Ground (SOG) and Course Over Ground (COG) exhibit different values than normal trajectories. In order to remove this effect, the time threshold, trajectory points threshold, and SOG and COG thresholds are used to differentiate these data. A ship trajectory is segmented into discrete voyages when the temporal gap between consecutive data points surpasses a predefined threshold. For trajectories containing data points less than the preset threshold, they will be considered noise and removed from the data set. A preliminary trajectory data cleaning is also conducted by removing the data points with abnormal SOG and COG.
The second is HDBSCAN clustering: (1) Compressed data. Based on the Douglas–Peucker compression algorithm, the trajectory can be compressed without losing shape features. The algorithm compresses the curve graphics from the overall point of view and determines the final point sequence to be retained by finding the key points of each segment in the curve. This algorithm is based on connecting a straight line between the first and last points of each trajectory and then calculating the distance between all points and the straight line. The maximum distance value
is then identified. If
is less than the tolerance value
, all intermediate points on the curve are discarded. On the other hand, if
is greater than or equal to
, the coordinate point corresponding to
is kept. The curve is then divided into two parts at this point, and the same process is repeated for each part. (2) HDBSCNA clustering trajectory. The algorithm has two input parameters: min cluster size and min samples. The former represents the minimum size of the cluster and is the core parameter of HDBSCAN. The larger this parameter is, the fewer species will be clustered in the final cluster, and points less than this will be considered as ‘noise’. The latter is min samples, which defines the number of samples a point has in its neighborhood. To determine the values of the two parameters of the clustering algorithm, a comprehensive evaluation method that combines the Silhouette Coefficient (SC) and Davies–Bouldin index (DBI) is used to evaluate the clustering performance. This evaluation method involves calculating the clustering performance for different parameter values and selecting the parameter value that corresponds to the clustering result with the best performance. For details on setting the parameters of HDBSCAN and DP algorithm to specific values, please refer to
Section 4.1.
The last is cubic spline interpolation. The cubic spline interpolation function can obtain the cubic spline interpolation of the time–longitude trajectory and the time–latitude trajectory, respectively, and the ship’s navigation trajectory can be obtained by combining the above two cubic spline curves. Cubic spline interpolation can effectively provide equidistant data by interpolating trajectory data.
3.3. Trajectory Prediction
The conventional LSTM method has better performance on the prediction of time series data than that of spatial data. The data of the LSTM model is usually represented by two dimensions: one represents the stack of time steps, and the other represents the characteristics of the current time step. To overcome the shortcomings of LSTM in processing spatial information, ConvLSTM was developed. For the data at each moment, ConvLSTM replaces the fully connected operation of each gate in LSTM with a convolution operation, i.e., matrix multiplication becomes a convolution calculation. Based on previous experiments, this paper replaces the activation function of the input information (default tanh) and current hidden state output (default tanh) in the ConvLSTM model with Rectified Linear Unit (ReLU) to achieve better results. At the same time, this approach has been verified in RNN [
32]. The unit structure of ConvLSTM with ReLU activation function is shown in
Figure 3.
The asterisk ‘*’ in the figure indicates convolution calculation, and the others are the same as in
Section 2.3. In this way, it captures the underlying spatial features by performing convolution operations in multidimensional data, allowing ConvLSTM to make predictions from the current input and the past states of local neighbors. This approach enables ConvLSTM not only to establish a temporal relationship similar to LSTM but also to have a spatial feature extraction capability similar to CNN. Experiments have proved that ConvLSTM has a better effect than LSTM in acquiring spatio-temporal relationships [
31].
The ConvLSTM model in this research consists of a ConvLSTM-based encoder layer, a decoder layer, and a separate convolutional layer, respectively. The structure of the model is shown in
Figure 4.
As shown in
Figure 4, for each input sample original trajectory sequence, the data format conversion is performed first, and the longitude and latitude of the ship trajectory are, respectively, used as the characteristics of the two dimensions. Thus, the latitude and longitude of the ship trajectory become a point in the two-dimensional grid, which has a spatial relationship. The specific form is shown in
Figure 5.
Then, generate a trajectory sequence with a number of t, and, at the same time, t also represents the length of the input trajectory sequence. Then, the trajectory sequence is used as the input of the encoder layer, and the ConvLSTM network encodes the trajectory sequence in a many-to-many form. For the ConvLSTM unit, the longitude and latitude of the trajectory are no longer regarded as two features in one dimension, but as the values corresponding to the two dimensions. Therefore, the encoding of the trajectory sequence has both the temporal relationship of the input sequence and the spatial feature relationship of the input sequence. The encoder layer exports the encoding result and hidden feature matrix h at the same time. The decoded layer outputs the decoding sequence, which is then passed through a convolutional layer to produce the predicted trajectory sequence. In the training phase, the decoder layer also uses the input sequence for decoding auxiliary training to help the network model learn quickly. In the prediction stage, the decoder uses the output of the previous time step of the ConvLSTM unit as its decoding aid. Finally, the predicted trajectory sequence is converted into a trajectory sequence, and the output is a predicted trajectory sequence with a number of q.
3.4. Evaluation Function
In this paper, Root Mean Square Error (RMSE) is used to evaluate the overall performance of the model, and the Mean Distance Error (MDE) between the predicted data and the real AIS data are used to evaluate the prediction results. The specific calculation method is as follows:
Among them, is the total data volume of AIS, is the predicted value of the network model, and is the expected output value. is the predicted value of the latitude of the network model, and is the expected output value of the latitude. is the longitude prediction value of the network model, and is the longitude expected output value. These predicted values and expected output values are the longitude and latitude values under the Mercator transformation.
4. Case Study
In this section, a case study on trajectory prediction of the proposed ConvLSTM-based Seq2Seq ship trajectory prediction model was carried out to verify the effectiveness of the method. The data utilized in this study were real historical data. The case study area was within the following boundaries: Latitude: 31.08° N to 31.00° N; Longitude: 122.0° E to 122.4° E. In order to prove the effectiveness of the proposed prediction model and avoid the influence of AIS data on ships with special nature of work, this case excluded the AIS data of small working boats, pilot boats, and fishing boats. The details of the case study are shown in
Table 1, and the initial ship trajectories in the study waters are shown in
Figure 6.
4.1. AIS Data Preprocessing
According to the geographical information and the set boundaries of the study area, this article selected the AIS data on 1 May 2019, and used the trajectory data elimination method in
Section 3.2 to obtain 280 ship trajectory sets. First, the initial AIS data are read, and trajectory estimation points are generated according to the kinematic characteristics of the ship. Then, position and velocity errors between estimated points and trajectory data are analyzed. After that, the kinematic-based anomaly detection proposed by Guo et al. [
29] is used to identify the error data. And, by repeating the above steps, abnormality detection is realized. The trajectory data after removing abnormal data are shown in
Figure 7.
After applying trajectory anomaly detection, as seen in
Figure 7, the anomalies in the original data that deviate from the expected kinematic characteristics of the ship are removed. This step ensures that the remaining trajectories accurately represent the ship’s true trajectory.
Due to the large number of trajectories, this article uses the DP algorithm to reduce the amount of ship trajectory data to accelerate the clustering process, and 100 m was utilized as the threshold of each trajectory to maintain the shape characteristics of the trajectory. The trajectory data were then clustered by the HDBSCAN algorithm. For its two parameters, this article used an adaptive method (Loop to find the optimal value) to receive the optimal values of min cluster size = 9 and min samples = 8. Finally, this article used cubic spline interpolation to complete the space between trajectory data and performed 20 s equidistant interpolation. An example of the interpolation effect is shown in
Figure 8.
As shown in
Figure 8, the cubic spline interpolation method demonstrates excellent performance in interpolating the trajectories of ships with large, curved sections, as well as general ship trajectories. The resulting interpolated ship trajectories are generally smooth and accurately represent the ship’s actual movement.
After performing several data preprocessing operations, this article obtained a total of 184 ship trajectories. These trajectories were then organized into six distinct clusters, as shown in
Figure 9.
As exhibited in
Figure 9, after a series of preprocessing operations, the trajectory data within the selected area were clustered into six groups. In comparison to
Figure 7, some trajectory data without clear characteristics were excluded as noise, whereas small missing pieces of ship trajectory data were interpolated to create a continuous trajectory. The trajectory exhibited in
Figure 9 was partitioned into three distinct datasets according to the characteristics of the clusters. The first dataset consisted of black and red trajectory clusters, which exhibited numerous curved segments. The second dataset included the yellow and blue trajectory clusters, which had a relatively significant single curved segment. The final dataset contained the green and pink trajectory clusters, which were relatively straight in comparison to the other clusters.
In order to make model training more efficient and accurate, the min–max normalization method was used to normalize the data, and the min–max normalization was given by the following formula:
In the formula: is the maximum value of the sample data, is the minimum value of the sample data, and the converted data are all within [0,1].
Then, the training sample is divided by the sliding window method. For a trajectory, the trajectory points of the first p consecutive time steps is used as the input sample, and the trajectory points of the subsequent q consecutive time steps are used as the predicted trajectory . This experiment will predict the trajectory data of the ship in the next 10, 15, and 20 min.
4.2. Trajectory Prediction
This study involves two different testing methods on three datasets, each serving a different purpose. The data set is divided into a training set and a test set according to the ratio of 8:2, and a trajectory is randomly extracted from the test set as the target trajectory. Firstly, the performance of the model is tested on the trajectory with clear maneuvering behavior and the long straight trajectory to verify its validity. For this purpose, Dataset 2 and Dataset 3 were selected, and a target prediction length of 20 min was chosen. Secondly, the ability of the model to monitor ship behavior was examined by analyzing its performance on trajectories that indicated different characteristics for an extended period of time. To achieve this, Dataset 1 was selected, and a target forecast length of 60 min for this trajectory was chosen. This approach allowed for a comprehensive analysis of the model’s predictive capabilities across the three different datasets.
The operating system used in this experiment was Windows 10, the programming software was Pycharm, and the deep learning framework was tensorflow v2.3.0. In this experiment, the training model structure consisted of ConvLSTM layers with 64 output units and a convolutional nuclear unit. The Convolutional layer had one output unit with a convolutional nuclear unit. The setting of the convolution kernel was to perform convolution operations on the latitude and longitude data. The model was trained using the ADAM optimizer with a learning rate of 0.001 and a training loss function of Mean Squared Error. A batch size of 36 was used. During the prediction stage, the model predicted the trajectory in the form of accumulated errors, whereby all input data, except for the first historical data input, were predicted data from the model’s previous output.
To assess the influence of input and output lengths on the model, the input and output were set to
p and
q = 5, 10, 15, 20, and 25 with a total input and output length, respectively. Each model length was consistent with other settings, except for the epoch. To reduce randomness and improve the accuracy of the experiment, the RMSE and MDE of each model were averaged over five experiments, and the maximum and minimum RMSE and MDE were recorded for each group. Prediction results for different input and output lengths were tabulated in
Table 2,
Table 3 and
Table 4, and prediction result icons were illustrated in
Figure 10,
Figure 11 and
Figure 12.
Regarding
Figure 10 and
Figure 12, both the trajectories at
p = 20,
q = 20 and the original trajectories closely resemble the trend and length. In
Figure 10, there is noticeable bending in all five trajectories, with the trajectories at
p = 25 and
q = 25 exhibiting a soft reverse trend, and each trajectory demonstrating a gentler cornering trend towards the middle of the turn. In
Figure 11, the five trajectories are significantly longer than the original trajectory, and the trajectories corresponding to
p = 5,
q = 5;
p = 10,
q = 10; and
p = 15,
q = 15 appear to be jittering and not smooth enough. When
p = 20,
q = 20 and
p = 25,
q = 25, the trajectory jitter is alleviated and smoother.
As illustrated in
Figure 12, the trajectory at
p = 25,
q = 25 closely resembles the trend and length of the original trajectory, with the distance between the mark points remaining relatively consistent. Conversely, the trajectory at
p = 15,
q = 15 exhibits a shorter length than the original trajectory, and the trend differs the most from the raw trajectory. The remaining trajectories are all longer than the raw trajectory, and the distance between points is larger than that in the original trajectory.
As demonstrated by
Table 2,
Table 3 and
Table 4, the length of the input and output parameters in the model affects its performance. For both Dataset 2 and Dataset 3, the models with
p = 20 and
q = 20 have the smallest average RMSE and MDE values, whereas
p = 15 and
q = 15 lead to the highest values of both metrics. Specifically, when predicting a 20 min trajectory, the average RMSE and MDE values for Dataset 2 are 148.71 and 180.84, respectively, with
p = 20 and
q = 20, whereas the corresponding numbers for
p = 15 and
q = 15 are 249.13 and 338.81. When
p = 20 and
q = 20, the average MDE was 106.54 for a 10 min trajectory but increased to 180.84 for a 20 min trajectory, representing a 69.74% increase in MDE within the 10 min of trajectory prediction.
Similar trends can be observed for Dataset 3, where the average RMSE and MDE values with p = 20, q = 20 for 20 min trajectory prediction are 174.51 and 229.19, respectively, whereas they are 318.17 and 398.91 when p = 15 and q = 15. Additionally, when p = 20 and q = 20, the average MDE was 155.76 for a 10 min trajectory and increased to 229.19 for a 20 min trajectory, indicating a 45.96% increase in MDE for the 10 min of trajectory prediction.
According to
Table 4 for Dataset 1, models with
p = 25 and
q = 25 have the lowest average RMSE and average MDE, whereas those with
p = 15 and
q = 15 have the highest. For example, when predicting a trajectory of 60 min, the model with
p = 25 and
q = 25 has an average RMSE of 222.23 and an average MDE of 281.75, whereas the model with
p = 15 and
q = 15 has an average RMSE of 758.16 and an average MDE of 969.62, indicating better performance for the former model. Moreover, when
p = 25 and
q = 25, the average MDE was 115.61 for a 10 min trajectory, 123.13 for a 20 min trajectory, and 281.75 for a 60 min trajectory. Within the 10 min of prediction, the average MDE increased by 6.50%, and it increased by 143.77% within an extra 50 min of prediction.
4.3. Model Performance Comparison
To validate the proposed method, this paper compares some other prediction methods. The use of the dataset is consistent with
Section 4.2. Please be noted that the results of the comparison are based on the parameter settings of each method that obtains the best performance on trajectory prediction; therefore, the parameter settings for each method may not be consistent under each testing scenario. The comparing methods are as follows:
- (1)
Bi-attention-LSTM: The Bi-LSTM model can learn the characteristics of future moment information while using the data information of the past moment and perform recursion and feedback on it. At the same time, adding the attention mechanism will help the Bi-LSTM model to further optimize the ability of data information feature extraction and improve the accuracy of the model prediction. The model adopts the form of single-step prediction cumulative error, takes the trajectory points of the first five consecutive time steps as input, and predicts the trajectory points at the next moment.
- (2)
LSTM-Seq2Seq: Sequence to Sequence consists of three parts: encoder, intermediate vector, and decoder. The composition of the encoder and the decoder is basically the same, and this paper uses LSTM as its cycle unit. The model adopts the form of multi-step prediction cumulative error, takes the trajectory points of the first 20 continuous time steps as input, and predicts the trajectory points of the last 20 continuous time steps.
- (3)
ConvLSTM-Seq2Seq: The ConvLSTM-Seq2Seq model utilized the same set of parameters as described in
Section 4.3. Additionally, for Dataset 1, the model took as input the trajectory points of the first 25 consecutive time steps and predicted the trajectory points of the next 25 time steps. For Datasets 2 and 3, the model took as input the trajectory points of the first 20 consecutive time steps and predicted the trajectory points of the next 20 time steps.
The experimental parameters of the three models are shown in
Table 5.
For the performance of the three models on dataset 2 (
Figure 13), the trajectory generated by the ConvLSTM-Seq2Seq (ours) model closely resembles the original trajectory (blue trajectory), with the two almost overlapping. The trajectory of LSTM-Seq2Seq delivers comparable outcomes. For the performance of the models on Dataset 3 (
Figure 14), the trajectory of LSTM-Seq2Seq outperforms the others by being the closest to the original trajectory, followed by the trajectory of our model. The performance of the Bi-LSTM model is much worse than those of the other two. As depicted in
Figure 15, the trajectory of our model (orange trajectory) is the most similar to the trend and length among the three models and exhibits a similar trend as the original ship trajectory. Although the trajectory of Bi-LSTM (red trajectory) also shows high similarity to the real ship trajectory, its second half is not as close as that of our model’s trajectory, which indicates the performance on long time prediction of our model is better. The trajectory of LSTM-Seq2Seq (green trajectory) is the most different from other results and exceeds the length of results of our model and Bi-LSTM model trajectories. To recap, the trajectory of our model is the most effective when compared with the original trajectory across all three figures. The trajectory of LSTM-Seq2Seq provides the second-best performance, whereas the trajectory of Bi-LSTM performs the worst. And, in each picture, the initial position of the trajectory of Bi-LSTM has shifted.
Table 6 shows the results for 20 min trajectory predictions using Dataset 2. From the figure, one can see that the ConvLSTM-based Seq2seq proposed in this paper has the lowest average RMSE and MDE among the three models, which is followed by the LSTM-Seq2Seq model, and the Bi-LSTM (Attention) model has the worst performance. In the meantime, with the increment of the prediction time, the performance of all models started to deteriorate and show higher prediction errors, whereas our model still maintains the best performance. From the analysis, our model has an evident advantage on prediction of curved trajectories. As for the prediction on straight trajectories, the model with the lowest errors is LSTM-Seq2Seq, followed by the ConvLSTM-Seq2Seq model, and the Bi-LSTM (Attention) model has the worst performance. This could be explained by the LSTM-Seq2seq having an advantage when learning the short-term characteristics of the data series. The detailed analysis could be referred to
Section 6. As for the trajectory with continuous and small changes (
Table 6), the results reveal the results for 60 min trajectory predictions using Dataset 1. The model with the lowest errors is ConvLSTM-Seq2Seq, followed by the Bi-LSTM (Attention) model, whereas the LSTM-Seq2Seq model performs the worst. Overall, the ConvLSTM-Seq2Seq model outperforms other models for predicting trajectory in Dataset 1.
5. Discussion
Ship trajectory prediction plays a very important role in regional ship intelligent collision avoidance and supervision, as it could facilitate the identification and prediction of ship intentions in the region. This paper proposes a ship trajectory prediction model ConvLSTM-based Seq2Seq. Compared with other models in the experiment, the effectiveness of our proposed model is verified. In data preprocessing, our preprocessing method divides trajectory clusters into six clusters, each with unique characteristics.
Experiments were conducted across different datasets, input and output lengths, and prediction lengths. The results revealed that the optimal parameters for the ConvLSTM-Seq2Seq model were
p = 25 and
q = 25 on Dataset 1, and
p = 20 and
q = 20 on Datasets 2 and 3, under which conditions this model achieved the best performance. Our observations of
Figure 10,
Figure 11 and
Figure 12 and
Table 2,
Table 3 and
Table 4 demonstrate that the accuracy of our model’s predictions is significantly influenced by different input and output lengths. Interestingly, in all three datasets, the models with
p = 15 and
q = 15 exhibited the greatest errors, indicating that as
p and
q lengths increase, prediction errors initially increase and then decrease slightly, with
p = 15 and
q = 15 representing a peak in prediction errors. Furthermore, due to the cumulative effect of errors, as the length of the prediction time increases, the prediction error of the model also continues to increase. This is evident from the data records corresponding to the trajectory in
Figure 15 and the trajectory in
Table 6. In
Figure 15, the three trajectories initially closely follow the original trajectory. However, as the length of the forecast time increases, they deviate to varying degrees from the original trajectory, with the trajectory of LSTM-Seq2Seq being longer and the trajectory of Bi-LSTM and our model being slightly shorter. Additionally, as indicated in
Table 6, the model error increases by 143.71%, 259.03%, and 413.45% within a time range of 50 min. These findings highlight the fact that prediction errors increase with the increase in predictive length. Therefore, by selecting appropriate input and output lengths and increasing the form of the forecasting step, the error can be reduced within the selected time range, and cumulative error can be minimized. The convLSTM-Seq2Seq model exhibits excellent performance when the input and output length is either 20 or 25.
The ConvLSTM-Seq2Seq model exhibits the best performance out of the three models, particularly on the training sets with Dataset 1 and Dataset 2. Although its performance is slightly weaker than the LSTM-Seq2Seq model on Dataset 3, it still produces good results. This superiority may be attributed to the convolutional structure of the ConvLSTM unit, which extracts further information on the relationship between the longitude and latitude of the trajectory data, thereby increasing its accuracy and significantly improving its predictive ability for trajectories with long-time trajectories compared to the other two models. On the other hand, the Bi-LSTM (Attention) model performs poorly among the three models, possibly because it uses a many-to-one prediction approach that outputs the trajectory data of the next time step, leading to multiple accumulated errors that increase its errors. However, in Dataset 3, the LSTM-Seq2Seq model exhibits higher prediction error, almost five times that of the ConvLSTM-Seq2Seq model, whereas the Bi-LSTM (Attention) model’s error is three times that of the ConvLSTM-Seq2Seq model. One of the reasons could be that in the Dataset 3 training set, each small training set has significantly different features, making it difficult for the LSTM-Seq2Seq model to learn these characteristics effectively. In contrast, the attention mechanism of the Bi-LSTM (Attention) model enables it to learn more features from the Dataset 3 training set. Although the ConvLSTM-Seq2Seq model does not have an attention mechanism, its stronger feature extraction ability allows it to learn the features of Dataset 3 as well. However, the improved prediction accuracy of the ConvLSTM-Seq2Seq model comes at the expense of longer computational runtime. To quantify this trade-off, the inference times of the ConvLSTM-Seq2Seq, LSTM-Seq2Seq, and Bi-LSTM (Attention) models were benchmarked by measuring the duration taken to estimate 60 min ship trajectories using Dataset 1. The results, tabulated in
Table 7, demonstrate that the ConvLSTM-Seq2Seq architecture exhibits substantially higher time consumption relative to the baseline LSTM-Seq2Seq and Bi-LSTM(Attention) models.
In summary, the ConvLSTM-Seq2Seq model performs best overall due to its powerful feature extraction capabilities, which allow it to learn the characteristics of trajectories with curves effectively.
6. Conclusions
This paper proposed a high-precision trajectory prediction method that combines ConvLSTM and Seq2Seq models to address the long-term ship trajectory prediction problem. To alleviate potential defects of AIS equipment in receiving and sending ship information, this paper preprocessed the AIS data using methods such as abnormal data elimination, HDBSCAN clustering, and cubic spline interpolation to enable subsequent feature extraction through the proposed model. As the ConvLSTM model was effective in extracting spatial-related features, this paper combined it with the Seq2Seq model to develop a ship trajectory prediction model. The research explored the appropriate input and output lengths of the proposed model and compared it with the LSTM-Seq2Seq and Bi-LSTM (Attention) models. The experimental results revealed that the ConvLSTM-Seq2Seq model proposed in this paper exhibited excellent accuracy for turning trajectories. In direct trajectory prediction, the accuracy of the proposed model was slightly lower (by about 10% when predicting 20 min ahead) than that of the LSTM-Seq2Seq baseline model. However, the proposed model still demonstrated decent performance overall. Moreover, by setting the ratio of the number of input trajectory points to output trajectory points at p = 20, q = 20, the proposed model performed optimally in the dataset of straight and curve trajectories. When p = 25, q = 25, the proposed model performed better in datasets with long-time trajectories. Nevertheless, it should be noted that increasing the length of the input and output does not always guarantee a significant improvement in model accuracy. In fact, there exists a trend where accuracy may first increase and then decrease as the lengths are extended. In comparison experiments with other models, the proposed model showed the best results in two of the datasets and also had good accuracy in the other dataset. Furthermore, the cumulative error accumulation of long-term prediction (60 min) on the trajectory was significantly smaller than those of other models. Therefore, the proposed model could be regarded as an effective method for more accurate ship trajectory predictions in a wider range of scenarios. The proposed ship trajectory prediction method could enable accurate risk avoidance, intelligent management and monitoring of ships, aligning with the development trends in future intelligent vessels. Specifically, the method allowed the discovery of abnormal ship behaviors by comparing predicted and actual trajectories and early warning generation. Additionally, precise trajectory forecasts assisted autonomous navigation systems in identifying collision risks and making sensible route-planning decisions. Overall, this work represented a noteworthy contribution to the field of ship trajectory prediction and could help bolster the safety and efficiency of ship navigation in complex marine environments.
In future work, other factors that may affect ship trajectory prediction, such as Speed Over Ground (SOG), Course Over Ground (COG), and environmental information, can be added to the process of spatial extraction of trajectory to further improve the accuracy of the trajectory prediction model. Additionally, when predicting trajectories, incorporating the influence of surrounding vessels into the prediction model could be explored to develop a ship trajectory forecasting approach with enhanced practicality and fidelity to real-world navigation.