Next Article in Journal
Design of Third-Order Dispersion Compensation for the SG PW Laser System Using a Birefringent Crystal
Previous Article in Journal
One-Step Synthesis of Cross-Linked Esterified Starch and Its Properties
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

A New Method of Inland Water Ship Trajectory Prediction Based on Long Short-Term Memory Network Optimized by Genetic Algorithm

1
School of Navigation, Wuhan University of Technology, Wuhan 430036, China
2
Hubei Key Laboratory of Inland Shipping Technology, Wuhan University of Technology, Wuhan 430036, China
3
Suzhou Port and Shipping Development Center, Suzhou 215000, China
*
Author to whom correspondence should be addressed.
Submission received: 25 February 2022 / Revised: 12 April 2022 / Accepted: 14 April 2022 / Published: 18 April 2022

Abstract

:
Ship position prediction plays a key role in the early warning and safety of inland waters and maritime navigation. Ship pilots must have in-depth knowledge of the future position of their ship and target ship in a specific time period when maneuvering the ship to effectively avoid collisions. However, prediction accuracy and computing efficiency are crucial issues that need to be worked out at present. To solve these problems, in this paper, the deep long short-term memory network framework (LSTM) and genetic algorithm (GA) are introduced to predict the ship trajectory of inland water. Firstly, the collected actual automatic identification system (AIS) data are preprocessed and a series of typical trajectories are extracted from them; then, the LSTM network is used to predict the typical trajectories in real time. Considering that the hyperparameters of the LSTM network have difficulty obtaining the optimal solution manually, the GA is used to optimize hyperparameters of LSTM; finally, the GA-LSTM trajectory prediction model is constructed with the optimal network parameters and compared with the traditional support vector machine (SVM) model and LSTM model. The experimental results show that the GA-LSTM model effectively improves the accuracy and speed of trajectory prediction, with outstanding performance and good generalization, which possess certain reference values for the development of collision avoidance of unmanned ships.

1. Introduction

“A country with strong transportation, parallel by land and water.” As one of the comprehensive transportation modes, waterway transportation undertakes nearly 90% of the world’s bulk trade freight volume. Due to its characteristics of low cost and large volume, the activity of the waterway transportation industry is regarded as a barometer of world and regional economic recovery. [1]. With the rapid development of China’s shipping industry, the number of ships in the oceans, especially inland rivers, has increased dramatically, leading to an increasing trend of ship traffic accidents. Therefore, in ports or waters with high traffic density and complex conditions, improving the safety of ship navigation is a key issue [2,3]. Vessel Traffic Service (VTS) [4,5] can accurately and effectively monitor and predict the real-time trajectory of ships, which provides a technical support for the early warning of marine traffic accidents. In order to improve the safety of ship navigation in inland river environments, it is necessary to provide real-time trajectory prediction and risk warning functions for the ship’s intelligent navigation system. However, the inland river environment is complex and changeable, and traffic accidents are prone to occur, especially in crowded docks and bridge areas. Consequently, it is difficult to predict the trajectory of ships [6].
In recent years, domestic and foreign scholars have proposed a series of ship trajectory prediction models. Anderson [7] takes time as the independent variable, obtains the measured value of the trajectory in discrete time, and regards the trajectory as a one-dimensional Gaussian process. A prior continuous time is defined by a nonlinear time-varying stochastic differential equation driven by white noise. By obtaining the joint prior density and covariance matrix of the observed and the predicted value, the posterior distribution of the predicted value is calculated, and the smoothing trajectory is predicted by combining with dynamics. This method is computationally intensive, and its accuracy gradually decreases over time. Jiang [8] proposed the polynomial Kalman filter method to fit the ship trajectory. This method implements trajectory prediction in a recursive manner, which occupies less memory space in the calculation process and can achieve short-term prediction. However, the assumptions of initial state and ideal conditions of the model have a greater impact on the prediction results. Literature [9] divides the specified sea area into grids, calculates the grid state with the ship’s position, speed, and direction as the key factors, and uses the K-order Markov chain to establish a state transition matrix for prediction; however, the utilization rate of historical track information is poor when calculating the grid state at each moment. Zhang [10] proposed a spatial clustering method based on hierarchical density clustering, adopting the DBSCAN model to cluster and denoise the original AIS trajectories to achieve the purpose of predicting ship trajectories. Rong [11] proposed a new probabilistic trajectory prediction model, which described the uncertainty of the future position of the ship trajectory through a continuous probability distribution and has high prediction accuracy.
With the continuous in-depth research of artificial neural networks (ANN) [12,13], the ship trajectory prediction model based on ANN is becoming more and more popular and is widely used in the field of ship navigation [14,15,16]. Literature [17] uses the back-propagation (BP) neural network model to train and predict ship trajectory with longitude, latitude, and speed information in the AIS data, but the BP neural network has a weak ability to deal with nonlinear problems, and only in the case of a short track are the prediction results more accurate. Literature [18] uses a support vector machine (SVM) to establish a ship trajectory prediction model and adopts speed over ground (SOG), course over ground (COG), longitude (LON), latitude (LAT), and time stamp as the input sample features, which improves the prediction efficiency and accuracy to a certain extent; however, SVM has shortcomings such as weak generalization ability and ease of falling into local extreme values. Brian [19] proposed a dual linear auto-encoder method to predict the future trajectories of selected ships. The auto-encoder consists of two modules, encoding and decoding, which can extract hidden features of AIS data, and the model can predict the trajectory of multiple ships. However, in the process of trajectory features extraction, useless data features cannot be effectively filtered, so the prediction effect of the model is poor. Mao [20] proposed a method for predicting ship trajectory based on an extreme learning machine (ELM). As a single-hidden-layer feed-forward neural network model, the ELM does not require weights and biases of the iterative network and has a high calculation speed. However, the number of hidden-layer nodes in the ELM model is difficult to determine, which affects the generalization performance of the network.
Recurrent neural networks (RNNs) have been extensively developed due to their powerful ability to process sequence information and predictable time information. Hochreater et al. [21] improved the RNN unit structure and proposed a long short-term memory network (LSTM) model, which solved the problems of gradient disappearance, gradient explosion, and insufficient information memory ability by designing the “gate” structure, and LSTM networks can effectively use long-distance timing information [22]. LSTM networks have been successfully applied in speech recognition [23], text processing [24], and other fields, yet there are some defects key hyperparameters, such as the number of hidden-layer neurons, learning rate, etc., which are difficult to determine [25]. Because the number of hidden-layer neurons plays a decisive role in the fitting ability of the model, the learning rate directly affects the convergence speed and calculation time of the model and the topology of the model is controlled directly by the LSTM network structure parameters. Therefore, the prediction performance of the model established by different hyperparameters is quite different, and how to select the appropriate parameters is very important for the establishment of the model. At present, the hyperparameters of the network model are often selected based on the experience of the researchers and the results of multiple experiments. The randomness is relatively large, which affects the prediction performance of the model to a certain extent.
In order to predict the ship trajectory quickly and accurately, this paper adopts the LSTM network model [26,27,28] as the technical basis to establish an inland river ship trajectory prediction model. Considering that the key hyperparameters of the current LSTM model are difficult to determine, such as the number of hidden-layer neurons, learning rate, etc., the genetic algorithm (GA) is proposed to optimize the key hyperparameters of LSTM networks. The model takes LOG, LAT, SOG, and COG as the input features and the future position of the ship as the target output. The LSTM neural network model optimized by the GA (GA-LSTM) is used to predict the ship trajectory. The experimental results show that, compared with the current classical LSTM and SVM, the algorithm proposed in this paper can predict the ship trajectory more quickly and accurately to a certain extent.
The remainder of this paper is organized as follows. Section 2 describes the ship trajectory prediction model. Section 3 describes the theoretical background of the LSTM, GA and GA-LSTM models. Moreover, Section 4 mainly contains experiments and analysis. Finally, Section 5 concludes the paper.

