# Ship Track Prediction Based on DLGWO-SVR

Authors: Yingyu Chen; Shenhua Yang; Yongfeng Suo; Minjie Zheng
Journal: Scientific Programming
 (2021)

---

## Abstract

To improve the accuracy of ship track prediction, the improved Grey Wolf Optimizer (GWO) and Support Vector Regression (SVR) models are incorporated for ship track prediction. The hunting strategy of dimensional learning was used to optimize the move search process of GWO and balance exploration and exploitation while maintaining population diversity. Selection and updating procedures keep GWO from being stuck in locally optimal solutions. The optimal parameters obtained by modified GWO were substituted into the SVR model to predict ship trajectory. Dimension Learning Grey Wolf Optimizer and Support Vector Regression (DLGWO-SVR), Grey Wolf Optimized Support Vector Regression (GWO-SVR), and Differential Evolution Grey Wolf Optimized Support Vector Regression (DEGWO-SVR) model trajectory prediction simulations were carried out. A comparison of the results shows that the trajectory prediction model based on DLGWO-SVR has higher prediction accuracy and meets the requirements of ship track prediction. The results of ship track prediction can not only improve the efficiency of marine traffic management but also prevent the occurrence of traffic accidents and maintain marine safety.


---

## Body

## 1. Introduction

To introduce unmanned vessels into commercial shipping lanes, an effective collision avoidance system must be built to ensure the level of safety required for unmanned vessel autonomy. Ship track prediction is the prediction of a ship’s future navigation state based on the target ship’s history and current trajectory. The results of ship track prediction can be used to evaluate collision risk, promote active collision avoidance, serve as a reference for ship collision avoidance decisions, and enhance the ability of situational awareness at sea.Ship track prediction methods can be classified into three categories: Prediction methods based on a statistical model, probability graph model, and machine learning model. The prediction methods based on the statistical model include Gaussian regression [1], Kalman filter [2] and Bayesian network [3], etc., whose characteristics are as follows: In the modeling, the influence of wind, current, and other environments on the ship movement generally need to be considered. The establishment of the ship kinematics equation will increase the complexity of the model. As the experiment goes on, the error increases. The prediction methods based on the probability graph model include the Markov model [4] and grey model [5]. Their characteristics are as follows: It combines probability theory and graph theory, abstruse knowledge in different fields into probability model, and reduces problems in application to the calculation of probability distribution of probability model variables. Under the condition of a large amount of data, the grey model has low performance and long-running time, but the improved prediction effect is better than that of the least square method. This method improves the prediction accuracy to some extent, but it is still not ideal. Prediction methods based on the machine learning model include recurrent neural network [6], backpropagation neural network [7], long and short time memory network [8], and Support Vector Regression (SVR) [9]. With the following characteristics: As data amount increases, gradient explosion or gradient disappearance may occur, and the convergence rate is slow, which leads to the decrease of prediction accuracy and the low efficiency of sample training. SVR needs to choose parameters independently, which is subjective, and the prediction time is short, but the prediction accuracy needs to be further improved.With the rise and widespread application of intelligent optimization algorithms, an increasing number of researchers have introduced optimization algorithms into prediction tasks, such as Particle Swarm Optimization (PSO) [10], Differential Evolution (DE) [11], Artificial Bee Colony (ABC) [12], Gravitational Search Algorithm (GSA) [13], Genetic Algorithm (GA) [14], and Ant Colony Optimization (ACO) [15], and other algorithms are also proposed for combinatorial optimization. These algorithms can explore the search space continually and find the best or relatively close answer in a reasonable time.Compared to algorithms such as PSO, GSA, DE, ABC, ACO, and the GWO method produces superior outcomes in unknown space. There are several characteristics. First, the GWO algorithm showed superior exploitation. Second, the exploration ability of GWO was confirmed. Third, the GWO showed high local optima avoidance to some extent. Finally, the convergence analysis of GWO confirmed the convergence of this algorithm [16]. GWO requires fewer control parameters and is easy to implement. It has been used in many disciplines to address various optimization issues, such as parameter estimation [17], economic scheduling [18], pattern recognition [19], feature selection [20], and wind speed prediction [21].In terms of prediction, GWO has not been found to be used in the research of ship track prediction. The GWO search procedure is carried out byα wolf, β wolf, and δ wolf in each iteration, ensuring that the algorithm is convergent. At the same time, it has several limitations, such as lack of population variety, a disparity between exploration and exploitation, local optimization, and premature convergence.To balance the exploration and exploitation of GWO, Malik et al. [22] proposed Weighted Distance Grey Wolf Optimizer (WDGWO) to calculate the weighted average of the optimal solution. Long et al. [23] proposed Random Opposition-Based Learning Grey Wolf Optimizer (ROL-GWO) by modifying parameter C, which increased the searching ability of the algorithm. N. Singh and S. B. Singh [24] proposed an improved Grey Wolf Optimization algorithm to solve the economic dynamical load scheduling problem, which can both increase the global search and local search simultaneously. This step can coordinate the behavior of grey wolves, global and local random search, and opposition learning. Jayabarathi et al. [18] solved the economic scheduling problem by incorporating HGWO into GWO via variation and crossover operations. It performs well in solving the constrained nonkernel solution problem, although it does not achieve the proper balance of global search and local search. Gaidhane and Nigam [25] proposed GWO-ABC, a hybrid that combines the benefits of GWO and ABC. GWO adopted the information-sharing strategy of ABC to improve the global search capability while retaining the original hunting strategy of grey wolves for local search. Saxena et al. [26] proposed Equipped Grey Wolf Optimizer (E-GWO), which used sinusoidal function bridging, tournament selection, crossover, and mutation operations in the position update stage. The sinusoidal bridging mechanism and evolutionary operation assist the grey wolf in achieving greater accuracy and avoiding the local optimal solution. It shows good searchability in local scenes, but the lack of local search effect remains the main issue in crossover operations with a single peak problem and unbalanced search.Many scholars enhanced GWO by modifying the GWO mechanism to avoid it falling into local optimality. Mittal et al. [27] developed Modified GWO (MGWO), which is based on a nonlinear control parameter approach and focuses on the right balance of global and local search, and this method may avoid the difficulties of the local optimal solution and premature convergence. Long et al. [28] proposed Exploration Enhanced GWO (EEGWO) to guide the search of new candidates by applying random individuals in the population for a location update. Nonlinear control parameters were employed to grow linearly during the iteration phase to balance the global and local searches of GWO. However, the primary issues remain falling into a local optimum and early convergence. Nasrabadi et al. [29] improved GWO by combining oppositional learning and parallelization to improve the convergence speed and the accuracy of the final result. However, in some cases, the convergence performance of the algorithm was not good. N. Singh and S. B. Singh [24] proposed Hybrid GWOSCA (HGWOSCA) to update the position of α in GWO by using the position update equation of the Sine Cosine Algorithm (SCA), which improved the global convergence and searchability of GWO when dealing with single-mode problems. But its global searching ability in multimode function is limited, and the combinatorial function balance problem persists. Alomoush et al. [30] proposed Harmony Search with Grey Wolf Optimizer (GWO-HS) Algorithm to solve global optimization problems by using opposing learning strategies. Meng et al. [31] proposed a hybrid Crisscross Search-Based Grey Wolf Optimizer (CS-GWO) algorithm, which used two crossover operators to improve the global search ability of α,βandδ wolves while maintaining the population diversity, but the algorithm convergence occurred too soon.To solve the problem of poor population diversity and slow convergence rate of GWO, a hybrid Grey Wolf Optimizer based on Elite Opposition (EOGWO) was proposed by introducing the elite opposition-based learning strategy and simplex method into GWO [32]. Inspired by the hierarchical social pyramid of the GWO, Rodrguez et al. [33] proposed to introduce hierarchical operators into GWO to simulate the search process and gives five variations. The cellular automata (CA) concept is embedded into the GWO. A Cellular Grey Wolf Optimizer (CGWO) with a topological structure is proposed [34]. CGWO with a topological structure can also help to improve the diversity of the population. To solve the hybrid flow shop scheduling problem considering noise pollution, Lu et al. [35] proposed a Multiobjective Cellular Grey Wolf Optimizer (MOCGWO) algorithm, which integrates the merits of cellular automata for diversification and variable neighborhood search for intensification.However, GWO is easy to fall into the local optimal solution, and the balance exploration and exploitation remains to be solved. Meanwhile, the selection parameters of the SVR model are subjective.Alaa and Abdel [36] explore the advantages of the GWO algorithm in estimating the software reliability growth model’s parameters with the objective of minimizing the difference between the estimated and the actual number of failures of the software system. Almazini and Mahamud [37] proposed an enhanced binary grey wolf optimization (EBGWO) algorithm for feature selection in anomaly detection by controlling the balancing parameter. This method focused on obtaining a value for a parameter that controlled the trade-off between exploration and exploitation.Using the GWO, which was inspired by the previous research, the problem of SVR parameter selection can be solved. Improving the accuracy of ship track prediction for real-time data training and modeling is critical for better collision avoidance guidance at sea. A vessel trajectory prediction model based on Grey Wolf Optimized Support Vector Regression (GWO-SVR), which fully utilizes SVR’s advantage of maintaining higher precision in the case of nonlinearity and small samples. However, the model has certain setbacks. The GWO model suffers from the lack of population diversity, the imbalance between exploitation and exploration, and premature convergence. Thus, if the previously trained model is still used, the accuracy of prediction decreases.The main purpose of this study is to overcome the above deficiency of GWO and improve the effect of ship track prediction. The Dimensional Learning Hunting (DLH) strategy was used to improve the search performance of GWO and track the prediction accuracy of DLGWO-SVR. The DLH search approach is based on individual wolf hunting behavior in nature, and it expands the global search domain by using multineighbors learning. The DLGWO then uses both candidate wolves created by the DLH and GWO search algorithms to move the wolfXi from its current location to a better one in each iteration. In addition, the DLGWO employs a separate selecting and updating process in each iteration to determine the winner candidate wolf and update the current position for the following iteration. The main work of this paper is as follows:(1)
Analyze the GWO and SVR models, apply the improved GWO in the training process of the SVR model, and establish the model of ship trajectory prediction.(2)
The hunting search strategy based on dimensional learning is used to improve the search effect of grey wolves. In each iteration, candidate wolves are generated by the search strategy of DLH and GWO.(3)
Select and update operations are used in each iteration to select the winning candidate wolf to update the position of the grey wolf in the next iteration.(4)
The prediction experiment was carried out with AIS data, and the experimental results of GWO-SVR, Differential Evolution Grey Wolf Optimized Support Vector Regression (DEGWO-SVR), and DLGWO-SVR models were compared and analyzed.The remainder of this paper can be divided into the following four parts. Section2 mainly proposes the SVR and GWO related principles. The vessel track prediction based on DLGWO-SVR is then presented in Section 3. Extensive experiments are carried out in Section 4. We end this work by summing up the main contributions in Section 5.


