Ship trajectory repair method and device considering secondary repair and medium
Through the trained ship trajectory repair model, combined with the bidirectional time domain convolution network and self-attention mechanism, the secondary repair process is carried out, which solves the problem of poor ship trajectory repair effect in the existing technology, and achieves a more accurate and stable trajectory Repair and improve navigation safety.
Patent Information
- Application Number
- CN202411236094.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-04
- Publication Date
- 2024-12-20
AI Technical Summary
When processing ship AIS data, especially in the case of long-distance data loss and data loss, the repair effect is not ideal, and the information between data such as longitude, latitude, ship speed, bow direction is not fully utilized, resulting in trajectory. The repair results are inaccurate, affecting navigation safety.
Using a method that considers secondary repair, a trained ship trajectory repair model, including generators and discriminators, uses a bidirectional time domain convolution network, a bidirectional gating cycle unit, a self-attention mechanism and a bidirectional long and short-term memory network. Data reconstruction is carried out, and the error indicators are used to determine whether secondary repair is needed. It is divided into straight line segments and curve segments for SG filtering and cubic exponential smoothing.
It improves the accuracy of ship trajectory repair, can remove noise while retaining the overall trend of data, ensures the continuity and smoothness of trajectory, enhances generalization capabilities, and improves navigation safety.
Smart Images