2. Ship Trajectory Prediction Model

An automatic identification system (AIS) can provide real-time ship trajectory data for detecting the navigation status of ships. Nowadays, it is widely used in ship collision avoidance, maritime monitoring, ship traffic flow forecasting, and maritime accident investigation mechanisms [29]. When a ship is sailing, it mainly relies on the AIS data from the target ship to obtain its navigation behavior, so as to make timely and accurate collision avoidance decisions in complex encounters. In actual navigation, the navigation behavior of a ship is mainly reflected in the changes of characteristic variables such as ship position, SOG, and COG [30]. It is assumed that the navigation behavior of a ship at time t can be characterized as:
y ( t ) = { l a t t , l o n t , s o g t , c o g t }
where l o n t , l a t t , s o g t , and c o g t are respectively LON, LAT, SOG, and COG of the ship at time t .
Generally speaking, the navigation behavior of the ship at the next moment is the result of the current behavior and historical behavior. Therefore, in order to improve the accuracy of the model, the navigation behavior of the ship at the past three moments, y ( t 2 ) , y ( t 1 ) , and y ( t ) , is taken as the input of the model and the LON and LAT of the ship at the next moment as the output of the model, namely:
I i n p u t = { y ( t 2 ) , y ( t 1 ) , y ( t ) } O o u t p u t = { l a t t + 1 , l o n t + 1 }
This is the functional relationship between I i n p u t and O o u t p u t : O o u t p u t = f ( I i n p u t ) where f ( ) is the nonlinear transformation function.
Therefore, for ship trajectory prediction, with some samples of AIS data as the training data set { [ y ( t 2 ) , y ( t 1 ) , y ( t ) ] , y ( t + 1 ) , t = 1 , 2 , , l } , obtaining the best estimate of the nonlinear transformation between the input sample I i n p u t and the target output sample O o u t p u t is a problem. This paper selects the GA-LSTM model to fit the nonlinear transformation function f ( ) , the GA-LSTM model is constructed with training data, and then the test data are input into the GA-LSTM model, and finally the real-time prediction of the ship trajectory is carried out.

3. LSTM Network Optimized by GA

3.1. LSTM Network Model

The LSTM neural network solves the problem of gradient disappearance and the explosion of traditional recursive neural networks linked by network units in a chain way, which can effectively improve the learning time. In dealing with the prediction of time series and nonlinear mapping problems, the LSTM model with memory ability shows strong advantages [22]. A structure called a memory cell is added to LSTM to memorize past information, and three gate structures, input gate, output gate, and forget gate, are added to control the transmission of historical information [31].
The structure of the LSTM neural network is shown in Figure 1. Supposing that the network input is ( x 1 , x 2 , , x T ) and the hidden-layer state is ( h 1 , h 2 , , h T ) , at time t, the calculations of each unit and gate are shown in Equations (3)–(8):
i t = σ ( w i [ h t 1 , x t ] + b i )
f t = σ ( w f [ h t 1 , x t ] + b f )
c ˜ t = tanh ( w c [ h t 1 , x t ] + b c )
c t = f t c t 1 + i t c ˜ t
o t = σ ( w o [ h t 1 , x t ] + b o )
h t = o t tanh ( c t )
In Formulas (3)–(8), i t , f t , and o t are the calculations of input gate, forget gate, and output gate, respectively; among them, the input gate is mainly used to determine how much input information at the current moment is retained to the unit state at the current moment; the forget gate is mainly used to determine how much information of the unit state c t 1 from the previous moment is retained in the current cell state c t ; the output gate is mainly used to determine how much output the current cell state has. h t is the final output of the network, c ˜ t is the current input unit state; c t is the current moment unit state; w i , w f , w c , and w o are the weight matrices of the three gates and unit states; b i , b f , b c , and b o are respectively the bias of each gate and unit state; σ ( ) and tanh ( ) are transfer functions; represents the vector inner product; and the symbol represents element-wise multiplication.

3.2. Genetic Algorithm

The GA is usually a biological scientific algorithm that simulates Darwin’s theory of biological evolution by a computer, proposed by J. Holland [32] in 1975. In the genetic evolution of populations in the GA, it is found that chromosomes are used as the main carrier of population inheritance, and with the help of a variety of random operations— gene selection, gene crossover, and gene mutation—a new solution set population is constantly evolving. According to the value of individual fitness and the selection function, the optimal population individual can be selected, which is the optimal solution of the optimization problem in the GA.
In this paper, the GA is used to optimize the key hyperparameters of the LSTM network and the powerful global random search ability of the GA is adopted to obtain the optimal combination of the number of neurons and the learning rate in the LSTM network. The basic idea is as follows:
(1)
Chromosome coding
The number of hidden-layer neurons and the learning rate in the LSTM network are taken as the initialization objects of the GA, and chromosome coding is carried out in the form of real-number coding. The interval range of hidden-layer neurons is set to [2, 40], and the interval range of the learning rate is set to [0.001–0.1].
(2)
Fitness function
The fitness function is applied to determine which individuals in the population can perform next-generation genetic operations. According to differing individual fitness, the “survival of the fittest” is used for screening individuals. The selection-of-fitness function directly affects the performance of the optimized network by the GA and then affects the performance of prediction. This paper mainly constructs the fitness function based on the overall fit between the estimated value and the true value of the ship navigation position. In order to make the network parameters obtained by the GA more suitable for the LSTM model and improve the generalization ability of the model, the AIS data are divided into training samples and test samples. The training samples are utilized for LSTM network training. After reaching the limit of the number of iterations, the training sample output value and test sample output value of the LSTM network are obtained. Then the individual fitness function is defined as:
f i t n e s s = 0.5 × 1 J j = 1 J y j t y t j 2 + 0 . 5 × 1 K k = 1 K y k v y v k 2
where y t j and y v k are the predicted value of the training sample and the predicted value of the test sample, respectively, and y t j and y v k are the actual value. The error of the test sample directly reflects the prediction effect of the model; therefore, the fitness function f i t n e s s includes not only the fitting error of the training sample but also the verification error of the test sample. In the experiment, the error of the training sample and the error of the test sample are given the same weight, which is 0.5, and the sum of the two multiplied with the weight is used as the fitness function of the model.
(3)
Selection operator, crossover operator, and mutation operator
The selection operator selects individuals with better adaptability as parents in the current population and passes genetic information to the offspring. Here, the tournament selection algorithm is used as the GA selection strategy. This selection strategy has the characteristics of efficient algorithm execution rate and easy implementation, and its algorithm complexity is much lower than other selection strategies and is easy to parallelize. It is not easy to fall into the local optimal individual during the selection process and does not require sorting the fitness values of all individuals. The crossover operator takes the shuffle crossover algorithm. Before the crossover, the random . shuffle function is used to perform the shuffle operation in the parent, and then when the random number generated between 0 and 1 is less than the given crossover rate, the crossover transformation is performed. In the mutation operator, when the random number generated between 0 and 1 is less than the given mutation rate, the mutation operation is performed. The rule of variation about the number of hidden-layer neurons and learning rate is shown in Equation (10):
c . L n = abs ( c . L n + random . randint ( 3 , 3 ) ) c . l r = abs ( c . l r + random . uniform ( 0.001 , 0.001 ) )
where c . L n is the number of hidden-layer neurons in a population and c . l r is the learning rate.

3.3. GA-LSTM Model

