A method for predicting the route of a maritime target
The integration of CNN, Bi-LSTM, and attention mechanisms with a moving window approach addresses the challenges of large AIS data and complex marine environments, enhancing ship route prediction accuracy and speed, thereby improving maritime safety.
Patent Information
- Application Number
- CN202510224039.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-27
- Publication Date
- 2025-07-15
- Estimated Expiration
- 2045-02-27
AI Technical Summary
When processing marine ship trajectory data, it is difficult to achieve efficient and accurate route prediction in complex scenarios. Especially when ship trajectory data is missing and environmental factors are complex and changeable, existing methods such as polynomial Kalman filtering algorithms are difficult to adapt.
Convolutional neural network (CNN) is used to extract local spatiotemporal correlation features, combine bidirectional long and short-term memory network (Bi-LSTM) to model timing dependence, and use attention mechanism to weight extraction of key features, predict through mobile window technology, and fuse multiple models to improve prediction accuracy and speed.
It significantly improves the accuracy and speed of maritime target route prediction, can accurately predict the future route of ships in complex navigation scenarios, and improves the safety and efficiency of maritime navigation.
Smart Images

Figure CN119721402B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of route prediction, and particularly to a method for predicting the route of a maritime target. Background Art
[0002] Accurate prediction of ship trajectories is of crucial significance for maritime traffic management. It can effectively prevent ship collisions, optimize navigation routes, and improve navigation efficiency. Compared with the relatively fixed routes of vehicles on land, the navigation of ships in water areas is more flexible and changeable, which undoubtedly increases the difficulty of predicting navigation trajectories. In view of this, the International Maritime Organization actively advocates the use of various navigation systems, such as the Bridge Navigation Watch Alarm System, the Automatic Identification System (AIS for short), and the Electronic Chart Display and Information System. With the continuous progress of maritime traffic monitoring technologies and communication equipment, most ships are currently equipped with the AIS system to record relevant information such as positions. This system can communicate with coastal AIS base stations to achieve the identification, positioning, and real-time monitoring of ships. China has established a complete coastal AIS base station network and accumulated a large amount of information related to port ships. This information covers the static information of ships (such as Maritime Mobile Service Identity (MMSI), size, and type), dynamic information (such as the longitude and latitude, ground speed, and heading of ships), and navigation-related information (such as the draft and destination of ships). By deeply processing this information, we can extract and analyze the behavioral characteristics of ships, and then achieve accurate prediction of ship navigation trajectories. However, it should be noted that the AIS system usually sends a message every 2 seconds to 3 minutes, which results in a large scale of the AIS dataset. Therefore, how to efficiently process these AIS data to achieve accurate prediction of ship routes has become a hot and difficult issue in current research. Although several ship route prediction technologies have emerged, they all face certain limitations. In response to challenges such as missing ship trajectory data, the existing technology relies on an improved Kalman filter algorithm to construct a polynomial Kalman filter model. However, this kind of method based on physical modeling is difficult to build mathematical equations and is hard to cope with complex and changeable environmental factors. Summary of the Invention
[0003] Object of the Invention: The object of the present invention is to provide a method for predicting the route of a maritime target to solve the problem of trajectory prediction in complex scenarios.
[0004] Technical Solution: A method for predicting the route of a maritime target according to the present invention includes the following steps:
[0005] (1) Collect and preprocess historical AIS data, calculate and introduce new features, and consider the impact of the vessel itself under complex scenarios; divide the data into training set, validation set, and test set;
[0006] (2) Use a convolutional neural network to extract local spatio-temporal correlation features;
[0007] (3) Use a bidirectional long short-term memory network to model the temporal dependence of the target;
[0008] (4) Use an attention mechanism to weight and extract critical moments or features;
[0009] (5) Train each model independently and evaluate the performance of the fused model on the test set;
[0010] (6) Use the moving window technique to extract and output fixed-length data to complete the prediction from one time period to another.
[0011] Further, in step (1), collect Automatic Identification System (AIS) historical data and extract the required features including time, longitude, latitude, speed over ground, course over ground, and MMSI;
[0012] Further, in step (1), preprocess the AIS data, including abnormal data handling, missing value handling, and normalization; based on the dynamic information of the vessel, calculate the relative position, relative course, relative speed, and relative mass between the vessel and the target vessel, and add them as new features to obtain the distance between vessels, the overlap of navigation trajectories, and the impact of vessel types on vessel trajectories under complex scenarios.
[0013] Further, step (2) is specifically as follows: use a Convolutional Neural Network (CNN) to extract local spatio-temporal correlation features from the input route trajectory: after the input data is normalized, it first enters the convolutional layer for convolution operations to extract data features; then it enters the pooling layer to reduce the output dimension, where the average pooling layer is selected for the pooling layer; the pooling layer is connected to the Dropout layer; where the Dropout layer makes each neuron stop working with probability That is, each dimension of the data output by the pooling layer becomes 0 with probability becomes 0.
[0014] Further, step (3) is specifically as follows: use a Bidirectional Long Short-Term Memory (Bi-LSTM) network to construct the temporal dependence of the target; where the Bi-LSTM neural network consists of two layers of LSTM, and the output values of the forward and backward LSTM units of the same input are concatenated to obtain the output vector of the Bi-LSTM network.
[0015] Further, step (4) is specifically as follows: Using the similarity between the hidden state and the target state, calculate the attention weights through a scoring function to measure the importance of each hidden state; through the function, normalize the weights into a probability distribution; use the normalized attention weights to perform weighted summation on the hidden states; the flattening layer converts the input data into one-dimensional data, and finally passes through a fully connected layer to output the final result; among them, the scoring function calculates the similarity between the features at each time step in the input sequence and the current input target state, and the formula is as follows:
[0016] ;
[0017] Among them, is the hidden state at the time step in the input sequence, is the query input, is the similarity score between the hidden state and .
[0018] Further, step (5) is specifically as follows: On the basis of constructing a convolutional neural network, a bidirectional long short-term memory network, and an attention mechanism, combine the three models CNN, Bi-LSTM, and the attention mechanism in series; define a loss function, and use evaluation metrics including MSE, MAE, accuracy, and recall for evaluation; among them, the loss functions mean squared error and root mean squared error evaluate the prediction performance of the model.
[0019] Further, step (6) is specifically as follows: Use the moving window technique to extract a data chain of a fixed length and input it into the trained model to output the longitude, latitude, heading, and speed at the next moment; then move the window by one unit length, use the just output result as a part of the input data, remove the data at the oldest moment, and perform the prediction for the next moment; until the trajectory result of the last moment of the target window is output, combine the output results together and output them as the trajectory prediction result of the target time period.
[0020] An electronic device according to the present invention includes a memory, a processor, and a computer program stored on the memory and executable on the processor. When the computer program is loaded into the processor, it implements any one of the methods for predicting the sea target route.
[0021] A storage medium according to the present invention stores a computer program, and when the computer program is executed by a processor, it implements any one of the methods for predicting the sea target route.
[0022] Beneficial effects: Compared with the prior art, the present invention has the following remarkable advantages: By integrating a convolutional neural network, a long short-term memory network, and an attention mechanism, the advantages of each model are fully utilized, significantly enhancing the accuracy of prediction. In addition, in actual complex navigation scenarios, in view of the mutual influence between the trajectories and ship types of different ships, the present invention innovatively introduces relative position, heading, speed, and relative mass as new feature parameters. These features not only conform to the reality but also greatly broaden the application prospects. In order to improve the speed and accuracy of the model and enhance its practicality, the present invention adheres to the concept of a moving window, realizing prediction from one time period to another, effectively making up for the defect of the reduced prediction accuracy of the model for long time periods and the problem of the slowdown of the prediction speed caused by the increase in feature parameters. The present invention can accurately predict the future route of the target ship, providing strong decision-making support for ship drivers, thereby effectively improving the safety of maritime navigation. Brief Description of the Drawings
[0023] Figure 1 is the overall flowchart of the present invention;
[0024] Figure 2 is the basic structure diagram of the convolutional neural network of the present invention;
[0025] Figure 3 is the structure diagram of the Bi-LSTM network of the present invention;
[0026] Figure 4 is the schematic diagram of the principle of the attention mechanism of the present invention;
[0027] Figure 5 is the schematic diagram of the principle of the moving window technology of the present invention. Detailed Embodiment
[0028] The technical solution of the present invention will be further described below with reference to the accompanying drawings.
[0029] As Figure 1 shown, an embodiment of the present invention provides a method for predicting the route of a maritime target, including the following steps:
[0030] (1) Collect and preprocess historical AIS data, calculate and introduce new features, and consider the influence of the own ship under complex scenarios; divide the training set, validation set, and test set; including the following steps:
[0031] (11) Extract historical AIS data, retain the required feature fields in the dataset, and perform resampling; the feature fields include: time, longitude, latitude, speed over ground, course over ground, and MMSI feature;
[0032] (12) Process error data, noise data, and missing values through filtering and interpolation;
[0033] (13) Calculate and introduce relative heading, relative speed, relative position, and relative mass as new features. The formulas are as follows:
[0034] The formula for relative heading is as follows: △C(t) = C(t) - C(t - 1)
[0035] Where △C(t) represents the heading at two adjacent times; C(t) represents the heading at time t; C(t - 1) represents the heading at time t - 1;
[0036] The formula for relative speed is as follows: △V(t) = V(t) - V(t - 1)
[0037] Where △V(t) represents the change in speed at two adjacent times;
[0038] The formula for relative position is as follows: △E(t) = E(t) - E(t - 1); △N(t) = N(t) - N(t - 1)
[0039] △E(t) and △N(t) respectively represent the changes in longitude and latitude at two adjacent times;
[0040] (2) Use a convolutional neural network to extract local spatio-temporal correlation features; as Figure 2 shown, it includes the following steps:
[0041] (21) After the input data is normalized, it first enters the convolutional layer for convolution operations to extract data features;
[0042] (22) Subsequently, it enters the pooling layer to reduce the output dimension;
[0043] (23) The pooling layer is connected to the Dropout layer. The essence of the Dropout layer is to make each neuron stop working with a probability That is, each dimension of the data output by the pooling layer changes from probability to This can reduce the complex co-adaptation relationship between neurons and improve the generalization ability of the model.
[0044] (3) Use a bidirectional long short-term memory network to model the temporal dependence of the target; as Figure 3 shown, it includes the following steps:
[0045] (31) Build a Bi-LSTM model and use the output of step (2) as the input of the model;
[0046] (32) Concatenate the output values of the forward and backward LSTM units for the same input to obtain the output vector of the Bi-LSTM network. The specific process is as follows: Bidirectional Long Short-Term Memory Network (Bi-LSTM): A recurrent neural network that processes data from the forward and backward directions of a time series through two independent LSTM networks respectively, and combines the outputs of both for better feature representation and modeling; Forward LTSM / Backward LTSM: The forward LTSM is a standard LSTM network that processes in the chronological order of the input sequence; it receives input information sequentially from the start (earliest time step) to the end (latest time step) of the sequence; The backward LSTM is also an LSTM network, but it processes the input sequence in the reverse chronological order; that is, it reads the input information from the end (latest time step) of the sequence forward (earliest time step). The formula is as follows:
[0047] Let the input sequence be , where is the length of the sequence; The forward LSTM processes the input in order from to to generate a series of hidden states , and the backward LSTM processes the input in order from to to generate a series of hidden states ;
[0048] The specific method for concatenating the output vectors is as follows:
[0049] ;
[0050] where, represents the output vector, represents the concatenation function, represents the hidden state vector at time t generated by the forward and backward LSTMs.
[0051] (4) Use the attention mechanism to weightedly extract key moments or features; As shown in Figure 4 , the specific process is as follows: Use the similarity between the hidden state and the target state, and calculate the attention weights through a scoring function to measure the importance of each hidden state; Through the function, normalize these weights into a probability distribution; Use the normalized attention weights to weightedly sum the hidden states, and the result after weighted summation is called the context vector; The flatten layer converts multi-dimensional data into one-dimensional data, and finally passes through a fully connected layer to output the final result;
[0052] where, Scoring function: Calculate the similarity between the features at each time step in the input sequence and the current input target state. The definition of the scoring function can be written as the following formula:
[0053]
[0054] Among them, is the hidden state at the time step in the input sequence, is the query input;
[0055] Flatten layer: In a neural network, the role of the Flatten layer is to flatten the input multi-dimensional tensor into a one-dimensional vector so that it can be passed to a fully connected layer (Dense layer) for further processing;
[0056] Fully connected layer: The most common type of layer in a neural network, its main feature is that each neuron is connected to all neurons in the previous layer; the role of the fully connected layer is to map the input data to the output space through linear transformation and non-linear activation functions.
[0057] (5) Train each model independently and evaluate the performance of the fused model on the test set; specifically as follows: On the basis of constructing a convolutional neural network, a bidirectional long short-term memory network, and an attention mechanism, combine the three models CNN, Bi-LSTM, and the attention mechanism in series; define the loss function, and use evaluation metrics including MSE, MAE, accuracy, and recall for evaluation; among them, the mean squared error and root mean squared error of the loss function are used to evaluate the model prediction performance.
[0058] (6) Use the moving window technique to extract and output fixed-length data to complete the prediction from time period to time period. As Figure 5 shown, it includes the following steps:
[0059] (61) According to the determined moving window length, select a fixed-length data chain as the input;
[0060] (62) Input the input data chain into the model fused in step (5);
[0061] (63) Add the result of the next moment output to the end of the input data chain, and at the same time remove the data of the earliest moment in the original input data chain, and then input the data chain into the model obtained in step (5) again to obtain the prediction result of the next moment;
[0062] (64) Repeat step (63) until the prediction results of all moments in the target time period are obtained, and combine the results into the ship trajectory prediction result of the target time period for output.
[0063] An embodiment of the present invention also provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the computer program is loaded into the processor, it implements any one of the above-mentioned methods for predicting a sea target route.
[0064] An embodiment of the present invention further provides a storage medium storing a computer program, and when the computer program is executed by a processor, any one of the above-mentioned methods for predicting a sea target route is implemented.
Claims
1. A method for predicting the route of a maritime target, characterized in that, It includes the following steps: (1) Collect and preprocess historical AIS data, calculate and introduce new features, considering the impact of the own ship in complex scenarios; divide the training set, validation set, and test set; preprocess the AIS data, including abnormal data processing, default value processing, and normalization; based on the dynamic information of the ship, calculate the relative position, relative course, relative speed, and relative mass of the ship and the target ship, and add them as new features to obtain the distance between ships, the coincidence of navigation trajectories, and the impact of ship types on ship trajectories in complex scenarios; the formulas are as follows: The formula for relative course is as follows: △C(t)=C(t)-C(t - 1) Where, △C(t) represents the course between two adjacent moments; C(t) represents the course at moment t; C(t - 1) represents the course at moment t - 1; The formula for relative speed is as follows: △V(t)=V(t)-V(t - 1) Where, △V(t) represents the change in speed between two adjacent moments; The formula for relative position is as follows: △E(t)=E(t)-E(t - 1); △N(t)=N(t)-N(t - 1) △E(t) and △N(t) respectively represent the changes in longitude and latitude between two adjacent moments; (2)Use a convolutional neural network to extract local spatio-temporal correlation features; specifically as follows: Use a convolutional neural network CNN to extract local spatio-temporal correlation features from the input flight trajectory: After the input data is normalized, it first enters the convolutional layer for convolution operations to extract data features; then it enters the pooling layer, and the pooling layer is connected to the Dropout layer; among them, the Dropout layer makes each neuron stop working with a probability That is, each dimension of the data output by the pooling layer becomes 0 with a probability (3) Use a bidirectional long short-term memory network to model the temporal dependence of the target; it includes the following steps: (31) Construct a Bi-LSTM model and use the output of step (2) as the input of the model; (32) Concatenate the output values of the forward and backward LSTM units of the same input to obtain the output vector of the Bi-LSTM network; the specific process is as follows: Bidirectional long short-term memory network: A recursive neural network that processes data from the forward and backward directions of a time series through two independent LSTM networks respectively, and combines the outputs of both for better feature representation and modeling; Forward LTSM / Backward LTSM: Forward LTSM is a standard LSTM network that processes in the chronological order of the input sequence; it receives input information sequentially from the start to the end of the sequence; Backward LSTM is also an LSTM network, but it processes the input sequence in the reverse chronological order; that is, it reads the input information forward from the end of the sequence; the formula is as follows: Let the input sequence be , where is the length of the sequence; the forward LSTM processes the input sequentially from to to generate a series of hidden states , and the backward LSTM processes the input sequentially from to to generate a series of hidden states ; The specific method for concatenating the output vector is as follows: ; Among them, represents the output vector, represents the concatenation function, represents the hidden state vector at time t generated by the forward and backward LSTMs; (4) Use the attention mechanism to weight and extract key moments or features; specifically as follows: Use the similarity between the hidden state and the target state, and calculate the attention weights through a scoring function to measure the importance of each hidden state; Through The function normalizes these weights into a probability distribution; Use the normalized attention weights to perform a weighted sum of the hidden states, and the result after the weighted sum is called the context vector; The flattening layer converts the multi-dimensional data into one-dimensional data, and finally passes through a fully connected layer to output the final result; Among them, the scoring function: calculates the similarity between the features at each time step in the input sequence and the current input target state, and the definition of the scoring function can be written as the following formula: ; Among them, is the hidden state at the time step in the input sequence, is the query input; Flatten layer: In a neural network, the role of the Flatten layer is to flatten the input multi-dimensional tensor into a one-dimensional vector so that it can be passed to a fully connected layer for further processing; Fully connected layer: The most common type of layer in a neural network, and its main feature is that each neuron is connected to all neurons in the previous layer; the role of the fully connected layer is to map the input data to the output space through linear transformation and non-linear activation functions (5) Independently train each model and evaluate the performance of the fused model on the test set; (6) Use the moving window technique to extract and output fixed-length data to complete the prediction from one time period to another; it includes the following steps: (61) Select a data chain of a fixed length as the input according to the determined moving window length; (62) Input the input data chain into the model after fusion in step (5); (63) Add the result of the next moment output to the end of the input data chain. At the same time, after removing the data at the earliest moment in the original input data chain, input the data chain into the model obtained in step (5) again to obtain the prediction result of the next moment; (64) Repeat step (63) until the prediction results of all moments in the target time period are obtained, and combine the results into the ship trajectory prediction result of the target time period for output.
2. The method for predicting a sea target route according to claim 1, wherein In step (1), collect the historical data of the Automatic Identification System (AIS), and extract the required features including time, longitude, latitude, speed over ground, course over ground, and MMSI.
3. The method for predicting the route of a maritime target according to claim 1, characterized in that, Step (5) is specifically as follows: On the basis of constructing a convolutional neural network, a bidirectional long short-term memory network, and an attention mechanism, combine the three models CNN, Bi-LSTM, and the attention mechanism in series; define a loss function, and use evaluation metrics including MSE, MAE, accuracy, and recall for evaluation; among them, the mean square error and root mean square error of the loss function are used to evaluate the prediction performance of the model.
4. An electronic device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, When the computer program is loaded into the processor, it implements a method for predicting the route of a maritime target according to any one of claims 1-3.
5. A storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements a method for predicting the route of a maritime target according to any one of claims 1-3.
Citation Information
Patent Citations
Offshore ship trajectory real-time prediction method, system and equipment based on CNN-GRU and attention mechanism and medium
CN116306790A
Navigation AIS data restoration method based on generative adversarial neural network
CN116758403A