Ship trajectory prediction method and system based on AIS data

By introducing cubic spline interpolation method and Savitzky-Golay filter in the Transformer model, the missing and outliers in the AIS data are processed, and combined with the sliding window attention mechanism and normalization processing, the existing methods are solved in the short ship prediction time and insufficient general use, achieving high-precision and widely applicable ship trajectory prediction.

CN119884732AActive Publication Date: 2025-04-25HUAZHONG NORMAL UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411783537.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-06
Publication Date
2025-04-25
Estimated Expiration
2044-12-06

AI Technical Summary

Technical Problem

The existing methods are difficult to ensure the accuracy and scope of application of prediction in terms of short ship prediction time and insufficient general use, especially when dealing with missing and outliers in AIS data.

Method used

A ship trajectory prediction method based on the Transformer model was designed, and data loss was filled with cubic spline interpolation, and data smoothing was performed in combination with Savitzky-Golay filter. The improved Transformer model adopts sliding window attention mechanism and normalization processing, which enhances the prediction accuracy and robustness of the model.

Benefits of technology

It improves the accuracy and scope of application of ship trajectory prediction, effectively deals with data missing and outliers, and improves the operation and safety supervision capabilities of the maritime industry.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119884732A_ABST
    Figure CN119884732A_ABST
Patent Text Reader

Abstract

The invention discloses a ship trajectory prediction method and system based on AIS data, and relates to the fields of AIS ship data, artificial intelligence and the like, aiming at the application problem of the AIS data in liner navigation. According to the method, missing data are repaired by adopting a cubic spline interpolation method, abnormal values are processed by using a Savitzky-Golay filtering algorithm, and track prediction is performed in combination with an improved Transform model, so that high-precision ship track tracking and prediction are realized, and the safety and efficiency of liner navigation are effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the fields of AIS ship data, artificial intelligence, and in particular to a ship trajectory prediction method based on AIS data. Background Art

[0002] Vessel Traffic Dervice (VTS) is an important component of maritime safety. VTS monitors the course, speed, etc. of ships, tracks ships in real time, and provides technical assistance for early warning of ship accidents by using communication equipment such as Automatic Identification System (AIS), radar, Closed Circuit Television (CCTV), wireless telephones and ship-borne terminals. The sensing and information technologies are used to assist in the collection, storage, processing and visualization of maritime traffic data. AIS is a new navigation aid system for navigation safety and ship-to-shore and ship-to-ship communications. According to the International Maritime Organization (IMO) Safety of Life at Sea Convention, ships with a displacement of more than 300 tons and all passenger ships must be equipped with the system. AIS was originally designed for ships to avoid collisions by allowing them to broadcast information about their position and other information to avoid collisions between ships.

[0003] Due to the huge amount of data received by AIS, the rich content and diverse types of data, such as providing a large amount of valuable monitoring data, including dynamic information such as longitude, latitude, speed over the ground, and course over the ground, and static information about the ship itself, such as the name and type, it provides a large amount of rich maritime ship trajectory feature data for maritime transport management and related research. Therefore, combining the characteristics of AIS data, studying ship trajectory-related issues based on deep learning algorithms is a crucial issue for improving the accuracy of ship trajectory prediction and solving navigation safety. Summary of the invention

[0004] In order to overcome the problems of short ship prediction time and insufficient versatility of existing methods, the present invention designs a Transformer model optimized for AIS time series data, aiming to improve the prediction accuracy and scope of application of the model. The present invention focuses on the practical application problems of AIS data in liner navigation, such as incomplete data and outlier processing, as well as the accuracy of track prediction. Through methods that fit the characteristics of liner navigation, such as data repair technology, track clustering analysis, and the establishment of track prediction models, the present invention aims to provide more practical solutions for daily operations and safety supervision in the maritime industry.

[0005] Affected by various factors such as AIS system equipment and data collection environment, there are often varying degrees of data missing in the original AIS data. The present invention uses cubic spline interpolation to fill and repair the missing parts in the AIS data, and combines the application of Savitzky-Golay filter to make the inserted trajectory smoother and more natural, so as to improve the effect of AIS trajectory prediction.

[0006] The object of the present invention is achieved by the following technical solution: A ship trajectory prediction method based on AIS data comprises the following steps:

[0007] Step 1: Obtain AIS ship historical positioning data set, and perform data selection and preprocessing;

[0008] Step 2, using the cubic spline method to fill the preprocessed AIS data;

[0009] Step 3, smoothing the filled data sequence;

[0010] Step 4: segment the smoothed time series data for model training;

[0011] Step 5: construct an improved transformer model, including an encoder consisting of a sliding window attention mechanism and normalization, and a decoder consisting of a sliding window attention mechanism and a fully connected layer;

[0012] The processing process of the improved transformer model is as follows: the AIS data in step 4 is input into the Embedding layer to obtain an embedded sequence, and then processed by the encoder and decoder to obtain the predicted data. The predicted loss function is designed to train the improved transformer model. At the same time, the predicted data is processed by the Embedding layer again as the next input of the decoder to sample the next position information. Through the iterative prediction process, the time series of the predicted position is generated;

[0013] Step 6: Use the trained model to predict the ship trajectory.

[0014] Furthermore, in step 1, the longitude LON, latitude LAT, speed SOG, and heading COG data in the AIS ship historical positioning data set are selected, and the data with abnormal values ​​in LON, LAT, SOG, and COG are deleted.

[0015] Furthermore, in step 2, the data of the same ship are first sorted in the order of timestamps, a cubic polynomial is constructed between two adjacent data points, and the longitude LON, latitude LAT, speed SOG, and heading COG information are respectively introduced into the formula to obtain interpolation data. The specific formula is:

[0016]

[0017] Where x represents the LON, LAT, COG or SOG data of the current calculated position, a i Represents the cubic spline interpolation polynomial S i (x) at node x i The function value at S i (x i ), b i Indicates that at node x i The first derivative at time, M i Indicates that at node x i Time i The second derivative of (x), h i Represents the distance between two adjacent endpoints.

[0018] Furthermore, the longitude sequence Lon = {lon1, lon2, ..., lon n} and the dimension sequence Lat = {lat1, lat2, ..., lat n}, and process the data in sequence. When processing the data with index i, obtain the data with indexes between iw and i+w for polynomial fitting, where w is the set window size; fit a polynomial f(x) in the window by the least squares method, and the form of the polynomial is: f(x)=a0+a1x+a2x 2 +…+a k x k , by solving the least squares problem, find the best polynomial coefficients a0, a1,…, a k ; Use the fitting polynomial f(x) to calculate the window center point x i The value f(x i ) as the smoothed data point to achieve a smoothing effect; for boundary points, the error after filtering is reduced by adding zero values ​​at the beginning or end of the data; the specific formula is as follows:

[0019] f lon =Savitzky_Golay(lon i ,w,k) (2)

[0020] f lat = Savitzky_Golay(lat i ,w,k) (3)

[0021] where f lon and f lat Represents the i-th smoothed data, lon i and lat irepresents the i-th data to be processed; w represents the i-th data that needs to be smoothed, and the data from iw to i+w need to be selected for auxiliary smoothing processing; k is the level of the polynomial.

[0022] Furthermore, in step 5, the processing of the Eembedding layer is as follows:

[0023] The longitude, latitude, speed and heading parameters in the training set data are discretized into one-hot vectors, and the one-hot vectors of longitude, latitude, speed and heading are concatenated to form a four-dimensional one-hot vector. The result is where h t Represents the four-dimensional one-hot vector encoding at time t, They represent the one-hot vectors of the longitude, latitude, speed and heading parameters at time t respectively;

[0024] The Embedding layer of the encoder is used to transform the original h t Mapped to a higher dimensional vector e t , the specific formula can be expressed as:

[0025] e t =embedding(h t ) (4)

[0026] So we get the embedded sequence e 0:t ,in

[0027] Furthermore, the processing of the sliding window attention mechanism in step 5 is as follows:

[0028] The time window size is set to w by embedding the sequence Input into the sliding window attention mechanism, the window effectively captures local dependencies and patterns. The specific formula is:

[0029]

[0030] Where t represents the current time step, which represents the time point at which the attention weight is being calculated; i represents a time step of the sliding window, specifically a time step around the current time step t, located in the window arrive within the scope of :t means from arrive The sequence between q t represents the query vector at time step t, k i represents the key vector at time step i within the window, v irepresents the value vector of time step i within the window, q t , k i 、v i By inputting feature data and W q , W k , W v By performing matrix operations, W q , W k , W v Data is generated by random initialization, and then the parameters are optimized in back propagation; sim(q t ,k i ) is the similarity function, calculated using dot product; attention weight a i Indicates the degree of attention of time step t to the data point of time step i in the window; the output y is calculated t , represents the weighted integration of data points in the local time period before and after time step t.

[0031] Furthermore, in order to avoid the gradient explosion problem during training, the processed data is normalized. The specific formula is:

[0032]

[0033] Where x represents the data after the sliding window attention mechanism extracts features, Represents the normalized data and will be continuously fed as input to the decoder for trajectory prediction.

[0034] Furthermore, the formula for the fully connected layer in the decoder is as follows:

[0035]

[0036] Where x is the feature matrix output by the sliding window attention mechanism, W is the weight matrix, which is generated by random initialization and then optimized in back propagation. Represents the predicted value at time t+l.

[0037] Furthermore, Huber Loss is used as the prediction loss function, and the specific formula is:

[0038]

[0039] in represents the true value at time t+1, δ is a hyperparameter, and the calculation formula is: δ raw is a learnable parameter; prediction result It will be re-input into the model as the next input of the decoder to sample the next position information;

[0040] Through the iterative prediction process, the model starts from the current time t and uses the results of each prediction As the input for the next prediction, the ship trajectory is continuously predicted in the next T hours. The prediction error of each step is evaluated and optimized by Huber Loss. Finally, the model generates a time series containing the predicted positions from t+1 to t+T. Represents the ship's trajectory in the next T hours.

[0041] The present invention also provides a ship trajectory prediction system based on AIS data, including a processor and a memory, the memory is used to store program instructions, and the processor is used to call the stored instructions in the memory to execute the ship trajectory prediction method based on AIS data as described in the above technical solution.

[0042] Compared with the prior art, the present invention has the following beneficial effects:

[0043] Aiming at the application problem of AIS data in liner navigation, the present invention designs a complete trajectory prediction method and system, which realizes high-precision ship trajectory tracking and prediction by using cubic spline interpolation method to repair missing data, uses Savitzky-Golay filtering algorithm to process outliers, and combines with improved Transformer model for track prediction, thus effectively improving the safety and efficiency of liner navigation. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] Figure 1 is a flow chart of the present invention;

[0045] Figure 2 This is the principle diagram of cubic spline interpolation method;

[0046] Figure 3 This is the schematic diagram of the Savitzky-Golay algorithm;

[0047] Figure 4 It is the flow chart of the AIS data trajectory prediction model;

[0048] Figure 5 This is a Transformer model diagram optimized for AIS data trajectory prediction;

[0049] Figure 6 This is a comparison chart of the effects before and after AIS data repair. DETAILED DESCRIPTION

[0050] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below with reference to the accompanying drawings.

[0051] This paper studies AIS ship data and conducts in-depth exploration and analysis on core challenges such as "scarcity of abnormal navigation pattern samples, complex sample types, and decreased information sophistication caused by increased model complexity". A high-performance and high-precision AIS data prediction model is designed and implemented, aiming to fundamentally reduce data reconstruction errors, enhance the prediction accuracy and positioning capabilities of navigation anomalies, and strive to optimize the response speed and accuracy of the early warning system. The ultimate goal of this innovative strategy is to provide a highly reliable AIS data prediction solution for modern maritime traffic management systems.

[0052] like Figure 1 As shown, the ship trajectory prediction method based on AIS data provided by an embodiment of the present invention comprises the following steps:

[0053] Step S1: In the embodiment of the present invention, we use the historical positioning data set of Hailanxin radar and AIS ships in a certain province, which contains data sequence number, ship call sign, ship's destination, heading, ship positioning latitude and other information. The data set contains more than 20,000 data, which will be used for model training. The data set only takes LON (longitude), LAT (latitude), SOG (speed), COG (heading) and other data, which can be specifically expressed as in It can be expressed as the i-th track at time t. The data with abnormal values ​​in LON, LAT, SOG, and COG (including null values, speed greater than 0 miles per hour or greater than 25 miles per hour) are deleted.

[0054] Step S2: Use the cubic spline method to fill the AIS data. Specifically, Figure 2 As shown, first sort the data of the same ship in the order of timestamps. Construct a cubic polynomial between two adjacent data points, and we bring the longitude, latitude, SOG, and COG information into the formula to obtain interpolation data. The specific formula is:

[0055]

[0056] Where x represents the longitude, latitude, SOG or COG data of the current calculated position. i Represents the cubic spline interpolation polynomial S i (x) at node x i The function value at S i (x i ), b i Indicates that at node x i The first derivative at time, M i Indicates that at node x i Time i The second derivative of (x), hi Represents the distance between two adjacent endpoints.

[0057] Step S3: In order to reduce the impact of noise in the inserted data, we use the Savitzky-Golay filtering algorithm to smooth the inserted data sequence, thereby improving the smoothness of the AIS trajectory. Specifically, Figure 3 As shown, we obtain the longitude and latitude sequence Lon = {lon1, lon2, ..., lon n} and lat={lat1,lat2,…,lat n} and process the data in sequence. When processing the data with index i, obtain the data between index iw and i+w for polynomial fitting, where w is the set window size. Fit a polynomial f(x) in the window by the least squares method. The form of the polynomial is: f(x) = a0+a1x+a2x 2 +…+a k x k , by solving the least squares problem, find the best polynomial coefficients a0, a1,…, a k . Use the fitting polynomial f(x) to calculate the window center point x i The value f(x i ) as the smoothed data point to achieve a smoothing effect. In particular, for boundary points, the error after filtering is reduced by adding zero values ​​at the beginning or end of the data. The summary formula is as follows:

[0058] f lon =Savitzky_Golay(lon i ,w,k) (2)

[0059] f lat = Savitzky_Golay(lat i ,w,k) (3)

[0060] where f lon and f lat Represents the i-th smoothed data, lon i and lat i represents the i-th data to be processed. w represents the i-th data to be smoothed, and the data from iw to i+w need to be selected for auxiliary smoothing. k is the level of the polynomial, where the smaller the k, the smaller the calculation amount, the greater the error may be. In this paper, w is fixed to 51 and k is 3. Finally, we take the data with an interval of 4 minutes to reconstruct the new AIS sequence.

[0061] Step S4: Segment the time series data after smoothing in step S3 into a training set, a validation set, and a test set, with the data accounting for 60%, 20%, and 20% respectively, to provide data support for the subsequent training of the AIS prediction module.

[0062] Step S5: The model adopts an improved transformer model, where the transformer consists of an encoder and a decoder. The encoder includes a sliding window attention mechanism and normalization, and the decoder includes a sliding window attention mechanism and a fully connected layer. Figure 4 and Figure 5 As shown in the figure, the main task of the encoder is to convert the input time series data into a high-dimensional context representation, which contains all the relevant information of the input sequence. In AIS trajectory prediction, the encoder usually processes historical data with the goal of extracting patterns and features from these data. The main task of the decoder is to gradually generate future predictions based on the context representation generated by the encoder. In time series prediction, the decoder usually generates future time steps, which can be continuous or multi-step.

[0063] In the training, the longitude, latitude, speed and heading parameters in the training set data are discretized into one-hot vectors, and these four one-hot vectors (one-hot vectors of longitude, latitude, speed and heading) are connected in series to form a four-dimensional one-hot vector. The result is where h t Represents the four-dimensional one-hot vector encoding at time t, Then they represent the one-hot vectors of the latitude and longitude, speed and heading parameters at time t. In this way, multi-dimensional continuous parameters can be effectively converted into discrete forms that can be processed by the model, thereby improving the training efficiency and prediction accuracy of the model.

[0064] First, the original h is transformed through the embedding layer t Mapped to a higher dimensional vector e t , the specific formula can be expressed as:

[0065] e t =embedding(h t ) (4)

[0066] Thus we can get the embedding sequence e 0:t ,in

[0067] Step S6: embed the sequence e 0:tThe information is passed to the sliding window attention mechanism module to capture the local AIS time series features. In order to correctly predict the trajectory of the ship, the prediction model needs to capture the possible long-term correlations in the historical AIS observations. The non-sparse attention in the original transformer formula has a self-attention component, so it cannot be efficiently extended to long time series. The present invention adopts a sliding window attention mode, which takes into account the importance of local context and uses a fixed-size window attention around each marker. By using the sliding attention mechanism, it is possible to effectively predict the trajectory of ships for a longer time.

[0068] Specifically, we set the time window size to w by embedding the sequence Input into the sliding window attention mechanism, the local dependencies and patterns within the window are effectively captured. The specific formula is:

[0069]

[0070] Where t represents the current time step, which represents the time point at which the attention weight is being calculated; i represents a time step of the sliding window, specifically a time step around the current time step t, located in the window arrive within the range of :t means from The sequence between q t represents the query vector (Query) at time step t, k i represents the key vector (Key) of time step i in the window, v i Represents the value vector (Value) of time step i in the window, q t , k i 、v i Characteristic data and W can be input through s5 q , W k , W v By performing matrix operations, W q , W k , W v Data can be generated by random initialization, and then the parameters can be optimized in back-propagation. sim(q t ,k i ) is the similarity function, which can be calculated using dot product. Attention weight a i Indicates the degree of attention of time step t to the data points of time step i in the window. i The value means that the model believes that the data point at time step i is more important for the prediction of the current time step t. After calculation, we get the output y t, represents the weighted integration of data points in the local time period before and after time step t. In this way, the model can effectively capture and utilize local features and patterns, thereby improving the accuracy and robustness of predictions.

[0071] Furthermore, in order to avoid the gradient explosion problem during training, we normalize the processed data. The specific formula is:

[0072]

[0073] Where x represents the data after the sliding window attention module extracts features, Represents the normalized data and will be continuously fed as input to the decoder for trajectory prediction.

[0074] Step S7: Input the sequence obtained by the encoder into the decoder, where the decoder also consists of a sliding window attention module and a fully connected layer. It is responsible for predicting the position information of the next time interval. The calculation of the sliding window attention mechanism is the same as formula (5) and formula (6). The fully connected formula is as follows

[0075]

[0076] Where x is the feature matrix output by the sliding window attention module, and W is the weight matrix, which can be generated by random initialization and then the parameters can be optimized in back propagation. Represents the predicted value at time t+l.

[0077] Step S8: In order to measure the difference between the model prediction value and the true value, MSE can be used as the loss function, but the ship may have noise values ​​due to the change of course during the driving process, so this patent uses Huber Loss as the prediction loss function. The specific formula is:

[0078]

[0079] in represents the true value at time t+1. δ is used to determine when to switch from square loss to linear loss. Traditionally, δ is a hyperparameter that needs to be set manually, and usually requires a lot of experiments and debugging through grid search, random search, or Bayesian optimization. In this paper, δ is used as a learnable parameter, and the model can automatically adjust the value of δ during the training process. Specifically, a learnable parameter δ is set. raw , which is converted to δ through the Softplus function. The Softplus formula is In this way, δ can gradually converge to the optimal value as training progresses, just like other model parameters, so that Huber Loss can adaptively balance the square error and absolute error, improving the robustness and prediction accuracy of the model.

[0080] Prediction results It will be re-input into the model as the next input of the decoder to sample the next position information.