In this paper, the GA and LSTM neural network models are combined to construct a ship trajectory prediction model based on GA-LSTM. Firstly, the GA is adopted to optimize the hyperparameters of the LSTM network, and then the best combination of learning rate and the number of hidden-layer neurons is obtained to further improve the nonlinear mapping ability of the model; in addition, the GA-LSTM model constructed by the optimal parameter combination is used as the nonlinear transformation function f ( ) between the input sample and output sample; on this basis, the nonlinear transformation function f ( ) is applied to obtain the position information of the ship at the next moment. The specific operation process of the model is as follows:
(1)
Selecting training data set.
In order to obtain the best-fitting effect of the function f ( ) , the input data of the GA-LSTM model are composed of the navigation information of the ship at the past three moments, which are represented by the vector u , and the target output is represented by the vector M . As shown in Formula (11):
u i = [ l a t i 2 , l a t i 1 , l a t i , l o n i 2 , l o n i 1 , l o n i , s o g i 2 , s o g i 1 , s o g i , c o g i 2 , c o g i 1 , c o g i ] T M i = l a t i + 1 l o n i + 1
(2)
Optimizing LSTM network parameters with the GA.
a. Taking the learning rate and the number of hidden-layer units of LSTM model as the optimization objects, and then performing the initialization of the population and the chromosome encoding and decoding operations.
b. Calculating the fitness value of each individual in the initial population.
c. Performing selection, crossover, and mutation operations on chromosomes.
d. Decoding chromosomes and calculating the fitness of individuals in the population. The smaller the fitness value in this algorithm, the more the individual should be retained; otherwise, the individual should be eliminated.
e. If the genetic termination conditions are not met, it will return to Step c. If the genetic termination conditions are met, the optimal parameters calculated by the GA are taken as the final parameters of the LSTM network model.
(3)
Training the GA-LSTM model.
Inputting u and M into the GA-LSTM network of the optimal parameter combination, the output of the GA-LSTM network model is the position of the ship at the next moment. The difference between the target output M and the predicted output f ( u ) of the model is represented by the error e , which is e = M f ( u ) . The GA-LSTM model minimizes the fitting error E ( e T e ) according to the mean square error and finally obtains the best-fitting function f ( ) between the input samples and the output samples.
(4)
Predicting ship trajectory.
The experimental data are sent to the GA-LSTM model, and then the ship navigation position at the next moment is calculated by using the best-fitting function f ( ) .
The ship trajectory prediction model framework is shown in Figure 2. The framework is mainly composed of three parts: data preprocessing, model analysis, and error analysis. Data preprocessing is an essential part of GA-LSTM model, and the data after preprocessing can improve the overall performance of the model to a certain extent. For model analysis, the GA is introduced into the selection of network hyperparameters based on the LSTM network model, which reduces the influence of artificial determination to some extent. For error analysis, visualization and index evaluation are used to further verify the feasibility and performance of the proposed method.

4. Experiments and Analysis

4.1. Model Evaluation Index

In this paper, the overall performance of the model is evaluated through mean square error (MSE) [13] and mean absolute error (MAE) [12]. The smaller the value of MSE and MAE are, the higher the prediction accuracy is. The calculation formulas of MSE and MAE as follows:
M S E = 1 P i = 1 p ( Y i y i ) 2
M A E = 1 P i = 1 p | Y i y i |
where P is the total AIS data, Y i is the predicted value of the network model, and y i is the expected output value.

4.2. AIS Data Sources and Preprocessing

The AIS data were collected in November 2020, and the experimental area was from the Zhuankou waterway of the Wuhan section of the Yangtze River to the Baihushan crossing area. Because of the interrupted or missing data in the process of AIS signal sending, transmission, and reception and that the time series data with large deviations may appear in the AIS data, it is necessary to preprocess the data appropriately. The preprocessing process [33] of the collected AIS data in this paper is as follows:
Firstly, removing invalid data, mainly including:
(1)
MMSI is not a 9-bit data value.
(2)
AIS attribute information contains a large amount of data with null values.
(3)
In this paper, the LAT range of the track point is set to [110.00, 115.00], the LON range is set to [30.00, 32.00], the SOG range is set to [2.0–14.0], the SOG range is set to [0–360], and the distribution of research data after AIS data cleaning is shown in Figure 3 and Figure 4.
(4)
Treatment of missing values.
In the experimental data in this paper, there are some missing AIS data for individual ships. As for the problem of missing values for ship LON and LAT, the method of cubic spline interpolation [34] is used to complete the model, as shown in Figure 5 for the interpolation results of completing missing values of LON and LAT data in two AIS data values. For the missing of SOG and COG during this period, considering the relatively constant characteristics of ship SOG and COG in a short period of time, the average value is used for interpolation.
(5)
The attribute data contained in AIS information have different dimensions, so the trajectory data are normalized between 0 and 1. In this paper, the deviation method [3] is used for processing, and the normalization formula is shown in Equation (14):
X = X X min X max X min
where X min is the minimum value in the experimental data, X max is the maximum value, X is the original data value, and X is the normalized data value.

4.3. Experimental Methods

After data preprocessing, a series of typical ship trajectories with large turning amplitudes is selected for experiments. In this paper, considering model calculation complexity, calculation time, and prediction performance for the SVM model, the radial basis function K ( x , y ) = exp ( | | x y | | 2 / σ 2 ) is selected as the kernel function, where the values of kernel function parameter σ and penalty coefficient C are σ 2 = 3 and C = 50 , respectively. For the LSTM network model, 30 hidden-layer neurons are selected, the number of iterations is 1000, and the learning rate is 0.01. The parameter values for the GA [35,36] are shown in Table 1, where MaxGenerations is the maximum number of iterations before the GA stops optimization and PopulationSize is the size of the initial population. The smaller its value is, the more prone sick populations are to appear. The larger the population size is, the more difficult the algorithm is to converge and the lower robustness it has. CrossoverPop is the crossover probability; if the value is too large, it is easy to miss the optimal individual and the randomness is large, while the crossover probability is too small to effectively update the population. MutationPop is the mutation probability; if its value is too small, the diversity of population decreases too quickly, which easily leads to the loss of effective solutions and is hard to repair. If its value is too large, the probability of the optimal individual being destroyed also increases, which is not conducive to finding the optimal solution.

4.4. Visualized Comparative Analysis of Experimental Results

After data preprocessing, two typical trajectories are selected for experiments. This paper selects AIS data with MMSI values of 413826669 (ship-1) and 413997528 (ship-2) and compares the experiments with the LSTM model and the SVM model. The original trajectories of the two ships are shown in Figure 6.

4.4.1. Visual Analysis of Ship-1 Trajectory Prediction

