Data knowledge dual-driven unsupervised ship navigation mode identification method
By constructing a macroscopic navigation pattern encoder and a microscopic navigation pattern decoder, and combining hypergraph neural networks and nautical knowledge, the problems of quantization and mapping relationships in ship navigation pattern recognition are solved, and higher accuracy navigation pattern recognition is achieved.
Patent Information
- Application Number
- CN202511096949.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-06
- Publication Date
- 2025-12-16
AI Technical Summary
Existing technologies for ship navigation pattern recognition suffer from problems such as the large number and lack of quantification of ship navigation elements, difficulty in determining the spatiotemporal field range, and difficulty in mapping relationships with international maritime rules, resulting in insufficient recognition accuracy.
By combining traditional clustering algorithms with a contrastive learning framework, and extracting ship habitual routes based on AIS data, we use hypergraph neural networks and nautical knowledge to construct a macroscopic navigation pattern encoder and a microscopic navigation pattern decoder for unsupervised identification.
It effectively extracts ship navigation patterns and collision avoidance behavior patterns, overcomes the limitations of insufficient recognition accuracy under a single scale, and improves recognition accuracy and reliability.
Smart Images

Figure CN121144775A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of ship traffic management, and particularly relates to a data-knowledge dual-driven unsupervised ship navigation mode recognition method. BACKGROUND
[0002] As an important pillar of global trade, the shipping industry undertakes about 90% of the international trade cargo transportation volume, and is a key link connecting international markets. In the current complex international situation, geopolitical unrest and global economic downturn, many shipping companies are actively seeking cost reduction and efficiency improvement, and implementing and exploring new shipping modes, such as using large-scale ships to expand their scale effect and implementing unmanned ships to reduce their labor costs. However, when the ship navigates in high-density waters, with the increase in ship size, the ship maneuvering ability will be more restricted, and the potential collision risk will escalate; in the mixed navigation scene of unmanned ships and manned ships, the contradiction between algorithms and experience decisions will bring new challenges of lack of man-machine cooperation rules. Therefore, the research on ship navigation mode recognition is of great significance.
[0003] Ship navigation mode is a complex and comprehensive concept, which mainly includes three categories: navigation mode based on navigation state, navigation mode based on geographical space, and navigation mode based on collision avoidance rules. From the perspective of navigation state, it includes behaviors such as sailing, anchoring, berthing / mooring, wandering, drifting, and maneuvering; from the perspective of geographical space, it includes behaviors such as driving in the channel, driving in the habitual route, crossing the channel, and driving against the flow in the channel; from the perspective of collision avoidance rules, it includes behaviors such as meeting, overtaking, and crossing. Traditional ship navigation mode recognition technologies include unsupervised clustering algorithms, statistical inference methods, and physical modeling methods based on ship motion principles. Unsupervised clustering algorithms are a class of machine learning algorithms that do not rely on prior labeled information, which can mine potential ship navigation modes by clustering ship motion feature information. Statistical inference methods are a class of methods based on mathematical statistics and probability to estimate the distribution of data population, which can infer the ship navigation mode of the sampled water area by using historical ship motion data obtained by random sampling. Physical modeling methods based on ship motion principles can simulate and predict the motion trajectory, speed, and turning behavior of ships under certain conditions by establishing mathematical models describing the motion behavior of ships in water areas.
[0004] Currently, AIS data is mostly used to recognize ship navigation modes, but there are the following difficulties to be solved: first, the content elements involved in ship navigation are numerous and lack unified quantitative regulations; second, the spatiotemporal field range of ship navigation and the number of ships involved are difficult to determine, and the mutual influence between individual behaviors lacks research; finally, it is difficult to establish a mapping relationship between international maritime rules and ship navigation, and the generalization of feature semantics is limited. SUMMARY
[0005] In view of the defects of the prior art, the present application combines a traditional clustering algorithm with a contrast learning framework, extracts the habitual route of a ship in a research area based on AIS data, identifies the macro navigation mode of the ship, and avoids the subjectivity of priori brought by manual selection of features and manual threshold; by constructing a hypergraph neural network with variable input ship quantity and introducing knowledge in the field of navigation, the micro navigation mode of the ship under complex and variable situations is identified.
[0006] In order to achieve the above purpose, the present application provides a data and knowledge double-driven unsupervised ship navigation mode recognition method, comprising the following steps: (1) Obtain the AIS historical data set of all ships and perform preprocessing to obtain the AIS data set under continuous time, wherein the AIS data includes longitude and latitude coordinates, speed, heading and ship length data; (2) Perform trajectory similarity matching according to the longitude and latitude coordinates in the AIS data set under continuous time, and perform trajectory clustering based on the DBSCAN clustering algorithm optimized by particle swarm optimization to obtain similar ship matching pairs; (3) Construct a ship macro navigation mode encoder based on a frequency domain multilayer perceptron and a contrast learning method, and pre-train the ship macro navigation mode encoder using a reconstruction sequence loss function and a sequence contrast learning loss function; (4) Construct a ship micro navigation mode decoder based on a hypergraph neural network, compose the nodes and hyperedges of the network according to the feature vectors output by the pre-trained ship macro navigation mode encoder, obtain the intermediate features of the ship encounter scene, and jointly train the ship macro navigation mode encoder and the ship micro navigation mode decoder by calculating the loss term of the reconstructed trajectory and the loss term of the ship critical situation quantization value; (5) Obtain real-time AIS data of the ship, input the trained ship macro navigation mode encoder and ship micro navigation mode decoder, and obtain the intermediate features of the ship encounter scene.
[0007] Further, the preprocessing is specifically: (1.1) For each ship's AIS data, save the AIS data under the same timestamp in the same AIS data vector, and arrange the AIS data vectors in ascending order of timestamp to obtain the updated AIS data of each ship: The timestamp difference between adjacent AIS data vectors is greater than or equal to 1; (1.2) Segment and remove the updated AIS data of each ship; Calculate the difference of the time stamp of every two adjacent AIS data vectors, if the difference is greater than the first threshold, then the two AIS data vectors are regarded as a split point, and the AIS data of each ship is divided into several split blocks according to the split point; For the split AIS data, count the number of AIS data vectors in each split block, if the number is less than the second threshold, then the split block is removed; (1.3) For each split block, use the improved Radeach criterion method to remove outliers; For any feature element in the AIS data vector in each split block, use the sliding window method for sampling; Where: β is the second threshold; is any feature element sequence in the AIS data vector of any split block; is the number of the feature element sequence; Judge the sampled feature element sequence and remove outliers: Where: is the average value of , is the variance of , not more than range is divided into the retained data array , more than range is divided into the deleted data array ; If the number of elements in is less than the third threshold, then the entire is removed; (1.4) Use the cubic spline interpolation method to interpolate obtained in step (1.3) and correct the values with data jumps to obtain continuous time stamp data.
[0008] Further, the step (1.4) is specifically: For each group of adjacent data in , use the cubic spline interpolation method to fit a cubic polynomial ; Where: , , , are the coefficients of the cubic polynomial; If the timestamps of adjacent data are discontinuous, the data with continuous timestamps is obtained by interpolation according to the corresponding cubic polynomial; For the heading data in the AIS data, the heading data of the AIS data close to or is interpolated and completed, if there is a data jump phenomenon, the unreasonable data jump generated after interpolation is corrected; Wherein: is the heading data after interpolation.
[0009] Further, the step (2) is specifically: (2.1) for the latitude and longitude information in the AIS data under continuous time, the distance between different ship trajectories is calculated based on the dynamic regularization method under the semi-chord distance, and the similarity matrix between ship trajectories is obtained ; Wherein: and are the latitude and longitude coordinates of the ship and the ship ; is the radius of the earth; the similarity matrix element between ship trajectories is used to represent the similarity of the trajectories between the ship and the ship ; (2.2) the trajectory clustering is carried out based on the DBSCAN clustering algorithm of particle swarm optimization, and the similar ship trajectory pair data is obtained according to the similarity matrix between ship trajectories.
[0010] Further, the step (2.2) is specifically: (2.2.1) based on the similarity matrix between the ship trajectories, the ship trajectory data points in the high-dimensional space are mapped to the low-dimensional space using the metric multidimensional scaling analysis, and the distance relationship of the original similarity matrix is kept; the similarity matrix containing trajectory sequences is mapped to dimensional space, and ; in dimensional space, the coordinate array is randomly initialized, wherein the coordinate The distance between coordinates is: The optimized coordinate array is obtained by iteration through gradient descent method to minimize the objective function The objective function is: (2.2.2) Based on the optimized coordinate array The pre-defined parameters of DBSCAN clustering algorithm are considered as the optimized particles in the algorithm; is the velocity of is the velocity of , indicating the direction and step size of particle position update; The velocity and position of where: is the neighborhood radius, is the minimum number of samples, is the inertia weight, and are learning factors, and are random numbers uniformly distributed within is the historical optimal position of particle at time is the historical optimal position of all particles; Under each parameter , the DBSCAN algorithm is used to cluster , and there is a clustering result corresponding to it; After updating the particle position, the clustering result is also updated, and the variance ratio criterion is used to evaluate the fitness of each particle; where: is the coordinate point of the trajectory in the low-dimensional space, is the mean of all coordinate points, is the mean of coordinate points in the th cluster , and is the label of the cluster to which the trajectory belongs; and respectively are the total dispersion matrix and the intra-cluster dispersion matrix, for measuring the degree of separation between clusters; for measuring the degree of closeness of points within the same cluster, is the number of clusters, is the number of data points; According to the variance ratio criterion, update the historical optimal position and the global optimal position as follows until the numerical change of is less than a predetermined threshold ; (2.2.3) Based on the parameters obtained by the particle swarm optimization algorithm , get the trajectory clustering result under the trajectory ; (2.2.4) Based on the AIS data clustering above, slice all AIS data within the cluster, and calculate the similarity and of two sequence slices , get the most similar ship matching pair; Wherein: is the maximum and minimum value normalization function, , , , are the difference between the average speed, the average heading, the average speed variance, and the average heading variance of and .
[0011] Further, the ship macroscopic navigation mode encoder in step (3) is specifically: (3.1) For each group of AIS data in the AIS data set at continuous time, randomly mask M data in it based on geometric distribution, and combine the corresponding data in the similar ship matching pair to get enhanced AIS data as the input set of the ship macroscopic navigation mode encoder; Wherein: is the similar ship matching pair data of ; (3.2) Vector embedding is performed on the input data of the ship macroscopic navigation mode encoder to realize dimensionality increase; wherein: is the input set of the encoder, is the embedding vector, is the number of ships, is the original variable dimension, is the time dimension, is the latent variable dimension; (3.3) Transform the up-scaled data along the feature dimension by Fourier transform to features in the frequency domain space containing information between variables ; input to the frequency domain multi-layer perceptron, whose output is converted back to features in the time domain space by inverse Fourier transform; wherein: and denote the real and imaginary part extraction operation, respectively; and are weight matrices composed of complex numbers; and are bias vectors composed of complex numbers; is the imaginary unit; is the relu activation function; denotes the inverse Fourier transform, which converts back to features in the time domain space ; (3.4) Repeat the operation of step (3.3) to the obtained features in the time domain space, recalculate along the time dimension, and the obtained result is taken as the output of the ship macroscopic navigation pattern encoder; wherein: denotes the same processing operation as step (3.3); (3.5) Calculate the similarity features of , and calculate the similarity coefficient between features; wherein: is the full connection layer calculation, is the weight matrix of , is the bias vector of , , ; (3.6) obtaining the aggregated features based on the output of step (3.4) and step (3.5) and further obtaining the reconstructed trajectory sequence set ; ; wherein: , ; is a temperature hyperparameter; ; is calculated for the fully connected layer.
[0012] Further, the reconstruction sequence loss function is: The sequence contrastive learning loss function is: The total encoder loss function is: wherein: is a set of trajectory sequence true values, , is corresponding features; According to the total encoder loss function, the ship macroscopic navigation mode encoder is trained.
[0013] Further, the step (4) is specifically: (4.1) taking the feature vector output by the pre-trained ship macroscopic navigation mode encoder as an initial node of the hypergraph neural network; (4.2) calculating the similarity between nodes to further obtain the hyperedge of the hypergraph neural network, and finding the most relevant node combination at different scales through a greedy algorithm ; wherein: , respectively represent the feature vectors of different nodes, Q represents a node set, represents a hyperedge composed of nodes in Q; is a similarity matrix; represents a node; (4.3) based on the initial node and the hyperedge, calculating the hyperedge feature vector and the updated node feature vector is obtained through the hyper-edge feature vector ; wherein: 、 、 is calculated for different fully connected layers, is a vector merging operation, is a Hadamard product, is the number of hyper-edges containing ; (4.4) calculates corresponding to the ship critical situation quantitative value , combined with and get the intermediate features of the ship encounter scenario , and reconstruct the ship trajectory ; wherein the intermediate features of the ship encounter scenario is the output of the ship micro-navigation mode decoder; wherein: 、 、 is calculated for different fully connected layers.
[0014] Further, the loss of the reconstructed trajectory is: The loss of the ship critical situation quantitative value is: The total loss function is: wherein: is a certain real label in the ship critical situation quantitative value data set , and any element in the set is in the form of , is a vector containing the time to the nearest encounter point and the distance to the nearest encounter point at the time ; Based on the total loss function, the joint training of the ship macro-navigation mode encoder and the ship micro-navigation mode decoder is carried out.
[0015] Further, the time to the closest point of approach and the distance of the closest point of approach are respectively: Wherein: , are the longitude coordinates, latitude coordinates, speed, and heading of the own ship and the target ship ; , are the speeds of the two ships along the latitude and longitude directions; is the distance of the closest point of approach between the two ships; is the time to the closest point of approach; is the secant distance between the two ships.
[0016] Advantages of the present application: The present application effectively extracts the ship navigation pattern under the habitual navigation route and the collision avoidance behavior pattern under the multi-ship encounter scene by constructing the ship macroscopic navigation pattern encoder and the ship microscopic navigation pattern decoder, and improves the limitation of insufficient ship navigation pattern recognition accuracy in the past single scale. BRIEF DESCRIPTION OF DRAWINGS
[0017] Figure 1 is a flowchart of the unsupervised ship navigation pattern recognition method of the present application driven by data knowledge. DETAILED DESCRIPTION
[0018] The present application will be further explained and described below in conjunction with the drawings and examples.
[0019] As shown in the drawings, the present application provides an unsupervised ship navigation pattern recognition method driven by data knowledge, comprising the following steps: Figure 1 S101, acquiring an AIS data set of all ships and pre-processing to obtain an AIS data set under continuous time, wherein the AIS data includes longitude and latitude coordinates, speed, heading, and ship length data. The AIS data set of all ships is acquired, and considering the influence of AIS data due to equipment failure, data transmission delay or loss, human operation error, environmental factors, data processing error, and malicious signal interference, the acquired AIS data needs to be pre-processed, specifically as follows:
[0020] (1) For each AIS data of the ship, the AIS data with the same timestamp is saved in the same AIS data vector, and the AIS data vectors are arranged in ascending order according to the timestamp, to obtain the updated AIS data of each ship: The timestamp difference of adjacent AIS data vectors is greater than or equal to 1.
[0021] First, the required AIS data is screened and retained, and the AIS information with the same timestamp is saved in the same AIS data vector, and each AIS data vector is represented as: (1) Among them: , , , and are the longitude coordinate, latitude coordinate, speed, heading and length of the ship data; is the AIS data vector; is an integer, indicating the timestamp of the data recorded.
[0022] Suppose there are AIS data vectors, the AIS data vectors are sorted in ascending order according to the timestamp, to obtain the updated AIS data array of each ship The timestamp difference of adjacent vectors is .
[0023] (2) The updated AIS data of each ship is segmented and removed.
[0024] For the updated AIS data of each ship, sequentially traverse all vectors in the array, calculate the difference of the timestamps of all adjacent two AIS data vectors, if to The timestamp difference of adjacent vectors is less than or equal to the first threshold (in the embodiment of the present application, the first threshold = 10), and and The timestamp difference is greater than the first threshold, then is segmented, is the segmented AIS data vector array; if contains less than the second threshold (in the embodiment of the present application, the second threshold = 7) number of vector elements, then is removed, because it does not meet the number requirement for subsequent use of the sliding window sampling method. According to the sequential traversal, until is completely segmented, to obtain multiple segmented blocks.
[0025] (3) For each segmented block, the improved Rayleigh criterion method is used to remove outliers.
[0026] Due to sensor failure, AIS data may have data drift phenomenon, and there may be error information in the original data, so the improved Relyda criterion method is needed to remove the potential error information.
[0027] For a certain feature element in the AIS data vector in each partition block , which contains the number of elements , the sliding window method is used for sampling; (2) Where: β is the second threshold; in the formula is the sampling object of index .
[0028] The sampled feature element sequence is judged, and the abnormal value is removed: (3) Where: is the average value of ; is the variance of ; the within the range of is divided into a retainable data array , and the beyond the range of is divided into a deleted data array ; When ; when or , that is, the data is at the edge of the sliding window sampling, the range of abnormal data can be appropriately relaxed, .
[0029] If the number of elements in is less than the third threshold (in the embodiment of the present application, the third threshold = 4), the entire is removed.
[0030] (4) The obtained in step (3) is interpolated and the value of the existing data jump is corrected using the cubic spline interpolation method, and the data with continuous time stamp is obtained.
[0031] Take for example, the time stamp array corresponding to the feature element is . A cubic polynomial can be fitted on the given interval by the cubic spline interpolation method, as shown in formula (4), where , , 、 are coefficients of the cubic polynomial.
[0032] (4) The cubic spline interpolation function on the interval is shown in equation (5). If there are missing values in the given interval , the characteristic element array is interpolated using equation (5) to obtain the interpolated characteristic element array .
[0033] (5) Since the numerical range of the heading is within , when interpolating data near or , there may be a phenomenon of data jumping. Therefore, equation (6) is used to correct the unreasonable data jump generated after interpolation, where is the interpolated heading data.
[0034] (6) S102, according to the latitude and longitude coordinates in the AIS data set under continuous time, the trajectory similarity matching is performed, and the DBSCAN clustering algorithm based on particle swarm optimization is used for trajectory clustering to obtain similar ship matching pairs.
[0035] (1) For the latitude and longitude information in the AIS data under continuous time, the distance between different ship trajectories is calculated based on the dynamic normalization method under the half tangent distance to obtain the similarity matrix between ship trajectories.
[0036] To realize the matching of ship trajectories with different sequence lengths, the distance between different ship trajectories is calculated based on the dynamic normalization method under the half tangent distance, and the half tangent distance calculation formula about coordinate and coordinate is shown in equation (7): (7) Wherein: and are the latitude and longitude coordinates of ship and ship .
[0037] Further, the local distance matrix is obtained, and the matrix element can be calculated by equation (8), is the normalization matrix, and the matrix element represents the distance from to The shortest distance between the two ships can be calculated by formula (9): (8) (9) After calculating all ship trajectory sequences using the above dynamic normalization method based on the Haversine distance, the similarity matrix between ship trajectories can be obtained , as shown in formula (10), where the similarity matrix element can be used to represent the similarity of the trajectory between ship and ship , the closer the distance between the two ship trajectories, the more similar the trajectories.
[0038] (10) (2) The DBSCAN clustering algorithm based on particle swarm optimization is used for trajectory clustering, and according to the similarity matrix between ship trajectories , the similar ship trajectory pair data is obtained.
[0039] Using the density-based clustering algorithm, define as the neighborhood radius, as the minimum number of samples, and according to the above similarity matrix between ship trajectories , the ship trajectory clustering results , are obtained. The number of ship trajectory clusters is based on the particle swarm optimization DBSCAN clustering algorithm. The objective function of the algorithm is the silhouette coefficient of the clustered trajectory data , and the specific steps of the algorithm are as follows: (2.1) Based on the similarity matrix between ship trajectories , use metric multidimensional scaling analysis to map ship trajectory data points in high-dimensional space to low-dimensional space while maintaining the distance relationship of the original similarity matrix .
[0040] Map the similarity matrix containing trajectory sequences to dimensional space, and ; randomly initialize the coordinate array in dimensional space, where the coordinates , and the distance between the coordinates is: (11) Iterate by gradient descent method to minimize the objective function to obtain the optimized coordinate array , and the objective function is: (12) (2.2) Based on the optimized coordinate array , using particle swarm optimization algorithm, the pre-defined parameters of DBSCAN clustering algorithm are regarded as the particles to be optimized in the algorithm, where is the neighborhood radius, is the minimum number of samples; is the velocity of the particle, representing the direction and step size of the particle position update; The velocity and position update of (13) (14) where: is the inertia weight, and are learning factors, and are random numbers uniformly distributed within , is the particle the historical optimal position at time , is the historical optimal position of all particles.
[0041] Under each parameter , the DBSCAN algorithm is used to cluster , and there is a clustering result .
[0042] (15) After updating the particle position, the clustering result is also updated, and the variance ratio criterion is used to evaluate the fitness of each particle.
[0043] (16) (17) (18) where: is the coordinate point of the trajectory in the low-dimensional space, is the mean of all coordinate points, is the mean of the coordinate points in the th cluster , is the label of the cluster to which the trajectory belongs; and are the total scatter matrix and the intra-cluster scatter matrix, respectively, to measure the degree of separation between clusters; to measure the degree of closeness of points within the same cluster, is the number of clusters, is the number of data points.
[0044] According to the variance ratio criterion, update the historical optimal position and the global optimal position as follows until the numerical change of is less than a predetermined threshold .
[0045] (19) (20) wherein: (2.3) the parameters obtained based on the particle swarm optimization algorithm , get the trajectory clustering results under the trajectory .
[0046] (2.4) based on the AIS data clustering above, slice all AIS data within the cluster, and calculate the similarity of two sequence slices and by formula (9) , get the most similar ship matching pair.
[0047] (21) wherein: is the maximum and minimum normalization function, , , , are the differences between and speed average, heading average, speed variance, and heading variance.
[0048] S103, based on the frequency domain multilayer perceptron and the contrast learning method to construct the ship macroscopic navigation mode encoder, and use the reconstruction sequence loss function and the sequence contrast learning loss function to train the ship macroscopic navigation mode encoder.
[0049] (1) for each group of AIS data in the AIS data set under continuous time, based on the geometric distribution, randomly mask M data in it, and combine the corresponding data in the similar ship matching pair to get the enhanced AIS data as the input set of the ship macroscopic navigation mode encoder.
[0050] (22) (23) wherein: for Similar ship matching pair data.
[0051] (2) Vector embedding is performed on the input data of the ship's macro navigation mode encoder to achieve dimensionality increase.
[0052] (twenty four) in: For the input set of the encoder, For embedding vectors, For the number of ships, For the original variable dimensions, In terms of time dimension, For the dimension of latent variables.
[0053] (3) Transform the upgraded data along the feature dimension using Fourier transform to convert it into features in the frequency domain containing information between variables. .
[0054] (25) Will The input is fed into the frequency domain multilayer perceptron module, and its output is then converted into features in the time domain through inverse Fourier transform.
[0055] (26) (27) in: and These represent the operations of extracting the real and imaginary parts of a complex number, respectively. and It is a weight matrix composed of complex numbers; and It is a bias vector composed of complex numbers; It is the imaginary unit; It is the ReLU activation function; Indicates the inverse Fourier transform, Transform back to features located in the time domain .
[0056] (4) Repeat the operations of formulas (25) to (27) on the obtained temporal spatial features, along the time dimension. The result is then recalculated and used as the output of the ship's macroscopic navigation mode encoder.
[0057] (28) in: This indicates the same processing operation as formulas (25) to (27).
[0058] (5) Calculation Similarity features And calculate the similarity coefficient between features. .
[0059] (29) (30) in: For calculation of fully connected layers, yes The weight matrix, yes The bias vector, , .
[0060] (6) Based on step (4) The aggregated features are obtained from the output of step (5). Further, the reconstructed trajectory sequence set is obtained. .
[0061] (31) (32) in: , ; It is a temperature hyperparameter; ; Calculations are performed for fully connected layers.
[0062] The ship macro navigation pattern encoder was pre-trained using the reconstruction sequence loss function and the sequence contrast learning loss function, and the combined loss function was then applied. As shown in formulas (33) to (35).
[0063] The loss function for reconstructing the sequence is: (33) The sequence comparison learning loss function is: (34) The total encoding loss function is: (35) in: It is the set of true values of the trajectory sequence. , yes Corresponding features.
[0064] S104, based on the hypergraph neural network, a ship micro-navigation mode decoder is constructed, and according to the feature vector output by the ship macro-navigation mode encoder, the nodes and hyperedges of the network are composed to obtain the dynamic information of the ship and the mutual influence information between the ships; and the training of the hypergraph neural network is carried out by calculating the loss term of the reconstructed trajectory and the loss term of the ship critical situation quantitative value.
[0065] (1) The feature vector output by the pre-trained ship macro-navigation mode encoder is used as the initial node of the hypergraph neural network.
[0066] (2) The similarity between nodes is calculated, and then the hyperedge of the hypergraph neural network is obtained, and the most relevant node combination under different scales is found through a greedy algorithm .
[0067] (36) (37) Wherein: , respectively represent the feature vectors of different nodes, Q represents the node set, represents the hyperedge composed of nodes in Q; is a similarity matrix; represents a node.
[0068] (3) Based on the initial node and the hyperedge, the hyperedge feature vector is calculated, and the updated node feature vector is obtained through the hyperedge feature vector.
[0069] (38) (39) (40) Wherein: , , are different connection layers, is a vector merging operation, is a Hadamard product, is the number of hyperedges containing .
[0070] (4) The corresponding ship critical situation quantitative value is calculated , the intermediate feature of the ship encounter scene is obtained by combining and , and the ship trajectory is reconstructed; wherein the intermediate feature of the ship encounter scene The output of the ship micro-navigation mode decoder.
[0071] (41) (42) (43) wherein: , , are calculated for different fully connected layers.
[0072] Finally, the whole model is trained using the new reconstruction sequence loss function and the loss function fitting the ship critical situation quantification value, the comprehensive loss function As shown in equation (46), The loss of the reconstructed trajectory is: (44) The loss of the ship critical situation quantification value is: (45) The total loss function of the decoder is: (46) wherein: is a real label of one of the ship critical situation quantification value data sets , any element in the set is in the form of , is a vector containing the time to closest point of approach and the distance to closest point of approach at the time .
[0073] The time to closest point of approach and the distance to closest point of approach are respectively: (47) (48) (49) (50) (51) (52) wherein: , are the longitude coordinate, the latitude coordinate, the speed, and the heading of the own ship and the target ship respectively; , are the speeds of the two ships in the direction of the latitude and the longitude respectively; is the distance between the two ships at the closest point of approach; is the time to the closest point of approach; is the secant range between the two ships, which can be calculated by equation (8).
[0074] The pre-trained overall network can be used to identify different encounter scenarios and calculate the similarity between encounter scenarios by inputting the AIS information of ships in different encounter scenarios. and are the AIS information of ships in two different encounter scenarios, and the intermediate features representing different encounter scenarios are extracted based on equation (42) and . By calculating the cosine similarity of the intermediate features and , the difference between different encounter scenarios can be quantified, so as to identify different ship navigation modes.
[0075] The above specific description further details the purpose, technical solutions and beneficial effects of the application. It should be understood that the above description is only a specific embodiment of the application and is not used to limit the protection scope of the application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principles of the application shall be included in the protection scope of the application.
Claims
1. A data-knowledge dual-driven unsupervised ship navigation pattern recognition method, characterized in that, The method comprises the following steps: (1) obtaining an AIS historical data set of all ships and pre-processing to obtain an AIS data set under continuous time, the AIS data comprising longitude and latitude coordinates, speed, heading and ship length data; (2) performing trajectory similarity matching according to the longitude and latitude coordinates in the AIS data set under continuous time, and performing trajectory clustering based on a DBSCAN clustering algorithm optimized by a particle swarm to obtain similar ship matching pairs; (3) constructing a ship macroscopic navigation mode encoder based on a frequency domain multi-layer perceptron and a contrast learning method, and pre-training the ship macroscopic navigation mode encoder using a reconstruction sequence loss function and a sequence contrast learning loss function; (4) constructing a ship microscopic navigation mode decoder based on a hypergraph neural network, and obtaining intermediate features of a ship encounter scenario according to feature vectors output by the pre-trained ship macroscopic navigation mode encoder to form nodes and hyperedges of the network, and performing joint training of the ship macroscopic navigation mode encoder and the ship microscopic navigation mode decoder by calculating a loss term of a reconstructed trajectory and a loss term of a ship critical situation quantization value; (5) obtaining real-time AIS data of a ship, inputting the trained ship macroscopic navigation mode encoder and ship microscopic navigation mode decoder to obtain intermediate features of a ship encounter scenario. The pre-processing specifically comprises:
2. The data-knowledge dual-driven unsupervised ship navigation pattern recognition method according to claim 1, characterized in that, (1.2) segmenting and removing each updated AIS data of a ship; (1.1) For each AIS data of the ship, the AIS data with the same timestamp is saved in the same AIS data vector, and the AIS data vectors are arranged in ascending order according to the timestamp, to obtain the updated AIS data of each ship: The timestamp difference of the adjacent AIS data vector is greater than or equal to 1. calculating the difference between the time stamps of two adjacent AIS data vectors, if the difference is greater than a first threshold, the two AIS data vectors are taken as a segmentation point, and the updated AIS data of each ship is divided into multiple segmentation blocks according to the segmentation point; for the segmented AIS data, count the number of AIS data vectors in each segmentation block, if the number is less than a second threshold, the segmentation block is removed; (1.3) for each segmentation block, an improved Rida criterion method is used to remove outliers; for any feature element in the AIS data vector in each segmentation block, a sliding window is used for sampling; the sampled feature element sequence is judged and outliers are removed; wherein: β is a second threshold value; is any sequence of feature elements in the AIS data vector of any partitioned block; is the number of the sequence of feature elements. the step (1.4) specifically comprises: in: for The average value, for The variance does not exceed Scope Divide into a retainable data array ,Exceed Scope Divide into the data array to be deleted ; If the number of elements in the element is less than a third threshold, then the entire is culled. (1.4) The data obtained in step (1.3) is interpolated using a cubic spline interpolation method The interpolation is performed and the values with data jumps are corrected to obtain data with continuous time stamps.
3. The data-knowledge dual-driven unsupervised ship voyage pattern recognition method according to claim 2, characterized in that, if the time stamps of adjacent data are not continuous, the data with continuous time stamps are obtained by interpolation according to the corresponding cubic polynomial; for For each pair of adjacent data points, a cubic polynomial is obtained by fitting the data using cubic spline interpolation. ; wherein: , , , are the coefficients of the cubic polynomial; the step (2) specifically comprises: For the AIS data in the direction of the data, close to or near the data interpolation, if there is a data jump phenomenon, the unreasonable data jump after interpolation is corrected; wherein: is the interpolated heading data.
4. The data-knowledge dual-driven unsupervised ship voyage pattern recognition method according to claim 1, characterized in that, the step (2.2) specifically comprises: (2.1) For the latitude and longitude information in AIS data in continuous time, the distance between different ship trajectories is calculated based on the dynamic scaling method under the semi-chord distance, and the similarity matrix between ship trajectories is obtained ; wherein: with is the latitude coordinate of the ship with the ship ; and is the longitude coordinate of the ship is the earth radius; a similarity matrix element between ship trajectories is used to represent the similarity between ship trajectories; (2.2) The DBSCAN clustering algorithm based on particle swarm optimization is used for trajectory clustering, and the similar ship trajectory pair data is obtained according to the similarity matrix between ship trajectories .
5. The data-knowledge dual-driven unsupervised ship voyage pattern recognition method according to claim 4, characterized in that, the ship macroscopic navigation mode encoder in the step (3) specifically comprises: (2.2.1) based on the similarity matrix among the ship trajectories , using metric multidimensional scaling analysis to map the ship trajectory data points in high-dimensional space into low-dimensional space while maintaining the distance relationship of the original similarity matrix The similarity matrix of the sequence of trajectories is calculated mapped to a 2-dimensional space , and ; the coordinate array is randomly initialized in a 2-dimensional space where the coordinates , the distance between coordinates is: The optimized coordinate array is obtained by iteration through gradient descent method to minimize the objective function , the objective function is: (2.2.2) Based on the optimized coordinate array , using the particle swarm optimization algorithm, the predefined parameters of the DBSCAN clustering algorithm are considered as the optimized particles in the algorithm; is the velocity of , indicating the direction and step length of the particle position update; The velocity and position of are updated as follows: in: The neighborhood radius, Minimum sample size It is inertial weight. and It is a learning factor. and Is Uniformly distributed random numbers within the range. It is a particle exist The historical best position at any given moment. It is the historical optimal position of all particles; In each parameter Next, using DBSCAN algorithm to cluster, there is a cluster result ; After updating the particle positions, the clustering results are updated simultaneously using the variance ratio criterion Evaluate the fitness of each particle; wherein: is a coordinate point of the trajectory in the low-dimensional space, is the mean of all coordinate points, is the cluster of the coordinate point, is the label of the cluster the trajectory belongs to; and are the total scatter matrix and the within-cluster scatter matrix, respectively, to measure the degree of separation between clusters; to measure the closeness of points within the same cluster, is the number of clusters, is the number of data points; According to the variance ratio criterion, the historical optimal position and the global optimal position are updated as follows until the numerical variation range of the value of the objective function is less than a predetermined threshold ; (2.2.3) parameters obtained based on particle swarm optimization algorithm , get trajectory clustering results under the trajectory of this parameter ; (2.2.4) Based on the above AIS data after clustering, all AIS data in the cluster are sliced, and two sequence slices are calculated With Similarity , get the most similar ship matching pair; wherein: is a max-min normalization function, , , , are respectively and the difference of the mean of the speed, the difference of the mean of the heading, the difference of the mean square of the speed, the difference of the mean square of the heading.
6. The data-knowledge dual-driven unsupervised ship voyage pattern recognition method according to claim 1, characterized in that, (3.1) for each group of AIS data in the AIS data set under continuous time, M data in each group are randomly masked based on a geometric distribution, and enhanced AIS data are obtained by combining the corresponding data in the similar ship matching pairs as the input set of the ship macroscopic navigation mode encoder; (3.2) vector embedding is performed on the input data of the ship macroscopic navigation mode encoder to realize dimensionality increase; wherein: is similar ship pair data; the reconstruction sequence loss function is: wherein: is an input set for an encoder, is an embedding vector, is a number of ships, is an original variable dimension, is a time dimension, is a latent variable dimension; (3.3) transforming the dimensionally increased data into features containing information between variables in the frequency domain space by Fourier transform along the feature dimension ; Will The input is fed into a frequency domain multilayer perceptron, and its output is then converted into time-domain features through an inverse Fourier transform. wherein: and represent the operation of extracting the real and imaginary parts of a complex number, respectively; and is a weight matrix consisting of complex numbers; and is a bias vector consisting of complex numbers; is the imaginary unit; is the relu activation function; represents the inverse Fourier transform, converting back to the features located in the time domain space ; (3.4) repeat the operation of step (3.3) for the obtained time-domain space to calculate the feature along the time dimension the result as the output of the ship macroscopic navigation pattern encoder; wherein: denotes the same processing operation as in step (3.3); (3.5) calculating the similarity features of the features and calculating the similarity coefficient between the features ; wherein: is a weight matrix for the fully connected layer, is a bias vector for the fully connected layer, is a bias vector for the fully connected layer, , ; (3.6) obtaining the aggregated features based on the output of step (3.4) and the output of step (3.5), obtaining the aggregated features , further obtaining the reconstructed trajectory sequence set ; wherein: , ; is a temperature hyperparameter; ; for the fully connected layer computation.
7. The data-knowledge dual-driven unsupervised ship voyage pattern recognition method according to claim 6, characterized in that, the sequence contrast learning loss function is: the total encoder loss function is: the ship macroscopic navigation mode encoder is trained according to the total encoder loss function. wherein: is a set of trajectory sequence ground truths, , is corresponding features; the step (4) specifically comprises:
8. The data-knowledge dual-driven unsupervised ship voyage pattern recognition method according to claim 1, characterized in that, (4.1) taking the feature vector output by the pre-trained ship macro-navigation mode encoder as an initial node of the hypergraph neural network; (4.2) Calculate the similarity between nodes, and then get the hyperedge of the hypergraph neural network, and find the most relevant node combination at different scales through the greedy algorithm ; wherein: , respectively represent feature vectors of different nodes, Q represents a node set, represents a hyperedge composed of nodes in Q; is a similarity matrix; represents a node; (4.3) calculating the hyperedge eigenvector based on the initial nodes and the hyperedge , and obtaining the updated node eigenvector through the hyperedge eigenvector ; wherein: , , are different fully connected layers computations, is a vector merge operation, is a Hadamard product, is a super edge number containing . (4.4) calculating a corresponding ship criticality value , in combination with an intermediate feature of the ship encounter scenario , and reconstructing the ship trajectory ; wherein the intermediate feature of the ship encounter scenario is an output of the ship micro-navigation pattern decoder wherein: , , are computed for different fully connected layers.
9. The data-knowledge dual-driven unsupervised ship voyage pattern recognition method according to claim 8, characterized in that, The loss of the reconstructed trajectory is: The loss of the ship critical situation quantitative value is: The total loss function is: in: Its data set of quantitative values for ship emergency situations A real label in the set, and any element in the set. The form is , It is a vector, contained in The time to reach the nearest meeting point and the distance to the nearest meeting point at any given moment; The joint training of the ship macro-navigation mode encoder and the ship micro-navigation mode decoder is performed based on the total loss function.
10. The data-knowledge dual-driven unsupervised ship voyage pattern recognition method according to claim 9, characterized in that, The arrival time at the nearest encounter point and the distance of the nearest encounter point are respectively: wherein: , are the longitude and latitude coordinates, the speed and the heading of the own ship and the target ship , respectively; , are the projections of the ship speeds along the latitude and longitude directions; is the closest point of approach distance between the two ships; is the time to go to the closest point of approach; is the secant distance between the two ships.
Citation Information
Cited By
Ship trajectory anomaly detection method and system based on KAN network
CN121580042A
A ship trajectory anomaly detection method and system based on a KAN network
CN121580042B