[0081] Through the iterative prediction process, the model starts from the current time t and uses the results of each prediction As input for the next prediction, the ship trajectory is continuously predicted for the next 2 hours. The prediction error at each step is evaluated and optimized by Huber Loss (where δ is set to 0.5). Finally, the model generates a time series containing the predicted positions from t+1 to t+120 (predicted every 1 minute, a total of 120 time steps) Indicates the ship's trajectory in the next 2 hours.

[0082] The ship trajectory prediction effect is shown in the figure. Figure 6 The table shows the original trajectory data of the ship with MMSI number 636017435, represented by discrete points; the chart on the right shows the trajectory predicted for the next two hours using the improved Transformer model, represented by a continuous line. The overall path is smooth and continuous, indicating that the model can effectively capture and predict the movement path of the ship, thereby significantly improving the accuracy and robustness of the prediction.

[0083] On the other hand, an embodiment of the present invention also provides a ship trajectory prediction system based on AIS data, including a processor and a memory, the memory is used to store program instructions, and the processor is used to call the stored instructions in the memory to execute the ship trajectory prediction method based on AIS data as described in the above technical solution.

[0084] The specific embodiments described herein are merely examples of the spirit of the present invention. Those skilled in the art may make various modifications or additions to the specific embodiments described or replace them in similar ways, but they will not deviate from the spirit of the present invention or exceed the scope defined by the appended claims.

Claims

1. A ship trajectory prediction method based on AIS data, characterized in that: The steps include: Step 1: Obtain AIS ship historical positioning data set, and perform data selection and preprocessing; Step 2, using the cubic spline method to fill the preprocessed AIS data; Step 3, smoothing the filled data sequence; Step 4: segment the smoothed time series data for model training; Step 5: construct an improved transformer model, including an encoder consisting of a sliding window attention mechanism and normalization, and a decoder consisting of a sliding window attention mechanism and a fully connected layer; The processing process of the improved transformer model is as follows: the AIS data in step 4 is input into the Embedding layer to obtain an embedded sequence, and then processed by the encoder and decoder to obtain the predicted data. The predicted loss function is designed to train the improved transformer model. At the same time, the predicted data is processed by the Embedding layer again as the next input of the decoder to sample the next position information. Through the iterative prediction process, the time series of the predicted position is generated; Step 6: Use the trained model to predict the ship trajectory.

2. The ship trajectory prediction method based on AIS data according to claim 1, characterized in that: In step 1, the longitude LON, latitude LAT, speed SOG, and heading COG data in the AIS ship historical positioning data set are selected, and the data with abnormal values ​​in LON, LAT, SOG, and COG are deleted.

3. The ship trajectory prediction method based on AIS data according to claim 1, characterized in that: In step 2, firstly, the data of the same ship are sorted in the order of timestamps, and a cubic polynomial is constructed between two adjacent data points. The longitude LON, latitude LAT, speed SOG, and heading COG information are respectively introduced into the formula to obtain the interpolation data. The specific formula is: Where x represents the LON, LAT, COG or SOG data of the current calculated position, a i Represents the cubic spline interpolation polynomial S i (x) at node x i The function value at S i (x i ), b i Indicates that at node x i The first derivative at time, M i Indicates that at node x i Time i The second derivative of (x), h i Represents the distance between two adjacent endpoints.

4. The ship trajectory prediction method based on AIS data according to claim 1, characterized in that: Get the longitude sequence lon = {lon1, lon2, ..., lon n } and the dimension sequence Lat = {lat1, lat2, ..., lat n }, and process the data in sequence. When processing the data with index i, obtain the data with indexes between iw and i+w for polynomial fitting, where w is the set window size; fit a polynomial f(x) in the window by the least squares method, and the form of the polynomial is: f(x)=a0+a1x+a2x 2 +…+a k x k , by solving the least squares problem, find the best polynomial coefficients a0, a1,…, a k ; Use the fitting polynomial f(x) to calculate the window center point x i The value f(x i ) as the smoothed data point to achieve a smoothing effect; for boundary points, the error after filtering is reduced by adding zero values ​​at the beginning or end of the data; the specific formula is as follows: f lon =Savitzky_Golay(lon i ,w,k) (2) f lat =Savitzky_Golay(age i ,in,k) (3) where f lon and f lat Represents the i-th smoothed data, lon i and lat i Represents the data to be processed for the i-th time; w represents that for the i-th data that needs to be smoothed, data from iw to i+w need to be selected for auxiliary smoothing processing; k is the level of the polynomial.

