Attention-BiLSTM-based ship track prediction method
By using the Attention-BiLSTM method in ship track prediction and combining DBSCAN and LSTM for data processing and filling, the problem of limited prediction accuracy in the prior art is solved, and high-precision track prediction in complex marine environments is achieved.
Patent Information
- Application Number
- CN202510185515.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-20
- Publication Date
- 2025-03-21
AI Technical Summary
The existing ship track prediction methods are difficult to cope with complex and changeable marine dynamic navigation environments, and the model is highly sensitive to the selection of feature input variables, making it difficult to explore the deep correlation between input feature variables, resulting in limited prediction accuracy.
The ship track prediction method based on Attention-BiLSTM is used to detect and eliminate abnormal data through DBSCAN combined with sliding time window, and fill missing data using Gaussian process regression and LSTM neural network, select feature input variables that affect the track, and determine the delay order between the feature input variables and the track through the ARX model, and the scope of the model is divided and the Attention-BiLSTM prediction model is established for rolling prediction.
It improves the accuracy and reliability of ship track prediction, can provide high-precision prediction in different scenarios, and enhances navigation safety and resource scheduling efficiency.
Smart Images

Figure CN119669797A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of ship track prediction, and in particular to a ship track prediction method based on Attention-BiLSTM. Background Art
[0002] In recent years, with the development of the global ocean transportation industry and its growing demand for intelligent technology, ship track prediction has become an important means to ensure navigation safety and improve transportation efficiency. Accurate ship track prediction can not only effectively reduce the risk of collision during navigation and ensure navigation safety, but also optimize the selection of ship navigation routes and improve resource scheduling efficiency, thereby improving overall navigation efficiency.
[0003] For ship track prediction, the data quality in the data preprocessing stage directly affects the accuracy of the ship track prediction model and the reliability of the ship navigation strategy formulation. Usually, the ship AIS data will be interfered by various factors during the transmission process, such as complex navigation environment, equipment aging, noise interference, signal interruption, etc., resulting in a large amount of noise data and missing data in the acquired AIS data. Therefore, before predicting the ship track, it is necessary to detect and eliminate the abnormal data in the AIS data. After completing the detection and elimination of abnormal ship track data, it is necessary to fill in the missing data of the ship track. The missing data includes the missing data in the AIS original data and the missing data generated after the ship abnormal data is eliminated. For the strong nonlinearity of the ship track data affected by multiple complex factors, how to use the information provided by the remaining data to complete the filling of the ship's missing data is crucial to improving the filling accuracy.
[0004] Traditional ship track prediction methods mainly rely on statistical models and machine learning algorithms. Due to the complex nonlinear relationship between the ship track and its characteristic input variables, the adaptability and accuracy of the model are limited, making it difficult to cope with the complex and changeable dynamic navigation environment at sea. With the development of technology, deep learning algorithms such as long short-term memory neural network LSTM have been proposed and applied to ship track prediction. Although deep learning algorithms perform well in time series data modeling, they are highly sensitive to the selection of characteristic input variables and it is difficult to mine the deep correlation between input characteristic variables. In addition, the impact of external factors on ship tracks is usually nonlinear. The existing input feature candidate set does not fully consider the impact of external factors, and lacks a systematic feature input variable selection standard, which is crucial to ensure the accuracy of ship track prediction.
[0005] Although deep learning model algorithms have significant advantages in improving the prediction accuracy of time series, the performance of the model depends on the collected data. Under different navigation conditions, it is difficult for the ship track prediction model to fully cover the complex nonlinear process. At the same time, the ship's navigation process will be affected by weather conditions, date attributes, etc., which makes the data have obvious spatiotemporal uncertainty and nonlinearity. It is difficult for the ship track prediction model to achieve high-precision prediction in all scenarios. Therefore, how to reasonably divide the scope space of ship track prediction so that the model can provide high-precision predictions in different scenarios is an urgent problem to be solved. Summary of the invention
[0006] In view of this, the present invention proposes a ship track prediction method based on Attention-BiLSTM. The method provides accurate high-quality data and reasonable scope division for ship track prediction, ensures the accuracy of ship track prediction, and achieves the purpose of reasonable ship path planning, resource optimization scheduling, and improving maritime navigation safety.
[0007] In order to achieve the above object, the technical solution adopted by the present invention is as follows:
[0008] A ship track prediction method based on Attention-BiLSTM includes the following steps:
[0009] Step 1, obtaining ship AIS data, weather data and date attribute data;
[0010] Step 2: Use DBSCAN combined with the sliding time window method to detect and remove abnormal data from the ship track data;
[0011] Step 3, filling in the missing data of the ship track after the abnormal data is removed;
[0012] Step 4, establishing a candidate set of ship track feature inputs, and selecting feature input variables that affect the ship track;
[0013] Step 5, determining the delay order between the ship track and the characteristic input variable, and constructing a characteristic vector based on the characteristic input variable, the ship track and the delay order between the ship track and the characteristic input variable;
[0014] Step 6: divide the feature vector into a limited number of sub-model scopes based on a high-dimensional clustering algorithm, and use a support vector machine to perform boundary division and boundary estimation on the sub-model scopes;
[0015] Step 7: Based on the bidirectional long short-term memory neural network BiLSTM combined with the Attention mechanism, a ship track prediction model is established for each sub-model scope, and a rolling prediction of the ship track is performed through the established ship track prediction model.
[0016] Furthermore, the specific method in step 2 is:
[0017] Step 201, obtain the longitude and latitude data of the ship track and construct a ship data set ;
[0018] Step 202, setting the neighborhood radius ε and density threshold Min of the DBSCAN method Pt , and the length of the sliding time window;
[0019] Step 203, the ship data set in the current window The ε neighborhood of each point in is calculated to determine whether it is a core point. Starting from the core point, all density-reachable points are found based on the direct density-reachable relationship to form a cluster. Points that are not core points and not directly density-reachable are recorded as abnormal data and removed. Then the sliding window is used.
[0020] Step 204, repeating step 203 until abnormal data is detected and eliminated for all ship track data.
[0021] Furthermore, the specific method in step 3 is:
[0022] Step 301: Use k-fold cross validation method to obtain k GPR Gaussian process regression missing data imputation models and k LSTM A long short-term memory neural network missing data filling model;
[0023] The outputs of the Gaussian process regression missing data filling model and the long short-term memory neural network missing data filling model are the longitude and latitude values of the ship track;
[0024] Step 302, k GPR k Gaussian process regression missing data filling model output GPR The average of the longitude and latitude values of the ship tracks is used to obtain the average value y of the corresponding longitude filling value of the Gaussian process regression data. lon,GPR The mean value y of the latitude filling value of the Gaussian process regression data lat,GPR ; and calculate y respectively lon,GPR With y lat,GPR The standard deviation S lon,GPR , S lat,GPR ;
[0025] K LSTM k missing data of the LSTM neural network are used to fill the output of the model LSTM The average of the longitude and latitude values of the ship tracks is taken to obtain the average value y of the longitude filling value of the corresponding long short-term memory neural network missing data lon,LSTMThe average value y of the missing data latitude filling value of the long short-term memory neural network lat,LSTM ; and calculate y respectively lon,LSTM With y lat,LSTM The standard deviation S lon,LSTM , S lat,LSTM ;
[0026] Step 303, calculate the filling value of the latitude and longitude of the ship track:
[0027] ;
[0028] ;
[0029] In the formula, y lon ,y lat are the filled values of the longitude and latitude of the ship’s track respectively.
[0030] Furthermore, the specific method in step 4 is:
[0031] Step 401, based on the acquired AIS data, adding weather data and date attribute factors when the ship is sailing to the candidate set of ship track feature input;
[0032] Step 402, for each feature variable in the candidate set of ship track feature input, calculate the MIC value between its feature variable and the longitude and latitude of the ship track:
[0033] ;
[0034] ;
[0035] Where a and b are the number of grids divided horizontally and vertically respectively. The scatter plot composed of vectors x and y is divided into grids, and the distribution of scatter points in each grid is checked to obtain the joint probability. B is a variable, which is set to the 0.6th power of the ship track sample data volume. x represents a feature variable in the candidate set of ship track feature input, y represents the ship track, p(x, y) is the joint probability density of vectors x and y, and p(x) and p(y) are the marginal probability densities of vectors x and y respectively. The closer the MIC value is to 1, the stronger the correlation between the two variables.
[0036] Step 403, according to the size of the MIC value, select the variable with the greatest impact on the ship track from the candidate set of ship track feature input as the feature input variable.
[0037] Furthermore, the specific method in step 5 is:
[0038] Step 501, establish the ARX model in the system identification model:
[0039] ;
[0040] y(t) is the output at time t, representing the ship track value, u(t) is the characteristic input variable, is the autoregressive coefficient, which indicates the relationship between the current output y(t) and the past n a The relationship between the output values of each time step is is the input coefficient, which represents the difference between the current output y(t) and the past n b The relationship between the characteristic input variables at each time step, n a is the autoregressive order, indicating the number of historical output steps on which the current output depends, n b is the input order, indicating the number of historical input steps on which the current output depends, n k is the lag order of the input, indicating the time delay required for u(t) to affect the output y(t), and e(t) is the error disturbance value;
[0041] Step 502, set n a 、n b 、n k The value range of , the Bayesian Information Criterion BIC method is used to determine the delay order between the characteristic input variables and the ship track:
[0042] ;
[0043] Among them, k b is the number of parameters of the ARX model, n is the amount of ship track sample data, and L represents the maximum likelihood estimate;
[0044] Step 503, determine the order n by selecting the ARX model with the minimum BIC a 、n b 、n k ;
[0045] Step 504, construct a feature vector Z(k) based on the feature input variable, the ship track and the delay order between the ship track and the feature input variable:
[0046] Z ( k ) = [ y T ( k − 1 ) , y T ( k − 2 ) , ⋯ , y T ( k − n a ) , u T ( k − n k ) , u T ( k − n k − 1 ) , ⋯ , u T ( k − n k − n b + 1 ) ] .
[0047] Furthermore, the specific method in step 6 is:
[0048] Step 601, based on the feature vector Z(k), the samples with similar features in the feature vector are clustered using the bi-Kmeans clustering algorithm, and the feature vector is divided into S sub-model spaces;
[0049] Step 602, using a soft margin support vector machine to estimate the boundaries of the sub-model scopes, obtaining the hyperplane coefficients between the S sub-model scopes, and completing the boundary estimation of each sub-model scope;
[0050] The parameters of the hyperplane are solved by minimizing the following soft margin optimization objective:
[0051] ;
[0052] ;
[0053] w is the normal vector of the hyperplane, is the bias term, ξ i is a slack variable, representing the error between each sample point and the hyperplane, C is the penalty factor, is the total number of samples, is the data classification label, is the sample point data.
[0054] Furthermore, the specific method in step 7 is:
[0055] An Attention-BiLSTM prediction model is established for each of the S sub-model spaces. The Attention-BiLSTM prediction model includes an input layer, a BiLSTM layer, an Attention layer, a fully connected layer, and an output layer. The Attention-BiLSTM prediction model uses a cross-validation method to select hyperparameters.
[0056] The input layer uses the feature input variable as the input of the BiLSTM layer;
[0057] The BiLSTM layer includes a forward LSTM layer and a backward LSTM layer. The parameters corresponding to the LSTM neural network are calculated as follows:
[0058] f t = σ ( W f ⋅ [ x t , h t − 1 ] + b f ) i t = σ ( W i ⋅ [ x t , h t − 1 ] + b i ) o t = σ ( W o ⋅ [ x t , h t − 1 ] + b o ) c t = f t c t − 1 + i t tanh ( W c ⋅ [ x t , h t − 1 ] + b c ) h t = o t tanh c t ;
[0059] In the formula, f t is the state of the forget gate at the current time t, i t is the state of the input door at the current time t, o t is the state of the output gate at the current time t, c t is the state of the state unit at the current time t, h t is the hidden layer state at the current time t, h t-1 is the hidden layer state at the previous moment, c t-1 is the state of the gate control unit at the previous moment, x t is the input at the current time t, W f , W i , Wo , W c and b f 、b i 、b o 、b c are the corresponding weight coefficient matrix and bias term, σ(·) represents the sigmoid activation function, and tanh represents the hyperbolic sine activation function;
[0060] The calculation formulas for the parameters in the Attention layer are as follows:
[0061] ;
[0062] ;
[0063] In the formula, v and W are the weights of the multi-layer perceptron when calculating the attention weights. is the bias number of the multilayer perceptron when calculating the attention weight, m is the input vector dimension of the ship track prediction model, and e is j represents the attention score at the jth time step, e t is the weight score corresponding to different features at the current time t, is the attention weight at the current moment t, C t is the output of the Attention layer at time t;
[0064] The fully connected layer processes the weighted features passed from the BiLSTM layer and the Attention layer, and the output layer outputs the predicted longitude and latitude of the ship’s track;
[0065] After the Attention-BiLSTM prediction model training is completed, the rolling prediction method is used to predict the longitude and latitude of the ship's track at the next moment based on the current longitude and latitude prediction results of the ship's track.
[0066] Due to the adoption of the above technical solution, the beneficial effects of the present invention compared with the prior art are:
[0067] 1. The present invention proposes a method including detection and elimination of abnormal ship track data and weighted combination filling of missing ship track data. Based on DBSCAN combined with a sliding time window, the abnormal data can be quickly and effectively detected and eliminated. On the basis of detection and elimination of abnormal ship track data, the missing data is weighted combined and filled using the remaining data. The filling accuracy is effectively improved using the remaining data, providing more accurate and effective high-quality data support for ship track prediction.
[0068] 2. The present invention proposes a method for rolling prediction of ship tracks, including feature input variable selection, delay order determination, sub-model scope division, and bidirectional long short-term memory neural network BiLSTM combined with attention mechanism. Feature input variables are selected from a feature input candidate set of factors affecting the ship track, and the influence of external factors such as weather factors and date attributes during the ship's navigation on the ship track is considered. The delay between the ship track and the feature input variables is considered, and the delay order between the ship track and the feature input variables is determined by using the BIC criterion based on the ARX model. A feature vector is constructed based on the feature input variables, the ship track, and the delay order between the ship track and the feature input variables. The feature vector is divided into a limited number of sub-model scopes based on a high-dimensional clustering algorithm. The sub-model scopes are divided and estimated based on a support vector machine. The sub-model scopes can be switched between according to the boundary conditions to ensure that the ship track can be accurately predicted under different conditions.
[0069] 3. The present invention proposes a rolling prediction model structure of Attention-BiLSTM combined with the attention mechanism, and establishes an Attention-BiLSTM ship track prediction model for each sub-model scope. After the data is input, different sub-models can be dynamically switched for prediction according to the sub-model scope where the data features are located to ensure the accuracy of ship track prediction. It can achieve accurate prediction of ship tracks, which is of great significance for the reasonable planning of the paths of ships sailing at sea, optimal resource scheduling, and improved navigation safety. BRIEF DESCRIPTION OF THE DRAWINGS
[0070] Figure 1 The present invention provides a ship track prediction flow chart of a ship track prediction method based on Attention-BiLSTM in an embodiment of the present invention.
[0071] Figure 2 The figure is a schematic diagram of the LSTM neural network structure of a ship track prediction method based on Attention-BiLSTM in an embodiment of the present invention.
[0072] Figure 3 This is the prediction result of an embodiment of a ship track prediction method based on Attention-BiLSTM in an embodiment of the present invention. DETAILED DESCRIPTION
[0073] The present invention will be further described below in conjunction with the accompanying drawings and specific embodiments.
[0074] A ship track prediction method based on Attention-BiLSTM, such as Figure 1 As shown, the following steps are included;
[0075] (1) Obtain ship AIS data, weather data and date attribute data;
[0076] (2) Detect and eliminate abnormal data from ship track data;
[0077] (3) Fill in the missing data of the ship tracks after the outliers are removed;
[0078] (4) Establish a candidate set of ship track feature inputs and select feature input variables that affect the ship track;
[0079] (5) Determine the delay order between the ship track and the characteristic input variable, and construct a characteristic vector based on the characteristic input variable, the ship track, and the delay order between the ship track and the characteristic input variable;
[0080] (6) Based on the high-dimensional clustering algorithm, the feature vector is divided into a limited number of sub-model scopes, and the support vector machine is used to divide and estimate the boundaries of the sub-model scopes;
[0081] (7) Based on the bidirectional long short-term memory neural network BiLSTM combined with the Attention mechanism, a ship track prediction model is established for each sub-model scope, and a rolling prediction of the ship track is performed through the established ship track prediction model;
[0082] As an improvement, the detection and elimination of abnormal ship track data in step (2) is performed using DBSCAN combined with a sliding time window method. DBSCAN is a density-based spatial clustering method that can divide high-density areas into clusters for clustering. DBSCAN can quickly and effectively detect and mark abnormal ship track data.
[0083] For the ship dataset , the minimum number of data points required to define the core point Min Pt , for the dataset Point p in c and dot q c , the area within the radius ε is point p c ε neighborhood of . c In q c , and q c There is at least a minimum number of points Min in the ε neighborhood of Pt , then point p c Point q c Direct density reachable; if there exist points p1,…,p n , where each point p i From p i-1 Direct density can reach (i ≥ 2), then p n From p1 density can be reached.
[0084] Determine the length of the sliding time window and calculate the ship data set within the window length. The ε neighborhood of each point in is calculated to determine whether it is a core point. Starting from the core point, based on the direct density reachable relationship, all density reachable points are found to form a cluster. Noise points are defined as points that are not core points and are not directly density reachable. Noise points are abnormal data values. The DBSCAN algorithm is performed in the current time window to detect noise points, i.e., abnormal data values, and remove them. The detection and removal of abnormal ship track data within the current time window length is completed, and the sliding window is performed until the detection and removal of all abnormal ship track data are completed.
[0085] As an improvement, in the step (3), the missing data of the track data after the outliers are removed is filled by a weighted combination filling method to obtain the filling result. In order to improve the filling accuracy of the missing data and reduce the error, the Gaussian process regression algorithm and the LSTM neural network algorithm are used to train the missing data filling model. The input of the missing data filling model training is the ship track value at the previous moment, the ship heading and speed value at the previous moment, and the output is the ship track value at the current moment. Using the remaining data, the k-fold cross-validation method is used to train the Gaussian process regression missing data filling model and the long short-term memory neural network missing data filling model, respectively, to obtain k GPR Gaussian process regression missing data imputation model, k LSTM Long short-term memory neural network missing data filling model. Based on k GPR Gaussian process regression missing data imputation model and k LSTM The missing data filling model of long short-term memory neural network is used to fill the missing data of ship tracks, and k is calculated. GPR The average value y of the Gaussian process regression data filling value lon,GPR ,y lat,GPR , k LSTM The average value y of the LSTM neural network data filling value lon,LSTM ,y lat,LSTM , calculate the standard deviation S of the Gaussian process regression data filling mean lon,GPR , S lat,GPR , the standard deviation S of the mean value of the LSTM neural network data padding lon,LSTM , S lat,LSTM ; Fill the standard deviation S of the mean value for Gaussian process regression data lon,GPR , S lat,GPR and the standard deviation S of the mean value of the LSTM neural network data padding lon,LSTM , S lat,LSTM Perform weighted calculation to obtain the filling result, and use the filling result to fill the missing data.
[0086]
[0087]
[0088] In the formula, y lon ,y lat are the filling results of the ship track longitude and latitude, respectively, lon,LSTM ,y lat,LSTM are the long and short-term memory neural network data filling average values of the ship's track longitude and latitude, y lon,GPR ,y lat,GPR are the Gaussian process regression data filling average values of the longitude and latitude of the ship track, S lon,LSTM , S lat,LSTM are the standard deviation of the long short-term memory neural network data filling mean of the ship track longitude and latitude, S lon,GPR , S lat,GPR The Gaussian process regression data for the longitude and latitude of the ship track are filled with the standard deviation of the mean.
[0089] As an improvement, in the step (4), a candidate set of ship track feature input is established, and the feature variables affecting the ship track are selected using the maximum mutual information coefficient method MIC. MIC can not only describe the complex nonlinear relationship between the variables in the feature input candidate set, but also quantify the statistical correlation in large-scale data sets. MIC evaluates the dependency between variables by mapping the relationship between variables to a grid space and then calculating the maximum amount of information in the grid space. First, a candidate set of ship track feature input is constructed. Considering that the ship's navigation process will be affected by weather conditions and date attribute factors, on the basis of the acquired AIS data, the weather factors and date attribute factors during the ship's navigation are added to the candidate set of ship track feature input. MIC is used to analyze the correlation between the feature input variables in the candidate set of ship track feature input and the longitude and latitude of the ship track, and the feature variables affecting the track are selected. MIC is based on the concept of mutual information, and the mutual information formula is as follows:
[0090]
[0091] In the formula, x and y are two vectors, x represents an input variable in the candidate set of ship track feature input, y represents the ship track, p(x, y) is the joint probability density of vectors x and y, p(x) and p(y) are the marginal probability densities of vectors x and y respectively. Based on the coordinate system, the scatter plot composed of vectors x and y is divided into a certain number of grids, and the distribution of scatter points in each grid is checked to obtain the joint probability. The MIC calculation formula is as follows:
[0092]
[0093] Where a and b are the number of grids divided horizontally and vertically, respectively, and B is a variable, which is set to the 0.6th power of the ship track sample data volume. The MIC value between the feature variables in the feature candidate set and the longitude and latitude of the ship track is calculated respectively. The range of the MIC value is [0,1]. The closer the MIC value is to 1, the stronger the correlation between the two variables. According to the size of the MIC value, the variable with the greatest impact on the ship track in the ship track feature input candidate set is selected as the feature input variable.
[0094] As an improvement, in step (5), the delay order between the ship track and the characteristic input variable is determined. Based on the ARX model in the system identification model, the Bayesian Information Criterion BIC method is used to determine the delay order between the characteristic input variable and the ship track. The ARX model structure is as follows:
[0095]
[0096] y(t) is the output at time t, representing the ship track value, u(t) is the characteristic input variable, is the autoregressive coefficient, which indicates the relationship between the current output y(t) and the past n a The relationship between the output values of each time step is is the input coefficient, which represents the difference between the current output y(t) and the past n b The relationship between the inputs of time steps, n a is the autoregressive order, indicating the number of historical output steps on which the current output depends, n b is the input order, indicating the number of historical input steps on which the current output depends, n k is the lag order of the input, which indicates the time delay required for the input u(t) to affect the output y(t). e(t) is the error disturbance value. The model parameters that need to be identified are na, nb, and nk. Find an estimation model with a small BIC value to determine the order of the model. The value of BIC is defined by the following formula:
[0097]
[0098] Among them, k b is the number of parameters of the model, n is the amount of sample data of ship tracks, that is, the amount of sample data after missing data of ship tracks are filled after abnormal data are removed, and L represents the maximum likelihood estimate. Compared with the AIC method, BIC can effectively avoid overfitting problems when the sample data scale is large, and provide a more reasonable model selection. The order n is determined by selecting the model with the minimum BIC. a 、n b 、n k .
[0099] After determining the delay order between the characteristic input variable and the ship track based on the BIC order determination criterion, the characteristic input variable, the ship track, and the delay order between the ship track and the characteristic input variable constitute a characteristic vector represented by Z(k):
[0100] Z ( k ) = [ y T ( k − 1 ) , y T ( k − 2 ) , ⋯ , y T ( k − n a ) , u T ( k − n k ) , u T ( k − n k − 1 ) , ⋯ , u T ( k − n k − n b + 1 ) ] As an improvement, in step (6), after the characteristic input variables, the ship track, and the delay order between the ship track and the characteristic input variables form a characteristic vector represented by Z(k), the bi-Kmeans clustering algorithm is used to cluster the samples with similar characteristics in the characteristic vector, and the characteristic vector is divided into S sub-model spaces, each sub-space corresponding to a sub-model scope. After the sub-model scope division is completed, the soft margin support vector machine SVM is selected to estimate the boundary of the sub-model scope, and its optimization goal is to estimate the boundary of the sub-model scope by solving the hyperplane, obtain the hyperplane coefficients between the S sub-model scopes, complete the boundary estimation of each sub-model scope, and switch between the sub-model scopes according to the boundary conditions, effectively improving the prediction accuracy.
[0101] The parameters of the hyperplane are solved by minimizing the following soft margin optimization objective:
[0102] ;
[0103] ;
[0104] w is the normal vector of the hyperplane, is the bias term, ξ i is a slack variable, representing the error between each sample point and the hyperplane, C is the penalty factor, is the total number of samples, is the data classification label, is the sample point data.
[0105] By solving the optimization objective, the optimal hyperplane coefficient can be obtained, thereby determining the boundaries of each sub-model scope. After obtaining the hyperplane coefficient, it is possible to provide accurate estimates for the boundaries of different sub-model scopes. According to the divided sub-model scopes and the estimates of the scope boundaries, the ship track is dynamically modeled. After the ship track data is input, different sub-models can be dynamically switched for prediction according to the sub-model scope where the data features are located, ensuring that the ship track can be accurately predicted under different conditions, while improving the prediction accuracy and adaptability to different complex situations.
[0106] As an improvement, the ship track prediction model in step (7) is established using a bidirectional long short-term memory neural network model BiLSTM. The BiLSTM model is divided into the following four main parts: input layer, forward LSTM layer, backward LSTM layer, and output layer. Figure 2 As shown, the parameters corresponding to the basic structure of the LSTM neural network are calculated as follows.
[0107] f t = σ ( W f ⋅ [ x t , h t − 1 ] + b f ) i t = σ ( W i ⋅ [ x t , h t − 1 ] + b i ) o t = σ ( W o ⋅ [ x t , h t − 1 ] + b o ) c t = f t c t − 1 + i t tanh ( W c ⋅ [ x t , h t − 1 ] + b c ) h t = o t tanh c t
[0108] In the formula, f t is the state of the forget gate at the current time t, i t is the state of the input door at the current time t, o t is the state of the output gate at the current time t, c t is the state of the state unit at the current time t, h t-1 is the hidden layer state at the previous moment, c t-1 is the state of the gate control unit at the previous moment, x t is the input at the current time t, W f , W i , W o , W c and b f 、b i 、b o 、b c are the corresponding weight coefficient matrix and bias term, σ(·) represents the sigmoid activation function, and tanh represents the hyperbolic sine activation function. The BiLSTM neural network can obtain the timing information of the previous moment through the forward LSTM layer, and the timing information of the future moment through the backward LSTM layer. It can consider the information of the forward and backward data at the same time to improve the prediction accuracy.
[0109] In order to further improve the ship track prediction effect, the Attention mechanism is introduced. The attention mechanism calculates and learns the similarity of each input vector in the sequence, assigns different weights to different input features, pays more attention to the key information in the sequence, and pays less attention to non-key information. The calculation formulas of the parameters in Attention are as follows:
[0110] ;
[0111]
[0112] In the formula, v and W are the weights of the multi-layer perceptron when calculating the attention weights. is the bias number of the multilayer perceptron when calculating the attention weight, m is the input vector dimension of the ship track prediction model, and e is jrepresents the attention score at the jth time step, h t is the hidden layer state value, e t is the weight score corresponding to different features at the current time t, is the attention weight at the current moment t, c t is the output of the Attention mechanism at time t.
[0113] The Attention mechanism is introduced to establish the Attention-BiLSTM prediction model. The Attention-BiLSTM prediction model consists of five parts: input layer, BiLSTM layer, Attention layer, fully connected layer and output layer. The input layer takes the feature input variable as the input of BiLSTM. The BiLSTM layer can more comprehensively capture the temporal dependencies in the feature input sequence by processing forward and backward information at the same time. The core of the Attention layer is to learn the importance of each time step in the sequence. By calculating the weights of each input feature, the input feature data is weighted to enhance the attention to important information. The fully connected layer processes the weighted features passed from the BiLSTM layer and the Attention layer. The output layer outputs the predicted value of the ship's track. Attention-BiLSTM modeling is performed according to the divided S sub-model scopes, and the latitude and longitude values of the ship's track are used as output variables. The cross-validation method is used to select hyperparameters.
[0114] The ship track prediction model is established to perform rolling prediction of the ship track. Rolling prediction is a recursive prediction method. The ship track prediction at the next moment is performed based on the current ship track prediction result.
[0115] Specifically, in this embodiment,
[0116] Step 1: Select ship data from a coastal area for analysis and obtain ship AIS data, including collection time, ship speed, heading, ship track longitude value, and ship track latitude value. Obtain corresponding weather data including temperature, humidity, wind speed, and wind direction. Obtain date attribute factors including weekday and holiday date attributes. Align the time scales of ship AIS data, weather data, and date attribute data.
[0117] Step 2: Use DBSCAN combined with the sliding time window method to detect and eliminate abnormal data in the ship track data. Select a window length of 200, and use the DBSCAN algorithm to eliminate the noise anomalies detected in each window. Complete the detection and elimination of abnormal ship track data within the current window length, and slide the time window until all track data are detected and eliminated.
[0118] Step 3: After detecting and eliminating abnormal ship track data, it is necessary to fill in the missing ship track data. Use the remaining data information to perform weighted combination filling, and use the current ship speed s t , heading c t , the ship's longitude data y at the last moment lon,t-1 , the ship's latitude data y at the last moment lat,t-1 As input variable, the output is the latitude and longitude value y of the ship's track lon,t and lat,t . Ten-fold cross validation is used to train the Gaussian process regression missing data filling model. For the missing values of the ship track longitude and latitude data, a rolling filling method is used to fill the ship track value y at time T lon,T and lat,T As the missing value y of the ship track at time T+1 lon,T+1 and lat,T+1 The corresponding input vector of , and the process is repeated until all missing data of ship tracks are filled. The arithmetic mean of the latitude and longitude values of the ten groups of ship tracks are used as the filling value of the final longitude and latitude of the ship tracks, and the Gaussian process regression ship track missing data filling mean value y is obtained. lon,GPR ,y lat,GPR .
[0119] At the current ship speed s t , heading c t , the ship's longitude data y at the last moment lon,t-1 , the ship's latitude data y at the last moment lat,t-1 As input variable, the output is the latitude and longitude value y of the ship's track lon,t and lat,t , a ten-fold cross validation is used to train the long short-term memory neural network missing filling model. The ship track filling value y at time T is filled in by rolling method. lon,T and lat,T As the missing value y of the ship track at time T+1 lon,T+1 and lat,T+1 The corresponding input vector of the long short-term memory neural network is obtained by rolling the process until all the missing data of the ship track are filled. The arithmetic mean of the longitude and latitude values of the ten groups of ship tracks are used as the filling value of the final longitude and latitude of the ship track, and the average value y of the missing data of the long short-term memory neural network ship track is obtained. lon,LSTM ,y lat,LSTM .
[0120] Calculate the Gaussian process regression ship track missing data filling mean value y lon,GPR ,y lat,GPR Fill missing data with Gaussian process regression: mean standard deviation S lon,GPR , S lat,GPR, calculate the average value y of missing data filling of ship tracks in the long short-term memory neural network lon,LSTM ,y lat,LSTM The standard deviation S of the mean value for filling missing data of ship tracks with long short-term memory neural network lon,LSTM , S lat,LSTM , perform weighted combination to obtain the final data filling result y lon ,y lat .
[0121]
[0122]
[0123] In the formula, y lon ,y lat are the filling results of the ship track longitude and latitude, respectively, lon,LSTM ,y lat,LSTM are the long and short-term memory neural network data filling average values of the ship's track longitude and latitude, y lon,GPR ,y lat,GPR are the Gaussian process regression data filling average values of the longitude and latitude of the ship track, S lon,LSTM , S lat,LSTM are the standard deviation of the long short-term memory neural network data filling mean of the ship track longitude and latitude, S lon,GPR , S lat,GPR The Gaussian process regression data for the longitude and latitude of the ship track are filled with the standard deviation of the mean.
[0124] Step 4: Select factors that affect the ship's track, establish a candidate set of ship track feature input variables, and initially select seven factors including ship speed, heading, temperature, humidity, wind speed, wind direction, and date attributes as the feature candidate set, perform MIC feature selection, and calculate the MIC value of all factors for the longitude and latitude of the ship's track. Through calculation, the MIC value between the two characteristic variables of speed and heading and the longitude and latitude of the ship's track is the largest, so speed and heading are selected as feature input variables. Date attribute factors have an important influence on the ship's track, and date attribute factors are divided into weekdays and holidays. During holidays, the navigation density near the port may change significantly, affecting the ship's route adjustment, so the holiday date attribute characteristics are selected into the feature input variables. Among them, the input value of the working day is 1, and the input value of the holiday period is 2.
[0125] Step 5: Use the BIC order determination criterion based on the ARX model to determine the delay order between the characteristic input variable and the ship track, and select the estimated model order with a smaller BIC value as the delay order between the input characteristic variable and the ship track. Set the system parameters based on the ARX model, c(k) is the ship heading, s(k) is the ship speed, d(k) is the date attribute, and output y lon (k) is the longitude of the ship track, y lat (k) is the latitude of the ship's track. lon (k), y lat (k) Perform system identification and set n a 、n b 、n k The value range is 1-10, and the model with the smallest BIC is selected to determine the order n a 、n b 、n k Through system identification and BIC method, the optimal order is determined to be n a =4,n b =2,n k =1, the characteristic input variables c(k), s(k), d(k), and the ship track latitude and longitude output variable y lon (k), y lat (k), the delay order between the ship track and the characteristic input variable forms a characteristic vector represented by Z(k):
[0126] Z ( k ) = [ y lon T ( k − 1 ) , y lon T ( k − 2 ) , ⋯ , y lon T ( k − 4 ) , y lat T ( k − 1 ) , y lat T ( k − 2 ) , ⋯ , y lat T ( k − 4 ) , c T ( k − 1 ) , c T ( k − 2 ) , s T ( k − 1 ) , s T ( k − 2 ) , d T ( k − 1 ) , d T ( k − 2 ) ]
[0127] Step 6: Use the bi-Kmeans clustering algorithm to cluster samples with similar features in the feature vector. According to the clustering results, divide the feature vector into 5 sub-model scopes. Use the soft margin support vector machine to estimate the boundaries of the 5 sub-model scopes. Solve the soft margin optimization target to obtain the optimal hyperplane equation coefficients, determine the boundaries of each sub-model scope, and switch between sub-model scopes according to the boundary conditions. According to the divided sub-model scopes and the estimation of the scope boundaries, the ship track is dynamically modeled. After the data is input, different sub-models can be dynamically switched for prediction according to the sub-model scope where the data features are located.
[0128] Step 7: Use Attention-BiLSTM to establish a ship track prediction model. The overall structure of the model is divided into five layers: input layer, BiLSTM layer, Attention layer, fully connected layer and output layer. Among them, the input layer converts the data into a format suitable for Attention-BiLSTM network processing. The input feature variables include heading, speed, date attributes, historical track longitude values, and historical track latitude values. The BiLSTM layer can process the forward and backward information of the input sequence at the same time. The hidden layer consists of multiple LSTM units. Using RELU as the activation function can effectively avoid the gradient disappearance problem and accelerate the training of the model. The Attention layer assigns different weights to the input of each time step, thereby enhancing the focus on important information. The fully connected layer processes the weighted features passed from the BiLSTM layer and the Attention layer. In order to prevent overfitting, a Dropout layer is added. The output layer is used to generate the longitude and latitude prediction values of the ship track. In order to ensure the performance of the model, the Adam optimization algorithm and k-fold cross validation were used in the model training process. Attention-BiLSTM modeling was performed according to multiple sub-model scopes. The latitude and longitude values of the ship track were used as output variables, and the cross-validation method was used to select hyperparameters. The established ship track single-step prediction model is as follows:
[0129]
[0130] Among them, y t is the output variable of the model, indicating the latitude and longitude of the ship track at time t, y t =[y lon,t , y lat,t ],y lon,t represents the longitude of the ship's track at time t, y lat,t represents the latitude of the ship's track at time t, c t-1 、s t-1 ,d t-1 are the ship's heading, ship's speed, and date attributes at time (t-1), c t-2 、s t-2 ,d t-2 are the ship's heading, ship's speed, and date attributes at time (t-2); lon,t-1 to y lon,t-4 are the longitude values of the ship’s track from time (t-1) to time (t-4), y lat,t-1 to y lat,t-4 They represent the latitude and longitude values of the ship track from time (t-1) to time (t-4). The rolling prediction of the ship track is realized based on the Attention-BiLSTM ship track single-step prediction model. The rolling prediction obtains the predicted latitude and longitude values of the ship track at time t through the ship track single-step prediction model.lon (t), y lat (t), y lon (t), y lat (t) is used as the input of the single-step ship track prediction model to obtain the longitude and latitude values y of the ship track at time t+1 lon (t+1), y lat (t+1), the process is executed in a rolling manner until the predicted longitude and latitude values y of all ship tracks within the prediction time range D are obtained. lon (t), y lat (t), y lon (t+1), y lat (t+1)…,y lon (t+D),y lat (t+D).
[0131] The prediction results are evaluated by the mean absolute error MAE and the root mean square error RMSE, which are calculated by the following formula:
[0132]
[0133]
[0134] In the formula, p l pre represents the predicted value of the ship's track, p l is the actual value, and N is the number of samples.
[0135] In this example, D=30 is selected for ship track prediction. According to the multiple sub-model scopes divided above, the ship track longitude and latitude are predicted in a rolling manner. The ship track prediction results are as follows: Figure 3 The evaluation indicators of the modeling results are shown in Table 1. It can be seen that the prediction results of the proposed Attention-BiLSTM ship track prediction model based on the feature vector division sub-model scope have good accuracy, good overall prediction effect, and practical application value.
[0136]
[0137] Those skilled in the art will appreciate that the embodiments described are intended to help readers understand the principles of the present invention, and should be understood that the scope of protection of the present invention is not limited to the embodiments described. For those skilled in the art, the present invention may have various changes and variations. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of the claims of the present invention.
Claims
1. A ship track prediction method based on Attention-BiLSTM, characterized in that: The following steps are involved: Step 1, obtaining ship AIS data, weather data and date attribute data; Step 2: Use DBSCAN combined with the sliding time window method to detect and remove abnormal data from the ship track data; Step 3, filling in the missing data of the ship track after the abnormal data is removed; Step 4, establishing a candidate set of ship track feature inputs, and selecting feature input variables that affect the ship track; Step 5, determining the delay order between the ship track and the characteristic input variable, and constructing a characteristic vector based on the characteristic input variable, the ship track and the delay order between the ship track and the characteristic input variable; Step 6: divide the feature vector into a limited number of sub-model scopes based on a high-dimensional clustering algorithm, and use a support vector machine to perform boundary division and boundary estimation on the sub-model scopes; Step 7: Based on the bidirectional long short-term memory neural network BiLSTM combined with the Attention mechanism, a ship track prediction model is established for each sub-model scope, and a rolling prediction of the ship track is performed through the established ship track prediction model.
2. The ship track prediction method based on Attention-BiLSTM according to claim 1, characterized in that: The specific method in step 2 is: Step 201, obtain the longitude and latitude data of the ship track and construct a ship data set ; Step 202, setting the neighborhood radius ε and density threshold Min of the DBSCAN method Pt , and the length of the sliding time window; Step 203, the ship data set in the current window The ε neighborhood of each point in is calculated to determine whether it is a core point. Starting from the core point, all density-reachable points are found based on the direct density-reachable relationship to form a cluster. Points that are not core points and not directly density-reachable are recorded as abnormal data and removed. Then the sliding window is used. Step 204, repeating step 203 until abnormal data is detected and eliminated for all ship track data.
3. The ship track prediction method based on Attention-BiLSTM according to claim 2 is characterized in that: The specific method in step 3 is: Step 301: Use k-fold cross validation method to obtain k GPR Gaussian process regression missing data imputation models and k LSTM A long short-term memory neural network missing data filling model; The outputs of the Gaussian process regression missing data filling model and the long short-term memory neural network missing data filling model are the longitude and latitude values of the ship track; Step 302, k GPR k Gaussian process regression missing data filling model output GPR The average of the longitude and latitude values of the ship tracks is used to obtain the average value y of the corresponding longitude filling value of the Gaussian process regression data. lon,GPR The mean value y of the latitude filling value of the Gaussian process regression data lat,GPR ; and calculate y respectively lon,GPR With y lat,GPR The standard deviation S lon,GPR , S lat,GPR ; K LSTM k missing data of the LSTM neural network are used to fill the output of the model LSTM The average of the longitude and latitude values of the ship tracks is taken to obtain the average value y of the longitude filling value of the corresponding long short-term memory neural network missing data lon,LSTM The average value y of the missing data latitude filling value of the long short-term memory neural network lat,LSTM ; and calculate y respectively lon,LSTM With y lat,LSTM The standard deviation S lon,LSTM , S lat,LSTM ; Step 303, calculate the filling value of the latitude and longitude of the ship track: ; ; In the formula, y lon ,y lat are the filled values of the longitude and latitude of the ship’s track respectively.
4. The ship track prediction method based on Attention-BiLSTM according to claim 3 is characterized in that: The specific method in step 4 is: Step 401, based on the acquired AIS data, adding weather data and date attribute factors when the ship is sailing to the candidate set of ship track feature input; Step 402, for each feature variable in the candidate set of ship track feature input, calculate the MIC value between its feature variable and the longitude and latitude of the ship track: ; ; Where a and b are the number of grids divided horizontally and vertically respectively. The scatter plot composed of vectors x and y is divided into grids, and the distribution of scatter points in each grid is checked to obtain the joint probability. B is a variable, which is set to the 0.6th power of the ship track sample data volume. x represents a feature variable in the candidate set of ship track feature input, y represents the ship track, p(x, y) is the joint probability density of vectors x and y, and p(x) and p(y) are the marginal probability densities of vectors x and y respectively. The closer the MIC value is to 1, the stronger the correlation between the two variables. Step 403, according to the size of the MIC value, select the variable with the greatest impact on the ship track from the candidate set of ship track feature input as the feature input variable.
5. The ship track prediction method based on Attention-BiLSTM according to claim 4 is characterized in that: The specific method in step 5 is: Step 501, establish the ARX model in the system identification model: ; y(t) is the output at time t, representing the ship track value, u(t) is the characteristic input variable, is the autoregressive coefficient, which indicates the relationship between the current output y(t) and the past n a The relationship between the output values of each time step is is the input coefficient, which represents the difference between the current output y(t) and the past n b The relationship between the characteristic input variables at each time step, n a is the autoregressive order, indicating the number of historical output steps on which the current output depends, n b is the input order, indicating the number of historical input steps on which the current output depends, n k is the lag order of the input, indicating the time delay required for u(t) to affect the output y(t), and e(t) is the error disturbance value; Step 502, set n a 、n b 、n k The value range of , the Bayesian Information Criterion BIC method is used to determine the delay order between the characteristic input variables and the ship track: ; Among them, k b is the number of parameters of the ARX model, n is the amount of ship track sample data, and L represents the maximum likelihood estimate; Step 503, determine the order n by selecting the ARX model with the minimum BIC a 、n b 、n k ; Step 504, construct a feature vector Z(k) based on the feature input variable, the ship track and the delay order between the ship track and the feature input variable: 。 6. The ship track prediction method based on Attention-BiLSTM according to claim 5, characterized in that: The specific method in step 6 is: Step 601, based on the feature vector Z(k), the samples with similar features in the feature vector are clustered using the bi-Kmeans clustering algorithm, and the feature vector is divided into S sub-model spaces; Step 602, using a soft margin support vector machine to estimate the boundaries of the sub-model scopes, obtaining the hyperplane coefficients between the S sub-model scopes, and completing the boundary estimation of each sub-model scope; The parameters of the hyperplane are solved by minimizing the following soft margin optimization objective: ; ; w is the normal vector of the hyperplane, is the bias term, ξ i is a slack variable, representing the error between each sample point and the hyperplane, C is the penalty factor, is the total number of samples, is the data classification label, is the sample point data.
7. The ship track prediction method based on Attention-BiLSTM according to claim 6, characterized in that: The specific method in step 7 is: An Attention-BiLSTM prediction model is established for each of the S sub-model spaces. The Attention-BiLSTM prediction model includes an input layer, a BiLSTM layer, an Attention layer, a fully connected layer, and an output layer. The Attention-BiLSTM prediction model uses a cross-validation method to select hyperparameters. The input layer uses the feature input variable as the input of the BiLSTM layer; The BiLSTM layer includes a forward LSTM layer and a backward LSTM layer. The corresponding parameters of the LSTM neural network are calculated as follows: ; In the formula, f t is the state of the forget gate at the current time t, i t is the state of the input door at the current time t, o t is the state of the output gate at the current time t, c t is the state of the state unit at the current time t, h t is the hidden layer state at the current time t, h t-1 is the hidden layer state at the previous moment, c t-1 is the state of the gate control unit at the previous moment, x t is the input at the current time t, W f , W i , W o , W c and b f 、b i 、b o 、b c are the corresponding weight coefficient matrix and bias term, σ(·) represents the sigmoid activation function, and tanh represents the hyperbolic sine activation function; The calculation formulas for the parameters in the Attention layer are as follows: ; ; In the formula, v and W are the weights of the multi-layer perceptron when calculating the attention weights. is the bias number of the multilayer perceptron when calculating the attention weight, m is the input vector dimension of the ship track prediction model, and e is j represents the attention score at the jth time step, e t is the weight score corresponding to different features at the current time t, is the attention weight at the current moment t, C t is the output of the Attention layer at time t; The fully connected layer processes the weighted features passed from the BiLSTM layer and the Attention layer, and the output layer outputs the predicted longitude and latitude of the ship’s track; After the Attention-BiLSTM prediction model training is completed, the rolling prediction method is used to predict the longitude and latitude of the ship's track at the next moment based on the current longitude and latitude prediction results of the ship's track.
Citation Information
Patent Citations
Power distribution network line loss prediction method and system
CN112488395A
Ship key technical parameter prediction method and system based on machine learning
CN113743662A
Fan operation missing data filling method and device, electronic equipment and medium
CN114238297A
Non-supervision anomaly detection method for multi-dimensional unmanned aerial vehicle flight data based on space-time correlation
CN115712833A
Traffic mode recognition method and system based on graph convolutional network feature fusion
CN116541745A
Cited By
Prediction driving-based ship abnormal behavior early warning method and system
CN121034130A