It can be seen from Figure 6 that ship-1 has a tendency of greater steering amplitude and continuous maneuvering. Firstly, the AIS data of ship-1, LOG, LAT, SOG and COG, are taken as the input samples of the GA-LSTM network model. The position of ship-1, LON and LAT, are taken as the output samples of the model, and the experimental results are shown in Figure 7.
The collected AIS data of ships are divided into training and test sets according to the above method. Figure 7 shows the LON and LAT of the ship predicted by the GA-LSTM model proposed in this paper. It can be seen that the LON and LAT predicted by this model are basically consistent with the actual LON and LAT of ship-1, which can accurately predict the position of ships in inland rivers.
In order to further prove the feasibility and effectiveness of the proposed model, this paper conducts a comparative analysis of the LSTM model and the SVM model. The experimental results are shown in Figure 8. It can be seen that: (1) For the location prediction of ship-1, the SVM model performs the worst; even if the predicted ship trajectory has the same general trend, the position information has a larger deviation. This is due to the weak generalization ability of the SVM model and its ease of falling into local extreme values. (2) The prediction effect of the LSTM method is slightly better than that of the SVM method; however, the two methods are not as good as the method proposed in this paper. This is because the network hyperparameters of the LSTM method have difficulty manually obtaining the optimal solution, which makes the model prediction performance lower than that of GA-LSTM method. (3) In order to better compare the pros and cons of the three methods, zoom in and analyze the position of ship-1′s navigation status: the LSTM and GA-LSTM methods have comparable predictive performance in ship-1′s direct navigation state (see ① in Figure 8). The GA-LSTM model shows better performance when performing large-scale steering or continuous steering (Figure 8 at ②). In general, the GA-LSTM model performs best and can predict ship-1′s sailing position more accurately. The reason is that the GA obtains a better combination of LSTM network parameters, which makes the method proposed in this paper better than the ship trajectory predicted based on the SVM and LSTM models.

4.4.2. Visual Analysis of Ship-2 Trajectory Prediction

The AIS data of ship-2 are also used to predict the LON and LAT of the trajectory by the GA-LSTM model. The experimental results are shown in Figure 9. It can be seen from Figure 9 that the LON and LAT of ship-2 predicted by GA-LSTM are basically the same as the LON and LAT of the actual position in the position prediction of ship-2. Similarly, the trajectory was predicted by the SVM and LSTM models, and the experimental results are shown in Figure 10. It can be seen that the method proposed in this paper has higher prediction performance and better effect, and it can effectively predict the navigation position of ship-2, which further proves the effectiveness and feasibility of the method proposed in this paper.

4.5. Model Performance Index Analysis

In order to further analyze the prediction effect of the GA-LSTM model on the two typical trajectories, this paper adopts MSE and MAE to evaluate the performance of the models. The index analysis results of the three methods are shown in Table 2.
It can be seen from Table 2 that the GA-LSTM model is the lowest in both evaluation indicators, its accuracy is relatively the highest, and its model prediction performance is better. For ship-1, when the optimal parameter combination is (11, 0.0165), the LAT MSE and MAE predicted by this method are 1.6393 × 10−6 and 0.0014, respectively; meanwhile, when the optimal parameter combination for LON prediction is (7, 0.023), the MSE and MAE are 4.3188 × 10−6 and 0.0024, respectively. For ship-2, the LAT MSE and MAE predicted with the optimal parameter combination (13, 0.0163) are 3.0375 × 10−6 and 0.0017, respectively; the LON MSE and MAE predicted by the optimal parameter combination (14, 0.0105) are 1.8304 × 10−6 and 0.0012, respectively. Both indicators are the lowest. It can be seen that firstly adopting the GA to optimize the key hyperparameters of the LSTM network model and then using the optimal parameter combination to construct the GA-LSTM trajectory prediction model can effectively improve the performance and accuracy of prediction.

4.6. Real-Time and Popularization Analysis of Model

The experiment was carried out using the Windows 10 system, the central processing unit was a 2.90 GHz i5 processor with a memory of 32.0 GB, and the experiment was carried out with MATLAB2021b. In the comparison experiment of this paper, the initial population of the GA algorithm was set to 40, and the maximum number of iterations was 100. The training time of the network and the execution time after training were used to compare and discuss the real-time analysis and generalization of the network. The experimental results are shown in Table 3.
From the comparative analysis in Table 3, we can see that the methods adopted in the experiment require a certain amount of time to construct the network, and the difference in network structure makes the time used for network training different. It can be seen from Table 3 that: ① In the network training stage, the training times of the LSTM method and the SVM method are equivalent; after adding GA, the time consumption of the network training stage is increased by about two times; ② In the network execution stage, the time consumptions of the LSTM and SVM methods are basically the same. Compared with the other two algorithm models, the time consumption of the GA-LSTM method is not significantly increased but decreases slightly. In the MATLAB2021b environment, the execution time of GA-LSTM is about 0.2 s.
It can be seen that in practical applications, except for about 3 min in the program start-up training phase, the ship trajectory prediction results can be obtained quickly in other time periods. If another compiled language such as C writes the algorithm into the hardware to run, the running speed will be further improved. Therefore, the method proposed in this paper can meet the needs of certain scenarios in terms of real-time performance and has a good generalization.

5. Conclusions

