A shipping AIS data repairing method based on a generative adversarial neural network

By combining generative adversarial neural networks with temporal convolutional networks and self-attention mechanisms, the problem of incomplete data in shipping AIS data repair was solved, achieving high-quality data repair and ship navigation safety.

CN116758403BActive Publication Date: 2025-12-30NANJING UNIV OF SCI & TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310229089.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-10
Publication Date
2025-12-30
Estimated Expiration
2043-03-10

AI Technical Summary

Technical Problem

Existing shipping AIS data repair methods fail to effectively consider the interdependencies between data, and statistical machine learning-based models impose strong constraints on the data, resulting in incomplete or erroneous data repair, which affects the safety of ship navigation.

Method used

A generative adversarial neural network (GAN) is constructed by combining a temporal convolutional network, a bidirectional long short-term memory network, and a self-attention mechanism. By training the generator and discriminator, the GAN is used to repair ship data, and the repair results are further repaired to improve data quality.

Benefits of technology

It enables precise restoration of shipping AIS data, improves data integrity and accuracy, and ensures the safety and quality of ship navigation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116758403B_ABST
    Figure CN116758403B_ABST
Patent Text Reader

Abstract

The application discloses a shipping AIS data repairing method based on a generative adversarial neural network, according to ship historical data, classifies ships with different trajectories, converts the classified trajectory data into data sequences with fixed time steps, and constructs a missing data mask matrix accordingly; an autoencoder integrating a time domain convolution network, a bidirectional long short-term memory network and a self-attention mechanism is used as a generator, a bidirectional long short-term memory network is used as a discriminator, and a generative adversarial neural network is constructed; the generative adversarial neural network is trained by using the data sequences with fixed time steps and the mask matrix, and a data repairing model for repairing ship data is obtained; the data repairing model is used to repair ship data with missing values, and the repaired ship data is classified, unitarily repaired and synthesized, so that secondary repairing of ship trajectories is realized. The application can capture deep features of ship data, and improves the accuracy of ship data repairing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to ship data restoration technology, and in particular to a shipping AIS data restoration method based on generative adversarial neural networks. Background Technology

[0002] To ensure safe navigation, ships need accurate dynamic and static information about other vessels in their surrounding waters. AIS (Automatic Information System) has provided crucial safety assurance for the maritime transport industry. However, AIS data still has its significant drawbacks. First, data transmission may be lost to some extent due to environmental interference and even severe weather. Second, data transmission between AIS devices requires finding available time slots; in areas with high AIS device density, network overload or communication line congestion may occur, leading to data loss. Incomplete data can result in incorrect risk assessments. Therefore, finding a suitable restoration model to improve the quality of historical AIS data is of great importance for ship navigation safety.

[0003] Traditional data repair methods often have limitations. For example, statistical analysis-based methods often fail to consider the interdependencies between data, and statistical machine learning models impose strong constraints on the data.

[0004] Liang et al. proposed a two-step method for ship trajectory reconstruction. First, they introduced a random forest method to automatically identify missing position records in the ship's trajectory. Second, they used LSTM to reconstruct the ship's trajectory with missing AIS data. Zhang et al. proposed a three-step method for ship trajectory reconstruction using AIS data, which allows for trajectory reconstruction under different navigation states (i.e., docked, maneuvering, and constant speed). Li et al. proposed a trajectory reconstruction method based on U-Net. The advantage of this method is that it utilizes historical information for trajectory reconstruction and has strong robustness to low-quality trajectories. Summary of the Invention

[0005] The purpose of this invention is to propose a shipping AIS data repair method based on generative adversarial neural networks.

[0006] The technical solution for achieving the objective of this invention is: a shipping AIS data repair method based on generative adversarial neural networks, the method comprising the following steps:

[0007] Step 1: For shipping in inland waterways or open waters, obtain historical navigation data of vessels through the Automatic Identification System (AIS);

[0008] Step 2: Based on historical ship data, classify ships with different trajectories, convert the classified trajectory data into a data sequence with a fixed time step, and construct a missing data mask matrix accordingly.