5. The ship trajectory prediction method based on AIS data according to claim 1, characterized in that: In step 5, the processing of the Eembedding layer is as follows: The longitude, latitude, speed and heading parameters in the training set data are discretized into one-hot vectors, and the one-hot vectors of longitude, latitude, speed and heading are concatenated to form a four-dimensional one-hot vector. The result is where h t Represents the four-dimensional one-hot vector encoding at time t, They represent the one-hot vectors of the longitude, latitude, speed and heading parameters at time t respectively; The Embedding layer of the encoder is used to transform the original h t Mapped to a higher dimensional vector e t , the specific formula can be expressed as: e t =embedding(h t ) (4) So we get the embedded sequence e 0:t ,in 6. The ship trajectory prediction method based on AIS data according to claim 1, characterized in that: The processing process of the sliding window attention mechanism in step 5 is as follows: The time window size is set to w by embedding the sequence Input into the sliding window attention mechanism, the window effectively captures local dependencies and patterns. The specific formula is: Where t represents the current time step, which represents the time point at which the attention weight is being calculated; i represents a time step of the sliding window, specifically a time step around the current time step t, located in the window arrive within the scope of t means from arrive The sequence between t represents the query vector at time step t, k i represents the key vector at time step i within the window, v i represents the value vector of time step i within the window, q t , k i 、v i By inputting feature data and W q , W k , W v By performing matrix operations, W q , W k , W v Data is generated by random initialization, and then the parameters are optimized in back propagation; sim(q t ,k i ) is the similarity function, calculated using dot product; attention weight a i Indicates the degree of attention of time step t to the data point of time step i in the window; the output y is calculated t , represents the weighted integration of data points in the local time period before and after time step t.

7. The ship trajectory prediction method based on AIS data according to claim 1, characterized in that: In order to avoid the gradient explosion problem during training, the processed data is normalized. The specific formula is: Where x represents the data after the sliding window attention mechanism extracts features, Represents the normalized data and will be continuously fed as input to the decoder for trajectory prediction.

8. The ship trajectory prediction method based on AIS data according to claim 1, characterized in that: The formula for the fully connected layer in the decoder is as follows: Where x is the feature matrix output by the sliding window attention mechanism, W is the weight matrix, which is generated by random initialization and then optimized in back propagation. Represents the predicted value at time t+l.

9. The ship trajectory prediction method based on AIS data according to claim 1, characterized in that: HuberLoss is used as the prediction loss function, and the specific formula is: in represents the true value at time t+1, δ is a hyperparameter, and the calculation formula is: δ raw is a learnable parameter; prediction result It will be re-input into the model as the next input of the decoder to sample the next position information; Through the iterative prediction process, the model starts from the current time t and uses the results of each prediction As the input for the next prediction, the ship trajectory is continuously predicted in the next T hours. The prediction error of each step is evaluated and optimized by Huber Loss. Finally, the model generates a time series containing the predicted positions from t+1 to t+T. Indicates the ship's trajectory in the next T hours.

10. The ship trajectory prediction system based on AIS data is characterized by: The method comprises a processor and a memory, wherein the memory is used to store program instructions, and the processor is used to call the stored instructions in the memory to execute the ship trajectory prediction method based on AIS data as claimed in any one of claims 1 to 9.

Citation Information

Patent Citations

  • Ship track prediction method and system fusing data quality control and Transform network

    CN116541708A

  • Ship trajectory prediction method and system, computer equipment and storage medium

    CN119066373A