Long-distance ship track prediction method and device based on T-GRU

Through the T-GRU-based method, the residual sequence is decomposed and combined with the Transformer-GRU model, the problem of insufficient model expression ability in long-distance ship track prediction is solved, and the accuracy and robustness of the prediction are improved, which is suitable for long-term processing. span and complex environmental factors.

CN119047644APending Publication Date: 2024-11-29NO 15 INST OF CHINA ELECTRONICS TECH GRP
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202411184794.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-27
Publication Date
2024-11-29

AI Technical Summary

Technical Problem

In the prior art, in the prediction of long-distance ship tracks, the model's expression ability is limited, making it difficult to accurately capture long-term dependencies, resulting in a decrease in prediction accuracy.

Method used

Using a T-GRU-based method, the track data is processed through spline interpolation, the residual sequence is decomposed, and the GRU network is established using the EMD algorithm, and combined with the Transformer-GRU model for training and prediction, capturing long-term dependencies and complex environmental factors.

Benefits of technology

It improves the accuracy of long-distance track prediction, can better model the complex relationship between the ship's future position and early position, path selection and environmental conditions, and enhances the robustness and parallel processing capabilities of the prediction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119047644A_ABST
    Figure CN119047644A_ABST
Patent Text Reader

Abstract

The invention provides a T-GRU-based long-distance ship track prediction method and device, and the method comprises the steps: sorting track data according to timestamps, and carrying out the spline interpolation of longitude and latitude data; dividing the ship motion data into a training set and a test set according to a preset proportion, and training a neural network by using the training set; after the prediction is completed, the training set and the test set are respectively used for prediction to obtain a training set prediction value and a test set prediction value; determining a residual sequence of a predicted value and a true value of the training set; decomposing the residual error sequence to obtain an intrinsic mode component and a residual error item, training and predicting the intrinsic mode component and the residual error item respectively to obtain corresponding prediction results, and summing the prediction results to serve as a prediction value of a test set residual error; and determining the prediction result of the ship track as the sum of the prediction value of the residual error and the prediction value of the test set. The method can be used for capturing the long-time dependency relationship, accurate modeling is achieved for a complex relationship in long-distance track prediction, and the prediction accuracy is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of ship track prediction, and in particular to a T-GRU-based long-distance ship track prediction method and device. Background Art

[0002] Long-distance ship track prediction is used to solve the problem of track prediction accuracy when the predicted route is long.

[0003] Existing technologies include many different prediction models, but they are usually more accurate for short-distance track prediction, while the accuracy for long-distance track prediction decreases. Long-distance track prediction can solve a series of problems that short-distance navigation prediction cannot solve. Long-distance track prediction has outstanding advantages in transoceanic navigation, trade and shipping, national defense and military, environmental monitoring and protection, etc.

[0004] The track of a ship can describe the state of the ship and is used for navigation and positioning of the ship, collision avoidance simulation, etc. Track prediction can be used for shipping logistics optimization (including path planning, port management, etc.), maritime search and rescue and emergency response, military and national defense security, environmental protection, etc. With the rise of deep learning technology in recent years, more and more technical means are used to compensate and predict ship trajectories, trying to compensate for the ship's track over a period of time based on historical ship track data, thereby improving the accuracy of ship track prediction.

[0005] Many technologies at home and abroad are used for ship track prediction, and different models have been established. For example, CNN (Convolutional Neural Network) and GRU (Gated Recurrent Unit) models are used for track prediction.

[0006] Figure 1 This is a model structure diagram for ship track prediction using CNN-GRU. This technology uses a 3-layer 2D convolutional neural network with activation function and pooling layer to extract data features. First, the first 4 integrated 4*5 matrices of each group of data are input into the first layer of CNN, and then input into the second layer of CNN through the linear rectification function (ReLU). After the pooling layer MaxPooling, it is passed to the Dropout layer (rate: 0.3) to alleviate the degree of overfitting, and then passed to the third layer of CNN. After passing the linear rectification function and the second layer of pooling layer GlobalMaxPooling, the convolved vector data is passed to the GRU layer, and then passed to the Dropout layer (rate: 0.3), and then transferred to the fully connected layer for longitude and latitude prediction, thereby predicting the overall track.

