# A Ship Trajectory Prediction Method Based on an Optuna-BILSTM Model
## 1 Introduction
With ongoing research into artificial neural networks (ANN) [18; 19], artificial-neural-network-based ship trajectory prediction models are now becoming more popular and widely used in ship navigation [20; 21]. [PERSON] et al. developed a predictive model for forecasting the future behavior of ships, introducing a network-based infrastructure designed to yield favorable outcomes within a brief computational duration [22]. [PERSON] et al. and [PERSON] et al. employed the BP neural network algorithm for the prediction of ship trajectories [23; 24]. The aforementioned artificial neural network prediction techniques have significantly contributed to the advancement of ship trajectory forecasting methods. Nonetheless, these approaches fail to consider the temporal characteristics inherent in trajectory time series, and recurrent neural networks (RNNs) [25] are typical neural networks that can predict future data using time-series data. However, since backpropagation algorithms are basically used to train RNNs, the problem of vanishing gradients usually arises when error information is backpropagated through time. Models that can deal with this problem are LSTM [26] and selected-pass recursive units (GRU) [27]. In the domain of aviation, [PERSON] et al. have utilized long short-term memory (LSTM) networks for the prediction of aircraft trajectories [28]. [PERSON], [PERSON], and [PERSON] et al. demonstrated that the bidirectional LSTM (Bi-LSTM), an enhanced variant of the LSTM, exhibits superior performance compared with its predecessor [29; 30]. [PERSON] et al. constructed a predictive hybrid model based on CNNs and a bidirectional long short-term memory (Bi-LSTM) network based on the trajectory characteristics of ship navigation, and they obtained the optimal input-output mapping relationship by training the network model [31]. Trajectory prediction utilizing this neural network can yield relatively precise outcomes by learning from the observed data of ships. However, the network's hyperparameters significantly impact the predictive results, necessitating the identification of the optimal hyperparameter combination to construct the network structure for enhanced performance. [PERSON] not only formulated the hyperparameter issue as an optimization model in his paper but also introduced a random search strategy. He empirically and theoretically validated that this random search approach is more efficient than a grid search [32]. An algorithm for predicting precipitation models is LSTM (long short-term memory), which simulates the error distribution of the original model by constructing tree-structured Parzen estimators and achieves better results in high-dimensional space. [PERSON] and [PERSON] et al. in 2019 proposed an automatic hyperparameter optimization framework, Optuna, in 2019 [33]. The optimization technique within this framework employs Bayesian optimization, whereby trials exhibiting suboptimal performance are terminated early through a process of continuous \"trial and error\", enhancing speed. To swiftly and precisely predict ship trajectories, this study develops a ship trajectory prediction model utilizing a BILSTM. It addresses the challenge of accurately forecasting ship trajectories and employs the Optuna algorithm for hyperparameter optimization of the BILSTM network due to the difficulty of performing manual adjustments. The Optuna-BILSTM trajectory prediction model, created with optimal network parameters, is then evaluated against traditional BP neural networks and BILSTM models, including those fine-tuned with Bayesian optimization. The model integrates features into the Optuna-BILSTM and utilizes the future position of the ship as the target output for trajectory prediction. The paper is structured as follows: Section 2 discusses hyperparameter tuning algorithms, including Bayesian and Optuna tuning. Section 3 outlines the theoretical foundations of the BP neural network, LSTM, and BILSTM models. Section 4 is dedicated to experiments and analysis, while Section 4 offers conclusions.