## 2. The Related Principles

### 2.1. Principle of SVR

SVR nonlinear mapping of the original data to high-dimensional feature space for linear regression.Figure1 shows the structure of the SVR model in the data regression. Kxi,yi represents the kernel function.Figure 1
Structure of the support vector regression (SVR) model.In the SVR model, given the data setxi,yii=1N∈R, where xi is the input vector of the SVR model and yi is the true output value. N is the total number of data points used. The output of the SVR model is as follows:(1)y^=fx=∑i=1Nwiϕix+b=wTφx+b.w=w1w2,…,wNT,φ=ϕ1ϕ2,…,ϕNT, the function ϕix is called the feature. The parameters ω and b are the weight and deviation of the support vector machine, respectively. In the feature space, the input vector x is mapped to the high-dimensional kernel-induced feature space vector φx, and the nonlinear regression is transformed into linear regression. These parameters are calculated by minimizing the regular risk function:(2)Rw=12wTw+λ∑i=1Nyi−fxε,(3)yi−fxε=0,ifyi−fx<ε,yi−fx−ε,otherwise.In equation (2), Rω is a regular weight vector representing the complexity of the SVR model. Equation (3) represents the estimated vector. Parameter λ and ε is a user-defined parameter, yi−fxε is ε intensive loss function. If the predicted value of fx is within the error range ε, the loss is equal to 0. For other predicted points outside the range of the error ε, the loss is equal to the dimension of the difference between the predicted value and the error ε.The regular parameterλ ensures that a good SVR model is generated. Increasing regularization parameters can penalize larger estimation errors. The estimation error can also be reduced by increasing the weight vector norm of the first expression in equation (2). However, an increase in the weight vector norm does not guarantee the generation of the SVR model.In classical SVR, the appropriate value of the insensitive parameterε is difficult to determine in advance. The regular risk function of the minimization equation (2) is equivalent to the minimization constrained risk function:(4)Rw,ξ,ξ∗=12wTw+λ∑i=1Nξi+ξi∗.Constraints are as follows:(5)yi−wTφx−b≤ε+ξi,wTφx+b−yi≤ε+ξi∗,i=1,2,…,N,ξi,ξi∗≥0.Parameterξ=ξ1ξ2,…,ξNT and ξ∗=ξ1∗ξ2∗ξN∗T are the relaxation variable. It represents the maximum and minimum limits on the output of the SVR model, both of which are positive.The constrained optimization problem of equation (4) can be solved by applying Lagrange multipliers to equations (4) and (5) using standard quadratic programming. The regression function of equation (1) is derived as follows:(6)y^=fx=∑i=1Nai−ai∗φTxiφx=∑i=1NβiKx,xi+b.Under the Karush-Kuhn-Tucker complementary condition, the parametersw and b are calculated. Parameter K is the kernel function, which is expressed as follows:(7)Kx,xi=φTxiφx.The Lagrange multiplierai and ai∗ are used to express the coefficient βi. In this study, the SVR model uses the following radial basis kernel functions:(8)Kx,xi=exp−x−xiTx−xi2δ2.A solution is obtained in equation (6) where the coefficient βi is nonzero only for a subset of the training data.