[0007] However, current existing technologies still use traditional convolutional neural networks to fuse with GRU networks, but have limited modeling capabilities for long-term dependencies. Summary of the invention

[0008] The technical problem to be solved by the present invention is how to improve the expression ability of the model and realize the accurate prediction of long-distance ship tracks; in view of this, the present invention provides a long-distance ship track prediction method and device based on T-GRU.

[0009] The technical solution adopted by the present invention is a long-distance ship track prediction method based on T-GRU, comprising:

[0010] Step S1, sorting the track data according to timestamps, and performing spline interpolation on the longitude and latitude data respectively;

[0011] Step S2, dividing the ship motion data into a training set and a test set according to a preset ratio, and using the training set to train the initial neural network; wherein the input of the neural network includes latitude and longitude, speed, and heading, and the output is the predicted ship position. After the training is completed, the training set and the test set are used for prediction respectively to obtain the training set prediction value Y' train And the test set prediction value Y' pre ;

[0012] Step S3, determine the residual sequence res=Y between the training set prediction value and the true value true -Y' train ;

[0013] Step S4, using the EMD algorithm to decompose the residual sequence res, obtain the intrinsic mode components and the residual terms, and establish GRU networks based on the components and the residuals for training and prediction, obtain the corresponding prediction results and sum them up as the predicted value Y of the test set residual res ;

[0014] Step S5, the prediction result Y of the current ship track is determined as Y=Y' pre +Y res .

[0015] In one implementation, in step S1, the spline interpolation is specifically cubic spline interpolation.

[0016] In one embodiment, in step S2, the neural network adopts Transformer-GRU.

[0017] In one embodiment, in step S2, the ship motion data is divided into a training set and a test set in a ratio of 8:2.

[0018] Another aspect of the present invention further provides a long-distance ship track prediction device based on T-GRU, comprising:

[0019] an interpolation unit, configured to sort the track data according to timestamps and perform spline interpolation on the longitude and latitude data respectively;

[0020] The training unit is configured to divide the ship motion data into a training set and a test set according to a preset ratio, and use the training set to train the initial neural network; wherein the input of the neural network includes latitude and longitude, speed, and heading, and the output is the predicted ship position. After the training is completed, the training set and the test set are used for prediction respectively to obtain the training set prediction value Y' train And the test set prediction value Y' pre ;

[0021] The residual unit is configured to determine the residual sequence res=Y between the predicted value and the true value of the training set true -Y' train ;

[0022] The decomposition unit is configured to decompose the residual sequence res using the EMD algorithm to obtain the intrinsic mode components and the residual terms, and to establish GRU networks based on the components and the residuals for training and prediction, and to obtain the corresponding prediction results and sum them as the predicted value Y of the residual of the test set. res ;

[0023] The prediction unit is configured such that the prediction result Y of the current ship track is determined as Y=Y' pre +Y res .

[0024] Another aspect of the present invention provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the steps of the long-distance ship track prediction method based on T-GRU as described in any one of the above items.

[0025] Another aspect of the present invention further provides a computer storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the long-distance ship track prediction method based on T-GRU as described in any one of the above items are implemented.

[0026] Compared with the prior art, the present invention has at least the following advantages:

[0027] The method provided by the present invention can be used to capture long-term dependencies, that is, effectively capture the dependencies between different positions in a sequence, and is particularly suitable for processing data with a long time span; and in long-distance track prediction, the future position of a ship may have a complex relationship with its early position, path selection, environmental conditions, etc. This technology can better model these relationships and improve prediction accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] Figure 1 This is a schematic diagram of the model structure of ship track prediction using CNN-GRU in the prior art;

[0029] Figure 2 A schematic diagram of a flow chart of a long-distance ship track prediction method based on T-GRU according to an embodiment of the present invention;

[0030] Figure 3 A schematic diagram of a model structure of a long-distance ship track prediction method based on T-GRU according to an embodiment of the present invention;