Figure CN119166998A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of data mining, and in particular relates to a ship track repair method, device and medium considering secondary repair. Background Art
[0002] To ensure navigation safety, it is essential to accurately obtain relevant dynamic and static information of other ships in the surrounding waters. The emergence of the Automatic Identification System (AIS) provides an important guarantee for the safety of the shipping industry. It can not only provide some static and dynamic information to the crew to easily identify other ships, but also broadcast AIS data to surrounding ships through ultra-high frequency (VHF) data links to achieve identification and monitoring of ships in the sea area. Therefore, AIS data is essential for real-time navigation assessment and statistical analysis of ship collision risks.
[0003] However, AIS data may be lost or erroneous, which is mainly reflected in the ship's navigation trajectory data: First, AIS data needs to find idle time slots during transmission. In areas with dense AIS equipment, network overload or communication link blockage may occur, resulting in AIS data loss; in the case of sudden changes in latitude and longitude, there may also be missing data trajectory points with zero speed and heading; secondly, AIS data may have a large number of errors during signal conversion, resulting in abnormal trajectory data. AIS data loss and error problems will seriously affect ship collision avoidance decisions and lead to incorrect risk judgments. Traditional methods for repairing ship AIS data mostly use Newton interpolation, polynomial interpolation, spline interpolation and other methods, which mainly have the following problems: First, the above methods have a good repair effect for short-distance missing data, but the repair results are not ideal when long-distance data is missing and the amount of data loss is large; Second, the above methods do not fully exploit the inherent information between AIS data such as longitude, latitude, ship speed, and bow direction, and the trajectory repair results obtained in complex scenarios are not ideal. The collision detection model or path decision model established based on this has obvious problems of weak generalization ability and high computing power requirements. Chinese patent application 202310144472.3 discloses an AIS data repair method based on DE-LSSVM, which uses the similarity judgment method based on improved Euclidean distance as an indicator to retrieve similar historical data for long-distance missing AIS data, and obtain the AIS historical data most similar to the long-distance missing AIS data, but the above method is easily interfered by noise and outliers, and does not solve the second problem mentioned above. Therefore, it is necessary to redesign a ship trajectory repair method to further improve the accuracy of ship trajectory repair and ensure the safety of ship navigation. Summary of the invention
[0004] The purpose of the present invention is to overcome the defects of the above-mentioned prior art and provide a ship track repair method, equipment and medium taking into account secondary repair, so as to further improve the accuracy of ship track repair and ensure the safety of ship navigation.
[0005] The purpose of the present invention can be achieved by the following technical solutions:
[0006] The present invention provides a ship track repair method considering secondary repair, comprising the following steps:
[0007] Obtain ship AIS data, pre-process it and input it into the trained ship trajectory repair model, and output the repaired ship trajectory; determine whether the repaired ship trajectory needs secondary repair based on the error index, and if so, divide the repaired ship trajectory into straight segment trajectory and curved segment trajectory for secondary repair;
[0008] Among them, the ship trajectory repair model includes a generator and a discriminator. The generator is used to obtain the preprocessed ship AIS data and reconstruct the data to generate the repaired ship trajectory, and the discriminator is used to distinguish between real data and generated data; the generator includes a primary feature extraction module, a secondary feature extraction module, a feature fusion module and an AIS data reconstruction module connected in sequence, the primary feature extraction module is constructed based on a bidirectional time domain convolutional network for feature extraction; the secondary feature extraction module is constructed based on a bidirectional gated recurrent unit for further feature extraction; the feature fusion module is constructed based on a self-attention mechanism for integrating the extracted features to obtain hidden variables; the AIS data reconstruction module is constructed based on a bidirectional long short-term memory network for decoding the hidden variables.
[0009] Furthermore, the pre-processed ship AIS data is extracted based on the maritime mobile service identification code MMSI, and the extracted ship longitude, ship latitude, ship speed and heading data are input into the ship track repair model.
[0010] Furthermore, the preprocessing process is specifically as follows: after data cleaning, the linear interpolation method is used to align the granularity of the ship AIS data.
[0011] Furthermore, one or more of a regularization method, a dual time scale update rule method and a gradient descent method are used to train the ship trajectory repair model.
[0012] Furthermore, the error index is calculated based on the mean absolute error, the root mean square error, the mean absolute percentage error, the mean displacement error and the final displacement error. If the calculated result exceeds a set threshold, a secondary repair is required.
[0013] Furthermore, according to the curvature calculation result, the repaired ship trajectory is divided into a straight segment trajectory and a curved segment trajectory.
[0014] Furthermore, the SG filtering method is used to perform secondary repair on the straight line segment trajectory.
[0015] Furthermore, the cubic exponential smoothing method is used to perform secondary repair on the curve segment trajectory.
[0016] The present invention also provides an electronic device, comprising a memory, a processor, and a program stored in the memory, wherein the processor implements the above method when executing the program.
[0017] The present invention also provides a computer-readable storage medium on which a computer program is stored, and the program implements the above method when executed by a processor.
[0018] Compared with the prior art, the present invention has the following beneficial effects:
[0019] 1. The present invention obtains the repaired ship trajectory according to the ship AIS data through the trained ship trajectory repair model, and then determines whether the repaired ship trajectory needs secondary repair according to the error index. If so, the repaired ship trajectory is divided into a straight segment trajectory and a curve segment trajectory for secondary repair, which can further optimize the repair effect and obtain an accurate ship trajectory; the ship trajectory repair model includes a generator and a discriminator, the generator includes a primary feature extraction module, a secondary feature extraction module, a feature fusion module and an AIS data reconstruction module connected in sequence, wherein the primary feature extraction module is constructed based on a bidirectional time domain convolutional network, which is used for preliminary feature extraction and can capture the complex association and long-term dependency of time series data; the secondary feature extraction module is constructed based on a bidirectional gated recurrent unit and is used for further feature extraction, which can reduce the influence of interference factors introduced by the primary feature extraction module; the feature fusion module is constructed based on a self-attention mechanism and is used to integrate the extracted features to obtain hidden variables, which can capture the relationship between each element and other elements and capture key information; the AIS data reconstruction module is constructed based on a bidirectional long short-term memory network and is used to decode the hidden variables, and finally an accurate ship trajectory repair result can be obtained.
[0020] 2. According to the curvature calculation results, the present invention divides the repaired ship trajectory into a straight segment trajectory and a curved segment trajectory, and adopts the SG filtering method to perform secondary repair on the straight segment trajectory, which can effectively remove noise while retaining the overall trend of the data, repair the abnormal points and noise of the straight segment trajectory, and ensure the continuity and smoothness of the trajectory segment; the cubic exponential smoothing method is used to perform secondary repair on the curved segment trajectory. By performing multiple exponential weighted averages on the data, the time series data can be effectively smoothed, the abnormal points and fluctuations therein can be repaired, and the smoothness and continuity of the trajectory segment can be ensured. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 is a flow chart of the method of the present invention;
[0022] Figure 2 This is a schematic diagram of the structure of the ship trajectory repair model. DETAILED DESCRIPTION
[0023] The present invention is described in detail below in conjunction with the accompanying drawings and specific embodiments. This embodiment is implemented based on the technical solution of the present invention, and provides a detailed implementation method and specific operation process, but the protection scope of the present invention is not limited to the following embodiments.
[0024] Example:
[0025] This embodiment provides a ship track repair method considering secondary repair, such as Figure 1 As shown, the following steps are included:
[0026] Obtain ship AIS data, perform preprocessing and extract key data points, and then input the trained ship trajectory repair model to output the repaired ship trajectory. According to the error index, determine whether the repaired ship trajectory needs secondary repair. If so, divide the repaired ship trajectory into straight segment trajectory and curved segment trajectory for secondary repair.
[0027] The specific preprocessing process is as follows: first, data cleaning is performed to delete unreasonable stop points in the ship trajectory points where the ship speed is greater than zero but the ship longitude and latitude are almost unchanged; delete the trajectory points where the ship speed is continuously zero, which are regarded as mooring points and have no obvious effect on model training; delete the abnormal trajectory points in the ship trajectory points where the position changes greatly; then use the linear interpolation method to align the granularity of the ship AIS data so that the sampling time interval of the ship trajectory points in each ship trajectory segment is 1 minute. According to the MMSI code of the mobile maritime service, the data key points of the preprocessed ship AIS data are extracted to obtain the ship longitude, ship latitude, ship speed and heading, which can fully reflect the navigation status and position information of the ship.
[0028] The structure of the ship trajectory repair model is as follows: Figure 2 As shown, it includes a generator and a discriminator. The generator is used to obtain the preprocessed ship AIS data and reconstruct the data to generate the repaired ship trajectory. The discriminator is used to distinguish between real data and generated data. In the adversarial training between the generator and the discriminator, the discriminator's judgment on authenticity is used to prompt the generator to improve the repair process.
[0029] The generator includes a primary feature extraction module, a secondary feature extraction module, a feature fusion module and an AIS data reconstruction module connected in sequence. The primary feature extraction module is constructed based on a time domain convolutional network TCN. The time domain convolutional network can model time series tasks. It optimizes the extended causal convolution structure and can efficiently extract features from time domain data. The residual connection can avoid gradient vanishing and gradient explosion. This embodiment adopts a bidirectional time domain convolutional network, one input is forward, and the other input is backward to enter the network model to realize bidirectional feature extraction, and the AIS data is initially extracted, including local spatiotemporal features and short-term trend features, wherein the local spatiotemporal features include time-varying features such as ship position (latitude and longitude), speed, and heading, which are crucial for understanding the ship's immediate state and behavior pattern. Short-term trend features include acceleration, deceleration, turning, etc. These features are helpful for predicting the movement trend of ships in a short period of time (such as a few minutes to a few hours) or detecting abnormal behavior. When dealing with scenarios involving a large amount of missing AIS data, the features that can be extracted only through the time domain convolutional network may contain a large amount of missing data information, which may introduce interference factors in trajectory repair. Therefore, this embodiment designs a secondary feature extraction module based on a bidirectional gated recurrent unit BiGRU to further extract long-term dependent features, including the ship's navigation mode (such as straight-line navigation, sailing along a specific route), periodic behavior (such as daily or weekly navigation patterns) and other features. Combining the current time step feature information and the context information of the previous and next time steps can more comprehensively understand the navigation environment and state changes of the ship, and effectively fill in missing data or correct erroneous data. The feature fusion module is built based on the self-attention mechanism to integrate the extracted features and obtain hidden variables. The attention function can be described as mapping a query and a set of key-value pairs to an output, which is calculated by the weighted sum of values. The self-attention mechanism is better at processing the calculation of internal elements of the data source, and can focus on the characteristics of key data information and reduce the impact of non-key information on the task. The AIS data reconstruction module is built based on a bidirectional long short-term memory network to decode the hidden variables and finally obtain a high-precision ship trajectory.
[0030] The ship track repair model is trained by using one or more of the regularization method, the dual time scale update rule method and the gradient descent method. The initial parameters, including the learning rate, regularization parameter, model complexity, etc., are selected based on prior knowledge and experience. The optimal parameters are selected from a series of possible parameter combinations using a grid search or random search method. The performance of each parameter combination is evaluated by cross-validation, and the parameter combination that can achieve the best model performance is selected. Regularization terms are introduced, and regularization terms (such as L1 regularization or L2 regularization) are added to the loss function to prevent the model from overfitting. The appropriate regularization parameter λ is selected to balance the data error term and the regularization term in the loss function to ensure the generalization ability of the model. During the model training process, some fast-changing parameters are frequently updated to adapt to data changes through rapid adjustments. The slow-changing parameters in the model are updated less frequently, which maintains the stability of the model through slow adjustments.
[0031] For the AIS track of the ship whose error index still exceeds the set error threshold after being repaired by the ship track repair model, the track curvature recognition method is used to divide it into straight track segments and curved track segments, and the straight track segments and curved track segments are repaired twice. The error index is the average value of mean absolute error MAE, root mean square error RMSE, mean absolute percentage error MAPE, average displacement error ADE and final displacement error FDE. If the error index exceeds the set threshold, secondary repair is required. According to the curvature calculation results, the repaired ship track is divided into straight track segment track and curved track segment track. The SG filtering method is used to repair the straight track segment track twice. The SG filter is a filter used to smooth data. It can remove noise while retaining the overall trend of the data. It is suitable for repairing straight track segments. Determine the window size and polynomial order of the SG filter. The window size determines the number of data points considered for each smoothing operation, and the polynomial order determines the complexity of the fitting polynomial. Applying the SG filtering method to smooth the straight track segment can repair the abnormal points and noise in it and ensure the continuity and smoothness of the track segment. The cubic exponential smoothing method is used to perform secondary repair on the curve segment trajectory. The cubic exponential smoothing method is a weighted averaging method. By performing multiple exponential weighted averaging on the data, it can effectively smooth the time series data and is suitable for repairing the curve trajectory segment. The cubic exponential smoothing method is used to perform multiple smoothing on the curve trajectory segment, which can repair the abnormal points and fluctuations in the curve trajectory segment and ensure the smoothness and continuity of the trajectory segment.
[0032] The above method has the following advantages:
[0033] (1) The present invention combines the neural network algorithm with the attention mechanism, and uses the attention mechanism to focus on the importance differences ignored by the neural network, extracting more critical information for AIS ship trajectory repair, which is beneficial to reducing the consumption of model training computing resources and improving the effect of trajectory repair and generalization ability.
[0034] (2) The repair model proposed in the present invention does not directly repair the complex trajectory, but first decomposes the complex trajectory into spliced trajectory segments, so that the complex features of the complete trajectory are distributed to each trajectory segment, so that the model can better extract useful features from the trajectory segment data set. Such simplification can promote effective model training because the model can focus on learning and capturing the inherent dynamics in these trajectory segments. More importantly, any complex trajectory can be processed using the trajectory decomposition method. The simple characteristics of the decomposed atomic trajectory enable the model to better process ship trajectory data in a variety of complex situations as a whole.
[0035] (3) The repair model proposed in the present invention will perform secondary repair on the trajectory points with poor repair effect in the trajectory repaired by the model. For straight line segments, SG filter is used; for curve segments, cubic exponential smoothing is used. This secondary repair method further effectively repairs the atomic trajectory and obtains a high-precision trajectory.
[0036] (4) The repair model proposed in the present invention fully utilizes all four parameters of longitude, latitude, ship speed, and heading during repair, further enhancing the repair effect. For example, when repairing latitude and longitude, ship speed and heading are key features that describe the motion of the ship. The model can capture the deep connection between ship speed or heading and longitude / latitude, thereby improving the accuracy of the repair result.
[0037] To verify the effectiveness of the above method, this embodiment selects five relatively excellent repair models, including K neighboring points, CNN-LSTM, bidirectional long short-term memory network, DCGAN, and TLGAN, as benchmarks for comparative experiments. By calculating and comparing indicators such as mean absolute error MAE, root mean square error RMSE, mean absolute percentage error MAPE, average displacement error ADE, and final displacement error FDE, the repair results of the benchmark model and the method proposed in this embodiment are discussed and compared in terms of straight trajectory segments and curved trajectory segments.
[0038] If the above method is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0039] The above description of the embodiments is to facilitate the understanding and use of the invention by those skilled in the art. It is obvious that those skilled in the art can easily make various modifications to these embodiments and apply the general principles described herein to other embodiments without creative work. Therefore, the present invention is not limited to the above embodiments, and improvements and modifications made by those skilled in the art based on the disclosure of the present invention without departing from the scope of the present invention should be within the scope of protection of the present invention.
Claims
1. A ship trajectory repair method considering secondary repair, It is characterized in that The following steps are involved: Obtain ship AIS data, pre-process it and input it into the trained ship trajectory repair model, and output the repaired ship trajectory; determine whether the repaired ship trajectory needs secondary repair based on the error index, and if so, divide the repaired ship trajectory into straight segment trajectory and curved segment trajectory for secondary repair; The ship track repair model includes a generator and a discriminator. The generator is used to obtain the preprocessed ship AIS data and perform data reconstruction to generate the repaired ship track. The discriminator is used to distinguish between real data and generated data. The generator includes a primary feature extraction module, a secondary feature extraction module, a feature fusion module and an AIS data reconstruction module connected in sequence. The primary feature extraction module is constructed based on a bidirectional time domain convolutional network and is used for preliminary feature extraction. The secondary feature extraction module is constructed based on a bidirectional gated recurrent unit and is used for further feature extraction. The feature fusion module is constructed based on the self-attention mechanism to integrate the extracted features and obtain hidden variables; the AIS data reconstruction module is constructed based on the bidirectional long short-term memory network to decode the hidden variables.
2. A ship track repair method considering secondary repair according to claim 1, It is characterized in that The pre-processed ship AIS data is extracted based on the maritime mobile service identification code MMSI, and the extracted ship longitude, ship latitude, ship speed and heading data are input into the ship track repair model.
3. A ship track repair method considering secondary repair according to claim 1, It is characterized in that The preprocessing process is specifically as follows: after data cleaning, the linear interpolation method is used to align the granularity of the ship AIS data.
4. A ship track repair method considering secondary repair according to claim 1, It is characterized in that The ship trajectory repair model is trained by using one or more of a regularization method, a dual time scale update rule method and a gradient descent method.
5. A ship track repair method considering secondary repair according to claim 1, It is characterized in that The error index is calculated based on the mean absolute error, root mean square error, mean absolute percentage error, mean displacement error and final displacement error. If the calculated result exceeds the set threshold, secondary repair is required.
6. A ship track repair method considering secondary repair according to claim 1, It is characterized in that According to the curvature calculation results, the repaired ship trajectory is divided into a straight segment trajectory and a curved segment trajectory.
7. A ship track repair method considering secondary repair according to claim 1, It is characterized in that The SG filtering method is used to perform secondary repair on the straight line segment trajectory.
8. A ship track repair method considering secondary repair according to claim 1, It is characterized in that The cubic exponential smoothing method is used to perform secondary repair on the curve segment trajectory.
9. An electronic device comprising a memory, a processor, and a program stored in the memory, It is characterized in that When the processor executes the program, the method according to any one of claims 1 to 8 is implemented.
10. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.
Citation Information
Patent Citations
Navigation AIS data restoration method based on generative adversarial neural network
CN116758403A
