Ship trajectory clustering method, device, equipment and medium
By combining the weighted calculation of geometric similarity and dynamic characteristics, the problem of inaccurate ship trajectory clustering results in the existing technology is solved, fine-grained clustering and more accurate waterway information extraction are achieved, and it provides a solution for intelligent maritime traffic supervision. Data support.
Patent Information
- Application Number
- CN202411291279.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-14
- Publication Date
- 2025-01-24
AI Technical Summary
When clustering ship trajectory, the prior art mainly relies on geometric position characteristics and ignores dynamic attributes, such as velocity, direction, steering angle, etc., resulting in inaccurate clustering results.
By extracting ship trajectories from AIS data, calculating the two-way Hausdorff distance and moving feature similarity distance, combined with geometric similarity and dynamic features, a weighted calculation is performed to obtain the trajectory similarity measure, and then cluster analysis is performed.
It achieves fine-grained clustering of ship trajectories, improves the accuracy of clustering results, can better extract channel information, and provides data support for intelligent maritime traffic supervision.
Smart Images

Figure CN119357709A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of geographic information technology, and in particular to a ship trajectory clustering method, device, equipment and medium. Background Art
[0002] The massive data provided by the Automatic Identification System (AIS) contains rich trajectory information. Reliable feature extraction, analysis and mining of AIS data are helpful to obtain the traffic flow status of the sea area, explore the maritime traffic mode, and provide support for intelligent maritime traffic supervision. Among the many track analysis tasks, ship track clustering is a basic and key field. By dividing the track data set into multiple clusters to improve the similarity of intra-cluster data compared to inter-cluster data, the effective organization of data can be achieved, so as to provide reliable technical support for maritime traffic supervision based on the results of data analysis.
[0003] In related technologies, some trajectory clustering methods tend to focus on the geometric position characteristics of ship trajectories, that is, spatial morphological characteristics, when evaluating the similarity of ship trajectories. They mainly determine the similarity between ship trajectories by comparing the spatial positions of each discrete trajectory point, ignoring the potential movement mode characteristics in the trajectory data, such as speed, direction, steering angle and other dynamic attributes. However, these dynamic attributes may contain key information about the behavior and intention of the ship, which is particularly important for understanding the dynamics of maritime traffic and conducting effective navigation management.
[0004] Therefore, the relevant technology cannot achieve fine-grained clustering of ship trajectories, and the clustering results are inaccurate. Summary of the invention
[0005] The present application provides a ship trajectory clustering method, device, equipment and medium to solve the defects of the above-mentioned related technologies. The technical solution is as follows:
[0006] In a first aspect, an embodiment of the present application provides a ship trajectory clustering method, the method comprising:
[0007] Extracting multiple ship tracks from the AIS data; wherein each of the ship tracks includes multiple track points;
[0008] Calculating a bidirectional Hausdorff distance between every two ship trajectories, and obtaining a geometric similarity distance between every two ship trajectories according to the bidirectional Hausdorff distance;
[0009] Extracting a ship movement feature vector of each of the ship trajectories by using a trained trajectory movement feature extraction model, and calculating a movement feature similarity distance between each two ship movement feature vectors;
[0010] A trajectory similarity measure is obtained based on a weighted calculation of a geometric similarity distance and a movement feature similarity distance between each two ship trajectories;
[0011] Based on the trajectory similarity measure between every two ship trajectories, cluster analysis is performed on all ship trajectories, a ship trajectory clustering result is output, and channel information is determined according to the ship trajectory clustering result.
[0012] In an optional solution of the first aspect, extracting multiple ship tracks from AIS data includes:
[0013] Acquire the AIS data, and filter the discrete trajectory points that meet preset conditions according to the trajectory numbers, time information, and location information of the discrete trajectory points in the AIS data;
[0014] Obtain all discrete trajectory points with the same trajectory number to obtain the ship trajectory corresponding to the trajectory number;
[0015] The time interval between every two adjacent track points in each of the ship tracks is extracted, the ship track is segmented at the track point positions where the time interval is greater than a time interval threshold, and the segmented ship track is output.
[0016] In an optional solution of the first aspect, the calculating the bidirectional Hausdorff distance between every two ship trajectories comprises:
[0017] Calculate the first Euclidean distance from each track point in the first ship track to each track point in the second ship track, and calculate the second Euclidean distance from each track point in the second ship track to each track point in the first ship track;
[0018] Determine a first Hausdorff distance from the first ship track to the second ship track based on the first Euclidean distance, and determine a second Hausdorff distance from the second ship track to the first ship track based on the second Euclidean distance;
[0019] determining a bidirectional Hausdorff distance between the first ship track and the second ship track based on a maximum value of the first Hausdorff distance and the second Hausdorff distance;
[0020] The first ship trajectory and the second ship trajectory are different ship trajectories, and the first ship trajectory and the second ship trajectory are respectively any one of the multiple ship trajectories.
[0021] In an optional solution of the first aspect, before extracting the ship movement feature vector of each ship trajectory by using the trained trajectory movement feature extraction model, the method includes:
[0022] Obtaining the motion attribute of each track point in each of the ship tracks;
[0023] Arranging the motion attributes of each trajectory point in the order of the trajectory points in each of the ship trajectories, and generating trajectory sequences corresponding to the ship trajectories respectively;
[0024] The motion attributes include speed data and a turning rate of each track point, the speed data of each track point is extracted based on the AIS data, and the turning rate is calculated based on the heading data of every two adjacent track points in the ship track.
[0025] In an optional solution of the first aspect, extracting the ship movement feature vector of each ship trajectory by using a trained trajectory movement feature extraction model includes:
[0026] Inputting the trajectory sequence of each ship trajectory into the trained trajectory movement feature extraction model, wherein the trained trajectory movement feature extraction model extracts a ship movement feature vector based on the trajectory sequence of each ship trajectory, wherein each of the ship movement feature vectors has the same length;
[0027] The calculation of the movement feature similarity distance between each two ship movement feature vectors is performed by applying the formula:
[0028]
[0029] Among them, d2(o,r) is the movement feature similarity distance, g is the length of the ship movement feature vector, i is the ordinal number of the ship movement feature in the ship movement feature vector, and o and r are the ship movement feature vectors.
[0030] In an optional solution of the first aspect, before performing cluster analysis on all ship trajectories based on the trajectory similarity measure between every two ship trajectories, determining clustering parameters of the cluster analysis based on the trajectory similarity measure between every two ship trajectories includes:
[0031] Based on the trajectory similarity measurement between every two ship trajectories in the plurality of ship trajectories, a trajectory similarity measurement matrix is constructed:
[0032] D n×n ={d(i,j)|1≤i≤n,1≤j≤n};
[0033] Arrange each row in the similarity measure matrix in ascending order based on the numerical value of the trajectory similarity measure, and output a K proximity matrix; wherein the Kth column of the K proximity matrix is the Kth proximity distance of all ship trajectories;
[0034] The clustering parameters are determined based on the K neighbor matrix, and the clustering parameters include the clustering distance radius and the minimum number of clustering trajectories; wherein, D n×n is the trajectory similarity measurement matrix, d(i,j) is the trajectory similarity measurement of the i-th row and j-th column in the trajectory similarity measurement matrix, and n is the number of the ship trajectories.
[0035] In an optional solution of the first aspect, performing cluster analysis on all ship trajectories based on the trajectory similarity measure between every two ship trajectories and outputting a ship trajectory clustering result includes:
[0036] Acquire at least one trajectory cluster obtained by the cluster analysis, the number of ship trajectories in each trajectory cluster being greater than or equal to the minimum number of cluster trajectories, and output the ship trajectory clustering result including all trajectory clusters;
[0037] The channel information includes the channel and the distribution of ship types corresponding to the channel, and determining the channel information according to the ship trajectory clustering result includes:
[0038] A corresponding waterway is determined according to each trajectory cluster, and the ship type distribution on each waterway is determined according to the ship type corresponding to each ship trajectory extracted by the trained trajectory movement feature extraction model.
[0039] In a second aspect, an embodiment of the present application further provides a ship trajectory clustering device, comprising:
[0040] A data module, used to extract multiple ship tracks from AIS data; wherein each of the ship tracks includes multiple track points;
[0041] A trajectory similarity measurement module, used for calculating the bidirectional Hausdorff distance between every two ship trajectories, and obtaining the geometric similarity distance between every two ship trajectories according to the bidirectional Hausdorff distance;
[0042] The trajectory similarity measurement module is also used to extract the ship movement feature vector of each of the ship trajectories through the trained trajectory movement feature extraction model, and calculate the movement feature similarity distance between each two ship movement feature vectors;
[0043] The trajectory similarity measurement module is also used to obtain the trajectory similarity measurement based on the weighted calculation of the geometric similarity distance and the movement feature similarity distance between each two ship trajectories;
[0044] The clustering module is used to perform cluster analysis on all ship trajectories based on the trajectory similarity measurement between every two ship trajectories, output the ship trajectory clustering result, and determine the channel information according to the ship trajectory clustering result.
[0045] In a third aspect, an embodiment of the present application further provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method provided in the first aspect of the embodiment of the present application or any one of the implementation methods of the first aspect is implemented.
[0046] In a fourth aspect, the present application also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method provided by the first aspect of the embodiment of the present application or any one of the implementations of the first aspect.
[0047] The beneficial effects brought about by the technical solutions provided by some embodiments of the present application include at least:
[0048] The embodiment of the present application first obtains multiple ship trajectory data through AIS data, calculates the Hausdorff distance between the ship trajectories to quantify the geometric similarity between the trajectories, extracts the movement characteristics of the ship trajectories through a trained trajectory movement feature extraction model, and quantifies the movement feature similarity between the ship trajectories. By combining the geometric similarity and the movement feature similarity, the static geometric characteristics of the geometric position of the trajectory and the dynamic movement characteristics of the trajectory such as speed, direction, steering angle, etc. are integrated, so that the similarity between the trajectories can be calculated more objectively, and the defect of the related technology that only the spatial position of the trajectory is analyzed, which easily leads to the omission of key information such as ship behavior and heading, etc., and the ship trajectories are clustered according to the fused similarity index, so as to obtain more accurate clustering results, thereby better extracting waterway information, and providing data support for intelligent maritime traffic supervision. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] In order to more clearly illustrate the technical solutions in the present application or related technologies, the drawings required for use in the embodiments or related technical descriptions are briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0050] Figure 1 It is a flow chart of a ship trajectory clustering method provided in an embodiment of the present application;
[0051] Figure 2 It is a schematic diagram of bidirectional distance calculation of a ship trajectory clustering method provided in an embodiment of the present application;
[0052] Figure 3 It is a schematic diagram of a flow chart of extracting movement features of ship trajectories in a ship trajectory clustering method provided in an embodiment of the present application;
[0053] Figure 4 It is a structural schematic diagram of a ship trajectory clustering device provided in an embodiment of the present application;
[0054] Figure 5 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0055] In order to make the purpose, technical solutions and advantages of this application clearer, the technical solutions in this application will be clearly and completely described below in conjunction with the drawings in this application. Obviously, the described embodiments are part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0056] The terms "including" and "having" and any variations thereof in the specification and claims of the present application and the above drawings are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device including a series of steps or modules is not limited to the listed steps or modules, but may optionally include steps or modules that are not listed, or may optionally include other steps or modules that are inherent to these processes, methods, products or devices.
[0057] It should be noted that the terms "first\second" involved in the present application are only used to distinguish similar objects, and do not represent a specific order for the objects. It is understandable that "first\second" can be interchanged with a specific order or sequence where permitted. It should be understood that the objects distinguished by "first\second" can be interchanged where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those described or illustrated herein.
[0058] The present application is described in detail below with reference to specific embodiments.
[0059] Next, combine Figure 1 , taking a terminal executing a ship trajectory clustering method as an example, a ship trajectory clustering method provided by an embodiment of the present application is introduced. For details, please refer to Figure 1 , Figure 1 A schematic diagram of a process of clustering ship trajectories provided in an embodiment of the present application is shown, and the method comprises the following steps:
[0060] S101, extract multiple ship tracks from AIS data.
[0061] S102, calculating the bidirectional Hausdorff distance between every two ship trajectories, and obtaining the geometric similarity distance between every two ship trajectories according to the bidirectional Hausdorff distance.
[0062] S103, extracting the ship movement feature vector of each ship trajectory through the trained trajectory movement feature extraction model, and calculating the movement feature similarity distance between every two ship movement feature vectors.
[0063] S104, obtaining a trajectory similarity measure based on a weighted calculation of a geometric similarity distance and a movement feature similarity distance between every two ship trajectories.
[0064] S105, performing cluster analysis on all ship trajectories based on the trajectory similarity measurement between every two ship trajectories, outputting the ship trajectory clustering result, and determining the channel information according to the ship trajectory clustering result.
[0065] In some embodiments, in S101, existing AIS data can be obtained through the Automatic Identification System (AIS). For example, a certain sea area and a corresponding time period can be selected to extract the AIS data within the sea area within a given time period. It can be understood that the AIS data includes but is not limited to the location, speed, heading and other information of the ship, which is transmitted in real time through the AIS system, which can facilitate communication between ships and between ships and shore management agencies.
[0066] In some embodiments, in S101, the acquired AIS data is a plurality of discrete trajectory point data, and all discrete trajectory points of each ship are determined by the Maritime Mobile Service Identity (MMSI) of the discrete trajectory point data, thereby extracting a ship trajectory, that is, each ship trajectory includes a plurality of discrete trajectory points.
[0067] It should be noted that the Maritime Mobile Service Identification Code (MMSI) is a nine-digit code sent by the ship's radio communication system on its radio channel that can uniquely identify various types of stations and group call stations, and can be used to determine the corresponding ship information.
[0068] In some embodiments, after extracting multiple ship trajectories, the trajectory data can be pre-processed, including but not limited to deleting non-9-digit MMSI, incorrectly formatted time, and track points with abnormal headings. In addition, track points repeatedly received by the AIS system and track points that have been anchored for a long time are deleted, and outlier track points are detected and deleted. Outlier track points can be understood as position offset points caused by GPS positioning anomalies or signal interference.
[0069] In some embodiments, in S101, discrete trajectory points that meet preset conditions can be screened according to the trajectory number, time information, and location information of the discrete trajectory points in the AIS data, and all discrete trajectory points with the same trajectory number can be obtained to obtain the ship trajectory corresponding to the trajectory number; wherein the trajectory number can be the maritime mobile service identification code MMSI.
[0070] Specifically, the time interval between every two adjacent track points in each ship track can be extracted, and when the time interval is greater than the time interval threshold T seg The ship trajectory is segmented at the trajectory point position, and the segmented ship trajectory is output. For example, if the time interval between two adjacent trajectory points is greater than the time interval threshold T seg , the ship trajectory is divided into two segments. If there are two pairs of adjacent trajectory points whose time interval is greater than the time interval threshold T seg , then the ship trajectory is divided into three segments at the corresponding trajectory point positions.
[0071] In some embodiments, in S102, calculating the bidirectional Hausdorff distance between every two ship trajectories includes:
[0072] Calculate the first Euclidean distance from each track point in the first ship track to each track point in the second ship track, and calculate the second Euclidean distance from each track point in the second ship track to each track point in the first ship track;
[0073] Determine a first Hausdorff distance from the first ship track to the second ship track based on the first Euclidean distance, and determine a second Hausdorff distance from the second ship track to the first ship track based on the second Euclidean distance;
[0074] determining a bidirectional Hausdorff distance between the first ship track and the second ship track based on a maximum value of the first Hausdorff distance and the second Hausdorff distance;
[0075] The first ship trajectory and the second ship trajectory are different ship trajectories, and the first ship trajectory and the second ship trajectory are respectively any one of the multiple ship trajectories.
[0076] For example, Figure 2 As shown in FIG. 1 , the calculation process of the Hausdorff distance between two ship trajectories includes:
[0077] For example, Figure 2 a shows the Hausdorff distance from the ship trajectory P to Q. The coordinates of the two ship trajectories are expressed as P = (p1, p2, ... p α ) and Q=(q1,q2,…,q β), α and β are the number of trajectory points in the two ship trajectories, and the one-way Hausdorff distance from ship trajectory P to ship trajectory Q, i.e. the first Hausdorff distance, is:
[0078] h(P,Q)=max{min{||p α -q β ||}};
[0079] Where ‖·‖ represents the Euclidean distance between a trajectory point in the ship trajectory P and a trajectory point in the ship trajectory Q, min{||p α -q β ||} means taking trajectory point p α to q β The minimum value of the Euclidean distance is taken as a trajectory point pair p α -q β The Euclidean distance of max{min{||p α -q β ||}} means taking the maximum value of the Euclidean distances of all trajectory point pairs as the one-way Hausdorff distance from the ship trajectory P to the ship trajectory Q.
[0080] It should be noted that since the Hausdorff distance is asymmetric, the distance from trajectory P to trajectory Q is as follows: Figure 2 As shown in a, the distance from trajectory Q to trajectory P is Figure 2 As shown in FIG. 2 , referring to the above calculation of the one-way Hausdorff distance from the ship trajectory P to the ship trajectory Q, the one-way Hausdorff distance from the ship trajectory Q to the ship trajectory P is calculated including:
[0081] h(Q,P)=max{min{||q β -p α ||}};
[0082] Furthermore, the bidirectional Hausdorff distance is calculated:
[0083] H(P,Q)=max{h(P,Q),h(Q,P)};
[0084] Based on the maximum value of the two one-way Hausdorff distances, i.e., the first Hausdorff distance h(P, Q) and the second Hausdorff distance h(Q, P), the two-way Hausdorff distance H(P, Q) between the first ship trajectory P and the second ship trajectory Q is determined. The two-way Hausdorff distance is as follows: Figure 2 As shown in c.
[0085] Further, in S102, the calculated bidirectional Hausdorff distance is the geometric similarity distance between the two ship trajectories, and the maximum mismatch degree between the two trajectories is further determined. The smaller the geometric similarity distance is, the greater the geometric similarity measure between the two trajectories is.
[0086] In some embodiments, the value of the geometric similarity measure corresponding to the bidirectional Hausdorff distance can be determined by a mapping table or a fitting calculation, which is not limited in this embodiment of the present application.
[0087] Specifically, in S103, the ship movement feature vector of each ship trajectory may be extracted by using the trained trajectory movement feature extraction model, and then the movement feature similarity distance may be calculated to quantify the movement feature similarity between the ship trajectories.
[0088] In some embodiments, the trained trajectory movement feature extraction model may be a one-dimensional Unet network model.
[0089] In some embodiments, Figure 3 As shown, before executing step S103 to extract the ship movement feature vector, the motion attribute of each trajectory point can be determined based on the trajectory data, including:
[0090] Get the motion attributes of each track point in each ship track;
[0091] Arranging the motion attributes of each trajectory point in the order of the trajectory points in each ship trajectory, and generating trajectory sequences corresponding to the ship trajectories respectively;
[0092] Among them, the motion attributes include the speed data and turning rate of each trajectory point.
[0093] In some embodiments, speed data of each track point may be extracted based on AIS data, wherein the speed data includes the speed and acceleration of the vessel at the track point.
[0094] Exemplarily, calculating the velocity and acceleration of each trajectory point includes:
[0095]
[0096] Among them, x1 and y1 represent the coordinates of the trajectory point at time t1, x2 and y2 represent the coordinates of trajectory point 1 at time t2, t1 and t2 are time, a is acceleration, and v is acceleration.
[0097] In some embodiments, the heading data between every two adjacent track points can also be extracted based on the AIS data, that is, the turning rate of the ship at the position of the latter track point of the two adjacent track points is obtained by calculating the headings of the two adjacent track points.
[0098] Exemplarily, calculating the turning rate of each trajectory point includes:
[0099]
[0100] Among them, COG1 and COG2 represent the ground headings of two adjacent track points (i.e., the clockwise angle between the ship heading and the north direction), and the value range is [0°, 360°).
[0101] Furthermore, the calculated motion attributes may be zero-filled and normalized, and then input into a trained trajectory movement feature extraction model to extract a ship movement feature vector.
[0102] In some embodiments, in S103, the trajectory sequence of each ship trajectory is input into a trained trajectory movement feature extraction model, and the ship movement feature vector is extracted based on the trajectory sequence of each ship trajectory by the trained trajectory movement feature extraction model, specifically including:
[0103] The first feature is extracted by the convolution layer of the trained trajectory movement feature extraction model, for example, using a convolution kernel with a width of h For the trajectory segment T in the trajectory sequence i:i+h-1 Calculate and get the first feature c i for:
[0104]
[0105] Among them, f represents a nonlinear activation function, such as ReLU; b represents a bias value.
[0106] The feature vector generated after calculation
[0107] Where η is the trajectory sequence length, s is the window moving step, and floor[·] is the floor rounding function.
[0108] Furthermore, the second feature is extracted through pooling operation, which specifically includes:
[0109] The coarse-grained main features are obtained by interval sampling, and the trajectory segment features C with a window size of l are i*s:i*s+l-1 , take its maximum eigenvalue as the output, and apply the formula:
[0110]
[0111] After calculation, the new feature vector is output as:
[0112]
[0113] Furthermore, upsampling is performed through the upsampling block of the trained trajectory motion feature extraction model to gradually restore the input size of the feature map. For the input feature map P, the upsampling operation with a step size of s and a convolution kernel size of k is applied, and the formula is:
[0114] U=WT P;
[0115] Among them, W is the sparse matrix of the convolution kernel, U = {u1,u2,…u s(i-1)+k} is the output feature vector.
[0116] Finally, the trained trajectory movement feature extraction model introduces a fully connected layer to obtain a 128-dimensional ship movement feature vector, and each ship movement feature vector has the same length.
[0117] In some embodiments, the ship movement feature vector output by the last fully connected layer can characterize the deep movement pattern of the ship trajectory, and this vector can be used for trajectory clustering analysis in S105.
[0118] In some embodiments, after extracting the ship movement feature vector, the probability of the ship trajectory being identified as various ship types can be output, for example, the probability of identifying a fishing boat is 0.1 and the probability of identifying a cargo ship is 0.9, which is not limited to this embodiment of the present application.
[0119] Further, in S103, the movement feature similarity distance between every two ship movement feature vectors is calculated, including:
[0120] According to the Euclidean distance between the extracted ship movement feature vectors as the movement feature similarity distance, a movement feature similarity measurement matrix is constructed. For example, the ship movement feature vector of the ship trajectory P is o = (o1, o2, ..., o g ), the ship movement feature vector of the ship trajectory Q is r=(r1,r2,…,r g ), g is the length of the ship movement feature vector, and the calculation formula for the movement feature similarity distance of two ship trajectories is as follows:
[0121]
[0122] Further, based on the geometric similarity distance between the two ship trajectories calculated in S102 and the movement feature similarity distance calculated in S103, a trajectory similarity measure between the two sets of ship trajectories can be calculated.
[0123] It should be noted that the step of calculating the geometric similarity distance in S102 and the step of calculating the moving feature similarity distance in S103 can be executed simultaneously, or S102 can be executed first and then S103, or S103 can be executed first and then S102. This embodiment of the present application is not limited to this.
[0124] Specifically, in S104, the geometric similarity distance and the moving feature similarity distance may be normalized respectively to eliminate the influence of different dimensions.
[0125] In some embodiments, the geometric similarity distance may be normalized and assigned a geometric similarity metric, the moving feature similarity distance may be normalized and assigned a moving feature similarity metric, and then the two metrics are fused according to a preset weight to obtain a trajectory similarity metric.
[0126] In some embodiments, the geometric similarity distance and the moving feature similarity distance may be fused by weighted sum of linear functions to obtain the trajectory similarity measure d between the two trajectories, and the application formula is:
[0127] d = k1d′1+k2d2′;
[0128] Among them, d′1 is the geometric similarity distance of the trajectory data, d′2 is the moving feature similarity distance of the trajectory data, k1 and k2 are the weights of the geometric similarity distance and the moving feature similarity distance respectively, the sum of k1 and j2 is 1, and the specific values of k1 and j2 can be determined based on historical data, which is not limited in the embodiment of the present application.
[0129] Further, according to the trajectory similarity measure calculated in S104, S105 is executed. Before clustering analysis is performed on all ship trajectories, the clustering parameters of the clustering analysis are first determined based on the trajectory similarity measure between every two ship trajectories, that is, the distance radius ε and the minimum number of trajectories MinLns in the neighborhood when a trajectory segment can become a core trajectory. The minimum number of trajectories can be understood as the minimum number of trajectories obtained by clustering in a cluster cluster.
[0130] The process of generating the cluster distance radius ε specifically includes:
[0131] Based on the trajectory similarity measurement between every two ship trajectories in multiple ship trajectories, the trajectory similarity measurement matrix is constructed:
[0132] D n×n ={d(i,j)|1≤i≤n,1≤j≤n};
[0133] Wherein, d(i,j) is the trajectory similarity measure between the i-th trajectory and the j-th trajectory calculated according to S104, n is the number of ship trajectories, and D n×n is the trajectory similarity measurement matrix.
[0134] Furthermore, each row in the similarity measure matrix is arranged in ascending order based on the numerical value of the trajectory similarity measure, that is, from left to right in each row, the numerical values of the trajectory similarity measure are arranged in ascending order to obtain a K-neighborhood matrix, and the K-th column of the K-neighborhood matrix is the K-th neighbor distance of all ship trajectories;
[0135] Furthermore, the distance radius ε and the minimum number of trajectories can be determined according to the K neighbor matrix, including:
[0136] Take the average of each column of the sorted K nearest neighbor matrix and get Multiply by the self-attenuation term (1-λ 2 ) to get the ε parameter corresponding to each column, and then output the ε parameter list, applying the formula:
[0137]
[0138] The value range of the self-attenuation coefficient λ may be 0≤λ≤1. The greater the density difference between clusters of the data set or the more noise it contains, the larger the value of λ.
[0139] Furthermore, the minimum number of trajectories MinLns corresponding to each ε parameter is determined. For each determined ε, there is an optimal minimum number of trajectories MinLns corresponding to it.
[0140] Specifically, for each ε in the ε parameter list, a MinLns value range is given for traversal, and the trajectory data are clustered using a fixed ε parameter and different minimum trajectory numbers MinLns. Then, the CCPM indicator is used to evaluate the clustering effect, and the formula is applied:
[0141]
[0142] Where SC is the silhouette coefficient, and the application formula is:
[0143]
[0144] Where i is any object in the dataset, A represents the cluster to which it has been assigned, a(i) represents the average distance between object i and other objects in cluster A, and b(i) represents the minimum value of the average distance between object i and other objects not in cluster A.
[0145] DBI represents the degree of dispersion within the cluster and between clusters, and the application formula is:
[0146]
[0147] Among them, A i is the center of a cluster, N i is the number of trajectories contained in the cluster, X j is an object in the cluster, d(X j ,A i ) represents the distance between the center of the cluster and the objects in the cluster.
[0148] Specifically, after obtaining the CCPM index, the minimum number of trajectories MinLns corresponding to the best clustering effect, that is, the maximum CCPM value, is selected as the optimal MinLns value corresponding to the current ε parameter.
[0149] Furthermore, each distance radius ε parameter and the corresponding optimal MinLns value can be selected for clustering respectively, and the number of clusters N obtained by clustering the parameter combination of each distance radius ε parameter and the corresponding optimal MinLns value can be counted. A set of combined parameters can be selected according to the number of clusters of each set of parameter combinations. For example, the combined parameters with the smallest change in the number of clusters obtained after multiple clustering are selected as the optimal clustering parameters, and clustering analysis can be performed using the optimal clustering parameters.
[0150] In some embodiments, the clustering result obtained based on the clustering parameters includes at least one trajectory clustering cluster, the number of ship trajectories in each trajectory clustering cluster should be greater than or equal to the minimum clustering trajectory number parameter MinLns obtained in the above embodiment, and the ship trajectory clustering result containing all trajectory clustering clusters is output;
[0151] In some embodiments, the channel information includes the channel and the distribution of ship types corresponding to the channel, and a corresponding channel can be determined according to each trajectory cluster.
[0152] Optionally, the coordinate range, starting point, end point, direction, sea area and other location information of the channel can be determined according to each trajectory cluster.
[0153] Furthermore, the ship type corresponding to each ship trajectory can be extracted according to the trajectory movement feature extraction model trained in the above embodiments, and then the distribution of ship types on each waterway can be determined. For example, the ships passing through waterway 1 include 90% fishing boats and 10% cargo ships.
[0154] In some embodiments, the type of ship passing through each waterway can be determined based on the extracted ship type distribution data, and the type, level and other information of the waterway can be determined thereby.
[0155] Optionally, the passage time distribution of each type of ship on a waterway can also be determined based on the time information corresponding to each ship trajectory on the waterway. For example, fishing boats on waterway 1 usually pass through time periods 1 and 2, and cargo ships usually pass through time periods 2 and 3. The embodiment of the present application does not limit the output form of the passage time distribution.
[0156] The following are device embodiments of the present application, which can be used to execute the method embodiments of the present application. For details not disclosed in the device embodiments of the present application, please refer to the method embodiments of the present application.
[0157] See next Figure 4, is a schematic diagram of the structure of a ship trajectory clustering device provided by an exemplary embodiment of the present application. The device can be implemented as all or part of a terminal through software, hardware, or a combination of both, and can also be integrated on a server as an independent module. The ship trajectory clustering device in the embodiment of the present application can be applied to a terminal or a cloud. The device 40 includes a data module 401, a trajectory similarity measurement module 402, and a clustering module 403, wherein:
[0158] The data module 401 is used to extract multiple ship tracks from the AIS data; wherein each of the ship tracks includes multiple track points;
[0159] The track similarity measurement module 402 is used to calculate the bidirectional Hausdorff distance between every two ship tracks, and obtain the geometric similarity distance between every two ship tracks according to the bidirectional Hausdorff distance;
[0160] The trajectory similarity measurement module 402 is further used to extract the ship movement feature vector of each of the ship trajectories through the trained trajectory movement feature extraction model, and calculate the movement feature similarity distance between each two ship movement feature vectors;
[0161] The trajectory similarity measurement module 402 is further used to obtain a trajectory similarity measurement based on a weighted calculation of a geometric similarity distance and a movement feature similarity distance between each two ship trajectories;
[0162] The clustering module 403 is used to perform cluster analysis on all ship trajectories based on the trajectory similarity measurement between every two ship trajectories, output the ship trajectory clustering result, and determine the channel information according to the ship trajectory clustering result.
[0163] It should be noted that, when the device 40 provided in the above embodiment executes the ship trajectory clustering method, only the division of the above functional modules is used as an example. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the device provided in the above embodiment and the embodiment of the ship trajectory clustering method belong to the same concept, and the implementation process thereof is detailed in the method embodiment, which will not be repeated here.
[0164] An embodiment of the present application also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of any of the above-mentioned method embodiments when executing the program.
[0165] See also Figure 5 , which is a structural block diagram of an electronic device provided in an embodiment of the present application.
[0166] like Figure 5 As shown, the electronic device 500 includes: a processor 501 and a memory 502 .
[0167] In the embodiment of the present application, the processor 501 is the control center of the computer system, which can be a processor of a physical machine or a processor of a virtual machine. The processor 501 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 501 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array).
[0168] The processor 501 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also called a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state.
[0169] The memory 502 may include one or more computer-readable storage media, which may be non-transitory. The memory 502 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In some embodiments of the present application, the non-transitory computer-readable storage medium in the memory 502 is used to store at least one instruction, which is used to be executed by the processor 501 to implement the method in the embodiment of the present application.
[0170] In some embodiments, the electronic device 500 further includes: a peripheral device interface 503 and at least one peripheral device 504. The processor 501, the memory 502 and the peripheral device interface 503 can be connected via a bus or a signal line. Each peripheral device 504 can be connected to the peripheral device interface 503 via a bus, a signal line or a circuit board. Specifically, the peripheral device 504 includes: a display screen, a camera and an audio circuit. The peripheral device interface 503 can be used to connect at least one peripheral device related to I / O (Input / Output) to the processor 501 and the memory 502.
[0171] In some embodiments of the present application, the processor 501, the memory 502, and the peripheral device interface 503 are integrated on the same chip or circuit board; in some other embodiments of the present application, any one or two of the processor 501, the memory 502, and the peripheral device interface 503 can be implemented on a separate chip or circuit board. This embodiment of the present application does not specifically limit this.
[0172] The electronic device structure block diagram shown in the embodiment of the present application does not constitute a limitation on the electronic device 500. The electronic device 500 may include more or fewer components than shown in the figure, or combine certain components, or adopt a different component arrangement.
[0173] The embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, the steps of the method of any of the above embodiments are implemented. The computer-readable storage medium may include, but is not limited to, any type of disk, including a floppy disk, an optical disk, a DVD, a CD-ROM, a micro drive, and a magneto-optical disk, a ROM, a RAM, an EPROM, an EEPROM, a DRAM, a VRAM, a flash memory device, a magnetic card or an optical card, a nanosystem (including a molecular memory IC), or any type of medium or device suitable for storing instructions and / or data.
[0174] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, by hardware. Based on this understanding, the above technical solution can be essentially or in other words, the part that contributes to the relevant technology can be embodied in the form of a software product, which can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiment.
[0175] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A ship trajectory clustering method, characterized in that: include: Extracting multiple ship tracks from the AIS data; wherein each of the ship tracks includes multiple track points; Calculating a bidirectional Hausdorff distance between every two ship trajectories, and obtaining a geometric similarity distance between every two ship trajectories according to the bidirectional Hausdorff distance; Extracting a ship movement feature vector of each of the ship trajectories by using a trained trajectory movement feature extraction model, and calculating a movement feature similarity distance between each two ship movement feature vectors; A trajectory similarity measure is obtained based on a weighted calculation of a geometric similarity distance and a movement feature similarity distance between each two ship trajectories; Based on the trajectory similarity measure between every two ship trajectories, cluster analysis is performed on all ship trajectories, a ship trajectory clustering result is output, and channel information is determined according to the ship trajectory clustering result.
2. A ship trajectory clustering method according to claim 1, characterized in that: The multiple ship tracks are extracted from the AIS data, including: Acquire the AIS data, and filter the discrete trajectory points that meet preset conditions according to the trajectory numbers, time information, and location information of the discrete trajectory points in the AIS data; Obtain all discrete track points with the same track number to obtain the ship track corresponding to the track number; The time interval between every two adjacent track points in each of the ship tracks is extracted, the ship track is segmented at the track point positions where the time interval is greater than a time interval threshold, and the segmented ship track is output.
3. A ship trajectory clustering method according to claim 1, characterized in that: The calculation of the bidirectional Hausdorff distance between every two ship trajectories includes: Calculate the first Euclidean distance from each track point in the first ship track to each track point in the second ship track, and calculate the second Euclidean distance from each track point in the second ship track to each track point in the first ship track; Determine a first Hausdorff distance from the first ship track to the second ship track based on the first Euclidean distance, and determine a second Hausdorff distance from the second ship track to the first ship track based on the second Euclidean distance; determining a bidirectional Hausdorff distance between the first ship track and the second ship track based on a maximum value of the first Hausdorff distance and the second Hausdorff distance; The first ship trajectory and the second ship trajectory are different ship trajectories, and the first ship trajectory and the second ship trajectory are respectively any one of the multiple ship trajectories.
4. A ship trajectory clustering method according to claim 1, characterized in that: Before extracting the ship movement feature vector of each ship trajectory by using the trained trajectory movement feature extraction model, the method includes: Obtaining the motion attribute of each track point in each of the ship tracks; Arranging the motion attributes of each trajectory point in the order of the trajectory points in each of the ship trajectories, and generating trajectory sequences corresponding to the ship trajectories respectively; The motion attributes include speed data and a turning rate of each track point, the speed data of each track point is extracted based on the AIS data, and the turning rate is calculated based on the heading data of every two adjacent track points in the ship track.
5. A ship trajectory clustering method according to claim 4, characterized in that: The step of extracting the ship movement feature vector of each ship trajectory by using the trained trajectory movement feature extraction model includes: Inputting the trajectory sequence of each ship trajectory into the trained trajectory movement feature extraction model, wherein the trained trajectory movement feature extraction model extracts a ship movement feature vector based on the trajectory sequence of each ship trajectory, wherein each of the ship movement feature vectors has the same length; The calculation of the movement feature similarity distance between each two ship movement feature vectors is performed by applying the formula: Among them, d2(o,r) is the movement feature similarity distance, g is the length of the ship movement feature vector, i is the ordinal number of the ship movement feature in the ship movement feature vector, and o and r are the ship movement feature vectors.
6. A ship trajectory clustering method according to any one of claims 1 to 5, characterized in that: Before performing cluster analysis on all ship trajectories based on the trajectory similarity measure between every two ship trajectories, determining clustering parameters of the cluster analysis based on the trajectory similarity measure between every two ship trajectories includes: Based on the trajectory similarity measurement between every two ship trajectories in the plurality of ship trajectories, a trajectory similarity measurement matrix is constructed: D n×n ={d(i,j)|1≤i≤n,1≤j≤n}; Arrange each row in the similarity measure matrix in ascending order based on the numerical value of the trajectory similarity measure, and output a K proximity matrix; wherein the Kth column of the K proximity matrix is the Kth proximity distance of all ship trajectories; The clustering parameters are determined based on the K neighbor matrix, and the clustering parameters include the clustering distance radius and the minimum number of clustering trajectories; wherein, D n×n is the trajectory similarity measurement matrix, d(i,j) is the trajectory similarity measurement of the i-th row and j-th column in the trajectory similarity measurement matrix, and n is the number of the ship trajectories.
7. A ship trajectory clustering method according to claim 6, characterized in that: The clustering analysis is performed on all ship trajectories based on the trajectory similarity measurement between every two ship trajectories, and the ship trajectory clustering result is output, including: Acquire at least one trajectory cluster obtained by the cluster analysis, the number of ship trajectories in each trajectory cluster being greater than or equal to the minimum number of cluster trajectories, and output the ship trajectory clustering result including all trajectory clusters; The channel information includes the channel and the distribution of ship types corresponding to the channel, and determining the channel information according to the ship trajectory clustering result includes: A corresponding waterway is determined according to each trajectory cluster, and the ship type distribution on each waterway is determined according to the ship type corresponding to each ship trajectory extracted by the trained trajectory movement feature extraction model.
8. A ship trajectory clustering device, characterized in that: include: A data module, used to extract multiple ship tracks from AIS data; wherein each of the ship tracks includes multiple track points; A trajectory similarity measurement module, used for calculating the bidirectional Hausdorff distance between every two ship trajectories, and obtaining the geometric similarity distance between every two ship trajectories according to the bidirectional Hausdorff distance; The trajectory similarity measurement module is also used to extract the ship movement feature vector of each of the ship trajectories through the trained trajectory movement feature extraction model, and calculate the movement feature similarity distance between each two ship movement feature vectors; The trajectory similarity measurement module is also used to obtain the trajectory similarity measurement based on the weighted calculation of the geometric similarity distance and the movement feature similarity distance between each two ship trajectories; The clustering module is used to perform cluster analysis on all ship trajectories based on the trajectory similarity measurement between every two ship trajectories, output the ship trajectory clustering result, and determine the channel information according to the ship trajectory clustering result.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.