### 2.2. Principle of GWO

The grey wolf was inspired by social hierarchy and hunting behavior. Initializeα,β and δ wolves as the optimal solution, and guide the rest of ω wolves to find the optimal solution. Starting from randomly generating the initial wolves in the search space, the fitting function estimated the position of the wolves and repeated the hunting process of the grey wolves until the predefined number of iterations so as to determine the optimal hunting position, namely the position of α wolves.There are three main stages in the hunting process: encircling, hunting, and attacking prey.


#### 2.2.1. Encircling Prey

Grey wolves encircle prey during the hunt. Encircling prey is modeled as follows:(9)D=C⋅Xpt−Xt,Xt+1=Xpt−A⋅D,A=2a⋅r1−a,C=2⋅r2,where t indicates the current iteration, Xp is the prey position, and X is the position vector of a grey wolf. A and C represent coefficient vectors. r1,r2∈0,1.a decreases linearly from 2 to 0.


#### 2.2.2. Hunting

The hunting behavior of grey wolves was modeled on the assumption thatα, β and δ wolves knew the location of prey. The following formulas are proposed in this view:(10)Dα=C1⋅Xα−X,Dβ=C2⋅Xβ−X,Dδ=C3⋅Xδ−X,X1=Xα−A1⋅Dα,X2=Xβ−A2⋅Dβ,X3=Xδ−A3⋅Dδ,Xt+1=X1+X2+X33,where Xα,Xβ,Xδ represent the positions of α,βandδ wolves in the t iteration, respectively. X1,X2andX3 represent the positions of α,βandδ wolves in the t+1 iteration, respectively.


#### 2.2.3. Attacking Prey

The prey ceases to move and the hunt ends. The wolves began to attack their prey. The next position of a search agent can be in any position between its current position and the position of the prey. This process is carried out by linear reduction of the iterative curve of local and global search.Each iterationa updates within the range of [2, 0], half of which is used for global search to achieve a smooth transition effect. The rest is used as a local search, updating the location of the optimal solution to the location of the prey and the current location of the wolf.


## 2.1. Principle of SVR

SVR nonlinear mapping of the original data to high-dimensional feature space for linear regression.Figure1 shows the structure of the SVR model in the data regression. Kxi,yi represents the kernel function.Figure 1
Structure of the support vector regression (SVR) model.In the SVR model, given the data setxi,yii=1N∈R, where xi is the input vector of the SVR model and yi is the true output value. N is the total number of data points used. The output of the SVR model is as follows:(1)y^=fx=∑i=1Nwiϕix+b=wTφx+b.w=w1w2,…,wNT,φ=ϕ1ϕ2,…,ϕNT, the function ϕix is called the feature. The parameters ω and b are the weight and deviation of the support vector machine, respectively. In the feature space, the input vector x is mapped to the high-dimensional kernel-induced feature space vector φx, and the nonlinear regression is transformed into linear regression. These parameters are calculated by minimizing the regular risk function:(2)Rw=12wTw+λ∑i=1Nyi−fxε,(3)yi−fxε=0,ifyi−fx<ε,yi−fx−ε,otherwise.In equation (2), Rω is a regular weight vector representing the complexity of the SVR model. Equation (3) represents the estimated vector. Parameter λ and ε is a user-defined parameter, yi−fxε is ε intensive loss function. If the predicted value of fx is within the error range ε, the loss is equal to 0. For other predicted points outside the range of the error ε, the loss is equal to the dimension of the difference between the predicted value and the error ε.The regular parameterλ ensures that a good SVR model is generated. Increasing regularization parameters can penalize larger estimation errors. The estimation error can also be reduced by increasing the weight vector norm of the first expression in equation (2). However, an increase in the weight vector norm does not guarantee the generation of the SVR model.In classical SVR, the appropriate value of the insensitive parameterε is difficult to determine in advance. The regular risk function of the minimization equation (2) is equivalent to the minimization constrained risk function:(4)Rw,ξ,ξ∗=12wTw+λ∑i=1Nξi+ξi∗.Constraints are as follows:(5)yi−wTφx−b≤ε+ξi,wTφx+b−yi≤ε+ξi∗,i=1,2,…,N,ξi,ξi∗≥0.Parameterξ=ξ1ξ2,…,ξNT and ξ∗=ξ1∗ξ2∗ξN∗T are the relaxation variable. It represents the maximum and minimum limits on the output of the SVR model, both of which are positive.The constrained optimization problem of equation (4) can be solved by applying Lagrange multipliers to equations (4) and (5) using standard quadratic programming. The regression function of equation (1) is derived as follows:(6)y^=fx=∑i=1Nai−ai∗φTxiφx=∑i=1NβiKx,xi+b.Under the Karush-Kuhn-Tucker complementary condition, the parametersw and b are calculated. Parameter K is the kernel function, which is expressed as follows:(7)Kx,xi=φTxiφx.The Lagrange multiplierai and ai∗ are used to express the coefficient βi. In this study, the SVR model uses the following radial basis kernel functions:(8)Kx,xi=exp−x−xiTx−xi2δ2.A solution is obtained in equation (6) where the coefficient βi is nonzero only for a subset of the training data.