In the background of world economic globalization, shipping has become one of the most important modes of transportation in international trade. The number, types, and new routes of ships continue to increase. Although the shipping trade shows a thriving atmosphere, it also makes the channel congested and the load increases, which affects the safety of ship navigation and seriously threatens the life and property safety of ship personnel. From the analysis of the ship accident investigation organization, it can be seen that human error is the main cause of marine and inland river accidents. The key to the safe navigation of ships lies in the perception of the surrounding navigation environment during the navigation process and the effective use of varied information for correct analysis and decision making. As a common navigation environment perception means, AIS has some deficiencies in the process of receiving and sending ship information, which restricts the maneuvering behavior of the ship. Knowing how to use the AIS information to accurately predict the trajectories of their own ship and the target ship in a specific time is vital for a ship driver to make a correct evaluation and decision.
In order to improve the prediction accuracy and calculation efficiency when predicting the future position of the ship in a specific period, this paper introduces the LSTM network and the GA optimization algorithm to the future position prediction of the ship and proposes a new method based on GA-LSTM to predict the course and position of inland ships. Considering the disadvantages of AIS equipment in the process of receiving and sending ship information, firstly, the collected real-time AIS data are preprocessed and the cubic spline interpolation method is adopted to interpolate data for the data loss of individual ships. Then, RNNs have powerful time-series processing capabilities, and are able to use historical information to accurately predict future state, building the ship trajectory prediction model based on the LSTM network model, and utilizing the GA optimizes the hyperparameters of the LSTM network. The GA-LSTM prediction model can minimize the impact of hyperparameter factors on the accuracy of ship trajectory prediction. In this paper, two typical ship trajectories in the Wuhan section of the Yangtze River are selected for prediction experiments and compared with the classic SVM method and the LSTM method. The experimental results show that the GA-LSTM model proposed in this paper has higher prediction accuracy and prediction speed; this model not only performs well in predicting the trajectory of the ship sailing in a straight line but also has a strong advantage in trajectory prediction when the ship starts to maneuver or maneuvers at a large angle. On the basis of high computing efficiency, it can predict ship trajectory in real time and accurately provide effective guarantee measures for the safe navigation of ships, and it has better generalization ability.
This model solves the problems of low prediction accuracy and complex calculation of ship trajectory prediction to a certain extent and has good practical application value in the intelligent navigation of inland river ships. The GA-LSTM model is similar to other time-series models, and the effect of ship trajectory prediction with long-term information is not ideal. On the basis of ensuring the prediction accuracy and speed, if the accuracy of long-distance ship position prediction can be improved, it will provide great help for ship collision avoidance and other maneuvering processes. Even though the model in this paper is based on a recursive network model, the calculation cost is relatively high in long-distance ship position prediction, and it is not practical in the collision avoidance maneuvering of unmanned ships. How to predict the ship’s position without losing prediction accuracy and efficiency and how to decrease the computational cost as well will be carried out in further work.

Author Contributions

Conceptualization, Y.Z.; Data curation, L.L. and D.Z.; Formal analysis, L.Q.; Funding acquisition, Y.Z. and C.Z.; Investigation, Y.Z.; Methodology, L.Q.; Resources, Y.M. All authors have read and agreed to the published version of the manuscript.

Funding

The research is financially supported by National Nature Science Foundation of China (51979215; 52171349; 52171350).

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

Not applicable.

Conflicts of Interest

The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.

