Ship trajectory prediction method in combination with local density map
By introducing local density maps into the ship trajectory prediction method, providing prior information on the waterway and sea traffic density, the prediction inaccurate problem caused by ignoring these factors in traditional methods is solved, and more accurate trajectory prediction is achieved.
Patent Information
- Application Number
- CN202510072967.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-17
- Publication Date
- 2025-06-06
AI Technical Summary
Traditional ship trajectory prediction methods ignore prior knowledge such as waterways and sea traffic density, resulting in inaccurate prediction results and deviation from actual waterways.
The local density map is introduced to provide a priori information on the waterway and sea traffic density for the prediction model by reflecting the areas where the ship often passes within the current local range, helping the model better learn the motion laws of the ship.
It effectively improves the accuracy of the prediction results, makes the prediction trajectory more in line with the actual maritime traffic laws, and reduces deviation from the actual trajectory.
Smart Images

Figure CN120106271A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of ship trajectory prediction, and in particular to a ship trajectory prediction method combined with a local density map. Background Art
[0002] On the high seas, ships do not sail at random, but follow specific waterways and routes, which are closely related to ocean traffic density, geographical features, and maritime traffic regulations. Therefore, ship trajectory prediction not only needs to consider the ship movement laws in historical data, but also should be combined with prior information related to waterways and traffic density. However, traditional ship trajectory prediction methods mainly rely on historical data modeling, and often ignore prior knowledge related to factors such as waterways and density distribution, resulting in inaccurate trajectory prediction and deviation from the actual waterway in practical applications.
[0003] Although existing deep learning-based trajectory prediction methods have made some progress in extracting motion features of historical trajectories, when the model lacks understanding of local channel characteristics, the prediction results often deviate from the common channel, resulting in a decrease in prediction accuracy. Summary of the invention
[0004] In view of this, the present invention proposes a ship trajectory prediction method combined with a local density map. Different from the traditional method, the present invention introduces a local density map to provide the prediction model with prior information on the waterway and maritime traffic density, guiding the model to better learn the movement law of the ship. The local density map reflects the areas that the ship often passes through within the current local range, which can effectively help the model predict a trajectory that is more in line with the actual maritime traffic law during the trajectory prediction process, thereby improving the prediction accuracy.
[0005] A ship trajectory prediction method combined with a local density map comprises the following steps:
[0006] Step 1: Processing the original AIS data, including screening valid data, eliminating redundant information, voyage segmentation, speed anomaly processing, heading anomaly processing, resampling and data standardization;
[0007] Step 2: First, divide the AIS data processed in step 1 into three data sets: training set, validation set and test set; then divide the area of interest into several grids, and select the corresponding data set according to specific needs, count the ship density in each grid, and generate a global density map of the area;
[0008] Step 3: Construct a ship trajectory prediction model: The model consists of four modules: a historical trajectory encoding module, a local density map encoding module, a fusion module and a decoding module; the historical trajectory encoding module maps the input historical trajectory data to a high-dimensional feature space, and encodes the historical trajectory through the Transformer decoder architecture to obtain a historical trajectory encoding vector; the local density map encoding module extracts the density map of the local area from the global density map, and encodes the local density map to obtain a local density map encoding; the fusion module fuses the historical trajectory encoding vector with the local density map encoding to generate a multi-source information fusion vector; the decoding module linearly transforms and samples the multi-source information fusion vector to predict the trajectory point at the next moment and complete the prediction of the ship trajectory.
[0009] Preferably, the step 1 specifically includes the following process:
[0010] (1) Filter valid data: The selected data fields include mmsi number, latitude, longitude, ground speed and ground heading. To ensure data integrity, the data is retained only when the values of all fields are not empty. If the value of any field is empty, the data is deleted.
[0011] (2) Perform deduplication operations based on the mmsi number and timestamp, and delete duplicate records with the same mmsi number and timestamp;
[0012] (3) Flight segmentation: When the time interval between two consecutive AIS messages exceeds a preset threshold, the corresponding flight is divided into two segments; the preset threshold is set to 1 hour;
[0013] (4) Speed anomaly processing: By calculating the empirical speed between two adjacent AIS track points, the abnormal data with an empirical speed exceeding 40 knots are screened out and deleted; the empirical speed is obtained by dividing the sailing distance by the time interval between two consecutive AIS track points;
[0014] (5) Abnormal heading processing: By comparing the deviation between the ground heading and the heading, the abnormal trajectory data with a difference of more than 30° is deleted;
[0015] (6) Data resampling: The AIS trajectory is converted into a series of observations with a time interval of Δt = 10 min by interpolation;
[0016] (7) Data standardization: For each AIS track point, latitude lat, longitude lon, speed over ground SOG and course over ground COG are selected as features and processed using the maximum and minimum normalization method; the normalization formula is as follows:
[0017]
[0018] Where, att∈{lat, lon, SOG, COG}, x att is the original value of the attribute att, x′ att For x att The normalized result, x att,min and x att,max They are the minimum and maximum values of the attribute att respectively.
[0019] Preferably, the specific process of extracting the historical trajectory encoding vector by the historical trajectory encoding module in step 3 is as follows:
[0020] (1) Transform the AIS trajectory points from a low-dimensional real-valued vector Mapped to a high-dimensional dense embedding vector e t , the specific steps are as follows:
[0021] (1.1) Each attribute att∈{lat, lon, SOG, COG} of the AIS trajectory point is converted into the corresponding maximum value att max and the minimum value att min Discrete into N att Each portion represents an interval of the attribute;
[0022] (1.2) The specific real value of each attribute is mapped to the corresponding interval index, that is, the interval range to which the specific real value belongs, thereby generating a corresponding one-hot vector; in this way, four attributes are respectively given four one-hot vectors, and then these one-hot vectors are concatenated into a high-dimensional four-hot vector h t :
[0023]
[0024] In the formula, is the one-hot vector of attribute att, T represents the transpose of the vector;
[0025] Next, the four-hot vector h is embedded in the t The interval index value corresponding to each attribute in is mapped to the corresponding embedding vector Finally, the embedding vectors of these four attributes are concatenated into the final embedding vector e t :
[0026]
[0027] (2) Using the Transformer decoder architecture to decode historical trajectories Encoding is performed to obtain the historical trajectory encoding vector; the Transformer decoder consists of multiple stacked layers, each layer calculates the correlation between trajectory points through the causal self-attention mechanism, and extracts nonlinear features through the feedforward neural network, and combines residual connections and layer normalization to enhance the stability of the model.
[0028] Preferably, the specific process of the local density map encoding module in step 3 obtaining the local density map encoding is as follows:
[0029] (1) Based on the predicted starting point x t The local density map is extracted from the global density map according to the longitude and latitude of the grid, and the local density map is normalized to obtain the relative density of each grid in the local range.
[0030] (2) The relative density of each grid is mapped through the embedding layer and converted into a high-dimensional vector representation, thereby obtaining the relative density encoding vector of each grid in the local range;
[0031] (3) The position code of each grid is added to the relative density code vector of the grid to obtain the final code vector of each grid; the set of final code vectors of all grids in the local range is called local density map code.
[0032] Preferably, the specific process of the fusion module in step 3 fusing the historical trajectory encoding vector with the local density map encoding is as follows:
[0033] (1) The historical trajectory encoding vector and the local density map encoding are input into the Cross-Attention submodule. The specific process of this submodule is as follows: the historical trajectory encoding vector is used to generate the query vector q, i.e., query; the final encoding vector of each grid in the local density map encoding is used to generate the corresponding key vector k, i.e., key, and value vector v, i.e., value; the correlation between the query vector q and the key vector k is calculated by dot product, and then the influence weight is obtained after normalization by the softmax layer. The weight reflects the degree of correlation between each grid and the current historical trajectory; then the value vector v of each grid in the local density map is weighted and summed according to the weight to obtain the weighted value vector; then the weighted value vector is added to the historical trajectory encoding vector to obtain the preliminary fusion vector;
[0034] (2) The obtained preliminary fusion vector is linearly transformed through the Linear layer, and the fusion features after weighted summation are mapped into feature space to convert them into high-dimensional feature representations that are suitable for subsequent networks. At the same time, nonlinear features are extracted through a feedforward neural network, and the stability of the model is enhanced by combining residual connections and layer normalization, and finally a multi-source information fusion vector is output.
[0035] Preferably, the specific process of the decoding module in step 3 predicting the trajectory point at the next moment is as follows:
[0036] (1) The multi-source information fusion vector is mapped to the four-hot vector h through a linear layer t Vectors with the same dimensions I t+1 ; Then split it into four one-hot vectors Each vector corresponds to the likelihood probability distribution of the attribute att∈{lat, lon, SOG, COG} at the next moment;
[0037] (2) Sampling based on the likelihood probability distribution of each attribute to obtain the interval index prediction value of each attribute That is, get the predicted value of the attribute at the next moment within which range;
[0038] (3) Using an approximate method, for each attribute att, the midpoint of the interval of the attribute at the next moment predicted by the model is directly used as the specific predicted real value. This "pseudo-inverse" calculation process converts the interval index prediction value of each attribute into the corresponding real-valued prediction value, and then obtains the predicted trajectory point at the next moment:
[0039] Compared with the prior art, the present invention has the following beneficial effects:
[0040] The present invention innovatively introduces a local density map to characterize the maritime traffic density and channel characteristics, and provides it as prior information to the neural network model, helping the model to better understand the movement patterns of ships, thereby effectively solving the shortcomings of traditional trajectory prediction methods in modeling local channels and maritime traffic density. Furthermore, the present invention effectively integrates the local density map into the trajectory prediction model by gridding the local density map and the model itself, which can guide the model to pay more attention to areas that are consistent with historical trajectories and actual maritime traffic patterns during the trajectory prediction process, effectively improving the accuracy of the prediction results. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] Figure 1 is a flow chart of the present invention;
[0042] Figure 2 is a network structure diagram of the present invention;
[0043] Figure 3 It is a comparison diagram of the effects of the present invention. DETAILED DESCRIPTION
[0044] In order to better understand the technical content of the present invention, specific embodiments will be provided below in conjunction with the drawings in the present invention, and the present invention will be further described in conjunction with the drawings.
[0045] like Figure 1-Figure 2 As shown, a ship trajectory prediction method combined with a local density map includes the following steps:
[0046] Step 1: Processing the original AIS data, including the following steps:
[0047] (1) Filter valid data: The selected data fields include mmsi number, latitude, longitude, ground speed and ground heading. To ensure data integrity, the data is retained only when the values of all fields are not empty. If the value of any field is empty, the data is deleted.
[0048] (2) Perform deduplication operations based on the mmsi number and timestamp, and delete duplicate records with the same mmsi number and timestamp;
[0049] (3) Flight segmentation: When the time interval between two consecutive AIS messages exceeds a preset threshold, the corresponding flight is divided into two segments; the preset threshold is set to 1 hour;
[0050] (4) Speed anomaly processing: By calculating the empirical speed between two adjacent AIS track points, the abnormal data with an empirical speed exceeding 40 knots are screened out and deleted; the empirical speed is obtained by dividing the sailing distance by the time interval between two consecutive AIS track points;
[0051] (5) Abnormal heading processing: By comparing the deviation between the ground heading and the heading, the abnormal trajectory data with a difference of more than 30° is deleted;
[0052] (6) Data resampling: The AIS trajectory is converted into a series of observations with a time interval of Δt = 10 min by interpolation;
[0053] (7) Data standardization: For each AIS track point, latitude lat, longitude lon, speed over ground SOG and course over ground COG are selected as features and processed using the maximum and minimum normalization method; the normalization formula is as follows:
[0054]
[0055] Where, att∈{lat, lon, SOG, COG}, x att is the original value of the attribute att, x′ att For x att The normalized result, x att,min and x att,max They are the minimum and maximum values of the attribute att respectively.
[0056] In this embodiment, the AIS data from August to November provided by Shanghai Maili Marine Technology Co., Ltd. is used, and the longitude and latitude range of the data is: latitude 0° to 30°, longitude 100° to 130°.
[0057] Step 2: First, divide the AIS data processed in step 1 into three data sets: training set, validation set and test set. Among them, 90% of the AIS data from August to October are used as the training set, 10% of the AIS data are used as the validation set, and the AIS data in November are used as the test set.
[0058] Then the area of interest is divided into several grids, and valid samples are selected from the training set data. The density of ships in each grid is statistically analyzed using the point density estimation method to generate a global density map of the area. It is worth noting that only ship trajectories with a track time length of ≥ 6 hours are included in the statistical scope to ensure the representativeness and effectiveness of the statistical results.
[0059] Step 3: Construct a ship trajectory prediction model: The model consists of four modules: historical trajectory encoding module, local density map encoding module, fusion module and decoding module. The specific process of each module is as follows:
[0060] 1. History trajectory encoding module: used to extract the history trajectory encoding vector. The specific process is as follows:
[0061] (1) Transform the AIS trajectory points from a low-dimensional real-valued vector Mapped to a high-dimensional dense embedding vector e t , the specific steps are as follows:
[0062] (1.1) Each attribute att∈{lat, lon, SOG, COG} of the AIS trajectory point is converted into the corresponding maximum value att max and the minimum value att min Discrete into N att Each portion represents an interval of the attribute;
[0063] (1.2) The specific real value of each attribute is mapped to the corresponding interval index, that is, the interval range to which the specific real value belongs, thereby generating a corresponding one-hot vector; in this way, four attributes are respectively given four one-hot vectors, and then these one-hot vectors are concatenated into a high-dimensional four-hot vector h t :
[0064]
[0065] In the formula, is the one-hot vector of attribute att, T represents the transpose of the vector;
[0066] Next, the four-hot vector h is embedded in the t The interval index value corresponding to each attribute in is mapped to the corresponding embedding vector Finally, the embedding vectors of these four attributes are concatenated into the final embedding vector e t :
[0067]
[0068] (2) Using the Transformer decoder architecture to decode historical trajectories Encode to obtain the historical trajectory encoding vector; Transformer decoder consists of multiple layers, each layer calculates the correlation between trajectory points through the causal self-attention mechanism, ensuring that the calculation of each time step only depends on the current and previous trajectory points, thereby maintaining the causal relationship and avoiding information leakage. At the same time, nonlinear features are extracted through feedforward neural networks, and residual connections and layer normalization are combined to enhance the stability of the model.
[0069] 2. Local density map encoding module: used to obtain local density map encoding. The specific process is as follows:
[0070] (1) Based on the predicted starting point x t The local density map is extracted from the global density map and normalized locally to obtain the relative density of each grid in the local range. t The center is the area of 25×25 grids around it, and local normalization is performed on the local area. The normalization process uses the maximum and minimum values of the density value in the local range to convert the density value of each grid into relative density through the maximum and minimum value normalization method.
[0071] (2) The relative density of each grid is mapped through the embedding layer and converted into a high-dimensional vector representation, thereby obtaining the relative density encoding vector of each grid in the local range;
[0072] (3) The position code of each grid is added to the relative density code vector of the grid to obtain the final code vector of each grid. In this embodiment, the position code is composed of the latitude code vector and the longitude code vector, which are concatenated with the relative density code vector to obtain the final code vector of each grid. The set of final code vectors of all grids in the local range is called the local density map code.
[0073] 3. Fusion module: used to fuse the historical trajectory encoding vector and the local density map encoding. The specific process is as follows:
[0074] (1) The historical trajectory encoding vector and the local density map encoding are input into the Cross-Attention submodule. The specific process of this submodule is as follows: the historical trajectory encoding vector is used to generate the query vector q, i.e., query; the final encoding vector of each grid in the local density map encoding is used to generate the corresponding key vector k, i.e., key, and value vector v, i.e., value; the correlation between the query vector q and the key vector k is calculated by dot product, and then the influence weight is obtained after normalization by the softmax layer. The weight reflects the degree of correlation between each grid and the current historical trajectory; then the value vector v of each grid in the local density map is weighted and summed according to the weight to obtain the weighted value vector. These weights indicate which grids are more important in the local range under the current historical trajectory and local density map, thereby guiding the model to focus on these important grids during the prediction process.
[0075] Then, the weighted value vector is added to the historical trajectory encoding vector to obtain a preliminary fusion vector. Through this process, the historical trajectory encoding is supplemented so that the trajectory encoding not only contains historical behavior information, but also incorporates the regional importance information revealed by the density map, so that in the future trajectory prediction process, the model can be assisted to focus on areas with high correlation with the current behavior pattern.
[0076] (2) The obtained preliminary fusion vector is linearly transformed through the Linear layer, and the fusion features after weighted summation are mapped into feature space to convert them into high-dimensional feature representations that are suitable for subsequent networks. At the same time, nonlinear features are extracted through a feedforward neural network, and the stability of the model is enhanced by combining residual connections and layer normalization, and finally a multi-source information fusion vector is output.
[0077] 4. Decoding module: used to predict the trajectory point at the next moment. The specific process is as follows:
[0078] (1) The multi-source information fusion vector is mapped to the four-hot vector h through a linear layer t Vectors with the same dimensions I t+1 ; Then split it into four one-hot vectors Each vector corresponds to the likelihood probability distribution of the attribute att∈{lat, lon, SOG, COG} at the next moment;
[0079] (2) Sampling based on the likelihood probability distribution of each attribute to obtain the interval index prediction value of each attribute That is, get the predicted value of the attribute at the next moment within which range;
[0080] (3) Using an approximate method, for each attribute att, the midpoint of the interval of the attribute at the next moment predicted by the model is directly used as the specific predicted real value. This "pseudo-inverse" calculation process converts the interval index prediction value of each attribute into the corresponding real-valued prediction value, and then obtains the predicted trajectory point at the next moment: Predicted trajectory points It is then fed back into the proposed prediction model to similarly sample a predicted position at the next time instant. This iterative process is repeated until the desired predicted trajectory length is reached.
[0081] In this embodiment, two models are designed for comparison: a density-free model and a model of the present invention. The density-free model only includes a historical trajectory encoding module and a decoding module; while the model of the present invention introduces a local density map on this basis, and adds a local density map encoding module and a fusion module.
[0082] To ensure a fair comparison, the historical trajectory encoding module and decoding module of the two models maintain the same structure and parameter settings, and are trained using the same training method and training parameters. After training, the two models are tested using the test set data. During the test, the Haversine distance is used to calculate the distance error between the predicted value and the true value. The evaluation index is the average value of the Haversine distance. The smaller the average value, the higher the accuracy of the ship trajectory prediction and the better the performance of the model. The test results are shown in the table below:
[0083] Test results of two models
[0084]
[0085] Through comparative experiments, it was verified that the prediction accuracy of the model was improved after the introduction of the local density map. Figure 3 The visualization results of the predicted trajectories of the two models for the same sample are shown. It can be seen from the figure that the predicted trajectory of the model without density map deviates from the actual trajectory, while the model of the present invention successfully reduces the degree of deviation from the actual trajectory after introducing the local density map. This shows that the model of the present invention has a certain "correction" ability after adding the local density map.
[0086] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For ordinary technicians in the relevant field, several improvements and modifications can be made to the present invention without departing from the technical principles of the present invention, and these improvements and modifications also fall within the scope of protection of the claims of the present invention.
Claims
1. A ship trajectory prediction method combined with a local density map, characterized in that: The following steps are involved: Step 1: Processing the original AIS data, including screening valid data, eliminating redundant information, voyage segmentation, speed anomaly processing, heading anomaly processing, resampling and data standardization; Step 2: First, divide the AIS data processed in step 1 into three data sets: training set, validation set and test set; then divide the area of interest into several grids, and select the corresponding data set according to specific needs, count the ship density in each grid, and generate a global density map of the area; Step 3: Construct a ship trajectory prediction model: The model consists of four modules: a historical trajectory encoding module, a local density map encoding module, a fusion module and a decoding module; the historical trajectory encoding module maps the input historical trajectory data to a high-dimensional feature space, and encodes the historical trajectory through the Transformer decoder architecture to obtain a historical trajectory encoding vector; the local density map encoding module extracts the density map of the local area from the global density map, and encodes the local density map to obtain a local density map encoding; the fusion module fuses the historical trajectory encoding vector with the local density map encoding to generate a multi-source information fusion vector; the decoding module linearly transforms and samples the multi-source information fusion vector to predict the trajectory point at the next moment and complete the prediction of the ship trajectory.
2. The ship trajectory prediction method combined with the local density map according to claim 1 is characterized in that: The step 1 specifically includes the following process: (1) Filter valid data: The selected data fields include mmsi number, latitude, longitude, ground speed and ground heading. To ensure data integrity, the data is retained only when the values of all fields are not empty. If the value of any field is empty, the data is deleted. (2) Perform deduplication operations based on the mmsi number and timestamp, and delete duplicate records with the same mmsi number and timestamp; (3) Flight segmentation: When the time interval between two consecutive AIS messages exceeds a preset threshold, the corresponding flight is divided into two segments; the preset threshold is set to 1 hour; (4) Speed anomaly processing: By calculating the empirical speed between two adjacent AIS track points, the abnormal data with an empirical speed exceeding 40 knots are screened out and deleted; the empirical speed is obtained by dividing the sailing distance by the time interval between two consecutive AIS track points; (5) Abnormal heading processing: By comparing the deviation between the ground heading and the heading, the abnormal trajectory data with a difference of more than 30° is deleted; (6) Data resampling: The AIS trajectory is converted into a series of observations with a time interval of Δt = 10 min by interpolation; (7) Data standardization: For each AIS track point, latitude lat, longitude lon, speed over ground SOG and course over ground COG are selected as features and processed using the maximum and minimum normalization method; The normalization formula is as follows: Where, att∈{lat, lon, SOG, COG}, x att is the original value of the attribute att, x′ att For x att The normalized result, x att,min and x att,max They are the minimum and maximum values of the attribute att respectively.
3. The ship trajectory prediction method combined with the local density map according to claim 2 is characterized in that: The specific process of extracting the historical trajectory encoding vector by the historical trajectory encoding module in step 3 is as follows: (1) Transform the AIS trajectory points from a low-dimensional real-valued vector Mapped to a high-dimensional dense embedding vector e t , the specific steps are as follows: (1.1) Each attribute att∈{lat, lon, SOG, COG} of the AIS trajectory point is converted into the corresponding maximum value att max and the minimum value att min Discrete into N att Each portion represents an interval of the attribute; (1.2) The specific real value of each attribute is mapped to the corresponding interval index, that is, the interval range to which the specific real value belongs, thereby generating a corresponding one-hot vector; in this way, four attributes are respectively given four one-hot vectors, and then these one-hot vectors are concatenated into a high-dimensional four-hot vector h t : In the formula, is the one-hot vector of attribute att, T represents the transpose of the vector; Next, the four-hot vector h is embedded in the t The interval index value corresponding to each attribute in is mapped to the corresponding embedding vector Finally, the embedding vectors of these four attributes are concatenated into the final embedding vector e t : (2) Using the Transformer decoder architecture to decode historical trajectories Encoding is performed to obtain the historical trajectory encoding vector; the Transformer decoder consists of multiple stacked layers, each layer calculates the correlation between trajectory points through the causal self-attention mechanism, and extracts nonlinear features through the feedforward neural network, and combines residual connections and layer normalization to enhance the stability of the model.
4. The ship trajectory prediction method combined with the local density map according to claim 3 is characterized in that: The specific process of the local density map encoding module in step 3 obtaining the local density map encoding is as follows: (1) Based on the predicted starting point x t The local density map is extracted from the global density map according to the longitude and latitude of the grid, and the local density map is normalized to obtain the relative density of each grid in the local range. (2) The relative density of each grid is mapped through the embedding layer and converted into a high-dimensional vector representation, thereby obtaining the relative density encoding vector of each grid in the local range; (3) The position code of each grid is added to the relative density code vector of the grid to obtain the final code vector of each grid; the set of final code vectors of all grids in the local range is called local density map code.
5. The ship trajectory prediction method combined with local density map according to claim 1, characterized in that: The specific process of the fusion module in step 3 fusing the historical trajectory encoding vector with the local density map encoding is as follows: (1) The historical trajectory encoding vector and the local density map encoding are input into the cross-attention mechanism submodule. The specific process of this submodule is as follows: the historical trajectory encoding vector is used to generate the query vector q, i.e., query; the final encoding vector of each grid in the local density map encoding is used to generate the corresponding key vector k, i.e., key, and value vector v, i.e., value; the correlation between the query vector q and the key vector k is calculated by dot product, and then the influence weight is obtained after normalization by the softmax layer. The weight reflects the degree of correlation between each grid and the current historical trajectory; then the value vector v of each grid in the local density map is weighted and summed according to the weight to obtain the weighted value vector; then the weighted value vector is added to the historical trajectory encoding vector to obtain the preliminary fusion vector; (2) The obtained preliminary fusion vector is linearly transformed through the Linear layer, and the fusion features after weighted summation are mapped into feature space to convert them into high-dimensional feature representations that are suitable for subsequent networks. At the same time, nonlinear features are extracted through a feedforward neural network, and the stability of the model is enhanced by combining residual connections and layer normalization, and finally a multi-source information fusion vector is output.
6. The ship trajectory prediction method combined with local density map according to claim 5, characterized in that: The specific process of the decoding module in step 3 predicting the trajectory point at the next moment is as follows: (1) The multi-source information fusion vector is mapped to the four-hot vector h through a linear layer t Vectors with the same dimensions I t+1 ; Then split it into four one-hot vectors Each vector corresponds to the likelihood probability distribution of the attribute att∈{lat, lon, SOG, COG} at the next moment; (2) Sampling based on the likelihood probability distribution of each attribute to obtain the interval index prediction value of each attribute That is, get the predicted value of the attribute at the next moment within which range; (3) Using an approximate method, for each attribute att, the midpoint of the interval of the attribute at the next moment predicted by the model is directly used as the specific predicted real value. This "pseudo-inverse" calculation process converts the interval index prediction value of each attribute into the corresponding real-valued prediction value, and then obtains the predicted trajectory point at the next moment: