Ship Trajectory Prediction Based on BP Neural Network

: In recent years, with the prosperity of world trade, the water transport industry has developed rapidly, the number of ships has surged, and ship safety accidents in busy waters and complex waterways have become more frequent. Predicting the movement of the ship and analyzing the trajectory of the ship are of great significance for improving the safety level of the ship. Aiming at the multi-dimensional characteristics of ship navigation behavior and the accuracy and real-time requirements of ship traffic service system for ship trajectory prediction, a ship navigation trajectory prediction method combining ship automatic identification system information and Back Propagation (BP) neural network are proposed. According to the basic principle of BP neural network structure, the BP neural network is trained by taking the characteristic values of ship navigation behavior at three consecutive moments as input and the characteristic values of ship navigation behavior at the fourth moment as output to predict the future ship navigation trajectory. Based on the Automatic Identification System (AIS) information of the waters near the Nanpu Bridge in Pudong New Area, Shanghai, the results show that the method is used to predict the ship's navigational behavior eigenvalues accurately and in real time. Compared with the traditional kinematics prediction trajectory method, the model can effectively predict ship navigation. The trajectory improves the accuracy of the ship's motion situation prediction, and has the advantages of high computational efficiency and strong versatility, and the error is within an acceptable range.


Introduction
In recent years, with the rapid development of China's economy, domestic and foreign trade has developed rapidly, the amount of maritime traffic has increased, and some important waterway traffic are very busy. This has caused frequent traffic accidents at sea, causing not only major economic losses, but also serious Threatening human life. Therefore, it is necessary to carry out powerful monitoring of the ship, timely discover the abnormal trajectory of the ship, and reduce the risk of water traffic accidents [ Perera, Oliveira and Guedessoares (2012)]. By analyzing the optimal allocation solution of small-scale data sets, we speculate that there is a potential model in optimal resource allocation that can be represented by machine learning algorithms [Chen, Xu, Ren et al. (2018); Zheng, Huang, Xie and Zhu (2018)]. The widespread popularity of neural networks in many fields is mainly due to their ability to approximate complex multivariate nonlinear functions directly from the input samples. Neural networks can provide models for a large class of natural and artificial phenomena that are difficult to handle using classical parametric techniques [Han and Hou (2010); Katayama and Aoki (2014)].
2 Ship trajectory prediction model based on BP neural network Neural networks are systems in which computational units analogous to the human brain are interconnected [Kang and Isik (2005); Gan, Liang, Li et al. (2018)]. The idea is to input the historical behavior state and current behavior state of the ship in the sea as a network input, and to map the future ship behavior characterization data as a network, and train the network to establish historical ship behavior by comparing with the actual value [Zegers and Sundareshan (2003)]. The mapping relationship with the future ship behavior characterization data, to achieve the calculation and prediction of the future ship behavior state [Chu, Zhu and Yang (2017); Wang, Gao and Fang (2015)].
In scientific experiments and engineering practice, there are usually many variables involved, which will also be affected by various factors including heading speed and water flow speed during actual ship navigation. Each trajectory is composed of a series of points and has a linear or nonlinear structure over time [Sidar and Doolin (1983)]. The most important trajectory characteristics of the ship include longitude, latitude and time. The ship's longitude, latitude, speed and ship's direction are selected as the main variables. The movement situation at the previous moment is used to predict the movement situation at the next moment. The ship navigation behavior data of x, y and z for three consecutive times constitutes the vector x as the network input, and the ship navigation behavior characterization data y at time t is output as the output, and the parameters of the neural network are trained. The ship trajectory data is Where i x represents the input of the training set, which contains 12 variables, namely, the longitude  , latitude  , speed v and bow d of the ship at 3 consecutive moments (2) i y represents the output of the training set, including longitude and latitude at time t and four variables of course speed.
Theoretical derivation proves that a hidden layer BP-ANN (Back Propagation-Artificial Neural Network) can approximate any nonlinear continuous function with arbitrary precision, so we adopt a three-layer BP-ANN model [Li, Liu, Wu et al. (2018); Gao and Liao (2010)]. 1. Number of input and output neurons: according to the above model analysis, the number of input neurons is 12 and the number of output neurons is 4. 2. Number of neurons in the hidden layer: the number x of hidden layer neurons has a great influence on the prediction accuracy of BP-ANN. The selection of the best number can be found in Eq. (4) and Eq. (5). We should calculate the appropriate range and then find out the best through experimentation.Where n, m are the number of input and output neurons, and a is a constant between 0 and 10.
3. Network training: as mentioned earlier, BP-ANN trains itself by input/output data. In order to ensure the accuracy of the experimental results, we randomly selected the ship navigation AIS data of different inland river sections, and randomly selected 70% of the data as the training set, and the remaining 30% as the test set to verify the performance of the network. BP algorithm modifies the connection weights of neurons on the basis of output error data. The purpose is to make output error data to reach an expected range [Miao and Yuan (1993)].