[0009] Step 3: Using an autoencoder that integrates a temporal convolutional network, a bidirectional long short-term memory network, and a self-attention mechanism as the generator, and a bidirectional long short-term memory network as the discriminator, a generative adversarial neural network is constructed.

[0010] Step 4: Train a generative adversarial neural network using a data sequence with a fixed time step and a mask matrix to obtain a data restoration model for repairing ship data;

[0011] Step 5: Use the data repair model to repair ship data with missing values, and then distinguish, perform secondary repair and synthesis of the repaired ship data to achieve secondary repair of ship trajectories.

[0012] Further, in step 1, for shipping in inland waterways or open waters, historical navigation data of vessels is obtained through the Automatic Identification System (AIS), including vessel data such as longitude, latitude, speed, and heading angle.

[0013] Further, in step 2, the classified trajectory data is converted into a data sequence with a fixed time step of 1 minute.

[0014] Further, in step 2, a missing data mask matrix is ​​constructed, the specific process of which is as follows:

[0015] (1) Construct a ship data matrix;

[0016] In the ship data matrix, the i-th row and j-th column represents the j-th feature at the i-th time point in a ship's trajectory, and the feature includes longitude, latitude, speed, and heading angle;

[0017] (2) Construct a mask matrix for missing data;

[0018] The missing data mask matrix has the same dimension as the ship data matrix and is used to represent the missing data of the ship. If the data of a certain moment in the ship data is missing, the corresponding position of the mask matrix is ​​set to 0, otherwise it is set to 1.

[0019] Furthermore, in step 3, an autoencoder that integrates a temporal convolutional network, a bidirectional long short-term memory network, and a self-attention mechanism is used as the generator, and a bidirectional long short-term memory network is used as the discriminator. The specific computation process is as follows:

[0020] e f1 =TCN gen (X,z,m)

[0021] e f2 =BiLSTMgen_enc (e f1 ,z,m)

[0022]

[0023]

[0024]

[0025] p = BiLTM dis_dec (y)

[0026] In the formula, m is the mask matrix, representing the missing positions in the data; X is the ship data; and z is the noise data; e f1 For Temporal Convolutional Networks (TCN) gen The features extracted once, e f2 BiLSTM encoding network for generators gen_enc Features extracted in the second stage; e f1 and e f2 Connecting features using residual structures can prevent feature degradation and input the self-attention mechanism. gen The feature is used to emphasize the importance and relevance of the data information of the current trajectory point in the entire ship trajectory. It is a fused feature output by the self-attention mechanism and is input into the generator decoding network BiLSTM. gen_dec Finally, the reconstructed generated data is obtained. y is the discriminator-encoded network BiLSTM dis_enc The resulting hidden vector is used as input to the discriminator decoding network BiLSTM. dis_dec The discriminator's evaluation score p for the input data is obtained.

[0027] Furthermore, in step 4, a generative adversarial neural network is trained using a data sequence with a fixed time step and a mask matrix to obtain a data restoration model for repairing ship data. The specific training process is as follows:

[0028] Step 4-1, set the generator's loss function as follows:

[0029]

[0030] in,

[0031]

[0032] In the formula, m is the mask matrix, X is the ship data, and z is the noise; This indicates element-wise multiplication of matrices; X' represents historical data for known positions in the ship data; X” represents generated data for missing positions in the ship data; This refers to the repaired data after the ship data has been repaired; G is the generator. The absolute average error between the historical data of the missing positions in the ship data matrix and the repair data generated by the corresponding position generator represents the reconstruction loss of the repair data. This indicates the discriminator's evaluation score for the repaired data;

[0033] Step 4-2, set the loss function of the discriminator as follows:

[0034]

[0035] In the formula, D is the discriminator. This refers to the restored data after the ship data has been repaired. This indicates the score by which the discriminator evaluates the true data in the ship's data; This indicates the score the discriminator gives to the repair data in the ship's data.

[0036] Step 4-3: Train the generator by inputting the ship data and the constructed mask matrix into the generator to obtain the reconstructed generated data;

[0037] Step 4-4: Train the discriminator. Define ship data as positive samples and repaired data as negative samples. Use the positive and negative samples as inputs to the discriminator to evaluate the score of ship data repair.

