Track prediction method based on optimization generator
Through an optimization generator-based method, BiLSTM and GAN model confrontation training are used to extract ship trajectory features, which solves the problem of inaccurate ship behavior prediction in the existing technology, achieves more accurate and robust maritime traffic accident early warning, and improves Maritime traffic safety management capabilities.
Patent Information
- Application Number
- CN202411133952.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-19
- Publication Date
- 2024-09-17
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing technology is difficult to accurately predict the ship's direction when dealing with highly random and complex ship behaviors, affecting the accuracy and effectiveness of maritime traffic accident warnings. Moreover, traditional methods rely on professional knowledge and are not versatile and scalable.
A trajectory prediction method based on an optimized generator is adopted, by collecting historical ship AIS data, using a convolutional neural network to extract features, and constructing a model based on a double-ended long short-term memory network (BiLSTM) and an adversarial neural network (GAN) for adversarial training. Generate accurate ship trajectory predictions.
It improves the accuracy and robustness of ship trajectory prediction, can effectively process noise data, provides more accurate maritime traffic accident warnings, improves maritime traffic safety management and accident prevention capabilities, and is suitable for waters with dense traffic and complex sea conditions.
Smart Images

Figure CN118656602A
Abstract
Description
Technical Field
[0001] The invention relates to ship trajectory prediction, and in particular to a trajectory prediction method based on an optimization generator. Background Art
[0002] With the continuous development of shipping, it is more urgent to strengthen ship safety management and key target monitoring. In many coastal and port waters with dense traffic and complex conditions, the accuracy and effectiveness of maritime traffic accident warnings are also particularly important. Knowing the direction of the ship in advance can effectively reduce the occurrence of maritime traffic accidents such as ship grounding and collision. Existing technologies still face challenges in dealing with highly random and complex ship behaviors. Especially in coastal and port waters with dense traffic and changeable sea conditions, existing models may find it difficult to accurately predict the direction of the ship, thus affecting the accuracy and effectiveness of maritime traffic accident warnings. In addition, traditional methods are highly dependent on professional knowledge and need to be customized for different ships and scenarios, which limits their versatility and scalability. Summary of the invention
[0003] Purpose of the invention: In view of the above shortcomings, the present invention provides a trajectory prediction method based on an optimized generator to improve the accuracy and robustness of the prediction.
[0004] Technical solution: To solve the above problems, the present invention adopts a trajectory prediction method based on an optimization generator, comprising the following steps: (1) Collect historical ship AIS data and build a trajectory prediction dataset; (2) Use convolutional neural networks to extract features from trajectory prediction datasets; (3) Construct a trajectory prediction model based on the optimized generator and embed the BiLSTM model into the generator of the adversarial neural network GAN. Perform adversarial training on the trajectory prediction model through the extracted features to obtain a trained trajectory prediction model. (4) Perform trajectory prediction using the trained trajectory prediction model.
[0005] Furthermore, in the step (1), the collected historical ship AIS data is preprocessed, including data cleaning and normalizing the cleaned data, wherein the data cleaning includes deleting obviously erroneous data, deleting data with missing ship track data exceeding a threshold, and performing linear interpolation correction on data with missing ship track data not exceeding a threshold.
[0006] Furthermore, the historical ship AIS data collected in step (1) includes the longitude, latitude, heading and speed of several ship tracks.
[0007] Furthermore, the convolutional neural network in step (2) includes three convolutional layers and one fully connected layer, each convolutional layer includes a one-dimensional convolution operation, an activation function and a pooling operation, and the activation function adopts a DHAF function.
[0008] Furthermore, the generator of the adversarial neural network GAN in step (3) includes several BILSTM layers, each BILSTM layer includes a forward LSTM unit and a reverse LSTM unit, the forward LSTM unit is trained according to a forward sequence, the reverse LSTM unit is trained according to a reverse sequence, and the forward LSTM unit and the reverse LSTM unit each include a plurality of memory units, each memory unit includes an input gate , output gate , Forget Gate : ; ; ; ; ; ; in, represents the weight matrix corresponding to the forget gate, represents the weight matrix corresponding to the input gate, Represents the weight matrix corresponding to the current input unit state, Represents the weight matrix corresponding to the output gate; represents the bias term of the forget gate, represents the bias term of the input gate, represents the bias term of the current input cell state, represents the bias term of the output gate; represents the activation function, is the hyperbolic tangent function; represents the input at time t; Indicates the current input unit status; Represents the unit state at the current time t; represents the input gate; stands for Forget Gate; represents the output gate, Represents the unit state at the previous time t-1; represents the output at time t-1, Represents the final output.
[0009] Furthermore, the adversarial neural network GAN in step (3) includes a discriminator, which adopts a feedforward neural network model, including an input layer and multiple fully connected layers, and the discriminator is used to judge the authenticity of the output result of the generator.
[0010] Furthermore, the loss function used in the adversarial training is a weighted combination of binary cross entropy loss and Wasserstein loss: ; in, is the total loss function, is the binary cross entropy loss function, is the Wasserstein loss function, is the weight of the binary cross entropy loss function, is the weight of the Wasserstein loss function.
[0011] Furthermore, the binary cross entropy loss function formula is: ; in, is the true label, is the output of the discriminator; The Wasserstein loss function formula is: ; in, It is A real sample, is the total number of true samples, For the The output of the discriminator of real samples is is distributed from the generator Samples sampled in To distribute from the generator Samples sampled from , after being converted by the generator, the expected value evaluated by the discriminator D.
[0012] The present invention also adopts a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above method when executing the computer program.
[0013] The present invention also adopts a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of the above method are implemented.
[0014] Beneficial effects: Compared with the prior art, the significant advantage of the present invention is that it captures the long-term dependencies of ship motion through the powerful time series analysis capability of the BILSTM network, and uses the generation capability of GAN to simulate the complex distribution of ship trajectories, thereby improving the accuracy and robustness of predictions. This combined model is particularly suitable for waters with dense traffic and complex sea conditions. It can effectively process noisy data and provide more accurate marine traffic accident warnings, significantly improving the ability of marine traffic safety management and accident prevention. In addition, the design of the model allows it to self-improve through adversarial training, enhancing the generalization ability and real-time prediction performance of the model, enabling it to better adapt to the ever-changing maritime environment and ship behavior patterns. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] Figure 1 It is a schematic diagram of the workflow of the trajectory prediction method of the present invention.
[0016] Figure 2 It is a sparse schematic diagram of the ship trajectory in the present invention.
[0017] Figure 3 It is a schematic diagram of linear fitting of ship trajectory points in the present invention.
[0018] Figure 4 It is a schematic diagram of the trajectory prediction network structure in the present invention.
[0019] Figure 5 It is a schematic diagram of the result of trajectory prediction in the present invention. DETAILED DESCRIPTION
[0020] like Figure 1 As shown, in this embodiment, a trajectory prediction method based on an optimization generator includes the following steps: Step 1, data collection and preprocessing: The ship trajectory data is collected through the ship automatic identification system AIS. The AIS system can record the ship's latitude and longitude, speed, heading and other key data in real time, providing a rich input source for the trajectory prediction model. However, the original AIS data contains a lot of noise and outliers, so these data need to be strictly screened and preprocessed before formal modeling.
[0021] In the data screening stage, we first need to identify and retain key information that has a greater impact on the ship trajectory prediction. This information usually includes the ship's location, speed, heading, ship type, and the ship's historical trajectory. In order to ensure the accuracy of the model, it is necessary to delete obvious errors in the AIS data. For example, there may be some records with abnormal geographical locations in the data, such as the ship's location information suddenly jumping to an unreasonable location. This type of data is obviously wrong and needs to be eliminated during the data cleaning process.
[0022] like Figure 2 As shown in the figure, all the data with very sparse ship trajectory data are deleted, and the data with less missing ship trajectory data are corrected by linear interpolation method.
[0023] The specific method of linear interpolation is to organize the coordinate trajectory data of the ship into a time series of longitude and latitude. The data point includes three pieces of information: timestamp, longitude, and latitude. The timestamp is a fixed time interval set to 1 second. The reference timestamp is used to check whether the correlation of the data meets the set frequency. If there are missing values between the data, it will cause inconsistent intervals and mark the location of the missing data. For each missing value, linear interpolation is performed through the adjacent known data points before and after it. Specifically, assuming that at time point t 0 and t 2. Known longitude and latitude data and , and at the time point t 1. Missing longitude and latitude data, need to be passed t 0 and t 2These two known points are used to estimate t 1's latitude and longitude.
[0024] The linear interpolation formula is as follows: ; ; in: and is t 1The estimated longitude and latitude at the time point. and is t The known longitude and latitude at time 0. and is t 2 Known longitude and latitude at a point in time. t 0 and t 2 is the timestamp of the known data point. t 1 is the time point that needs to be interpolated.
[0025] like Figure 3 As shown, the estimated and Insert into the position of the missing value to complete the repair of the missing data.
[0026] Step 2, data division: normalize the preprocessed information data, and then divide the data into training set and test set according to 8:2. Specifically, shuffle the data and randomly divide the data according to 8:2 to ensure the randomness of the data.
[0027] Step 3, feature extraction: Use the optimized convolutional neural network (CNN) to extract features from the training set. The optimized CNN structure consists of multiple convolutional blocks, each of which includes the following basic components: One-dimensional convolution layer: The function of the one-dimensional convolution layer is to perform convolution operations on the ship trajectory data through sliding convolution kernels (filters) to extract local features in the data. In the optimized structure, convolution kernels of different sizes are used for different ranges to capture spatial and temporal features of different scales.
[0028] For data with a larger range, 7 time steps are set to facilitate the identification of broader patterns; for data with a smaller range, 3 time steps are set to facilitate the capture of local detailed features.
[0029] Activation function: The activation function introduces nonlinear characteristics, allowing the network to learn complex patterns. The activation function uses the Dynamic Hybrid Activation Function (DHAF) function, which is defined by the following formula: ; in: is the output of DHAF. , ... It is multiple basic activation functions ReLU. , ... Is the same as the input value The relevant dynamic weights satisfy .
[0030] These weights are learned and generated through a weight generation network. The weight generation network receives the input data (or intermediate features) of the current neural network layer, and then processes it through a series of neural network layers to output a weight vector. Each element of this vector corresponds to the weight of a basic activation function. The input layer extracts the feature vector from the previous layer of the network, and the input dimension is The fully connected layer 1 receives input And map it to a hidden layer. This hidden layer can increase nonlinearity and capture the complex characteristics of the input data. The number of neurons is set to , the activation function uses the ReLU function. The fully connected layer 2 further processes the output of the hidden layer to generate features equal to the number of basic activation functions. The number of neurons is set to The fully connected layer 3 maps the output of the second hidden layer to the same dimension as the number of base activation functions. The number of neurons is equal to the number of squeezed activation functions n=3, without activation function, directly outputting linear results, and inputting the results of the output layer into the Softmax function, defined by the following formula: ; in is the output vector of the weight generation network, processed by the softmax function to ensure that the sum of the weights is 1.
[0031] Step 4, build a BILSTM generator: The BILSTM generator generates reasonable future trajectories based on historical trajectory data. Specifically, the input of the BILSTM generator is the feature vector after feature extraction from CNN, which has extracted key information from the ship trajectory data through convolution and pooling operations. Design multiple BILSTM layers. Each BILSTM layer contains two LSTM units, which process the forward and reverse time series data respectively to capture long-term and short-term dependencies.
[0032] For a single BILSTM network, the input gate, output gate, and forget gate of the BILSTM network correspond to the writing, reading, and previous state resetting operations of the ship trajectory feature sequence in the present invention, respectively. The forward layer is forwardly calculated from time 1 to time t to obtain and save the output of the forward hidden layer at each moment. The reverse layer is reversely calculated from time t to time 1 to obtain and save the output of the backward hidden layer at each moment. Finally, the results of the outputs of the forward layer and the reverse layer at the corresponding moments are combined at each moment to obtain the final output.
[0033] The calculation formula is as follows: ; ; ; ; ; ; in, represents the weight matrix corresponding to the forget gate, represents the weight matrix corresponding to the input gate, Represents the weight matrix corresponding to the current input unit state, Represents the weight matrix corresponding to the output gate; represents the bias term of the forget gate, represents the bias term of the input gate, represents the bias term of the current input cell state, represents the bias term of the output gate; represents the activation function, is the hyperbolic tangent function; represents the input at time t; Indicates the current input unit status; Represents the unit state at the current time t; represents the input gate; stands for Forget Gate; represents the output gate, Represents the unit state at the previous time t-1; represents the output at time t-1, Represents the final output.
[0034] The output of the BILSTM layer (forward and backward hidden states) can be connected to the next BILSTM layer, and the last BILSTM layer adds a fully connected layer (or multiple fully connected layers) to generate ship trajectories from the output of the BILSTM.
[0035] Step 5, build the discriminator: Input layer, receiving trajectory data. The format of trajectory data must be consistent with the output of the generator. That is, if the prediction is the position of the ship at the next time step, the input layer will receive a vector containing longitude and latitude to ensure that the discriminator can effectively compare the real data with the generated data. Fully connected layer, followed by multiple fully connected layers, is used to extract high-level features of trajectory data, which is consistent with the generator. The discriminator processes the real information to obtain trajectory features and compares it with the information generated by the generator for adversarial training.
[0036] Step 6, such as Figure 4 As shown, adversarial training: train the generator and the discriminator at the same time, the goal of the generator is to produce realistic trajectories, while the goal of the discriminator is to correctly classify the trajectories. Use an adversarial loss function to guide the training process, making the trajectories generated by the generator increasingly difficult for the discriminator to recognize. In this embodiment, the adversarial loss function used is a weighted combination of binary cross entropy loss and Wasserstein loss, where the binary cross entropy loss function formula is: ; where y is the true label (1 for real data and 0 for generated data), is the output of the discriminator; this loss optimizes the discriminator’s prediction accuracy.
[0037] The Wasserstein loss calculation formula is: ; in, It is A real sample, is the total number of true samples, For the The output of the discriminator of real samples is is distributed from the generator Samples sampled in To distribute from the generator The loss is the expected value of the samples sampled from the generator, converted by the generator, and then evaluated by the discriminator D; this loss provides an interpretable distance metric that helps stabilize the training process and reduce mode collapse.
[0038] The total loss function is: .
[0039] and It is the weight used to balance the two loss functions. Using two loss functions at the same time can improve classification accuracy, provide stable training and better distance measurement. According to the performance during training, adjust the structure and parameters of the generator and discriminator.
[0040] Step 7, trajectory prediction and evaluation: Use the trained BILSTM generator to predict the trajectory of the test set. The prediction results are as follows: Figure 5 As shown. The performance of the model is evaluated, and indicators such as mean square error (MSE) and mean absolute error (MAE) are used to measure the accuracy of the prediction.
[0041] The MSE calculation formula is: ; Where N represents the total duration of the prediction, t is the time series number, represents the predicted value of the trajectory, Represents the true value of the trajectory.
[0042] The MAE calculation formula is: ; Where N represents the total duration of the prediction, t is the time series number, represents the predicted value of the trajectory, Represents the true value of the trajectory.
[0043] The present invention takes the GAN network as the benchmark and integrates the BILSTM network in the generator stage, which can better model the time series characteristics and improve the training efficiency and prediction results through the appropriate loss function design. It greatly improves the prediction accuracy and prediction efficiency of ship trajectories in complex situations.
Claims
1. A trajectory prediction method based on an optimization generator, characterized in that: The following steps are involved: (1) Collect historical ship AIS data and build a trajectory prediction dataset; (2) Use convolutional neural networks to extract features from trajectory prediction datasets; (3) Construct a trajectory prediction model based on the optimized generator and embed the BiLSTM model into the generator of the adversarial neural network GAN. Perform adversarial training on the trajectory prediction model through the extracted features to obtain a trained trajectory prediction model. (4) Perform trajectory prediction using the trained trajectory prediction model.
2. The trajectory prediction method according to claim 1, characterized in that: In the step (1), the collected historical ship AIS data is preprocessed, including data cleaning and normalization of the cleaned data. The data cleaning includes deleting obviously erroneous data, deleting data with missing ship track data exceeding a threshold, and performing linear interpolation correction on data with missing ship track data not exceeding a threshold.
3. The trajectory prediction method according to claim 2, characterized in that: The historical ship AIS data collected in step (1) includes the longitude, latitude, heading and speed of several ship tracks.
4. The trajectory prediction method according to claim 3, characterized in that: In the step (2), the convolutional neural network includes three convolutional layers and one fully connected layer, each convolutional layer includes a one-dimensional convolution operation, an activation function and a pooling operation, and the activation function adopts a DHAF function.
5. The trajectory prediction method according to claim 4, characterized in that: The generator of the adversarial neural network GAN in step (3) includes several BILSTM layers, each BILSTM layer includes a forward LSTM unit and a reverse LSTM unit, the forward LSTM unit is trained according to the forward sequence, and the reverse LSTM unit is trained according to the reverse sequence, and the forward LSTM unit and the reverse LSTM unit each include a plurality of memory units, each memory unit includes an input gate , output gate , Forget Gate : ; ; ; ; ; ; in, represents the weight matrix corresponding to the forget gate, represents the weight matrix corresponding to the input gate, Represents the weight matrix corresponding to the current input unit state, Represents the weight matrix corresponding to the output gate; represents the bias term of the forget gate, represents the bias term of the input gate, represents the bias term of the current input cell state, represents the bias term of the output gate; represents the activation function, is the hyperbolic tangent function; represents the input at time t; Indicates the current input unit status; Represents the unit state at the current time t; represents the input gate; stands for Forget Gate; represents the output gate, Represents the unit state at the previous time t-1; represents the output at time t-1, Represents the final output.
6. The trajectory prediction method according to claim 5, characterized in that: The adversarial neural network GAN in step (3) includes a discriminator, which adopts a feedforward neural network model, including an input layer and multiple fully connected layers, and the discriminator is used to judge the authenticity of the output result of the generator.
7. The trajectory prediction method according to claim 6, characterized in that: The loss function used in the adversarial training is a weighted combination of binary cross entropy loss and Wasserstein loss: ; in, is the total loss function, is the binary cross entropy loss function, is the Wasserstein loss function, is the weight of the binary cross entropy loss function, is the weight of the Wasserstein loss function.
8. The trajectory prediction method according to claim 7, characterized in that: The binary cross entropy loss function formula is: ; in, is the true label, is the output of the discriminator; The Wasserstein loss function formula is: ; in, It is A real sample, is the total number of true samples, For the The output of the discriminator of real samples is is distributed from the generator Samples sampled in To distribute from the generator Samples sampled from , after being converted by the generator, the expected value evaluated by the discriminator D.
9. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 8 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.
Citation Information
Patent Citations
Data processing method and device and computer readable storage medium
CN110826695A
Moving track generation method and device
CN113255951A
Elbow angle prediction method, terminal device and storage medium
CN113537489A
Power load control device, control method, terminal, medium and application
CN113591391A
Mechanical fault intelligent diagnosis method under class unbalanced data set
CN113935460A
Cited By
Self-supervised trajectory classification method and system based on multilevel feature extraction
CN119357751A
Deep learning-based wave force sensing modeling ship control motion forecasting method
CN119476015A
Surgical instrument needle tip track prediction method
CN119963593A
Time series data prediction system and method
CN120611152A