[0031] Figure 4 is a schematic diagram of the Transformer structure according to an embodiment of the present invention;

[0032] Figure 5 A schematic diagram of a result of an application example according to the present invention;

[0033] Figure 6 It is a schematic diagram of the composition of a long-distance ship track prediction device based on T-GRU according to an embodiment of the present invention;

[0034] Figure 7 FIG. 1 is a schematic diagram of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0035] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined purpose, the present invention is described in detail below in conjunction with the accompanying drawings and preferred embodiments.

[0036] Unless otherwise defined, all terms (including technical terms and scientific terms) used in this article have the same meaning as commonly understood by ordinary technicians in the field to which this application belongs. It should also be understood that terms (such as terms defined in commonly used dictionaries) should be interpreted as having the same meaning as their meaning in the context of the relevant technology, and will not be interpreted in an idealized or overly formal sense unless explicitly defined in this article.

[0037] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0038] The present invention provides a method for predicting long-distance ship tracks based on T-GRU. Figure 2 As shown, including:

[0039] Step S1, sorting the track data according to timestamps, and performing spline interpolation on the longitude and latitude data respectively;

[0040] Step S2, dividing the ship motion data into a training set and a test set according to a preset ratio, and using the training set to train the initial neural network; wherein the input of the neural network includes latitude and longitude, speed, and heading, and the output is the predicted ship position. After the training is completed, the training set and the test set are used for prediction respectively to obtain the training set prediction value Y' train And the test set prediction value Y' pre ;

[0041] Step S3, determine the residual sequence res=Y between the training set prediction value and the true value true -Y' train ;

[0042] Step S4, using the EMD algorithm to decompose the residual sequence res, obtain the intrinsic mode components and the residual terms, and establish GRU networks based on the components and the residuals for training and prediction, obtain the corresponding prediction results and sum them up as the predicted value Y of the test set residual res ;

[0043] Step S5, the prediction result Y of the current ship track is determined as Y=Y' pre +Y res .

[0044] The method provided in this embodiment is described in detail below.

[0045] Figure 3 The model structure diagram of long-distance ship track prediction based on Transformer-GRU (T-GRU). Transformer has the advantages of parallel processing and capturing global dependencies, while GRU can effectively retain historical information and achieve memory effect by recursively updating hidden states.

[0046] GRU neural network is a type of RNN (Recurrent Neural Network) neural network, which is developed and optimized based on LSTM (Long Short-Term Memory) model. It can solve the problems of gradient disappearance, gradient explosion in RNN, and other problems that cannot be remembered and back-propagated for a long time. GRU structure is simpler than LSTM structure, has fewer parameters, is easier to build and train the model, and converges faster.

[0047] GRU has two gate control units: reset gate and update gate. The reset gate controls the degree to which the state of the previous moment is retained when calculating the new state of the hidden state unit. The update gate is responsible for the degree to which the current hidden state unit is updated by the new state. The following formula is the mathematical expression of the GRU model:

[0048]

[0049] Among them, f t is the update gate, r t is the reset gate, the input is x t , c t is the output of the hidden layer, σ is the sigmoid activation function, 1-f t Represents the forgetting rate of the link forward propagating data.

[0050] like Figure 4 As shown in the figure, Transformer is a natural language processing model that uses a multi-head self-attention mechanism, changing the traditional RNN sequential structure. The entire network structure is only composed of Self-Attention and Feed-Forward Neural Network (FNN). The essence of Transformer is an Encoder-Decoder structure.

[0051] Specifically, it can reduce the distance between any two positions in the sequence to a constant, so that the calculation at time t no longer depends on the calculation result at time t-1, and there is no problem of long-term dependence similar to recurrent neural networks, which maximizes the parallel capability of the model.

[0052] In this embodiment, the input first passes through a series of GRUs and encoders, and the encoded data is output through a series of decoders. GRU is good at processing time dependencies in sequence data. Although Transformer excels in capturing long-term dependencies, GRU still has advantages in processing local time dependencies and short-term memory. GRU can effectively capture short-term dynamic changes in sequence data, making up for the shortcomings of Transformer in this regard. By processing the input sequence data, GRU can extract important features in the time series and pass these features to Transformer for further processing, thereby enhancing the robustness of the model.