References

  1. Chen, X.; Meng, X.; Zhao, Y. Genetic algorithm to improve Back Propagation Neural Network ship track prediction. J. Phys. Conf. Ser. 2020, 1650, 032133–032142. [Google Scholar] [CrossRef]
  2. Lehtola, V.; Montewka, J.; Goerlandt, F.; Guinness, R.; Lensu, M. Finding safe and efficient shipping routes in ice-covered waters: A framework and a model. Cold Reg. Sci. Technol. 2019, 165, 102795. [Google Scholar] [CrossRef]
  3. Sang-Won, P.; Young-Soo, P. Predicting Dangerous Traffic Intervals between Ships in Vessel Traffic Service Areas Using a Poisson Distribution. J. Korean Soc. Mar. Environ. Saf. 2016, 22, 402–409. [Google Scholar]
  4. Suo, Y.; Chen, W.; Claramunt, C.; Yang, S. A Ship Trajectory Prediction Framework Based on a Recurrent Neural Network. Sensors 2020, 20, 5133. [Google Scholar] [CrossRef]
  5. Liu, R.W.; Liang, M.; Nie, J.; Yuan, Y.; Xiong, Z.; Yu, H.; Guizani, M. STMGCN: Mobile Edge Computing-Empowered Vessel Trajectory Prediction Using Spatio-Temporal Multi-Graph Convolutional Networks. IEEE Trans. Ind. Inform. 2022. [Google Scholar] [CrossRef]
  6. Volkova Tamara, A.; Balykina Yulia, E.; Bespalov, A. Predicting Ship Trajectory Based on Neural Networks Using AIS Data. J. Mar. Sci. Eng. 2021, 9, 254. [Google Scholar] [CrossRef]
  7. Anderson, S.; Barfoot, T.D.; Tong, C.H.; Särkkä, S. Batch nonlinear continuous-time trajectory estimation as exactly sparse Gaussian process regression. Auton. Robot. 2015, 39, 221–238. [Google Scholar] [CrossRef] [Green Version]
  8. Jiang, B.; Guan, J.; Zhou, W.; Chen, X. Vessel Trajectory Prediction Algorithm Based on Polynomial Fitting Kalman Filtering. J. Signal Processing 2019, 5, 741–746. [Google Scholar]
  9. Guo, S.; Liu, C.; Guo, Z.; Feng, Y.; Hong, F.; Huang, H. Trajectory Prediction for Ocean Vessels Base on K-order Multivariate Markov Chain. In Proceedings of the 13th International Conference on Wireless Algorithms, Systems and Applications (WASA 2018), Tianjin, China, 20–22 June 2018; Springer: Cham, Switzerland, 2018. [Google Scholar]
  10. Zhang, S.K.; Shi, G.Y.; Liu, Z.J.; Zhao, Z.W.; Wu, Z.L. Data-driven based automatic maritime routing from massive AIS trajectories in the face of disparity. Ocean. Eng. 2018, 155, 240–250. [Google Scholar] [CrossRef]
  11. Rong, H.; Teixeira, A.P.; Soares, C.G. Ship trajectory uncertainty prediction based on a Gaussian Process model. Ocean. Eng. 2019, 182, 499–511. [Google Scholar] [CrossRef]
  12. Zhang, L.; Zhang, J.; Niu, J.; Wu, Q.M.J.; Li, G. Track Prediction for HF Radar Vessels Submerged in Strong Clutter Based on MSCNN Fusion with GRU-AM and AR Model. Remote Sens. 2021, 13, 2164. [Google Scholar] [CrossRef]
  13. Tang, H.; Yin, Y.; Shen, H. A model for vessel trajectory prediction based on long short-term memory neural network. J. Mar. Eng. Technol. 2019, 1–10. [Google Scholar] [CrossRef]
  14. Zhong, C.; Jiang, Z.; Chu, X.; Liu, L. Inland Ship Trajectory Restoration by Recurrent Neural Network. J. Navig. 2019, 72, 1359–1377. [Google Scholar] [CrossRef]
  15. De Vries, G.K.D.; Van Someren, M. Machine learning for vessel trajectories using compression, alignments and domain knowledge. Expert Syst. Appl. 2012, 39, 13426–13439. [Google Scholar] [CrossRef]
  16. Piotr, B. The Ship Movement Trajectory Prediction Algorithm Using Navigational Data Fusion. Sensors 2017, 17, 1432. [Google Scholar]
  17. Zhi-Jun, W.; Shan Tian, L.M. A 4D Trajectory Prediction Model Based on the BP Neural Network. J. Intell. Syst. 2019, 29, 1545–1557. [Google Scholar]
  18. Jiao, L.; Guoyou, S.; Kaige, Z. Vessel Trajectory Prediction Model Based on AIS Sensor Data and Adaptive Chaos Differential Evolution Support Vector Regression (ACDE-SVR). Appl. Sci. 2019, 9, 2983–3104. [Google Scholar]
  19. Brian, M.; Lokukaluge, P.P. A dual linear autoencoder approach for vessel trajectory prediction using historical AIS data. Ocean. Eng. 2020, 209, 107478. [Google Scholar]
  20. Mao, S.; Tu, E.; Zhang, G.; Rachmawati, L.; Rajabally, E.; Huang, G.B. An Automatic Identification System (AIS) Database for Maritime Trajectory Prediction and Data Mining. In Proceedings in Adaptation, Learning and Optimization; Springer: Cham, Switzerland, 2018; pp. 241–257. [Google Scholar]
  21. Hochreiter, S.; Schmidhuber, J. Long short-term memory. Neural Comput. 1997, 9, 1735–1780. [Google Scholar] [CrossRef]
  22. Deihimi, A.; Orang, O.; Showkati, H. Short-term electric load and temperature forecasting using wavelet echo state networks with neural reconstruction. Energy 2013, 57, 382–401. [Google Scholar] [CrossRef]
  23. Cai, M.; Liu, J. Maxout neurons for deep convolutional and LSTM neural networks in speech recognition. Speech Commun. 2016, 77, 53–64. [Google Scholar] [CrossRef]
  24. Zhou, C.; Sun, C.; Liu, Z.; Lau, F. A C-LSTM Neural Network for Text Classification. Comput. Sci. 2015, 1, 39–44. [Google Scholar]
  25. Fischer, T.; Krauss, C. Deep learning with long short-term memory networks for financial market predictions. Eur. J. Oper. Res. 2018, 270, 654–669. [Google Scholar] [CrossRef] [Green Version]
  26. Gao, D.W.; Zhu, Y.S.; Zhang, J.F.; He, Y.K.; Yan, K.; Yan, B.R. A novel MP-LSTM method for ship trajectory prediction based on AIS data. Ocean. Eng. 2021, 228, 108956. [Google Scholar] [CrossRef]
  27. Park, J.; Jeong, J.; Park, Y. Ship Trajectory Prediction Based on Bi-LSTM Using Spectral-Clustered AIS Data. J. Mar. Sci. Eng. 2021, 9, 1037. [Google Scholar] [CrossRef]
  28. Liu, R.W.; Liang, M.; Nie, J.; Lim, W.Y.B.; Zhang, Y.; Guizani, M. Deep Learning-Powered Vessel Trajectory Prediction for Improving Smart Traffic Services in Maritime Internet of Things. IEEE Trans. Netw. Sci. Eng. 2022. [Google Scholar] [CrossRef]
  29. Capobianco, S.; Millefiori, L.M.; Forti, N.; Braca, P.; Willett, P. Deep Learning Methods for Vessel Trajectory Prediction based on Recurrent Neural Networks. IEEE Trans. Aerosp. Electron. Syst. 2021, 57, 4329–4346. [Google Scholar] [CrossRef]
  30. Liang, Y.; Zhang, H. Ship Track Prediction Based on AIS Data and PSO Optimized LSTM Network. Int. Core J. Eng. 2020, 6, 23–33. [Google Scholar]
  31. Zhao, Z.; Chen, W.; Wu, X.; Chen, P.C.; Liu, J. LSTM network: A deep learning approach for short-term traffic forecast. IET Intell. Transp. Syst. 2017, 11, 68–75. [Google Scholar] [CrossRef] [Green Version]
  32. Holland, J.H.; Reitman, J.S. Cognitive systems based on adaptive algorithms. In Pattern-Directed Inference Systems; Academic Press: Cambridge, MA, USA, 1978; pp. 313–329. [Google Scholar]
  33. Liu, R.W.; Nie, J.; Garg, S.; Xiong, Z.; Zhang, Y.; Hossain, M.S. Data-driven trajectory quality improvement for promoting intelligent vessel traffic services in 6G-enabled maritime IoT systems. IEEE Internet Things J. 2021, 8, 5374–5385. [Google Scholar] [CrossRef]
  34. Haibing, H.; Zheng, X.; Yin, J.; Wang, Y. Research on O-ring Dimension Measurement Algorithm Based on Cubic Spline Interpolation. Appl. Sci. 2021, 11, 3716. [Google Scholar] [CrossRef]
  35. Liu, Y.; Li, W. An ATO Multi-objective Optimization Control Strategy Based on Genetic Algorithm. In Proceedings of the 31st Chinese Control and Decision Conference (2019 CCDC), Nanchang, China, 3–5 June 2019; pp. 1215–1219. [Google Scholar]
  36. Bagher, Z.; Mohammad, R.M. Detecting community structure in complex networks using genetic algorithm based on object migrating automata. Comput. Intell. 2020, 36, 824–860. [Google Scholar]