## 2.2. Principle of GWO

The grey wolf was inspired by social hierarchy and hunting behavior. Initializeα,β and δ wolves as the optimal solution, and guide the rest of ω wolves to find the optimal solution. Starting from randomly generating the initial wolves in the search space, the fitting function estimated the position of the wolves and repeated the hunting process of the grey wolves until the predefined number of iterations so as to determine the optimal hunting position, namely the position of α wolves.There are three main stages in the hunting process: encircling, hunting, and attacking prey.


### 2.2.1. Encircling Prey

Grey wolves encircle prey during the hunt. Encircling prey is modeled as follows:(9)D=C⋅Xpt−Xt,Xt+1=Xpt−A⋅D,A=2a⋅r1−a,C=2⋅r2,where t indicates the current iteration, Xp is the prey position, and X is the position vector of a grey wolf. A and C represent coefficient vectors. r1,r2∈0,1.a decreases linearly from 2 to 0.


### 2.2.2. Hunting

The hunting behavior of grey wolves was modeled on the assumption thatα, β and δ wolves knew the location of prey. The following formulas are proposed in this view:(10)Dα=C1⋅Xα−X,Dβ=C2⋅Xβ−X,Dδ=C3⋅Xδ−X,X1=Xα−A1⋅Dα,X2=Xβ−A2⋅Dβ,X3=Xδ−A3⋅Dδ,Xt+1=X1+X2+X33,where Xα,Xβ,Xδ represent the positions of α,βandδ wolves in the t iteration, respectively. X1,X2andX3 represent the positions of α,βandδ wolves in the t+1 iteration, respectively.


### 2.2.3. Attacking Prey

The prey ceases to move and the hunt ends. The wolves began to attack their prey. The next position of a search agent can be in any position between its current position and the position of the prey. This process is carried out by linear reduction of the iterative curve of local and global search.Each iterationa updates within the range of [2, 0], half of which is used for global search to achieve a smooth transition effect. The rest is used as a local search, updating the location of the optimal solution to the location of the prey and the current location of the wolf.


## 2.2.1. Encircling Prey

Grey wolves encircle prey during the hunt. Encircling prey is modeled as follows:(9)D=C⋅Xpt−Xt,Xt+1=Xpt−A⋅D,A=2a⋅r1−a,C=2⋅r2,where t indicates the current iteration, Xp is the prey position, and X is the position vector of a grey wolf. A and C represent coefficient vectors. r1,r2∈0,1.a decreases linearly from 2 to 0.


## 2.2.2. Hunting

The hunting behavior of grey wolves was modeled on the assumption thatα, β and δ wolves knew the location of prey. The following formulas are proposed in this view:(10)Dα=C1⋅Xα−X,Dβ=C2⋅Xβ−X,Dδ=C3⋅Xδ−X,X1=Xα−A1⋅Dα,X2=Xβ−A2⋅Dβ,X3=Xδ−A3⋅Dδ,Xt+1=X1+X2+X33,where Xα,Xβ,Xδ represent the positions of α,βandδ wolves in the t iteration, respectively. X1,X2andX3 represent the positions of α,βandδ wolves in the t+1 iteration, respectively.


## 2.2.3. Attacking Prey

The prey ceases to move and the hunt ends. The wolves began to attack their prey. The next position of a search agent can be in any position between its current position and the position of the prey. This process is carried out by linear reduction of the iterative curve of local and global search.Each iterationa updates within the range of [2, 0], half of which is used for global search to achieve a smooth transition effect. The rest is used as a local search, updating the location of the optimal solution to the location of the prey and the current location of the wolf.


## 3. The Proposed DLGWO-SVR

### 3.1. DLGWO Model

In GWO,α,β,δandω wolves move toward the search region for the global optimal solution. This behavior could result in a locally optimal solution. Furthermore, the decrease of population diversity makes it easy for grey wolves to fall into local optimum. To address this issue, grey wolf employs dimension learning hunting search strategy to determine candidates and then improves grey wolf algorithm through selection, update, and other operations [38].Improvements are made in the steps of initialization, movement, and selection and update.


#### 3.1.1. Initialization

In the search space composed oflj,uj,N wolves are randomly distributed.(11)Xij=lj+randj0,1×uj−lj,i∈1,N,j∈1,D.The position of thei th Wolf in the t-th iteration is expressed as Xit=xi1,xi2,…,xiD. In this case, D represents the dimension of the problem, and the entire population of grey wolves will be stored in a matrix with N rows and D columns. The fitting value of Xit is calculated by the fitting function fXit.


#### 3.1.2. Movement

Individual hunting of wolves is considered that is learned by its neighbors, the grey wolf in the neighborhood teaches its neighbor to become another candidate for the new position ofXit. The position of Xα,XβandXδ determines the position of prey. The first candidate set for the new position of the grey wolf Xit is called Xi−GWOt+1, and this value is calculated by the traditional GWO search strategy.Each dimension of the new position of the grey wolfXit is calculated by learning its neighbors and then using equation (14). Another candidate set for the new position of grey wolf Xit forms a DLH search strategy, called Xi−DLHt+1,Rit is solved by calculating the Euclidian distance between the current position Xit and the candidate position Xi−GWOt+1.(12)Rit=Xit−Xi−GWOt+1,(13)Nit=Xjt|DiXit,Xjt≤Rit,Xjt∈Pop.Through equation (13), considering Ri,Di is the Euclidian distance between Xit and Xjt, the neighbors of Xit are denoted as Nit. The neighbors of Xit are constructed, and the neighbor Xn,dt of the D dimension is randomly selected from Nit, and the wolf Xr,dt is randomly selected from the population. Multineighbor learning is performed through equation (14).