[0053] In the encoding stage, the data first passes through Self-Attention to obtain a weighted vector, which is calculated by the following formula:

[0054]

[0055] The obtained weighted vector Z enters FNN, which is mathematically expressed as a linear activation function with the formula:

[0056] FFN(Z)=max(0,ZW 1 +b 1 )W 2 +b 2

[0057] Among them, K and V come from the output of the encoder, and Q comes from the previous output of the decoder. Q is Query, K is Key, and V is Value. They are all matrices, which are obtained by multiplying the representation vector with the corresponding weight matrix. The representation vector is the vector obtained by adding the embedding (low-dimensional mapping) of the input data and the embedding of the position data. Q*K calculates the weight of each vector, and in order to stabilize the gradient, it is normalized, that is, divided by the square root of d.

[0058] In the Encoder, the self-attention mechanism module adopts the Add&Norm structure to solve the degradation problem in deep learning, where Add represents residual connection and Norm represents layer normalization. Add&Norm is used to solve the gradient disappearance problem and improve training efficiency.

[0059] The decoding process of the decoder is carried out sequentially, that is, when decoding the i-th vector, only the i-1-th vector and the previous decoding results can be seen. This situation is called masked multi-head attention. After the decoder decodes, the feature vector passes through a fully connected layer with the activation function of maxsoft, and then the output vector reflecting the probability can be obtained.

[0060] Since Transformer does not have the ability to capture sequential data, positional encoding is added to it, as shown below:

[0061]

[0062]

[0063] where k is the position in the input sequence and d model Represents the dimension of the vector.

[0064] Combining the above model, the steps of long-distance ship trajectory prediction based on T-GRU are as follows:

[0065] S1, data preprocessing. Sort the data by timestamp, and then perform cubic spline interpolation on the longitude and latitude data respectively to meet the requirement that at each time point t i At the point where the interpolation curve passes through the corresponding longitude lon i and dimension lat i .

[0066] S2, Transformer-GRU neural network training and prediction. The ship motion data is divided into training set and test set in a ratio of 8:2. The number of iterations, learning rate and other parameters are set according to experience. The neural network is trained using the training set. The input of the neural network is propagation information such as longitude and latitude, speed and heading.

[0067] Specifically, the ship's latitude and longitude, speed, and heading-related data at each moment form a matrix, and 80% of them are taken as the training set as the model input (i.e., the "input" in the model). Each Encoder and Decoder submodule in the model receives the output of the previous module (decoder output) as input (GRU input) and finally generates an output (i.e., the "output" in the model), which is the predicted ship position of a certain predicted target length.

[0068] After the model is successfully trained, the training set is used as the model input for prediction again to obtain the training set prediction value Y' train . And use the test set as the model input for prediction, and get the test set prediction value Y' pre .

[0069] S3, calculate the residual sequence res=Y between the predicted value and the true value of the training set true -Y' train .

[0070] S4, use EMD (Empirical Mode Decomposition) algorithm to decompose the residual sequence res, obtain intrinsic mode components and residual terms, and establish GRU networks for training and prediction for the components and residuals respectively, and sum the prediction results as the predicted value Y of the residual of the test set res .

[0071] S5, the prediction result of the combined model is Y = Y' pre +Y res .

[0072] refer to Figure 5 , a practical example of this scenario is:

[0073] Taking the track with MMSI 211331640 as an example, the prediction effects of seqToseq, CNN-GRU and Transformer-GRU models under different prediction target lengths are demonstrated and evaluated. The experimental data are divided, with 80% of the track point data as the training set and 20% of the track point data as the test set.

[0074] The initial learning rate is set to 0.001, the batch size is set to 32, the final number of iterations is set to 800, and the prediction target length is set to {1, 2, 5, 10, 15, 20, 40, 60, 80, 100, 120, 140, 160, 180, 200}. MSE is used as the indicator and is dimensionless.

[0075] The mean square error of the model loss of the seq2seq model in the future prediction length of 1-200 is basically stable, but the effect is not good. The mean square error of the loss of GRU and Transformer-GRU increases with the increase of prediction nautical miles, but when the prediction target length is within 50 nautical miles, the loss of the GRU model is smaller than that of the Transformer-GRU model. However, as the prediction target length increases, the loss of the GRU model increases rapidly and soon exceeds that of the Transformer-GRU. The loss of the transformer-GRU grows very slowly, reflecting the good effect and stability of the model under long prediction target lengths.

[0076] Compared with the prior art, this embodiment has at least the following effects:

[0077] 1) Capturing long-term dependencies: This technology can effectively capture the dependencies between different positions in a sequence and is particularly suitable for processing data with a long time span.

[0078] 2) Long-distance track prediction: In long-distance track prediction, the future position of a ship may have complex relationships with its early position, path selection, environmental conditions, etc. This technology can better model these relationships and improve prediction accuracy.

[0079] 3) Parallel processing capability: This technical architecture does not rely on the sequential processing of sequence data and can process input data in parallel, thereby improving the efficiency of training and prediction.

[0080] 4) Large-scale data processing: Long-distance track prediction usually involves a large amount of historical data. The capabilities of this technology give it a clear advantage in large-scale data processing.

[0081] 5) Complex environmental factors: Track prediction involves many complex factors such as wind speed, ocean currents, and weather. This technology enables the model to comprehensively consider the impact of these different factors and improve the robustness of the prediction.

[0082] In summary, the embodiments of the present invention play an important role in processing ocean and cross-sea shipping logistics optimization, ship scheduling and path planning, port management and berth allocation, maritime search and rescue and emergency response, environmental protection, and national defense and security.

[0083] The second embodiment of the present invention corresponds to the first embodiment. Figure 6 As shown, this embodiment introduces a long-distance ship track prediction device based on T-GRU, including the following components:

[0084] an interpolation unit, configured to sort the track data according to timestamps and perform spline interpolation on the longitude and latitude data respectively;

[0085] The training unit is configured to divide the ship motion data into a training set and a test set according to a preset ratio, and use the training set to train the initial neural network; wherein the input of the neural network includes latitude and longitude, speed, and heading, and the output is the predicted ship position. After the training is completed, the training set and the test set are used for prediction respectively to obtain the training set prediction value Y' train And the test set prediction value Y' pre ;

[0086] The residual unit is configured to determine the residual sequence res=Y between the predicted value and the true value of the training set true -Y' train ;

[0087] The decomposition unit is configured to decompose the residual sequence res using the EMD algorithm to obtain the intrinsic mode components and the residual terms, and to establish GRU networks based on the components and the residuals for training and prediction, and to obtain the corresponding prediction results and sum them as the predicted value Y of the residual of the test set. res ;

[0088] The prediction unit is configured such that the prediction result Y of the current ship track is determined as Y=Y' pre +Y res .

[0089] In this embodiment, the spline interpolation is specifically cubic spline interpolation.

[0090] In this embodiment, in step S2, the neural network adopts Transformer-GRU.

[0091] In this embodiment, in step S2, the ship motion data is divided into a training set and a test set in a ratio of 8:2.

[0092] A third embodiment of the present invention is an electronic device, such as Figure 7As shown, it can be understood as a physical device, including a processor and a memory storing instructions executable by the processor. When the instructions are executed by the processor, the following operations are performed:

[0093] Step S1, sorting the track data according to timestamps, and performing at least two spline interpolations on the longitude and latitude data respectively;

[0094] Step S2, dividing the ship motion data into a training set and a test set according to a preset ratio, and using the training set to train the initial neural network; wherein the input of the neural network includes latitude and longitude, speed, and heading, and the output is the predicted ship position. After the training is completed, the training set and the test set are used for prediction respectively to obtain the training set prediction value Y' train And the test set prediction value Y' pre ;

[0095] Step S3, determine the residual sequence res=Y between the training set prediction value and the true value true -Y' train ;

[0096] Step S4, using the EMD algorithm to decompose the residual sequence res, obtain the intrinsic mode components and the residual terms, and establish GRU networks based on the components and the residuals for training and prediction, obtain the corresponding prediction results and sum them up as the predicted value Y of the test set residual res ;

[0097] Step S5, the prediction result Y of the current ship track is determined as Y=Y' pre +Y res .

[0098] The fourth embodiment of the present invention, the process of the long-distance ship track prediction method based on T-GRU in this embodiment is the same as that of the first, second or third embodiment, except that, in engineering implementation, this embodiment can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the method of the present invention can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, disk, CD), including a number of instructions for a device to execute the method described in the embodiment of the present invention.

[0099] Through the description of the specific implementation methods, a deeper and more specific understanding of the technical means and effects adopted by the present invention to achieve the predetermined purpose should be obtained. However, the accompanying drawings are only for reference and illustration purposes and are not intended to limit the present invention.

Claims

1. A long-distance ship track prediction method based on T-GRU, characterized in that: include: Step S1, sorting the track data according to timestamps, and performing spline interpolation on the longitude and latitude data respectively; Step S2, dividing the ship motion data into a training set and a test set according to a preset ratio, and using the training set to train the initial neural network; wherein the input of the neural network includes latitude and longitude, speed, and heading, and the output is the predicted ship position. After the training is completed, the training set and the test set are used for prediction respectively to obtain the training set prediction value Y' train And the test set prediction value Y' pre ; Step S3, determine the residual sequence res=Y between the predicted value and the true value of the training set true -Y' train ; Step S4, using the EMD algorithm to decompose the residual sequence res, obtain the intrinsic mode components and the residual terms, and establish GRU networks based on the components and the residuals for training and prediction, obtain the corresponding prediction results and sum them up as the predicted value Y of the test set residual res ; Step S5, the prediction result Y of the current ship track is determined as Y=Y' pre +Y res .

2. The long-distance ship track prediction method based on T-GRU according to claim 1 is characterized in that: In the step S1, the number of times of the spline interpolation is three times.

3. The long-distance ship track prediction method based on T-GRU according to claim 1 is characterized in that: In step S2, the neural network adopts Transformer-GRU.

4. The long-distance ship track prediction method based on T-GRU according to claim 3 is characterized in that: In the step S2, the ship motion data is divided into a training set and a test set in a ratio of 8:

2.

5. A long-distance ship track prediction device based on T-GRU, characterized in that: include: an interpolation unit, configured to sort the track data according to timestamps and perform spline interpolation on the longitude and latitude data respectively; The training unit is configured to divide the ship motion data into a training set and a test set according to a preset ratio, and use the training set to train the initial neural network; wherein the input of the neural network includes latitude and longitude, speed, and heading, and the output is the predicted ship position. After the training is completed, the training set and the test set are used for prediction respectively to obtain the training set prediction value Y' train And the test set prediction value Y' pre ; The residual unit is configured to determine the residual sequence res=Y between the predicted value and the true value of the training set true -Y' train ; The decomposition unit is configured to decompose the residual sequence res using the EMD algorithm to obtain the intrinsic mode components and the residual terms, and to establish GRU networks based on the components and the residuals for training and prediction, and to obtain the corresponding prediction results and sum them as the predicted value Y of the residual of the test set. res ; The prediction unit is configured such that the prediction result Y of the current ship track is determined as Y=Y' pre +Y res .

6. An electronic device, characterized in that: The electronic device comprises: a memory, a processor and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, the steps of the long-distance ship track prediction method based on T-GRU as described in any one of claims 1 to 4 are implemented.

7. A computer storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the steps of the long-distance ship track prediction method based on T-GRU as claimed in any one of claims 1 to 4 are implemented.

Citation Information

Cited By

  • Large model-based ship abnormal behavior prediction method

    CN119646720A

  • Container ship track prediction method based on EMD-PSO-GRU-RBFNN

    CN121598173A

  • A Container Ship Track Prediction Method Based on EMD-PSO-GRU-RBFNN

    CN121598173B