Ship navigation simulation
In order to verify the effectiveness of the proposed method, the ship's trajectory is predicted in real time based on the AIS information of the waters near the Nanpu Bridge in Pudong New Area, Shanghai. For the performance evaluation of BP neural network, the root mean square error (RMSE) is used to test its prediction effect. In the above Eq. (6), real represents the true value of the test data, and pred is the predicted value trained by the BP neural network. The RMSE provides a measure of the goodness of fit of the test data, which measures the deviation between the predicted value and the true value. In the BP-ANN training process, the number of neurons in the hidden layer has a great influence on the accuracy of the prediction. In the experiment, according to the formula, the number of neurons in different hidden layers can be set. By comparing the neural network RMSE, the number of neurons with the smallest error is selected as the parameter, and the neural network after training under different hidden layer neuron nodes in the experiment. The obtained RMSE is shown in the Fig. 1. JAI, vol.1, no.1, pp.29-36, 2019 Figure 1: RMSE of neural networks under different hidden layer neuron nodes As can be seen from the above figure, the hidden layer neurons range from 4 to 14. It can be seen from the above figure that when there are 12 neurons in the hidden layer, the mean square error of the neural network is the smallest, so the number of optimal hidden layer neurons in the neural network can be set to 12, and the selected example of the ship The navigation trajectory prediction model is a BP neural network with a 12-12-4 structure. In this paper, several mainstream algorithms in statistical methods are selected for experiments, including linear fitting-based least squares method, multi-target regression is concerned with the simultaneous prediction of multiple continuous target variables based on the same set of input variables [Xi, Sheng, Sun et al. (2018)]. traditional kinematic method Kalman wave algorithm and gray prediction algorithm. The time scale of the track prediction depends on the frequency of the target ship maneuver, and the maneuver frequency is related to the navigable water environment. The ship's forecast period was set to 1 min, and the ship was tracked for a period of 20 min. In the above Fig. 2, the different color line segments represent the effects predicted using different algorithms, where the horizontal axis represents the predicted time axis and the vertical axis represents the predicted mean square error at that time. It can be seen from the above figure that the least squares error based on linear fitting is the largest, and the traditional kinematics algorithm such as Kalman wave algorithm and the gray prediction algorithm are also relatively large. The least squares method is an evaluation criterion for the degree of deviation. It is an optimization problem, but there are many factors affecting the ship's trajectory here, which leads to the traditional method not being able to perform linear fitting very well. In the ship trajectory prediction method of Kalman filter and gray model, the ship kinematics equation needs to be constructed, and environmental factors such as wind and flow have great influence on ship motion. We also conclude that the extended Hamiltonian algorithm has better convergence speed than the natural gradient algorithm [Arif, Bibi and Jhangir (2018)]. The randomness and diversity of interference directly lead to the complexity of motion. However, the neural network not only has a small prediction error, but its prediction result does not change greatly with time, and the volatility is small. This shows that the neural network can learn the law of ship motion in the actual environment without understanding the motion principle and environmental interference. And only the longitude, latitude, speed and heading structure prediction model is adopted, which has the advantages of simple principle, small data volume, high calculation efficiency and strong versatility.  In order to better observe the prediction effect, Fig. 3 shows the results of synchronous simulation on the electronic chart. As shown in the figure, the blue model represents the experimental vessel, the middle of the channel is a light red mid line, and the two sides are light floating lines. In accordance with the IMO traffic requirements, in addition to the U-turn, avoidance and other cross-border behavior, any vessel can only travel between the center line and the warning light float. During this time, the simulated ship was driving normally on the river, and the red curve in the black box was the predicted result predicted by the trained BP neural network prediction model within 20 seconds. The left figure of Fig. 3 shows the trajectory prediction curve of the ship during the straight-line voyage, and the right figure shows the trajectory prediction curve of the ship during the curve voyage. In order to show the difference between the real value and the prediction value, a section of the prediction process is selected to draw a scatter plot. Fig. 4 reflects the difference between the predicted point of the 20 seconds trajectory prediction and the actual navigation record point. The predicted trajectory and the actual trajectory are calculated and processed, and the actual amount of deviation for each point can be obtained. The trajectory prediction point is almost equal to the actual trajectory, and the error is small. The experimental results also show that BP neural network can correctly predict the ship's trajectory, and through calculation and analysis, predict the longitude, latitude, heading and speed of the ship's trajectory within an acceptable range, the prediction accuracy is very high, more than 90% Meet the needs of ship navigation behavior monitoring and navigation practices.

Summary
In the context of the increasingly developed shipping industry, it is important to study the intelligent prediction of the ship's future trajectory. This paper analyzes the important position and role of track prediction in maritime traffic supervision, and analyzes the limitations and drawbacks of existing track prediction methods. In view of the excellent learning ability of neural network and the remarkable characteristics of robustness and fault tolerance, a neural network-based track prediction model is developed. Based on the ship historical AIS data, BP neural network algorithm is used to construct the BP neural network ship trajectory prediction model. The motion situation of the ship in the previous three moments is used to predict the motion situation at the next moment, and the accuracy and effectiveness of the algorithm are verified by an example. And compare the computational efficiency of different hidden layer nodes and different training times. It can be seen from the running results that the algorithm is short in time and high in precision, which indicates that the neural network can learn the navigation law of the ship in the actual environment and can be used for real-time prediction.