Figure 1. The LSTM neural network structure.
Figure 1. The LSTM neural network structure.
Applsci 12 04073 g001
Figure 2. Flowchart of the vessel trajectory prediction framework.
Figure 2. Flowchart of the vessel trajectory prediction framework.
Applsci 12 04073 g002
Figure 3. LON and LAT distributions.
Figure 3. LON and LAT distributions.
Applsci 12 04073 g003
Figure 4. SOG and COG distributions.
Figure 4. SOG and COG distributions.
Applsci 12 04073 g004
Figure 5. Cubic spline interpolation results.
Figure 5. Cubic spline interpolation results.
Applsci 12 04073 g005
Figure 6. The original trajectories of experimental ships.
Figure 6. The original trajectories of experimental ships.
Applsci 12 04073 g006
Figure 7. Prediction results of LON and LAT of ship-1.
Figure 7. Prediction results of LON and LAT of ship-1.
Applsci 12 04073 g007
Figure 8. Comparison of experimental results of ship-1 trajectory prediction.
Figure 8. Comparison of experimental results of ship-1 trajectory prediction.
Applsci 12 04073 g008
Figure 9. Prediction results of LON and LAT of ship-2.
Figure 9. Prediction results of LON and LAT of ship-2.
Applsci 12 04073 g009
Figure 10. Comparison of experimental results of ship-2 trajectory prediction.
Figure 10. Comparison of experimental results of ship-2 trajectory prediction.
Applsci 12 04073 g010
Table 1. Parameter values for GA.
Table 1. Parameter values for GA.
MaxGenerationPopulationSizeCrossoverPopMutationPop
100400.80.2
Table 2. Performance index analysis of models on 3 models.
Table 2. Performance index analysis of models on 3 models.
ModelPositionMSEMAEOptimal Paramter Combination
Numb of NeuronLearning Rate
ship-1SVMLAT9.979 × 10−60.002
LON1.4957 × 10−50.0034
LSTMLAT2.6257 × 10−60.0015
LON7.8145 × 10−60.0026
GA-LSTMLAT1.6393 × 10−60.0014110.0165
LON4.3188 × 10−60.002470.0230
ship-2SVMLAT1.3404 × 10−50.0035
LON1.0037 × 10−50.0029
LSTMLAT5.4005 × 10−60.0023
LON8.742 × 10−60.0027
GA-LSTMLAT3.0375 × 10−60.0017130.0163
LON1.8304 × 10−60.0012140.0105
Table 3. Comparison of real-time analysis of 3 models.
Table 3. Comparison of real-time analysis of 3 models.
ModelTraining Time T/SExecution Time T/S
LONLATLONLAT
ship-1SVM55.91556956.13770.4261410.424251
LSTM53.921853.7661660.4034740.404457
GA-LSTM154.213806166.6478490.1292390.129546
ship-2SVM56.13704956.5867950.4272250.433015
LSTM53.67120253.8414510.4005930.401865
GA-LSTM145.977239142.8603580.1170130.123151
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Share and Cite

MDPI and ACS Style

Qian, L.; Zheng, Y.; Li, L.; Ma, Y.; Zhou, C.; Zhang, D. A New Method of Inland Water Ship Trajectory Prediction Based on Long Short-Term Memory Network Optimized by Genetic Algorithm. Appl. Sci. 2022, 12, 4073. https://0-doi-org.brum.beds.ac.uk/10.3390/app12084073

AMA Style

Qian L, Zheng Y, Li L, Ma Y, Zhou C, Zhang D. A New Method of Inland Water Ship Trajectory Prediction Based on Long Short-Term Memory Network Optimized by Genetic Algorithm. Applied Sciences. 2022; 12(8):4073. https://0-doi-org.brum.beds.ac.uk/10.3390/app12084073

Chicago/Turabian Style

Qian, Long, Yuanzhou Zheng, Lei Li, Yong Ma, Chunhui Zhou, and Dongfang Zhang. 2022. "A New Method of Inland Water Ship Trajectory Prediction Based on Long Short-Term Memory Network Optimized by Genetic Algorithm" Applied Sciences 12, no. 8: 4073. https://0-doi-org.brum.beds.ac.uk/10.3390/app12084073

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop