AIS ship trajectory prediction method, device, equipment and medium

Through the space-time trajectory prediction model based on Transformer, the problems of complex scene adaptability and long sequence processing in ship trajectory prediction in the prior art are solved, and more accurate multi-step prediction effect is achieved and prediction accuracy is improved.

CN118886558APending Publication Date: 2024-11-01NAT UNIV OF DEFENSE TECH
View PDF 0 Cites 4 Cited by

Patent Information

Application Number
CN202410953456.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-16
Publication Date
2024-11-01

AI Technical Summary

Technical Problem

In the ship trajectory prediction, traditional machine learning and deep learning models are difficult to adapt to complex scenarios, especially RNN and LSTM models have gradient vanishing problems when processing long sequences, and the focus on trajectory sequences is short-term, making it difficult to achieve effective multi-dimensional Step prediction.

Method used

Using the Transformer-based spatiotemporal trajectory prediction model, the ship AIS trajectory time series data is sliced ​​to construct the training sample data set of input sequences and target sequences, and the Transformer model is used to train the spatiotemporal trajectory prediction model, capture the global spatiotemporal characteristics of the trajectory, and realize the Multi-step prediction.

Benefits of technology

The problem of multi-step prediction of trajectory in traditional methods is effectively solved. The effectiveness of the method is verified through training of multiple data sets and comparing new models, achieving better capture and utilization of long-term trajectory dependencies, and improving prediction accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118886558A_ABST
    Figure CN118886558A_ABST
Patent Text Reader

Abstract

The invention provides an AIS ship trajectory prediction method and device, equipment and a medium. The AIS ship trajectory prediction method comprises the steps of inputting AIS trajectory time sequence data of a ship; carrying out trajectory data slicing on the ship AIS trajectory time sequence data, and decomposing to obtain a plurality of sub-trajectory data; the sub-track data are subjected to input sequence and target sequence division, the input sequence of the sub-track data corresponds to the target sequence and serves as a training sample, and therefore a training sample data set is constructed; a spatio-temporal trajectory prediction model is constructed on the basis of a transformer; training the spatio-temporal trajectory prediction model based on the input sequence and the target sequence of the training sample to complete training of the spatio-temporal trajectory prediction model; and realizing AIS ship trajectory prediction by using the trained space-time trajectory prediction model. According to the method, the problems existing in a traditional method are effectively solved, and multi-step track prediction is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of ship trajectory prediction, and in particular to an AIS ship trajectory prediction method, device, equipment and medium. Background Art

[0002] The Automatic Identification System (AIS) is a maritime communication system that uses radio technology to transmit the position, speed, heading and other relevant information of ships in real time to improve navigation safety and monitor shipping traffic. AIS data has become the mainstream data source for ship trajectory analysis. However, due to the inherent complexity of motion trajectory data, even with the use of modern machine learning and deep learning, it is still challenging to use AIS data to predict ship trajectories.

[0003] Researchers have proposed many methods for ship trajectory prediction. The earliest ship trajectory prediction was based on dynamic modeling. These models are often based on some ideal condition assumptions and are only applicable to fixed sea areas. [6] With the development of machine learning, more and more machine learning models are used for ship trajectory prediction. However, due to its inherent simple structure, the models based on traditional machine learning are difficult to adapt to complex scenarios and cannot fully utilize the information provided by the data. In recent years, deep learning has developed rapidly, and more and more deep learning models are used for ship trajectory prediction. These models mainly include RNN, LSTM and their variants. RNN has the problem of gradient disappearance when processing long sequences. LSTM, as an improvement of RNN, solves the problem of gradient disappearance to a certain extent, but the model's focus on trajectory sequences is still short-term. Summary of the invention

[0004] In view of the technical problems existing in the prior art, the present invention proposes an AIS ship trajectory prediction method, device, equipment and medium.

[0005] In order to achieve the above technical purpose, the technical solution adopted by the present invention is:

[0006] On the one hand, the present invention provides an AIS ship trajectory prediction method, comprising:

[0007] Input the ship's AIS trajectory time series data, which contains a series of ship AIS trajectory data corresponding to continuous sampling points;