#### 3.1.3. Selection and Update

By comparing the fitting values ofXi−GWOt+1 and Xi−DLHt+1, the optimal solution is selected.(14)Xi−DLH,dt+1=Xi,dt+rand×Xn,dt−Xr,dt,(15)Xit+1=Xi−GWOt+1,iffXi−GWO<fXi−DLH,Xi−DLHt+1,otherwise.Finally, after all the individuals have completed this step, the iteration counter is incremented by 1, and the next iteration is searched until the predefined number of iterations is reached.


### 3.2. DLGWO-SVR Model

The improved GWO is used to establish the ship trajectory prediction model based on DLGWO-SVR. Figure2 shows the flow chart of the DLGWO-SVR prediction model. The detailed experimental steps of DLGWO-SVR are as follows:Step 1: Initialize the position ofN wolves and the relevant parameters of the grey wolf model.Step 2: Calculate the positions ofα,βandδ wolves, input the SVR model for training, and calculate the optimal solution.Step 3: Update the position of the grey wolf according to the optimal solution.Step 4: Calculate the distances ofα,βandδ wolves to prey, and the positions of α,βandδ wolves, respectively, and calculate the first candidate set Xi−GWOt+1 for the new position of Xit.Step 5: Calculate the Euclidian distance between the candidate positionXi−GWOt+1 and the current position Xit, denote as radius Rit.Step 6: Build the neighborhoodNit of Xit, and calculate another candidate set Xi−DLH,dt+1 by using the random neighbors of the d dimension.Step 7: Select and update operations. By comparing the function values of the candidate set, the position of the next iteration of the grey wolf is determined fromXi−GWOt+1,Xi−DLHt+1.Step 8: Repeat Steps 2–7 until the preset number of iterations is reached. The experiment is terminated and the predicted results are returned.Figure 2
Flowchart of the model of DLGWO-SVR.


## 3.1. DLGWO Model

In GWO,α,β,δandω wolves move toward the search region for the global optimal solution. This behavior could result in a locally optimal solution. Furthermore, the decrease of population diversity makes it easy for grey wolves to fall into local optimum. To address this issue, grey wolf employs dimension learning hunting search strategy to determine candidates and then improves grey wolf algorithm through selection, update, and other operations [38].Improvements are made in the steps of initialization, movement, and selection and update.


### 3.1.1. Initialization

In the search space composed oflj,uj,N wolves are randomly distributed.(11)Xij=lj+randj0,1×uj−lj,i∈1,N,j∈1,D.The position of thei th Wolf in the t-th iteration is expressed as Xit=xi1,xi2,…,xiD. In this case, D represents the dimension of the problem, and the entire population of grey wolves will be stored in a matrix with N rows and D columns. The fitting value of Xit is calculated by the fitting function fXit.


### 3.1.2. Movement

Individual hunting of wolves is considered that is learned by its neighbors, the grey wolf in the neighborhood teaches its neighbor to become another candidate for the new position ofXit. The position of Xα,XβandXδ determines the position of prey. The first candidate set for the new position of the grey wolf Xit is called Xi−GWOt+1, and this value is calculated by the traditional GWO search strategy.Each dimension of the new position of the grey wolfXit is calculated by learning its neighbors and then using equation (14). Another candidate set for the new position of grey wolf Xit forms a DLH search strategy, called Xi−DLHt+1,Rit is solved by calculating the Euclidian distance between the current position Xit and the candidate position Xi−GWOt+1.(12)Rit=Xit−Xi−GWOt+1,(13)Nit=Xjt|DiXit,Xjt≤Rit,Xjt∈Pop.Through equation (13), considering Ri,Di is the Euclidian distance between Xit and Xjt, the neighbors of Xit are denoted as Nit. The neighbors of Xit are constructed, and the neighbor Xn,dt of the D dimension is randomly selected from Nit, and the wolf Xr,dt is randomly selected from the population. Multineighbor learning is performed through equation (14).


### 3.1.3. Selection and Update

By comparing the fitting values ofXi−GWOt+1 and Xi−DLHt+1, the optimal solution is selected.(14)Xi−DLH,dt+1=Xi,dt+rand×Xn,dt−Xr,dt,(15)Xit+1=Xi−GWOt+1,iffXi−GWO<fXi−DLH,Xi−DLHt+1,otherwise.Finally, after all the individuals have completed this step, the iteration counter is incremented by 1, and the next iteration is searched until the predefined number of iterations is reached.


## 3.1.1. Initialization

In the search space composed oflj,uj,N wolves are randomly distributed.(11)Xij=lj+randj0,1×uj−lj,i∈1,N,j∈1,D.The position of thei th Wolf in the t-th iteration is expressed as Xit=xi1,xi2,…,xiD. In this case, D represents the dimension of the problem, and the entire population of grey wolves will be stored in a matrix with N rows and D columns. The fitting value of Xit is calculated by the fitting function fXit.


## 3.1.2. Movement

Individual hunting of wolves is considered that is learned by its neighbors, the grey wolf in the neighborhood teaches its neighbor to become another candidate for the new position ofXit. The position of Xα,XβandXδ determines the position of prey. The first candidate set for the new position of the grey wolf Xit is called Xi−GWOt+1, and this value is calculated by the traditional GWO search strategy.Each dimension of the new position of the grey wolfXit is calculated by learning its neighbors and then using equation (14). Another candidate set for the new position of grey wolf Xit forms a DLH search strategy, called Xi−DLHt+1,Rit is solved by calculating the Euclidian distance between the current position Xit and the candidate position Xi−GWOt+1.(12)Rit=Xit−Xi−GWOt+1,(13)Nit=Xjt|DiXit,Xjt≤Rit,Xjt∈Pop.Through equation (13), considering Ri,Di is the Euclidian distance between Xit and Xjt, the neighbors of Xit are denoted as Nit. The neighbors of Xit are constructed, and the neighbor Xn,dt of the D dimension is randomly selected from Nit, and the wolf Xr,dt is randomly selected from the population. Multineighbor learning is performed through equation (14).


## 3.1.3. Selection and Update