[0038] Steps 4-5 repeat steps 4-3 and 4-4 to allow the generator and discriminator to compete and optimize each other until the repair accuracy reaches the preset threshold.

[0039] Furthermore, in step 5, the data repair model is used to repair ship data with missing values. The repaired ship data is then differentiated, undergoes secondary unit repair, and synthesized to achieve secondary repair of ship trajectories. The specific method is as follows:

[0040] Step 5-1: For the trajectory repaired by the data repair model, the complete trajectory is decomposed into several atomic trajectories with equal time steps. The distance between trajectory points at three adjacent time steps is calculated using the ship's latitude and longitude. The turning angle of the ship at adjacent time steps is then calculated. The atomic trajectories are distinguished based on the turning angle.

[0041]

[0042] cos t =cos(d t-1,t ,d t,t+1 ,d t-1,t+1 )

[0043] In the formula, d t-1,t ,d t,t+1 ,d t-1,t+1Let be the distance between trajectory points at every two time points t-1, t, and t+1; Represents the longitude and latitude of the i-th trajectory at time t; cos is a function for calculating the cosine angle between two adjacent sides. t The cosine value of the ship's trajectory point at time t is used to determine whether the ship has turned at time t by the angle formed by the ship's trajectory point at time t and the ship's trajectory points at two adjacent times.

[0044] Step 5-2: For the data points that fall within the straight-line trajectory, SG filtering is used to smooth the trajectory points. The processing formula is as follows:

[0045]

[0046] In the formula, h represents the trajectory smoothing result of the j-th feature of the i-th trajectory at time t; i is the correlation coefficient when filtering the w-th trajectory point, N is the number of convolutions; it is obtained from the least squares fitting polynomial; w is the range of values ​​for the sliding window, and the window size is 2m+1;

[0047] Step 5-3: For the data points to be repaired that fall within the curve trajectory, cubic exponential smoothing is applied. The specific calculation process is as follows:

[0048]

[0049] In the formula, Let a be the first, second, and third exponential smoothed values ​​at time t. t ,b t ,c t The coefficients of the cubic exponential smoothing function are determined by a weighted average of the results of the three exponential smoothing operations. T represents a future time, and y... t+T This represents the smoothed value at T time points after the current time, where 'a' is the smoothing coefficient, reflecting the proportion of historical data from different periods in the exponential smoothing.

[0050] Step 5-4: For inflection points where straight lines and curves intersect, to ensure smooth repair points, SG filtering and cubic exponential smoothing are applied respectively, and the average value is used to replace the original repair value. The specific calculation process is as follows:

[0051]

[0052]

[0053]

[0054] In the formula, SG represents SG filtering; w represents the sliding window size; k represents the degree of polynomial fitting; and p ijThis indicates model data repair; exp3_smooth represents cubic exponential smoothing, where 'a' is the smoothing coefficient. For the j-th feature of the i-th trajectory at time t, the SG smoothing result and the cubic exponential smoothing result are given. This indicates the final smoothed result of the inflection point at the intersection;

[0055] Step 5-5: For the ship repair data after secondary repair, firstly, the trajectory data of the same ship is extracted and classified by MMSI number, and then the ship trajectory is re-synthesized according to the time of each data point.

[0056] A shipping AIS data repair system based on generative adversarial neural networks is disclosed, which realizes shipping AIS data repair based on the aforementioned shipping AIS data repair method.

[0057] A computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it performs shipping AIS data repair based on the aforementioned shipping AIS data repair method based on a generative adversarial neural network.

[0058] A computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, shipping AIS data repair is performed based on the aforementioned shipping AIS data repair method based on a generative adversarial neural network.

[0059] Compared with existing technologies, the significant advantages of this invention are as follows: 1) It utilizes temporal convolutional networks and bidirectional long short-term memory networks to deeply extract AIS data features, and adds a self-attention mechanism to effectively emphasize the importance and correlation of the current trajectory point's data information in the entire ship trajectory, achieving the purpose of accurate repair; 2) It uses a GAN structure to force the generator to generate a complete sample that is closest to the historical data sample, thereby repairing the ship navigation data and improving the quality of data repair; 3) The method of this invention can effectively solve the problems of incomplete and erroneous shipping AIS data; 4) For trajectory points with unsatisfactory model repair results, it calculates the corners of the ship's trajectory points at adjacent times using the ship's latitude and longitude, designs methods for secondary repair of trajectory points with different corners, and finally obtains data points of the same ship through MMSI number and reorders and combines them according to time order to synthesize the trajectory. Attached Figure Description

[0060] Figure 1 This is a flowchart of AIS data repair based on generative adversarial neural networks.

[0061] Figure 2 This is a schematic diagram of a temporal convolutional network.

[0062] Figure 3 This is a diagram of a bidirectional long short-term memory network structure.

[0063] Figure 4 This is a diagram of the generator and discriminator structures.

[0064] Figure 5 This is a schematic diagram illustrating the repair of the curved portion using the model of the present invention.

[0065] Figure 6 This is a schematic diagram illustrating the repair of curve portions using several other data repair models.

[0066] Figure 7 The images show a comparison of the results after the second repair. Detailed Implementation

[0067] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0068] Combination Figure 1 A shipping AIS data repair method based on generative adversarial neural networks, the method comprising the following steps:

[0069] Step 1: For shipping in inland waterways or open waters, obtain historical ship navigation data through the Automatic Identification System (AIS). The historical ship navigation data includes longitude, latitude, speed, and heading angle.

[0070] Step 2: Classify ships with different trajectories and convert the classified trajectory data into a data sequence with a fixed time step. In some embodiments, the fixed step is 1 minute.

[0071] Step 3: For the aforementioned data sequence, construct a missing data mask matrix. The specific process is as follows:

[0072] Step 3-1: Construct a ship data matrix. The i-th row and j-th column of the matrix represents the j-th feature at the i-th time point in a certain ship trajectory, specifically including longitude, latitude, speed, and heading angle.

[0073] Step 3-2: Construct a mask matrix. The dimensions of this matrix are the same as those of the ship data matrix. It is used to represent the missing data of the ship. If the data of a certain moment in the ship data is missing, the corresponding position of the mask matrix is ​​set to 0; otherwise, it is set to 1.

[0074] Step 4: Using an autoencoder that integrates a temporal convolutional network, a bidirectional long short-term memory network, and a self-attention mechanism as the generator, and a bidirectional long short-term memory network as the discriminator, a generative adversarial neural network is constructed.

[0075] Combination Figure 4 (a) The generator includes a temporal convolutional network, a bidirectional long short-term memory network, and a self-attention mechanism;

[0076] The Temporal Convolutional Network (TCN), combined with Figure 2 Considering that a single TCN might overlook information about data points after the current time step, thus limiting feature extraction of the ship's navigation trajectory, this invention employs a bidirectional temporal convolutional network to extract features from the ship data in both forward and backward directions, and fuses the feature information from both directions. The specific calculation process is as follows:

[0077]

[0078]

[0079]

[0080] In the formula, P c N c Forward and backward features extracted for TCN; Let H1 represent the trajectory point at time t of the i-th trajectory, and H1 be the result after feature linear fusion.

[0081] Combination Figure 3 The bidirectional long short-term memory network can perform secondary extraction on the features extracted by the TCN to deeply extract the features of the ship's navigation trajectory.

[0082] The attention mechanism described employs a scaling dot product attention mechanism. The dimension d is calculated based on the input. k The "query" and "key" vectors and dimensions are d. v The "value" vector. Multiply and divide the transposes of the "query" and "key" by... The attention between the current input and each input at different time points is obtained, and the attention is normalized using the SoftMax function to obtain the attention weights. Finally, the obtained weights are multiplied by the "value" vector to obtain the attention output. The calculation formula is as follows:

[0083]

[0084] In the formula, Q is the "query" vector, K is the "key" vector, and V is the "value" vector.

[0085] The generator's calculation process is as follows:

[0086] e f1 =TCN gen (X,z,m)

[0087] e f2 =BiLSTMgen_enc (e f1 ,z,m)

[0088]

[0089]

[0090] In the formula, m is the mask matrix, representing the missing positions in the data; X is the ship data; and z is the noise data; e f1 For Temporal Convolutional Networks (TCN) gen The features extracted once, e f2 BiLSTM encoding network for generators gen_enc Features extracted in the second stage; e f1 and e f2 Connecting features using residual structures can prevent feature degradation and input the self-attention mechanism. gen This is used to emphasize the importance and relevance of the data information of the current trajectory point within the entire ship trajectory; the feature is the fused feature output by self-attention, which is input into the generator decoding network BiLSTM. gen_dec Finally, the reconstructed generated data is obtained.

[0091] Combination Figure 4 (b) The computation process using a bidirectional long short-term memory network as the discriminator is as follows:

[0092]

[0093] p = BiLSTM dis_dec (y)

[0094] In the formula, For the reconstructed generated data, X represents ship data, z represents noise data, and y represents data generated by the discriminator-encoded network BiLSTM. dis_enc The resulting hidden vector is used as input to the discriminator decoding network BiLSTM. dis_dec The discriminator's evaluation score p for the input data is obtained.

[0095] Step 5: Train a generative adversarial neural network using a data sequence with a fixed time step and a mask matrix to obtain a data restoration model for repairing ship data;

[0096] Step 5 describes training a generative adversarial neural network using a data sequence with a fixed time step and a mask matrix to obtain a data restoration model for repairing ship data. The specific process includes:

[0097] Step 5-1, set the generator's loss function as follows:

[0098]

[0099] in,

[0100]

[0101] In the formula, m is the mask matrix, X is the ship data, and z is the noise; This indicates element-wise multiplication of matrices; X' represents historical data for known positions in the ship data; X” represents generated data for missing positions in the ship data; This refers to the repaired data after the ship data has been repaired; G is the generator. The absolute average error between the historical data of the missing positions in the ship data matrix and the repair data generated by the corresponding position generator represents the reconstruction loss of the repair data. This indicates the discriminator's evaluation score for the repaired data;

[0102] Step 5-2, set the loss function of the discriminator as follows:

[0103]

[0104] In the formula, D is the discriminator. This refers to the restored data after the ship data has been repaired. This indicates the score by which the discriminator evaluates the true data in the ship's data; This indicates the score the discriminator gives to the repair data in the ship's data.

[0105] Step 5-3: Train the generator by inputting the ship data and the constructed mask matrix into the generator to obtain the reconstructed generated data;

[0106] Step 5-4: Train the discriminator. Define ship data as positive samples and repaired data as negative samples. Use the positive and negative samples as inputs to the discriminator to evaluate the score of ship data repair.

[0107] Step 5-5: Repeat steps 5-3 and 5-4 to allow the generator and discriminator to compete and optimize each other until the repair accuracy reaches the preset threshold.

[0108] Step 6: Use the data repair model to repair ship data with missing values, and then distinguish, perform secondary repair and synthesis of the repaired ship data to achieve secondary repair of ship trajectories.

[0109] Step 6 describes using a data repair model to repair ship data with missing values, and then differentiating, performing secondary repair and synthesis on the repaired ship data to achieve secondary repair of ship trajectories. The specific steps are as follows:

[0110] Step 6-1: For the trajectory after model repair, decompose the complete trajectory into several atomic trajectories with equal time steps. Calculate the distance between trajectory points at three adjacent time steps using the ship's latitude and longitude, and then determine the ship's turning angle at adjacent time steps. Distinguish the atomic trajectories based on the turning angle.

[0111]

[0112] cos t =cos(d t-1,t ,d t,t+1 ,d t-1,t+1 )

[0113] In the formula, d t-1,t ,d t,t+1 ,d t-1,t+1 Let be the distance between trajectory points at every two time points t-1, t, and t+1; Represents the longitude and latitude of the i-th trajectory at time t; cos is a function for calculating the cosine angle between two adjacent sides. t This represents the cosine value of the ship's trajectory point at time t. Whether the ship has turned at time t can be determined by the angle formed by the ship's trajectory point at time t and the trajectory points at two adjacent times.

[0114] Step 6-2: For the data points in the straight line trajectory, SG filtering is used to process these trajectory points. The smoothing formula is as follows:

[0115]

[0116] In the formula, h represents the trajectory smoothing result of the j-th feature of the i-th trajectory at time t; i is the correlation coefficient when filtering the w-th trajectory point, N is the number of convolutions; it is obtained from the least squares fitting polynomial; w is the range of values ​​for the sliding window, and the window size is 2m+1;

[0117] Step 6-3: For the data points to be repaired that fall within the curve trajectory, cubic exponential smoothing is applied. The specific calculation process is as follows:

[0118]

[0119] In the formula, Let a be the first, second, and third exponential smoothed values ​​at time t. t ,b t ,c t The coefficients of the cubic exponential smoothing function are determined by a weighted average of the results of the three exponential smoothing operations. T represents a future time, and y... t+TThis represents the smoothed value at T time points after the current time. 'a' is the smoothing coefficient, reflecting the proportion of historical data from different periods in the exponential smoothing process.

[0120] Step 6-4: For inflection points where straight lines and curves intersect, to ensure smooth repair points, SG filtering and cubic exponential smoothing are applied respectively, and the average value is used to replace the original repair value. The specific calculation process is as follows:

[0121]

[0122]

[0123]

[0124] In the formula, SG represents SG filtering; step represents the window size; k represents the degree of polynomial fitting; and p ij This indicates model data repair; exp3_smooth represents cubic exponential smoothing, and 'a' is the smoothing coefficient. For the j-th feature of the i-th trajectory at time t, the SG smoothing result and the cubic exponential smoothing result are given. This indicates the final smoothed result of the inflection point at the intersection;

[0125] Step 6-5: For the ship repair data after secondary repair, firstly, the trajectory data of the same ship is extracted and classified by MMSI number, and then the ship trajectory is re-synthesized according to the time of each data point.

[0126] This invention also proposes a shipping AIS data repair system based on generative adversarial neural networks, which realizes shipping AIS data repair based on the aforementioned shipping AIS data repair method.

[0127] A computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it performs shipping AIS data repair based on the aforementioned shipping AIS data repair method based on a generative adversarial neural network.

[0128] A computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, shipping AIS data repair is performed based on the aforementioned shipping AIS data repair method based on a generative adversarial neural network.

[0129] As a specific example, the schematic diagram of the repair of the curved portion by the model of the present invention is as follows: Figure 5 As shown, compared with other data restoration models (k-nearest neighbor model, CNN-LSTM model, bidirectional long short-term memory network model, deep convolutional generative adversarial network model), the restoration effect is as follows: Figure 6 As shown, by Figure 6 It can be seen that, under different data missing rates, the data repair effect of the method of this invention is better than other repair models. Furthermore, as... Figure 7 As shown, the AIS repaired data after two repairs showed a certain improvement in repair effect compared to the result after only model repair.

[0130] This invention utilizes temporal convolutional networks and bidirectional long short-term memory networks to deeply extract AIS data features. The addition of a self-attention mechanism effectively emphasizes the importance and relevance of the current trajectory point's data within the overall ship trajectory. Combined with a GAN structure, this forces the generator to produce a complete sample that most closely resembles historical data, thereby repairing ship navigation data and improving the quality of data repair. Furthermore, for trajectory points with unsatisfactory model repair results, the invention calculates the corners of adjacent trajectory points using the ship's latitude and longitude, designs methods for secondary repair of trajectory points with different corners, and finally obtains data points of the same ship using the MMSI number, reorders and combines them according to time sequence to synthesize the trajectory.

[0131] The foregoing has shown and described the basic principles, main features, and advantages of the present invention, but it should not be construed as limiting the scope of this application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the appended claims.

Claims

1. A method for repairing shipping AIS data based on a generative adversarial neural network, characterized in that, The method includes the following steps: Step 1: For shipping in inland waterways or open waters, obtain historical navigation data of vessels through the Automatic Identification System (AIS); Step 2: Based on historical ship data, classify ships with different trajectories, convert the classified trajectory data into a data sequence with a fixed time step, and construct a missing data mask matrix accordingly. Step 3: Using an autoencoder that integrates a temporal convolutional network, a bidirectional long short-term memory network, and a self-attention mechanism as the generator, and a bidirectional long short-term memory network as the discriminator, a generative adversarial neural network is constructed. Step 4: Train a generative adversarial neural network using a data sequence with a fixed time step and a mask matrix to obtain a data restoration model for repairing ship data. The specific training process is as follows: Step 4-1: Set the loss function for the generator; Step 4-2: Set the loss function for the discriminator; Step 4-3: Train the generator by inputting the ship data and the constructed mask matrix into the generator to obtain the reconstructed generated data; Step 4-4: Train the discriminator. Define ship data as positive samples and repaired data as negative samples. Use the positive and negative samples as inputs to the discriminator to evaluate the score of ship data repair. Steps 4-5: Repeat steps 4-3 and 4-4 to allow the generator and discriminator to compete and optimize each other until the repair accuracy reaches the preset threshold. Step 5: Use a data repair model to repair ship data with missing values, and then differentiate, perform secondary repair and synthesis on the repaired ship data to achieve secondary repair of ship trajectories. The specific method is as follows: Step 5-1: For the trajectory repaired by the data repair model, the complete trajectory is decomposed into several atomic trajectories with equal time steps. The distance between trajectory points at three adjacent time steps is calculated using the ship's latitude and longitude. The turning angle of the ship at adjacent time steps is then calculated. The atomic trajectories are distinguished based on the turning angle. Step 5-2: For the data points that are in the straight line trajectory, SG filtering is used to smooth the trajectory points. Step 5-3: For the data points to be repaired that are located in the curve trajectory, triple exponential smoothing is used for processing. Step 5-4: For inflection points where straight lines and curves intersect, to ensure the smoothness of the repair points, SG filtering and cubic exponential smoothing are applied respectively, and the average value is used to replace the original repair value. Step 5-5: For the ship repair data after secondary repair, firstly, the trajectory data of the same ship is extracted and classified by MMSI number, and then the ship trajectory is re-synthesized according to the time of each data point.

2. The shipping AIS data repairing method based on the generative adversarial neural network according to claim 1, characterized in that, Step 1: For shipping in inland waterways or open waters, obtain historical navigation data of vessels through the Automatic Identification System (AIS), including longitude, latitude, speed, and heading angle. 3.The shipping AIS data inpainting method based on a generative adversarial neural network according to claim 1, wherein, Step 2: Convert the classified trajectory data into a data sequence with a fixed time step of 1 minute. 4.The shipping AIS data inpainting method based on a generative adversarial neural network according to claim 1, wherein, Step 2, construct the missing data mask matrix, the specific process is as follows: (1) Construct a ship data matrix; In the ship data matrix, the i-th row and j-th column represents the j-th feature at the i-th time point in a ship's trajectory, and the feature includes longitude, latitude, speed, and heading angle; (2) constructing a missing data mask matrix; The missing data mask matrix is consistent with the dimension of the ship data matrix, and is used to represent the missing data of the ship. If the data of a certain time in the ship data is missing, the corresponding position of the mask matrix is set to 0, otherwise it is set to 1. 5.The shipping AIS data inpainting method based on a generative adversarial neural network according to claim 1, wherein, Step 3, using the autoencoder of the fusion time domain convolution network, the bidirectional long short term memory network and the self-attention mechanism as the generator, and using the bidirectional long short term memory network as the discriminator, the specific calculation process is as follows: In the formula, m is a mask matrix, indicating the missing position in the data, X is the ship data, and z is the noise data. is a time domain convolutional network extracting features once, is a generator encoding network extracting features twice; will and connected in a residual structure can prevent the degradation of features, and input the self-attention mechanism for emphasizing the importance and relevance of the data information of the current trajectory point in the entire ship trajectory, is the fusion feature output by the self-attention mechanism, which is input to the generator decoding network , and finally the reconstructed generated data is obtained , y is the hidden vector output by the discriminator encoding network , and y is input to the discriminator decoding network , to obtain the evaluation score p of the input data by the discriminator. 6.The shipping AIS data inpainting method based on a generative adversarial neural network according to claim 1, wherein, Step 4, training the generative adversarial neural network using the data sequence with fixed time step and the mask matrix to obtain a data repair model for repairing the ship data, wherein: Step 4-1, the loss function of the generator is set as follows: Wherein, In the formula, m is a mask matrix, X is ship data, and z is noise. denotes multiplication of matrix elements; is historical data of known positions in the ship data; is generated data of missing positions in the ship data; is repaired data of the ship data after repair; and G is a generator. is the absolute mean error of historical data of missing positions in the ship data matrix and repaired data generated by the corresponding position generator, indicating reconstruction loss of the repaired data. denotes an evaluation score of the repaired data by the discriminator; Step 4-2, the loss function of the discriminator is set as follows: In the formula, D is a discriminator, is the repaired data of the ship data after repair; represents the evaluation score of the discriminator on the real data in the ship data; represents the evaluation score of the discriminator on the repaired data in the ship data.

7. The shipping AIS data repairing method based on the generative adversarial neural network according to claim 1, characterized in that, Step 5, using the data repair model to repair the ship data with missing values, and performing division, unit secondary repair and synthesis on the repaired ship data to realize secondary repair of the ship trajectory, wherein: Step 5-1, for the trajectory repaired by the data repair model, the complete trajectory is decomposed into a plurality of atomic trajectories with equal time steps, and the distance between the trajectory points of adjacent three time points is calculated through the latitude and longitude of the ship, and then the corner of the ship at adjacent time is calculated. According to the number of corners, the atomic trajectory is divided, and the formula is: wherein, is the distance between the track points of each two time t-1, t, t+1; denotes the longitude and latitude of the i-th track at time t; COS is a function for calculating the cosine angle of the adjacent two edges, denotes the cosine value of the track point of the ship at time t, and whether the ship has turned at time t is determined by the degrees of the corner formed by the track point of the ship at time t and the track points of the ship at adjacent two times. Step 5-2, for the repaired data points in the straight line trajectory part, SG filtering is used to smooth the trajectory points, and the processing formula is as follows: In the formula, is the track smoothing result of the jth feature of the ith track at time t; is the correlation coefficient at the filtering time of the wth track point, N is the convolution number; obtained by least square fitting polynomial; w is the value range of the sliding window, and the window size is 2m+1; Step 5-3, for the repaired data points in the curve trajectory part, cubic exponential smoothing is used for processing, and the specific calculation process is as follows: wherein is the first, second and third exponential smoothing value at time t, is the coefficient of the third exponential smoothing function, whose value is determined by the weighted results of the three exponential smoothing, and T is the future time, is the smoothing value at the time point T after the current time, and a is the smoothing coefficient, which reflects the proportion of historical data in different periods in the exponential smoothing. Step 5-4, for the inflection point at the intersection of straight line and curve, in order to ensure the smoothness of the repaired point, SG filtering and cubic exponential smoothing are respectively adopted, and the average value is taken instead of the original repaired value. The specific calculation process is as follows: In the formula, SG represents SG filtering; w represents window size; k represents polynomial fitting degree, represents model repair data; represents cubic exponential smoothing, and a is a smoothing coefficient; is the SG smoothing result and the cubic exponential smoothing result of the jth feature of the ith track at the tth moment, represents the final smoothing result of the inflection point at the intersection. 8.A shipping AIS data repairing system based on a generative adversarial neural network, characterized in that, The marine AIS data repair method based on the generative adversarial neural network according to any one of claims 1-7 realizes marine AIS data repair.

9. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein when the processor executes the computer program, the marine AIS data repair method based on the generative adversarial neural network according to any one of claims 1-7 is realized to realize marine AIS data repair.

10. A computer readable storage medium having a computer program stored thereon, wherein when the processor executes the computer program, the marine AIS data repair method based on the generative adversarial neural network according to any one of claims 1-7 is realized to realize marine AIS data repair.

Citation Information

Patent Citations

  • Ship target classification method based on AIS data

    CN115063676A

  • Travel trajectory generation method and device, electronic equipment and storage medium

    CN115170607A