## 1 Introduction
Many scholars choose neural networks as a method for ship trajectory prediction because of their powerful nonlinear fitting ability and parallel computing capability [21], and these prediction methods are becoming more and more popular in the field of ship navigation [15; 22; 23]. [PERSON] et al. [13] proposed an artificial neural network (ANN) for ship trajectory prediction combined with an extended Kalman filter for ship state prediction. [PERSON] et al. [24] proposed a 4D trajectory prediction model based on BP neural network for the problem that traditional trajectory prediction methods cannot meet high accuracy, multi-dimensionality, and real-time. However, the BP neural network is weak in dealing with nonlinear problems, and the prediction results are more accurate only when the trajectory is short. Considering that BP neural networks cannot extract the contextual features in the data and cannot fully utilize the historical voyage information of ships, many scholars have turned their attention to recurrent neural networks. Recurrent neural network has memory, and its hidden layer neurons will remember the previous information and apply it to the current output calculation, which has a greater advantage for predicting time series data [25]. [PERSON] et al. [26] introduced physical assumptions to balance complexity and accuracy on the basis of LSTM based on the navigational trajectory characteristics of AIS data and verified the effectiveness of LSTM for the trajectory prediction problem. [PERSON] et al. [5] established BILSTM based on trajectory clustering and compared it with GRU and LSTM, and the experimental results concluded that BILSTM has the highest prediction accuracy. [PERSON] et al. [27] proposed CNN-BILSTM to improve the prediction accuracy of the trajectory prediction model, which constructs feature vectors by CNN to better mine the relationship between data and constructs the feature vectors as time series data to input into the BILSTM network for ship trajectory prediction. For the ship trajectory prediction problem, due to the large mass and inertia of ships, the current motion state of a ship is strongly correlated with its previous motion state. Therefore, effectively extracting context-related information about the ship's motion behavior is crucial to improving trajectory prediction accuracy. To enable LSTM units to retain longer-term context information, many researchers have adopted Attention mechanisms to enhance the model's focus on key information, thus preserving more useful information in the same LSTM units. [PERSON] et al. [28] used an Attention-BILSTM to predict collision risk for ships and conducted experiments using real ship trajectory data, demonstrating that the proposed Attention-BILSTM outperforms traditional LSTM in terms of accuracy and stability. [PERSON] et al. [29] proposed a goal-driven self-attentive recurrent network for trajectory prediction, conducted extensive experiments on publicly available datasets, and showed that our approach performs on par with state-of-the-art techniques while reducing model complexity. [PERSON] et al. [30] proposed a spatial attention mechanism based on LSTM to capture the spatial relationship between prediction targets and also designed a temporal attention mechanism to distinguish the impact of different historical time steps on future trajectory prediction. The proposed model was experimentally verified on public datasets and demonstrated its superior performance. Neural network models have shown good performance in ship trajectory prediction. However, these models have multiple hyperparameters that need to be optimized, which is crucial for prediction performance [31]. Traditional hyperparameter optimization methods usually require a large number of experiments, are inefficient, and are prone to get stuck in local optima [32].