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

^{1}

^{2}

^{3}

^{*}

## Abstract

**:**

## 1. Introduction

## 2. Ship Trajectory Prediction Model

## 3. LSTM Network Optimized by GA

#### 3.1. LSTM Network Model

#### 3.2. Genetic Algorithm

- (1)
- Chromosome coding

- (2)
- Fitness function

- (3)
- Selection operator, crossover operator, and mutation operator

#### 3.3. GA-LSTM Model

- (1)
- Selecting training data set.

- (2)
- Optimizing LSTM network parameters with the GA.

- (3)
- Training the GA-LSTM model.

- (4)
- Predicting ship trajectory.

## 4. Experiments and Analysis

#### 4.1. Model Evaluation Index

#### 4.2. AIS Data Sources and Preprocessing

- (1)
- MMSI is not a 9-bit data value.
- (2)
- AIS attribute information contains a large amount of data with null values.
- (3)
- (4)
- Treatment of missing values.

- (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}^{\prime}=\frac{X-{X}_{\mathrm{min}}}{{X}_{\mathrm{max}}-{X}_{\mathrm{min}}}$$

#### 4.3. Experimental Methods

#### 4.4. Visualized Comparative Analysis of Experimental Results

#### 4.4.1. Visual Analysis of Ship-1 Trajectory Prediction

#### 4.4.2. Visual Analysis of Ship-2 Trajectory Prediction

#### 4.5. Model Performance Index Analysis

^{−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

## 5. Conclusions

## Author Contributions

## Funding

## Institutional Review Board Statement

## Informed Consent Statement

## Data Availability Statement

## Conflicts of Interest

## References

- 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] - 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] - 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] - 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] - 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] - 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] - 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] - 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] - 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]
- 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] - 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] - 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] - 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] - 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] - 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] - Piotr, B. The Ship Movement Trajectory Prediction Algorithm Using Navigational Data Fusion. Sensors
**2017**, 17, 1432. [Google Scholar] - 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] - 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] - 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] - 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]
- Hochreiter, S.; Schmidhuber, J. Long short-term memory. Neural Comput.
**1997**, 9, 1735–1780. [Google Scholar] [CrossRef] - 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] - 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] - Zhou, C.; Sun, C.; Liu, Z.; Lau, F. A C-LSTM Neural Network for Text Classification. Comput. Sci.
**2015**, 1, 39–44. [Google Scholar] - 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] - 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] - 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] - 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] - 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] - 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] - 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] - 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]
- 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] - 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] - 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]
- 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]

MaxGeneration | PopulationSize | CrossoverPop | MutationPop |
---|---|---|---|

100 | 40 | 0.8 | 0.2 |

Model | Position | MSE | MAE | Optimal Paramter Combination | ||
---|---|---|---|---|---|---|

Numb of Neuron | Learning Rate | |||||

ship-1 | SVM | LAT | 9.979 × 10^{−6} | 0.002 | ||

LON | 1.4957 × 10^{−5} | 0.0034 | ||||

LSTM | LAT | 2.6257 × 10^{−6} | 0.0015 | |||

LON | 7.8145 × 10^{−6} | 0.0026 | ||||

GA-LSTM | LAT | 1.6393 × 10^{−6} | 0.0014 | 11 | 0.0165 | |

LON | 4.3188 × 10^{−6} | 0.0024 | 7 | 0.0230 | ||

ship-2 | SVM | LAT | 1.3404 × 10^{−5} | 0.0035 | ||

LON | 1.0037 × 10^{−5} | 0.0029 | ||||

LSTM | LAT | 5.4005 × 10^{−6} | 0.0023 | |||

LON | 8.742 × 10^{−6} | 0.0027 | ||||

GA-LSTM | LAT | 3.0375 × 10^{−6} | 0.0017 | 13 | 0.0163 | |

LON | 1.8304 × 10^{−6} | 0.0012 | 14 | 0.0105 |

Model | Training Time T/S | Execution Time T/S | |||
---|---|---|---|---|---|

LON | LAT | LON | LAT | ||

ship-1 | SVM | 55.915569 | 56.1377 | 0.426141 | 0.424251 |

LSTM | 53.9218 | 53.766166 | 0.403474 | 0.404457 | |

GA-LSTM | 154.213806 | 166.647849 | 0.129239 | 0.129546 | |

ship-2 | SVM | 56.137049 | 56.586795 | 0.427225 | 0.433015 |

LSTM | 53.671202 | 53.841451 | 0.400593 | 0.401865 | |

GA-LSTM | 145.977239 | 142.860358 | 0.117013 | 0.123151 |

Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. |

© 2022 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).

## 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://doi.org/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://doi.org/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://doi.org/10.3390/app12084073