By comparing the fitting values ofXi−GWOt+1 and Xi−DLHt+1, the optimal solution is selected.(14)Xi−DLH,dt+1=Xi,dt+rand×Xn,dt−Xr,dt,(15)Xit+1=Xi−GWOt+1,iffXi−GWO<fXi−DLH,Xi−DLHt+1,otherwise.Finally, after all the individuals have completed this step, the iteration counter is incremented by 1, and the next iteration is searched until the predefined number of iterations is reached.


## 3.2. DLGWO-SVR Model

The improved GWO is used to establish the ship trajectory prediction model based on DLGWO-SVR. Figure2 shows the flow chart of the DLGWO-SVR prediction model. The detailed experimental steps of DLGWO-SVR are as follows:Step 1: Initialize the position ofN wolves and the relevant parameters of the grey wolf model.Step 2: Calculate the positions ofα,βandδ wolves, input the SVR model for training, and calculate the optimal solution.Step 3: Update the position of the grey wolf according to the optimal solution.Step 4: Calculate the distances ofα,βandδ wolves to prey, and the positions of α,βandδ wolves, respectively, and calculate the first candidate set Xi−GWOt+1 for the new position of Xit.Step 5: Calculate the Euclidian distance between the candidate positionXi−GWOt+1 and the current position Xit, denote as radius Rit.Step 6: Build the neighborhoodNit of Xit, and calculate another candidate set Xi−DLH,dt+1 by using the random neighbors of the d dimension.Step 7: Select and update operations. By comparing the function values of the candidate set, the position of the next iteration of the grey wolf is determined fromXi−GWOt+1,Xi−DLHt+1.Step 8: Repeat Steps 2–7 until the preset number of iterations is reached. The experiment is terminated and the predicted results are returned.Figure 2
Flowchart of the model of DLGWO-SVR.


## 4. Results and Discussion

### 4.1. Datasets

The experiment was modeled and simulated with the help of MATLAB toolbox libsvm-3.24. In this experiment, the AIS data used for prediction are from September to October 2018 of Gulei Port in Zhangzhou, Fujian. The raw data should remove the wrong in the pretreatment and then carry out prediction and verification experiments. There are three types of errors in AIS data.(1)
The MMSI code of the ship is not 9 digits, or it is an unreasonable record.(2)
The longitude and latitude of the ship are beyond the reasonable range. For example, the longitude is greater than 180°, the latitude is greater than 90°, or the value of the longitude and latitude is negative.(3)
The ship’s speed and course are beyond the reasonable range, such as the course is greater than 360 or the speed is less than 0.Table1 randomly lists part of the AIS data of September 2018. These data are sample data after preprocessing.Table 1
Sample data structure.
MMSILongitude (°)Latitude (°)Course (°)Speed (kn)Timestamp (s)259681317117.5928823.687758293.76.81535837149412444715117.67611523.611697305.391536839207412358490117.40196323.990355.98.11536724254412445837117.5791523.72888183.47.51536604590600003568117.4926423.58772132.15.51535731218


### 4.2. Predicted Results

#### 4.2.1. Prediction Results for Different MMSI Ships

Input different sample data to the prediction model for the experiment. The predicted experimental results are shown below.Figure3 shows the prediction result of MMSI 259681317.Figure 3
Prediction result of MMSI 259681317.Figure4 shows the prediction result of MMSI 412444715.Figure 4
Prediction result of MMSI 412444715.Figure5 shows the prediction result of MMSI 412358490.Figure 5
Prediction result of MMSI 412358490.Figure6 shows the prediction result of MMSI 412445837.Figure 6
Prediction result of MMSI 600003568.Figure7 shows the prediction result of MMSI 600003568.Figure 7
Prediction result of MMSI 600003568.As can be seen from the above figures, the predicted trajectory is basically coincident with the original trajectory, or is parallel to the original trajectory with a very small distance difference near the original trajectory. However, the small distance difference will not affect the actual operation of the staff but is helpful to judge the traffic situation and greatly avoid the occurrence of maritime traffic accidents. Therefore, the above figures show that the new model can accurately predict the ship's trajectory.


#### 4.2.2. Prediction Errors for Different MMSI Ships

To further verify the prediction accuracy of the proposed model, the following is a comparison of the six experimental error curves for trajectory prediction. In the following figure, the num represents the number of track points, and the vertical axis represents the value of the prediction error.Figure8 shows the prediction error of MMSI 259681317.Figure 8
The prediction error of MMSI 259681317.Figure9 shows the prediction error of MMSI 412444715.Figure 9
The prediction error of MMSI 412444715.Figure10 shows the prediction error of MMSI 412358490.Figure 10
The prediction error of MMSI 412358490.Figure11 shows the prediction error of MMSI 412445837.Figure 11
The prediction error of MMSI 412445837.Figure12 shows the prediction error of MMSI 600003568.Figure 12
The prediction error of MMSI 600003568.As can be seen from Figures8–12, the prediction error basically fluctuates around the value of 0. Unlike the others, the error curves in Figure 10 are mostly below 0 and remain within 0.01°. However, they all meet the needs of the nautical practice.


### 4.3. Model Evaluation

The prediction model is evaluated by means of mean square error, mean absolute error, and mean absolute percentage error. Assume that the true valuey=y1,y2,…,yn, y′=y1′,y2′,…,yn′, then the evaluation index is expressed as follows:(16)EMAE=1n∑i=1nyi−yi′,EMSE=1n∑i=1nyi−yi′2,EMAPE=1n∑i=1nyi−yi′yi.TheEMAE, EMSE, and EMAPE of six trajectories are recorded in Table 2. The prediction error of each trajectory is very small, and the prediction accuracy of the model proposed in this paper can meet the requirements of ship track prediction.Table 2
Evaluation table of DLGWO-SVR prediction error.
MMSIEMAE°EMSE°EMAPE°2596813170.0018650.00000540.00007884124447150.0056950.00022060.00024034123584900.0068160.00005580.00006084124458370.0018110.00000480.00007656000035680.0013900.000004370.0000589


### 4.4. Error Comparison before and after Model Improvement

To further verify the prediction accuracy of the proposed model, the prediction errors of DLGWO-SVR and GWO-SVR models were compared. In the following figure, num represents the number of track points, and the vertical axis represents the value of the prediction error.Figure13 shows the model error comparison of MMSI 259681317.Figure 13
The model error comparison of MMSI 259681317.Figure14 shows the model error comparison of MMSI 412444715.Figure 14
The model error comparison of MMSI 412444715.Figure15 shows the model error comparison of MMSI 412358490.Figure 15
The model error comparison of MMSI 412358490.Figure16 shows the model error comparison of MMSI 412445837.Figure 16
The model error comparison of MMSI 412445837.Figure17 shows the model error comparison of MMSI 600003568.Figure 17
The model error comparison of MMSI 600003568.Figures13–17 show that the overall prediction error of DLGWO-SVR is smaller than that of GWO-SVR, and the prediction error of DLGWO-SVR fluctuates less. On the whole, the performance of the proposed method is better than that of GWO-SVR.


### 4.5. Error Comparison between the DLGWO-SVR and Other Models

To further verify the prediction accuracy of the proposed model, it was compared with DEGWO-SVR and GWO-SVR model. As the initial population of GWO is randomly generated, the grey wolf individuals lack diversity in the search space and are prone to fall into the local optimum. DE algorithm maintains population diversity through mutation and selection operations to improve the performance of GWO in local and global search. Figure18 shows that the prediction error of the proposed prediction model and DEGWO-SVR model. Table 3 shows the mean square error, mean absolute error, and mean absolute percentage error of the three models. It can be roughly seen that the prediction errors of the DEGWO-SVR model and DLGWO-SVR model are less than GWO-SVR.Figure 18
Comparison of the prediction errors obtained using the three models.Table 3
Prediction errors of the three models.
ModelEMAE°EMSE°EMAPE°GWO-SVR0.0131990.00019833840.000112287DEGWO-SVR0.00510.0000693170.00021666DLGWO-SVR0.00635320.000050120.00005405Since the proposed model randomly distributesN wolves in the search space during initialization to maintain population diversity and its neighbor learning mechanism performs better than DE in balancing global and local search, the proposed model performs better than DE and has higher prediction accuracy. As a result, the suggested model in this work meets the prediction requirements and increases the accuracy of the GWO-SVR model greatly.


## 4.1. Datasets

The experiment was modeled and simulated with the help of MATLAB toolbox libsvm-3.24. In this experiment, the AIS data used for prediction are from September to October 2018 of Gulei Port in Zhangzhou, Fujian. The raw data should remove the wrong in the pretreatment and then carry out prediction and verification experiments. There are three types of errors in AIS data.(1)
The MMSI code of the ship is not 9 digits, or it is an unreasonable record.(2)
The longitude and latitude of the ship are beyond the reasonable range. For example, the longitude is greater than 180°, the latitude is greater than 90°, or the value of the longitude and latitude is negative.(3)
The ship’s speed and course are beyond the reasonable range, such as the course is greater than 360 or the speed is less than 0.Table1 randomly lists part of the AIS data of September 2018. These data are sample data after preprocessing.Table 1
Sample data structure.
MMSILongitude (°)Latitude (°)Course (°)Speed (kn)Timestamp (s)259681317117.5928823.687758293.76.81535837149412444715117.67611523.611697305.391536839207412358490117.40196323.990355.98.11536724254412445837117.5791523.72888183.47.51536604590600003568117.4926423.58772132.15.51535731218


## 4.2. Predicted Results

### 4.2.1. Prediction Results for Different MMSI Ships

Input different sample data to the prediction model for the experiment. The predicted experimental results are shown below.Figure3 shows the prediction result of MMSI 259681317.Figure 3
Prediction result of MMSI 259681317.Figure4 shows the prediction result of MMSI 412444715.Figure 4
Prediction result of MMSI 412444715.Figure5 shows the prediction result of MMSI 412358490.Figure 5
Prediction result of MMSI 412358490.Figure6 shows the prediction result of MMSI 412445837.Figure 6
Prediction result of MMSI 600003568.Figure7 shows the prediction result of MMSI 600003568.Figure 7
Prediction result of MMSI 600003568.As can be seen from the above figures, the predicted trajectory is basically coincident with the original trajectory, or is parallel to the original trajectory with a very small distance difference near the original trajectory. However, the small distance difference will not affect the actual operation of the staff but is helpful to judge the traffic situation and greatly avoid the occurrence of maritime traffic accidents. Therefore, the above figures show that the new model can accurately predict the ship's trajectory.


### 4.2.2. Prediction Errors for Different MMSI Ships

To further verify the prediction accuracy of the proposed model, the following is a comparison of the six experimental error curves for trajectory prediction. In the following figure, the num represents the number of track points, and the vertical axis represents the value of the prediction error.Figure8 shows the prediction error of MMSI 259681317.Figure 8
The prediction error of MMSI 259681317.Figure9 shows the prediction error of MMSI 412444715.Figure 9
The prediction error of MMSI 412444715.Figure10 shows the prediction error of MMSI 412358490.Figure 10
The prediction error of MMSI 412358490.Figure11 shows the prediction error of MMSI 412445837.Figure 11
The prediction error of MMSI 412445837.Figure12 shows the prediction error of MMSI 600003568.Figure 12
The prediction error of MMSI 600003568.As can be seen from Figures8–12, the prediction error basically fluctuates around the value of 0. Unlike the others, the error curves in Figure 10 are mostly below 0 and remain within 0.01°. However, they all meet the needs of the nautical practice.


## 4.2.1. Prediction Results for Different MMSI Ships

Input different sample data to the prediction model for the experiment. The predicted experimental results are shown below.Figure3 shows the prediction result of MMSI 259681317.Figure 3
Prediction result of MMSI 259681317.Figure4 shows the prediction result of MMSI 412444715.Figure 4
Prediction result of MMSI 412444715.Figure5 shows the prediction result of MMSI 412358490.Figure 5
Prediction result of MMSI 412358490.Figure6 shows the prediction result of MMSI 412445837.Figure 6
Prediction result of MMSI 600003568.Figure7 shows the prediction result of MMSI 600003568.Figure 7
Prediction result of MMSI 600003568.As can be seen from the above figures, the predicted trajectory is basically coincident with the original trajectory, or is parallel to the original trajectory with a very small distance difference near the original trajectory. However, the small distance difference will not affect the actual operation of the staff but is helpful to judge the traffic situation and greatly avoid the occurrence of maritime traffic accidents. Therefore, the above figures show that the new model can accurately predict the ship's trajectory.


## 4.2.2. Prediction Errors for Different MMSI Ships

To further verify the prediction accuracy of the proposed model, the following is a comparison of the six experimental error curves for trajectory prediction. In the following figure, the num represents the number of track points, and the vertical axis represents the value of the prediction error.Figure8 shows the prediction error of MMSI 259681317.Figure 8
The prediction error of MMSI 259681317.Figure9 shows the prediction error of MMSI 412444715.Figure 9
The prediction error of MMSI 412444715.Figure10 shows the prediction error of MMSI 412358490.Figure 10
The prediction error of MMSI 412358490.Figure11 shows the prediction error of MMSI 412445837.Figure 11
The prediction error of MMSI 412445837.Figure12 shows the prediction error of MMSI 600003568.Figure 12
The prediction error of MMSI 600003568.As can be seen from Figures8–12, the prediction error basically fluctuates around the value of 0. Unlike the others, the error curves in Figure 10 are mostly below 0 and remain within 0.01°. However, they all meet the needs of the nautical practice.


## 4.3. Model Evaluation

The prediction model is evaluated by means of mean square error, mean absolute error, and mean absolute percentage error. Assume that the true valuey=y1,y2,…,yn, y′=y1′,y2′,…,yn′, then the evaluation index is expressed as follows:(16)EMAE=1n∑i=1nyi−yi′,EMSE=1n∑i=1nyi−yi′2,EMAPE=1n∑i=1nyi−yi′yi.TheEMAE, EMSE, and EMAPE of six trajectories are recorded in Table 2. The prediction error of each trajectory is very small, and the prediction accuracy of the model proposed in this paper can meet the requirements of ship track prediction.Table 2
Evaluation table of DLGWO-SVR prediction error.
MMSIEMAE°EMSE°EMAPE°2596813170.0018650.00000540.00007884124447150.0056950.00022060.00024034123584900.0068160.00005580.00006084124458370.0018110.00000480.00007656000035680.0013900.000004370.0000589


## 4.4. Error Comparison before and after Model Improvement

To further verify the prediction accuracy of the proposed model, the prediction errors of DLGWO-SVR and GWO-SVR models were compared. In the following figure, num represents the number of track points, and the vertical axis represents the value of the prediction error.Figure13 shows the model error comparison of MMSI 259681317.Figure 13
The model error comparison of MMSI 259681317.Figure14 shows the model error comparison of MMSI 412444715.Figure 14
The model error comparison of MMSI 412444715.Figure15 shows the model error comparison of MMSI 412358490.Figure 15
The model error comparison of MMSI 412358490.Figure16 shows the model error comparison of MMSI 412445837.Figure 16
The model error comparison of MMSI 412445837.Figure17 shows the model error comparison of MMSI 600003568.Figure 17
The model error comparison of MMSI 600003568.Figures13–17 show that the overall prediction error of DLGWO-SVR is smaller than that of GWO-SVR, and the prediction error of DLGWO-SVR fluctuates less. On the whole, the performance of the proposed method is better than that of GWO-SVR.


## 4.5. Error Comparison between the DLGWO-SVR and Other Models

To further verify the prediction accuracy of the proposed model, it was compared with DEGWO-SVR and GWO-SVR model. As the initial population of GWO is randomly generated, the grey wolf individuals lack diversity in the search space and are prone to fall into the local optimum. DE algorithm maintains population diversity through mutation and selection operations to improve the performance of GWO in local and global search. Figure18 shows that the prediction error of the proposed prediction model and DEGWO-SVR model. Table 3 shows the mean square error, mean absolute error, and mean absolute percentage error of the three models. It can be roughly seen that the prediction errors of the DEGWO-SVR model and DLGWO-SVR model are less than GWO-SVR.Figure 18
Comparison of the prediction errors obtained using the three models.Table 3
Prediction errors of the three models.
ModelEMAE°EMSE°EMAPE°GWO-SVR0.0131990.00019833840.000112287DEGWO-SVR0.00510.0000693170.00021666DLGWO-SVR0.00635320.000050120.00005405Since the proposed model randomly distributesN wolves in the search space during initialization to maintain population diversity and its neighbor learning mechanism performs better than DE in balancing global and local search, the proposed model performs better than DE and has higher prediction accuracy. As a result, the suggested model in this work meets the prediction requirements and increases the accuracy of the GWO-SVR model greatly.


## 5. Conclusions

In this paper, we use a DLH strategy to improve GWO for ship track prediction experiments. The improved optimization model can well balance the exploration and exploitation capabilities of GWO while maintaining the diversity of the population to avoid GWO falling into the local optimal solution, thus improving the accuracy of trajectory prediction.By conducting prediction experiments on ship trajectories with different MMSI and different lengths, it is not difficult to see that the prediction accuracy of the DLGWO-SVR model meets the requirements of marine ship trajectories prediction and improves the prediction accuracy of ship trajectories. Compared with other methods, DLGWO-SVR can maintain high prediction accuracy in small sample data.Future research can be combined with the information of surrounding ships and geographical environment to predict the sailing state of ships, and more state information of ships can also be considered for ship track prediction. Furthermore, it is necessary to make a real-time prediction of the trajectory of the target ship sailing in the ocean.In addition, there are many optimization algorithms not mentioned in this paper, such as Monarch Butterfly Optimization (MBO), earthworm optimization algorithm, Elephant Herding Optimization (EHO), moth search algorithm, slime mould algorithm, and Harris Hawks Optimization (HHO). These optimization algorithms are very effective when dealing with certain problems. MBO and HHO can be used in combination with other machine learning algorithms to deal with issues such as numerical optimization and feature selection. For example, the butterfly optimization algorithm can be combined with ACO and ABC algorithm. EW algorithm can be combined with a GA, PSO, and DE algorithm to deal with specific problems. EHO and SVM sets are better than GA and grid search in classification accuracy. The hybrid optimization algorithm shows better convergence and higher accuracy and lowers computational complexity when solving some suitable problems.



---

*Source: 9085617-2021-09-15.xml*