[0008] The ship AIS trajectory time series data is sliced ​​and decomposed into multiple sub-trajectory data, each of which contains the AIS trajectory time series data corresponding to n consecutive sampling points;

[0009] The ship AIS trajectory data corresponding to the first m sampling points in the sub-trajectory data are used as the input sequence of the training samples, and the ship AIS trajectory data corresponding to the remaining sampling points are used as the target sequence of the training samples to construct a training sample data set, where m < n;

[0010] A spatiotemporal trajectory prediction model was built based on transformer;

[0011] Training the spatiotemporal trajectory prediction model based on the input sequence and the target sequence of the training samples to complete the training of the spatiotemporal trajectory prediction model;

[0012] The trained spatiotemporal trajectory prediction model is used to realize AIS ship trajectory prediction.

[0013] On the other hand, an AIS ship trajectory prediction device is provided, comprising:

[0014] The first module is used to input the AIS track time series data of the ship, and the AIS track time series data of the ship includes the AIS track data of the ship corresponding to a series of continuous sampling points;

[0015] The second module is used to slice the ship AIS trajectory time series data into trajectory data and decompose them into multiple sub-trajectory data, each of which contains the AIS trajectory time series data corresponding to n consecutive sampling points;

[0016] The third module is used to take the ship AIS trajectory data corresponding to the first m sampling points in the sub-trajectory data as the input sequence of the training sample, and the ship AIS trajectory data corresponding to the remaining sampling points as the target sequence of the training sample, to construct a training sample data set, where m<n;

[0017] The fourth module is used to build a spatiotemporal trajectory prediction model based on transformer;

[0018] A fifth module is used to train the spatiotemporal trajectory prediction model based on the input sequence and target sequence of the training samples to complete the training of the spatiotemporal trajectory prediction model;

[0019] The sixth module is used to realize AIS ship trajectory prediction using the trained spatiotemporal trajectory prediction model.

[0020] On the other hand, the present invention provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the above-mentioned AIS ship trajectory prediction method when executing the computer program.

[0021] On the other hand, the present invention provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the above-mentioned AIS ship trajectory prediction method are implemented.

[0022] On the other hand, the present invention provides a computer program product, which is stored on a computer-readable storage medium and includes computer instructions, which, when executed by a processor, enable a computer device to implement the steps of the above-mentioned AIS ship trajectory prediction method.

[0023] Compared with the prior art, the technical effects of the present invention are:

[0024] The present invention effectively solves the problems existing in the traditional method and realizes multi-step trajectory prediction. Multiple data sets are used for training, and the newly proposed model is compared with the traditional method to verify the effectiveness of the method. The main work and contributions of the present invention are:

[0025] (1) Preprocess the trajectory data and divide it into sub-trajectory segments;

[0026] (2) Capturing local spatial features of trajectories based on convolutional layers;

[0027] (3) Capturing the global spatiotemporal characteristics of trajectories based on transformers;

[0028] (4) The effectiveness of the proposed method was verified by comparing it with existing methods. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the structures shown in these drawings without paying creative work.

[0030] Figure 1 A flowchart of an AIS ship trajectory prediction method provided by an embodiment;

[0031] Figure 2 Schematic diagram of trajectory data slices;

[0032] Figure 3 Schematic diagram of the division of input sequence and target sequence.

[0033] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0034] In order to make the purpose, technical scheme and advantages of the embodiments of the present invention more clearly understood, the following will be used to clearly illustrate the spirit of the content disclosed by the present invention with the accompanying drawings and detailed descriptions. After understanding the embodiments of the content of the present invention, any person skilled in the art can change and modify the technology taught by the content of the present invention without departing from the spirit and scope of the content of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention, but are not intended to limit the present invention.

[0035] One embodiment, referring to Figure 1 , providing an AIS ship trajectory prediction method, comprising:

[0036] S1. Input the AIS track time series data of the ship;

[0037] The ship's AIS trajectory time series data includes a series of ship AIS trajectory data corresponding to continuous sampling points.

[0038] S2. Slice the ship AIS trajectory time series data into trajectory data and decompose them into multiple sub-trajectory data;

[0039] S3. Divide each sub-trajectory data into an input sequence and a target sequence respectively, and the input sequence of each sub-trajectory data corresponds to the target sequence as a training sample, thereby constructing a training sample data set;

[0040] S4. A spatiotemporal trajectory prediction model was constructed based on transformer;

[0041] S5. Training the spatiotemporal trajectory prediction model based on the input sequence and target sequence of the training samples to complete the training of the spatiotemporal trajectory prediction model;

[0042] S6. Use the trained spatiotemporal trajectory prediction model to realize AIS ship trajectory prediction.

[0043] The AIS trajectory time series data of the ship described in the present invention includes but is not limited to sampling time, longitude and latitude coordinates, speed, and heading; the AIS trajectory data of the ship is represented by a time series T (t0, t1, t2, ..., t n ), T represents the AIS track data of a ship, and each track point is represented by t i Indicates that t i :(x,lon,lat,sog,cog), x represents the trajectory point t i The sampling time, lon represents the longitude coordinate of the ship on the ocean, lat represents the latitude coordinate of the ship on the ocean, sog represents the current speed of the ship, and cog represents the current heading of the ship.

[0044] For the trajectory points with missing data in the ship's AIS trajectory time series data, the linear interpolation method is used to supplement the missing trajectory points to obtain the final ship's AIS trajectory time series data.

[0045] The present invention uses a sliding pane method to slice the AIS trajectory time series data of the ship to decompose it into multiple sub-trajectory data, where the sub-trajectory data is the AIS trajectory time series data corresponding to the sub-trajectory, such as Figure 2 As shown in the figure, it is a schematic diagram of trajectory data slicing. The ship AIS trajectory time series data is sliced ​​and decomposed into multiple sub-trajectory data. Each sub-trajectory data is divided into the input sequence Input and the target sequence Targe. Figure 3 As shown in the figure, it is a schematic diagram of the division of input sequence and target sequence. Assume that each sub-trajectory data contains AIS trajectory time series data corresponding to n consecutive sampling points. The ship AIS trajectory data corresponding to the first m sampling points in the sub-trajectory data are used as the input sequence of training samples, and the ship AIS trajectory data corresponding to the remaining sampling points are used as the target sequence of training samples to construct a training sample data set, where m<n.

[0046] In the process of training the spatiotemporal trajectory prediction model: the input sequence of the training sample is input into the spatiotemporal trajectory prediction model, the input sequence is first position-encoded, the local spatial features are extracted by the convolution layer, and then the global features are extracted by the Transformer encoder, and then the sequence is input into the Transformer decoder to generate a prediction sequence, the loss function of the prediction sequence and the target sequence is solved, and the model parameters are adjusted using the Adam optimizer until the loss function reaches the threshold and then the model parameters are output to obtain a trained spatiotemporal trajectory prediction model.

[0047] In the spatiotemporal trajectory prediction model, the input sequence is positionally encoded. Position encoding is achieved by combining position information with word embedding. The position-encoded vector is composed of a basis combination of sine and cosine functions. Suppose the length of the input sequence is d, then the index of the input sequence is 1-d. Suppose there are f feature data contained in each sampling point, then the size of the input matrix is ​​d*f. A new m*f position matrix is ​​constructed. The elements of the odd and even rows of the position matrix are calculated as follows:

[0048] The index of the odd row is 2i+1, and the corresponding element P(pos,2i+1)=cos(pos / 10000 2i / d )

[0049] The index of the even row is 2i, and the corresponding element P(pos,2i)=sin(pos / 10000 2i / d )

[0050] The elements of each column of the position matrix are the same. The new matrix obtained by adding the position matrix to the input matrix embeds the position information, completing the position encoding of the input sequence, where: d represents the length of the input sequence, 2i represents the even index of the sequence, and 2i+1 represents the odd index.

[0051] For example, if the input sequence length d is 20, the sequence index is 1-20, such as t i :The four feature data in (x, lon, lat, sog, cog) are lon, lat, sog, cog, that is, there are 4 features, then the input matrix is ​​20*4, and a new 20*4 position matrix is ​​constructed. The elements of the odd and even rows of the position matrix are calculated according to the above formula respectively. The elements of each column of the position matrix are the same. Finally, the obtained position matrix is ​​added to the input matrix to obtain a new matrix with embedded position information.

[0052] In the spatiotemporal trajectory prediction model, both the Transformer encoder and the Transformer decoder include multi-head attention modules. The Transformer multi-head attention mechanism can pay attention to all positions in the input sequence and weight them according to the importance of different positions. This mechanism enables the model to better capture the long-distance dependencies in the sequence and effectively predict long trajectories. The multi-head attention mechanism consists of multiple scaled dot-product attention (Scaled Dot-ProductAttention) taps At n Stitched together.

[0053] MultiHead(Q,K,V)=Concat(At1,At2,At3,At4…At n )

[0054] Each scaled dot product attention tap contains three matrices Q, K, and V. The Q, K, and V matrices are obtained by linearly transforming the input sequence by performing Query, Key, and Value linear transformations respectively, and are used to calculate the attention weights.

[0055] Specifically, for each element in the input sequence, it is converted into Query, Key, and Value vectors through three independent linear transformations. The attention weights can be obtained by performing the following operations on the Q, K, and V matrices.

[0056]

[0057] In this way, the attention weight can calculate the influence of the vector at the key position on the target Q, and scale the result by dividing it by the square root of d to eliminate the influence of the matrix size.

[0058] Specifically, in the spatiotemporal trajectory prediction model, the input sequence is first mapped to a high-dimensional vector space through an embedding layer, and the input sequence is positionally encoded. Position encoding is used to retain the position information of the input sequence, and an embedded vector with position encoding is obtained. Position encoding is achieved by combining position information with word embedding. The position encoding vector is composed of a basis combination of sine and cosine functions. The position encoding method has been described in detail in the previous article and will not be repeated here.

[0059] The position-encoded embedding vector is fed into the Transformer encoder, where: The position-encoded embedding vector is fed into the multi-head self-attention layer. In the multi-head self-attention layer, the query, key, and value vectors are first calculated: where (Q, K, V) is a trainable weight matrix. Then, the attention weights are calculated by dot product. The multi-head mechanism captures different relationships through multiple independent attention calculations. The output of each head is concatenated and then passed through a linear layer to obtain the final self-attention output. The output of the multi-head self-attention layer enters the feedforward neural network layer for nonlinear transformation. The feedforward neural network layer consists of two linear transformations and a ReLU activation function. After each sublayer, layer normalization and residual connection are added to stabilize the training process and promote gradient propagation. The final generated output representation sequence contains the contextual information of the input sequence.

[0060] The operation of the Transformer decoder is similar to that of the Transformer encoder, but a mask mechanism is added to ensure that each position can only see the previous output. Then, through the Transformer encoder-Transformer decoder attention layer, the output of the Transformer encoder is used as the key and value, and the output of the Transformer decoder is used as the query for attention calculation. Finally, the output size is adjusted through the linear layer.

[0061] In general, the input sequence undergoes operations such as embedding, position encoding, self-attention, feedforward neural network, layer normalization, and residual connection, gradually extracting and fusing contextual information, and finally generating an output sequence through the Transformer decoder.

[0062] The present invention can adopt the following evaluation indicators: MSE (Mean Squared Error) RMSE (Root Mean Square Error) and MAE (Mean Absolute Error) to construct a loss function.

[0063]

[0064] Without loss of generality, one embodiment uses cross entropy as the loss function, as follows:

[0065]

[0066] Where n is the total number of training samples, t i is the target sequence corresponding to the input sequence in the i-th training sample, p i is the predicted sequence of model output corresponding to the input sequence in the i-th training sample.

[0067] However, the above indicators only measure the accuracy of the prediction results on the distance scale, such as Figure 3 In , the mean square errors of the two predicted trajectories are similar, but this does not mean that the two predicted trajectories have the same effect. Obviously, only using the mean square error will ignore some key direction information.

[0068] In the task of ship trajectory prediction, direction and distance are both important factors. Therefore, in a preferred embodiment, a new loss function is designed to more accurately measure the accuracy of the prediction in direction and distance. The loss function T_loss is as follows:

[0069]

[0070] Among them, λ is the preset coefficient, λ is less than 1, n is the total number of training samples, t i is the target sequence corresponding to the input sequence in the i-th training sample, p i is the predicted sequence of the model output corresponding to the input sequence in the i-th training sample, cosθ is used to measure the accuracy of the prediction results in the direction.

[0071] Compared with traditional RNN and LSTM models, the present invention shows better performance and smaller trajectory prediction error. This is because the spatiotemporal trajectory prediction model trained by the present invention can better capture and utilize the long-term dependencies of the trajectory. Under good weather conditions, within the maximum visibility range (i.e., 10 nautical miles), the time range maintained by the given model is equivalent to that of TrAISformer, and the prediction accuracy of the spatiotemporal trajectory prediction model is higher than that of TrAISformer in a short period of time. This is because the TrAISformer model models trajectory prediction as a classification problem, which brings about quantization errors. The present invention further designs a new loss function that can more accurately measure the accuracy of the prediction in direction and distance, so that the trained model can have a better prediction effect, and the predicted trajectory can better follow the actual trajectory.

[0072] In one embodiment, an AIS ship trajectory prediction device is provided, comprising:

[0073] The first module is used to input the AIS track time series data of the ship, and the AIS track time series data of the ship includes the AIS track data of the ship corresponding to a series of continuous sampling points;

[0074] The second module is used to slice the ship AIS trajectory time series data into trajectory data and decompose them into multiple sub-trajectory data, each of which contains the AIS trajectory time series data corresponding to n consecutive sampling points;

[0075] The third module is used to take the ship AIS trajectory data corresponding to the first m sampling points in the sub-trajectory data as the input sequence of the training sample, and the ship AIS trajectory data corresponding to the remaining sampling points as the target sequence of the training sample, to construct a training sample data set, where m<n;

[0076] The fourth module is used to build a spatiotemporal trajectory prediction model based on transformer;

[0077] A fifth module is used to train the spatiotemporal trajectory prediction model based on the input sequence and target sequence of the training samples to complete the training of the spatiotemporal trajectory prediction model;

[0078] The sixth module is used to realize AIS ship trajectory prediction using the trained spatiotemporal trajectory prediction model.

[0079] The implementation methods of the above modules and the construction of the model can adopt the methods described in any of the above embodiments, which will not be repeated here.

[0080] On the other hand, the present invention provides a computer device, including a memory and a processor, the memory storing a computer program, and the processor implementing the steps of the AIS ship trajectory prediction method provided in any of the above embodiments when executing the computer program. The computer device may be a server. The computer device includes a processor, a memory, a network interface, and a database connected via a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store sample data. The network interface of the computer device is used to communicate with an external terminal via a network connection.

[0081] On the other hand, the present invention provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the AIS ship trajectory prediction method provided in any of the above embodiments are implemented.

[0082] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0083] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0084] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention. It should be pointed out that, for a person of ordinary skill in the art, several modifications and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. AIS ship trajectory prediction method, It is characterized in that include: Input the ship's AIS trajectory time series data, which contains a series of ship AIS trajectory data corresponding to continuous sampling points; The ship AIS trajectory time series data is sliced ​​and decomposed into multiple sub-trajectory data, each of which contains the AIS trajectory time series data corresponding to n consecutive sampling points; The ship AIS trajectory data corresponding to the first m sampling points in the sub-trajectory data are used as the input sequence of the training samples, and the ship AIS trajectory data corresponding to the remaining sampling points are used as the target sequence of the training samples to construct a training sample data set, where m < n; A spatiotemporal trajectory prediction model was built based on transformer; Training the spatiotemporal trajectory prediction model based on the input sequence and the target sequence of the training samples to complete the training of the spatiotemporal trajectory prediction model; The trained spatiotemporal trajectory prediction model is used to realize AIS ship trajectory prediction.

2. The AIS ship trajectory prediction method according to claim 1, It is characterized in that The AIS trajectory time series data of the ship includes sampling time, longitude and latitude coordinates, speed, and heading. The AIS trajectory data of the ship is expressed in time series T(t 0 ,t 1 ,t 2 ,…,t n ), T represents the AIS track data of a ship, and each track point is represented by t i Indicates that t i :(x,lon,lat,sog,cog), x represents the trajectory point t i The sampling time, lon represents the longitude coordinate of the ship on the ocean, lat represents the latitude coordinate of the ship on the ocean, sog represents the current speed of the ship, and cog represents the current heading of the ship.

3. The AIS ship trajectory prediction method according to claim 2, It is characterized in that For the track points with missing data in the ship's AIS track time series data, the linear interpolation method is used to supplement the missing track points to obtain the final ship's AIS track time series data.

4. The AIS ship trajectory prediction method according to claim 2 or 3, It is characterized in that The sliding pane method is used to slice the AIS trajectory time series data of the ship and decompose it into multiple sub-trajectory data. The sub-trajectory data is the AIS trajectory time series data corresponding to the sub-trajectory.

5. The AIS ship trajectory prediction method according to claim 4, It is characterized in that The input sequence of the training sample is input into the spatiotemporal trajectory prediction model. The input sequence is first position-encoded, and the local spatial features are extracted by the convolution layer. The global features are then extracted by the Transformer encoder. The sequence is then input into the Transformer decoder to generate a prediction sequence. The loss function of the prediction sequence and the target sequence is solved. The model parameters are adjusted using the Adam optimizer until the loss function reaches the threshold and then the model parameters are output to obtain a trained spatiotemporal trajectory prediction model.

6. The AIS ship trajectory prediction method according to claim 5, It is characterized in that Position encoding is performed on the time series corresponding to the sub-trajectory. Position encoding is achieved by combining position information with word embedding. The position encoding vector is composed of the basis combination of sine and cosine functions, including: assuming that the input sequence length is d, then the index of the input sequence is 1-d, assuming that each sampling point contains f feature data, then the size of the input matrix is ​​d*f, and a new m*f position matrix is ​​constructed. The elements of the odd and even rows of the position matrix are calculated as follows: The index of the odd row is 2i+1, and the corresponding element P(pos,2i+1)=cos(pos / 10000 2i / d ) The index of the even row is 2i, and the corresponding element P(pos,2i)=sin(pos / 10000 2i / d ) The elements of each column of the position matrix are the same. The new matrix obtained by adding the obtained position matrix to the input matrix embeds the position information, completing the position encoding of the input sequence.

7. The AIS ship trajectory prediction method according to claim 5, It is characterized in that The loss function T_loss is as follows: Among them, λ is the preset coefficient, λ is less than 1, n is the total number of training samples, t i is the target sequence corresponding to the input sequence in the i-th training sample, p i is the predicted sequence of the model output corresponding to the input sequence in the i-th training sample, cosθ is used to measure the accuracy of the prediction results in the direction. 8.AIS ship trajectory prediction device, It is characterized in that include: The first module is used to input the AIS track time series data of the ship, and the AIS track time series data of the ship includes the AIS track data of the ship corresponding to a series of continuous sampling points; The second module is used to slice the ship AIS trajectory time series data into trajectory data and decompose them into multiple sub-trajectory data, each of which contains the AIS trajectory time series data corresponding to n consecutive sampling points; The third module is used to take the ship AIS trajectory data corresponding to the first m sampling points in the sub-trajectory data as the input sequence of the training sample, and the ship AIS trajectory data corresponding to the remaining sampling points as the target sequence of the training sample, to construct a training sample data set, where m<n; The fourth module is used to build a spatiotemporal trajectory prediction model based on transformer; A fifth module is used to train the spatiotemporal trajectory prediction model based on the input sequence and target sequence of the training samples to complete the training of the spatiotemporal trajectory prediction model; The sixth module is used to realize AIS ship trajectory prediction using the trained spatiotemporal trajectory prediction model.

9. A computer device comprising a memory and a processor, the memory storing a computer program, It is characterized in that When the processor executes the computer program, the steps of the AIS ship trajectory prediction method as claimed in claim 1 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the steps of the AIS ship trajectory prediction method as claimed in claim 1 are implemented.

Citation Information

Cited By

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

    CN119066373A

  • Video track positioning method and device, computer equipment and storage medium

    CN119180936A

  • Spacecraft orbit forecasting method based on improved transform network model

    CN120541421A

  • A spacecraft orbit prediction method based on an improved transformer network model

    CN120541421B