A trajectory clustering method and device based on space-time mahalanobis distance and density peak value
By using a trajectory clustering method based on spatiotemporal Mahalanobis distance and density peaks, the problem of difficulty in handling complex spatiotemporal trajectory data in existing technologies is solved, achieving more accurate and stable trajectory clustering results, which are applicable to fields such as transportation, ecology, and meteorology.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- NANCHANG INST OF TECH
- Filing Date
- 2026-01-14
- Publication Date
- 2026-04-17
AI Technical Summary
Existing trajectory clustering methods struggle to capture both global and local features of trajectories when dealing with complex spatiotemporal trajectory data, and also suffer from parameter sensitivity and high computational resource requirements.
A trajectory clustering method based on spatiotemporal Mahalanobis distance and density peaks is adopted. By dividing the initial trajectory segments, calculating the segment assumption length and data fitting cost, the optimal segmentation point is determined, sub-trajectory segments are generated, and potential cluster centers are screened using spatiotemporal Mahalanobis local density and relative distance, thereby reducing parameter sensitivity and improving clustering robustness.
Effective modeling of the spatiotemporal covariance structure generates sub-trajectory segments that better reflect the local dynamic characteristics of spatiotemporal trajectory data, improving the accuracy and robustness of clustering and reducing parameter sensitivity.
Smart Images

Figure CN121524664B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing technology, and in particular to a trajectory clustering method and apparatus based on spatiotemporal Mahalanobis distance and density peaks. Background Technology
[0002] Spatiotemporal trajectory data, as a core carrier for recording the dynamic behavior of moving objects, is widely used in transportation, ecology, meteorology, and other fields. Among them, typical extreme weather spatiotemporal trajectories, such as hurricane trajectories, consist of a sequence of trajectory points containing physical attributes such as latitude and longitude, timestamps, wind speed, and air pressure. They not only record the evolution of the hurricane's path and intensity but also contain complex dynamic patterns throughout its entire life cycle, from generation and development to maturity and dissipation. This type of data exhibits two main characteristics: spatiotemporal heterogeneity, as the spatiotemporal scales of hurricanes vary significantly at different stages, resulting in dynamically changing covariance structures across spatiotemporal dimensions and making it difficult to fairly measure local similarity; and density heterogeneity, as the trajectory points are extremely unevenly distributed spatiotemporally due to differences in movement speed at different stages of the life cycle. These characteristics pose a severe challenge to pattern mining of hurricane trajectories, requiring advanced mining methods to reveal potential patterns.
[0003] Given the complex dynamic patterns and unique spatiotemporal challenges inherent in spatiotemporal trajectory data, trajectory clustering has become a key tool for revealing its potential patterns. Existing technologies have proposed various trajectory clustering methods, which can be categorized into three main types based on their algorithm principles and processing units: those based on overall trajectories, those based on segmented trajectories, and those based on deep learning. However, despite the various trajectory clustering methods offered by existing technologies, challenges remain in handling complex spatiotemporal trajectory data: Methods based on the overall trajectory use complete trajectories as units, clustering by defining similarity metrics between trajectories, suitable for capturing global patterns, but prone to ignoring internal phase changes and failing to adequately handle local features; methods based on segmented trajectories divide the trajectory into sub-segments before clustering, better capturing local motion features, but generally rely on Euclidean distance or its simple spatiotemporal extensions, failing to fully model the covariance structure between spatiotemporal dimensions. Furthermore, their clustering stages often employ parameter-sensitive density clustering algorithms, making them ill-suited to uneven density distributions; deep learning-based methods automatically extract trajectory features using neural networks, suitable for large-scale and high-dimensional data processing, capable of capturing complex spatiotemporal patterns without manual feature engineering, but their processing requires substantial data and computational resources, suffers from poor interpretability, and ignores local dynamic changes.
[0004] Therefore, it is necessary to provide a new clustering method for spatiotemporal trajectory data to improve the accuracy and robustness of clustering complex spatiotemporal trajectory data. Summary of the Invention
[0005] The purpose of this invention is to provide a trajectory clustering method based on spatiotemporal Mahalanobis distance and density peaks, so as to improve the accuracy and robustness of clustering complex spatiotemporal trajectory data.
[0006] In a first aspect, the trajectory clustering method based on spatiotemporal Mahalanobis distance and density peak provided by the present invention includes: dividing the original trajectory into multiple initial trajectory segments according to the feature points of the spatiotemporal trajectory data; calculating the segmentation hypothesis length and the data fitting cost of the original trajectory based on the initial trajectory segments; determining the optimal segmentation point of the original trajectory by combining the segmentation hypothesis length and the data fitting cost; dividing the original trajectory according to the optimal segmentation point to obtain multiple sub-trajectory segments to form a sub-trajectory segment set; calculating the spatiotemporal Mahalanobis local density of each sub-trajectory segment; measuring the spatiotemporal Mahalanobis relative distance of each sub-trajectory segment according to the spatiotemporal Mahalanobis local density; calculating the decision value and screening potential cluster centers by combining the spatiotemporal Mahalanobis local density and the spatiotemporal Mahalanobis relative distance of each sub-trajectory segment; calculating the membership degree of all non-potential center sub-trajectory segments to each potential cluster center; and assigning the non-potential center sub-trajectory segments to the cluster with the highest membership degree to obtain the sub-trajectory segment clustering result.
[0007] The beneficial effects of the trajectory clustering method based on spatiotemporal Mahalanobis distance and density peak provided by this invention are as follows: by modeling the spatiotemporal covariance structure, sub-trajectory segments that better conform to the local dynamic characteristics of spatiotemporal trajectory data are generated; and a density peak sub-trajectory segment clustering strategy based on spatiotemporal Mahalanobis k-inverse nearest neighbors and fuzzy membership is designed to reduce parameter sensitivity and improve the clustering robustness to uneven density data.
[0008] In one possible embodiment, calculating the segmented hypothetical length and the data fitting cost of the original trajectory based on the initial trajectory segments includes: defining the spatiotemporal Mahalanobis distance between trajectory points and the spatiotemporal Mahalanobis geometric distance between trajectory segments; calculating the segmented hypothetical length of each initial trajectory segment based on the spatiotemporal Mahalanobis distance between the endpoints of the initial trajectory segments; and calculating the data fitting cost of the original trajectory based on the spatiotemporal Mahalanobis geometric distance of the trajectory points within each initial trajectory segment.
[0009] In another possible embodiment, determining the optimal segmentation point of the original trajectory by combining the segmentation hypothesis length and the data fitting cost includes: constructing an MDL cost function based on the segmentation hypothesis length and the data fitting cost that satisfies: ,in, Segmentation scheme The assumed length of the segments below, Segmentation scheme Lower original trajectory The data fitting cost is calculated; a greedy iterative strategy is used to search for an approximate optimal solution of the MDL function to determine the optimal segmentation points of the original trajectory.
[0010] In other possible embodiments, calculating the spatiotemporal Mahalanobis local density of each sub-trajectory segment includes: calculating the spatiotemporal Mahalanobis geometric distance between each sub-trajectory segment and other trajectory segments; for each sub-trajectory segment, selecting the one with the closest spatiotemporal Mahalanobis geometric distance to that sub-trajectory segment. The spatiotemporal Mathematical structure of each sub-trajectory segment is constructed. Nearest neighbor set; based on the spatiotemporal Markov model of each sub-trajectory segment The nearest neighbor set constructs the spatiotemporal Markovian of each sub-trajectory segment. Inverse nearest neighbor set; for each sub-trajectory segment, calculate its spatiotemporal Mahalanobis. The weighted sum of the inverse nearest neighbors yields the corresponding spatiotemporal Markov local density.
[0011] The spatiotemporal Mahalanobis relative distance of a sub-trajectory segment is defined by the following formula: ,in, Represents sub-trajectory segment The relative distance, Represents sub-trajectory segment and The spacetime Mahalanobis geometric distance between them Represents sub-trajectory segment The spacetime Markovial local density, Represents sub-trajectory segment The spacetime Markovial local density.
[0012] The membership degree of a non-potential center's sub-trajectory segment to each potential cluster center is calculated according to the following formula: ,in, Represents sub-trajectory segment For the first Potential cluster centers membership degree This represents the total number of potential cluster centers. Indicates the first A potential cluster center, Represents sub-trajectory segment To the potential cluster center The spacetime Mahalanobis geometric distance.
[0013] After obtaining the sub-trajectory segment cluster division results, the process also includes: calculating the average direction vector of each sub-trajectory segment cluster, defining the direction of the average direction vector as the principal axis of the corresponding sub-trajectory segment cluster; for each sub-trajectory segment cluster, projecting the endpoints of all sub-trajectory segments within the sub-trajectory segment cluster onto the principal axis and sorting them to establish a scanning sequence, defining the scanning line to move perpendicular to the principal axis, moving the scanning line along the scanning sequence and extracting representative trajectory points, connecting and smoothing all representative trajectory points to generate the representative trajectory of the sub-trajectory segment cluster.
[0014] The process of moving the scan line along the scan sequence and extracting representative trajectory points includes: defining points in the scan sequence as scan positions; counting the number of sub-trajectory segments that intersect with the scan line at each scan position; and calculating the average coordinates of the intersection points of the scan line and the sub-trajectory segments as representative trajectory points.
[0015] Secondly, the present invention also provides a trajectory clustering device based on spatiotemporal Mahalanobis distance and density peaks, comprising: a trajectory segmentation unit, used to divide the original trajectory into multiple initial trajectory segments according to feature points of spatiotemporal trajectory data, calculate the segmentation hypothesis length and the data fitting cost of the original trajectory based on the initial trajectory segments, determine the optimal segmentation point of the original trajectory by combining the segmentation hypothesis length and the data fitting cost, and divide the original trajectory according to the optimal segmentation point to obtain multiple sub-trajectory segments forming a sub-trajectory segment set; a cluster center selection unit, used to calculate the spatiotemporal Mahalanobis local density of each sub-trajectory segment, measure the spatiotemporal Mahalanobis relative distance of each sub-trajectory segment according to the spatiotemporal Mahalanobis local density, calculate the decision value by combining the spatiotemporal Mahalanobis local density and the spatiotemporal Mahalanobis relative distance of each sub-trajectory segment, and screen potential cluster centers; and a cluster partitioning unit, used to calculate the membership degree of all non-potential center sub-trajectory segments to each potential cluster center, and assign the non-potential center sub-trajectory segments to the cluster with the highest membership degree to obtain the sub-trajectory segment cluster partitioning result. For the beneficial effects of the above-mentioned second aspect, please refer to the description of the above-mentioned first aspect.
[0016] It also includes a representative trajectory generation unit, which is used to: calculate the average direction vector of each sub-trajectory segment cluster, define the direction of the average direction vector as the principal axis of the corresponding sub-trajectory segment cluster; for each sub-trajectory segment cluster, project the endpoints of all sub-trajectory segments in the sub-trajectory segment cluster onto the principal axis and sort them to establish a scan sequence, define the scan line to move perpendicular to the principal axis, the scan line moves along the scan sequence and extracts representative trajectory points, and connects and smooths all representative trajectory points to generate the representative trajectory of the sub-trajectory segment cluster. Attached Figure Description
[0017] Figure 1 A flowchart illustrating a trajectory clustering method based on spatiotemporal Mahalanobis distance and density peaks provided in an embodiment of the present invention;
[0018] Figure 2 This is a schematic diagram of the overall process of the trajectory clustering method based on spatiotemporal Mahalanobis distance and density peak provided in an embodiment of the present invention;
[0019] Figure 3a This is a schematic diagram of the spatiotemporal distribution of the simulation dataset ST-TD1 provided in this embodiment of the invention;
[0020] Figure 3b This is a schematic diagram of the spatiotemporal distribution of the simulation dataset ST-TD2 provided in this embodiment of the invention;
[0021] Figure 4a This is a schematic diagram of the trajectory spatial distribution of the Atlantic dataset provided in an embodiment of the present invention;
[0022] Figure 4b This is a schematic diagram of the trajectory spatial distribution of the Pacific dataset provided in an embodiment of the present invention;
[0023] Figure 5a A schematic diagram of the representative trajectory spatial distribution of the Atlantic dataset provided in an embodiment of the present invention;
[0024] Figure 5b A schematic diagram of the representative trajectory spatial distribution of the Pacific dataset provided in this embodiment of the invention.
[0025] Figure 6 A schematic diagram of a trajectory clustering device based on spatiotemporal Mahalanobis distance and density peak provided in an embodiment of the present invention;
[0026] Figure 7 This is a schematic diagram of an electronic device structure provided in an embodiment of the present invention. Detailed Implementation
[0027] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions in the embodiments of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without inventive effort are within the scope of protection of this invention. Unless otherwise defined, the technical or scientific terms used herein should have the ordinary meaning understood by those skilled in the art. The terms "comprising" and similar expressions used herein mean that the element or object preceding the word covers the element or object listed following the word and its equivalents, but do not exclude other elements or objects.
[0028] This embodiment provides a trajectory clustering method and apparatus based on spatiotemporal Mahalanobis distance and density peaks.
[0029] See Figure 1 and Figure 2 Trajectory clustering methods based on spatiotemporal Mahalanobis distance and density peaks include:
[0030] S101: Divide the original trajectory into multiple initial trajectory segments based on the feature points of the spatiotemporal trajectory data. Calculate the segmentation hypothesis length and the data fitting cost of the original trajectory based on the initial trajectory segments. Combine the segmentation hypothesis length and the data fitting cost to determine the optimal segmentation point of the original trajectory. Divide the original trajectory into multiple sub-trajectory segments based on the optimal segmentation point to form a sub-trajectory segment set.
[0031] In one possible embodiment, calculating the segmented hypothetical length and the data fitting cost of the original trajectory based on the initial trajectory segments includes: defining the spatiotemporal Mahalanobis distance between trajectory points and the spatiotemporal Mahalanobis geometric distance between trajectory segments; calculating the segmented hypothetical length of each initial trajectory segment based on the spatiotemporal Mahalanobis distance between the endpoints of the initial trajectory segments; and calculating the data fitting cost of the original trajectory based on the spatiotemporal Mahalanobis geometric distance of the trajectory points within each initial trajectory segment.
[0032] For example, two trajectory points and The spacetime Mahalanobis distance between Defined as: Among them, trajectory points and Each contains a three-dimensional vector consisting of spatial coordinates and a timestamp. ; This represents the 3×3 spatiotemporal covariance matrix obtained from the entire spatiotemporal trajectory data, which characterizes the variance and covariance structure between each dimension; The matrix representing the inverse of the spatiotemporal covariance matrix; This represents the transpose of a vector. The spatiotemporal Mahalanobis distance calculation method designed in this invention projects the original space onto a standard space with normalized covariance through a linear transformation, eliminating the problem of inconsistent scales across dimensions and improving the fairness and discriminative power of the distance calculation.
[0033] Define the measurement of two trajectory segments and The spatiotemporal Mahalanobis geometric distance between the spatiotemporal similarities The calculation satisfies the following formula: ,in, The weighting coefficient represents the vertical distance. The weighting coefficients representing parallel distances. The weighting coefficients representing angular distances. The spatiotemporal Mahalanobis vertical distance is used to measure the degree of orthogonal offset between two trajectory segments. The spatiotemporal Mahalanobis parallel distance is used to measure the degree of overlap between two trajectory segments in the principal direction. This is the spatiotemporal Mahalanobis angular distance used to measure the difference in direction between two trajectory segments.
[0034] In one specific embodiment, the measurements of the three distance components—spatial-temporal Mahalanobis vertical distance, spatial-temporal Mahalanobis parallel distance, and spatial-temporal Mahalanobis angular distance—are all performed in the covariance-normalized standard space described in the definition of spatial-temporal Mahalanobis distance, thereby more accurately reflecting the true similarity between trajectory segments.
[0035] In one possible embodiment, the segmentation assumption length is defined as the sum of the logarithms of the spatiotemporal Mahalanobis lengths of each initial trajectory segment obtained by dividing the original trajectory based on the feature points of the spatiotemporal trajectory data. For example, suppose a set of feature points of the spatiotemporal trajectory data is... The feature points divide the original trajectory into Initial trajectory segment In the above segmentation scheme Under the assumption that the length of each segment is assumed to be equal to the following formula: ,in, Indicates the first The spatiotemporal Mahalanobis distance between the two endpoints of each initial trajectory segment. The calculation of the segmentation assumption length uses a logarithmic function to control the rate of increase of the encoding length, guiding the algorithm to select a segmentation scheme with shorter and more compact paths to ensure the simplicity of the model.
[0036] The data fitting cost is defined as a measure of the fitting accuracy of each point in the original trajectory within the current segment. Specifically, for the first segment... Initial trajectory segment The data fitting cost is determined by the spatiotemporal Mahalanobis vertical distance and the spatiotemporal Mahalanobis angular distance of all trajectory points within it. The data fitting cost of the original trajectory is calculated according to the following formula: ,in, Represents trajectory points to the initial trajectory segment The spacetime Mahalanobis vertical distance, Represents trajectory points to the initial trajectory segment The spatiotemporal Mahalanobis angular distance. The two distance components, spatiotemporal Mahalanobis vertical distance and spatiotemporal Mahalanobis angular distance, together characterize the fitting residual of the original trajectory points relative to the hypothetical trajectory segmentation result. The smaller the data fitting cost term, the more effectively the initial trajectory segment can reconstruct the local shape of the original trajectory.
[0037] In one possible embodiment, determining the optimal segmentation points of the original trajectory by combining the segmentation hypothesis length and the data fitting cost includes: constructing an MDL cost function based on the segmentation hypothesis length and the data fitting cost that satisfies: ,in, Segmentation scheme The assumed length of the segments below, Segmentation scheme Lower original trajectory The data fitting cost is considered; a greedy iterative strategy is used to search for an approximate optimal solution to the MDL function to determine the optimal segmentation points of the original trajectory. Based on the determined optimal segmentation points, the original trajectory is divided into multiple sub-trajectory segments to form a sub-trajectory segment set.
[0038] Combining the segmented assumption length and data fitting cost defined above, spatiotemporal Mahalanobis distance segmentation constructs a novel MDL cost function capable of perceiving the inherent spatiotemporal variance structure of trajectory data. The optimization objective of this function is to find a set of feature points such that the total description cost... Minimum. Since traversing all possible segment combinations is an NP problem, this invention employs a greedy iterative strategy to search for an approximate optimal solution. In each iteration, this strategy selects the splitting point that minimizes the total MDL cost to divide the trajectory, until no further optimization is possible. Ultimately, the optimal segmentation point of the original trajectory and the set of sub-trajectory segments formed by dividing the original trajectory using the optimal segmentation point are obtained.
[0039] S102: Calculate the spatiotemporal Mahalanobis local density of each sub-trajectory segment, measure the spatiotemporal Mahalanobis relative distance of each sub-trajectory segment based on the spatiotemporal Mahalanobis local density, calculate the decision value by combining the spatiotemporal Mahalanobis local density and the spatiotemporal Mahalanobis relative distance of each sub-trajectory segment, and screen potential cluster centers.
[0040] In one possible embodiment, calculating the spatiotemporal Mahalanobis local density of each sub-trajectory segment includes: calculating the spatiotemporal Mahalanobis geometric distance between each sub-trajectory segment and other trajectory segments; for each sub-trajectory segment, selecting the one with the closest spatiotemporal Mahalanobis geometric distance to that sub-trajectory segment. The spatiotemporal Mathematical structure of each sub-trajectory segment is constructed. Nearest neighbor set; based on the spatiotemporal Markov model of each sub-trajectory segment The nearest neighbor set constructs the spatiotemporal Markovian of each sub-trajectory segment. Inverse nearest neighbor set; for each sub-trajectory segment, calculate its spatiotemporal Mahalanobis. The weighted sum of the inverse nearest neighbors yields the corresponding spatiotemporal Markov local density.
[0041] In one specific embodiment, based on the set of sub-trajectory segments, any sub-trajectory segment is... Calculate other sub-trajectory segments and The spatiotemporal Mahalanobis geometric distance is calculated, and the results are sorted in ascending order, starting from the previous... The set of sub-trajectory segments corresponding to the nearest distances is called a sub-trajectory segment. Spacetime Mas Nearest neighbor set. Spacetime Mas The nearest neighbor set is defined to satisfy: ,in, Represents sub-trajectory segment The The nearest neighbor.
[0042] For the sub-trajectory segment set Any two sub-trajectory segments and ,like Then it is called yes A spacetime Markovian inverse nearest neighbor is specifically defined as: Spacetime Ma's Reverse nearest neighbor transforms the number of neighbors into the number of other sub-trajectory segments that are considered neighbors by reversing the membership of the neighborhood.
[0043] For the sub-trajectory segment set sub-trajectory segments Its spacetime Markovial local density is: ,in, This indicates the preset number of neighbors. Represents sub-trajectory segment exist The ranking in the middle. The spatiotemporal Markov local density design of this invention adopts a neighbor number-based approach. The topological structure calculation, by setting an appropriate number of neighbors, can adaptively adjust the spatial extent of the neighborhood: in dense regions, the neighborhood is small and concentrated; in sparse regions, the neighborhood is large and dispersed. This adaptability to local density, combined with a linearly decreasing weighting function that emphasizes the contribution of closer neighbors, jointly improves the robustness to spatiotemporal trajectory data with uneven density. A neighbor-based approach is employed. The topological calculation of spatiotemporal Mahalanobis local density can solve the problem that the dense regions in the geometrically defined domain based on fixed stage distance commonly used in the prior art may contain too many neighbors, causing the density difference to be averaged, or the coefficient may not be able to delineate a sufficient number of neighbors.
[0044] In one possible embodiment, the spatiotemporal Mahalanobis relative distance of the sub-trajectory segment is defined by the following formula: ,in, Represents sub-trajectory segment The relative distance, Represents sub-trajectory segment and The spacetime Mahalanobis geometric distance between them Represents sub-trajectory segment The spacetime Markovial local density, Represents sub-trajectory segment The spacetime Markovial local density.
[0045] After calculating the spatiotemporal Mahalanobis local density of each sub-trajectory segment, the degree of isolation between each sub-trajectory segment and its higher-density neighborhood is measured by the spatiotemporal Mahalanobis relative distance. The relative distance of the sub-trajectory segment with the highest local density is defined as its distance from the set of sub-trajectory segments. The distance of the farthest sub-trajectory segment, for other sub-trajectory segments, sub-trajectory segment relative distance It is defined as the distance between it and the nearest sub-trajectory segment among all sub-trajectory segments with a local density higher than its own.
[0046] Decision values are calculated by combining the spatiotemporal Mahalanobis local density and spatiotemporal Mahalanobis relative distance of each sub-trajectory segment, and potential cluster centers are then selected. Specifically, the decision value is obtained by multiplying the spatiotemporal Mahalanobis local distance and spatiotemporal Mahalanobis relative distance of each sub-trajectory segment. Sub-trajectory segments with larger decision values are identified as potential cluster centers. The decision value integrates information from both the spatiotemporal Mahalanobis local distance and the spatiotemporal Mahalanobis relative distance. Based on the decision value, only sub-trajectory segments that simultaneously possess high local density and high relative distance are identified as potential cluster centers.
[0047] S103: Calculate the membership degree of all non-potential center sub-trajectory segments to each potential cluster center, and assign the non-potential center sub-trajectory segments to the cluster with the highest membership degree to obtain the sub-trajectory segment clustering result.
[0048] In one possible embodiment, the membership degree of the sub-trajectory segment of the non-potential center to each potential cluster center is calculated according to the following formula: ,in, Represents sub-trajectory segment For the first Potential cluster centers membership degree This represents the total number of potential cluster centers. Indicates the first A potential cluster center, Represents sub-trajectory segment To the potential cluster center The spacetime Mahalanobis geometric distance.
[0049] After identifying potential cluster centers, the fuzzy membership degree of each non-center sub-trajectory segment is calculated, and the non-center sub-trajectory segments are assigned to clusters based on the fuzzy membership degree. According to the specific definition of the function used for membership degree calculation, it can be seen that this function allows sub-trajectory segments to belong to multiple clusters with different probabilities, thus handling fuzzy sub-trajectory segments located at cluster boundaries more gently.
[0050] In one specific embodiment, after calculating the membership degree of each sub-trajectory segment to the center of each potential cluster, each sub-trajectory segment is assigned to the cluster with the highest membership degree through a defuzzification process to obtain the final sub-trajectory segment cluster division result.
[0051] In one possible embodiment, after obtaining the sub-trajectory segment cluster division results, the method further includes: calculating the average direction vector of each sub-trajectory segment cluster, defining the direction of the average direction vector as the principal axis of the corresponding sub-trajectory segment cluster; for each sub-trajectory segment cluster, projecting the endpoints of all sub-trajectory segments within the sub-trajectory segment cluster onto the principal axis and sorting them to establish a scanning sequence, defining the scanning line to move perpendicular to the principal axis, the scanning line moving along the scanning sequence and extracting representative trajectory points, connecting and smoothing all representative trajectory points to generate a representative trajectory of the sub-trajectory segment cluster.
[0052] The process of moving the scan line along the scan sequence and extracting representative trajectory points includes: defining points in the scan sequence as scan positions; counting the number of sub-trajectory segments that intersect with the scan line at each scan position; and calculating the average coordinates of the intersection points of the scan line and the sub-trajectory segments as representative trajectory points.
[0053] In one specific embodiment, the clustering results of sub-trajectory segments can classify similar motion segments into the same cluster. However, clusters composed of a large number of sub-trajectory segments often fail to intuitively reveal their overall motion patterns. To improve the interpretability and practicality of the clustering results, a representative trajectory that can summarize the common motion behavior is generated for each sub-trajectory segment cluster.
[0054] In one specific embodiment, the average direction vector of a sub-trajectory segment cluster is calculated to determine its main motion direction: for a cluster containing Clusters of strip trajectory segments Each sub-track segment It can be represented as a vector The average direction vector of this cluster is: ,in, To represent the sub-trajectory segment The vector points from its starting point to its ending point. The average direction vector reflects the combined trend of all sub-trajectory segments within a cluster in terms of direction and length, and its direction is regarded as the principal axis of the cluster.
[0055] After determining the principal axis of the cluster, a scan line algorithm is used to generate representative trajectory points: the endpoints of all sub-trajectory segments within the cluster are projected onto the principal axis and sorted to establish a scan sequence. Along the scan sequence, the scan line is perpendicular to the principal axis, and at each scan position, the number of trajectory segments intersecting the scan line is counted, and the average coordinates of the intersection points are calculated as representative trajectory points. All representative trajectory points are sequentially connected to form a preliminary representative trajectory. This preliminary representative trajectory is then smoothed and interpolated to remove overly dense or redundant nodes, generating a continuous, smooth, and ultimately representative trajectory that conforms to the actual motion characteristics, thus more clearly presenting the motion pattern revealed by the cluster.
[0056] Let the total number of samples in the spatiotemporal dataset be... The total number of sub-trajectory segments obtained after segmentation is The number of neighbors is The final number of clusters is And satisfy The overall time complexity of the TRACLUS algorithm is O(n log n). The time complexity of the trajectory clustering method (STM-DP-TRACLUS) based on spatiotemporal Mahalanobis distance and density peaks in this invention is calculated from the covariance matrix (time complexity is O(n log n)). Trajectory segmentation (time complexity is O(n)) Distance matrix construction (time complexity O(n)) Density and distance calculations (time complexity: O(n)) Cluster center selection and allocation (cluster center selection time complexity is O(n log n)). The time complexity of cluster allocation is O(n log n). ) and representative trajectory generation (time complexity is O(n log n) The overall time complexity is determined by several factors, with the dominant term being: In the number of sub-trajectory segments In common cases where it becomes the dominant factor, it can be simplified to In summary, the trajectory clustering method based on spatiotemporal Mahalanobis distance and density peaks of this invention has the same time complexity as TRACLUS, verifying the effectiveness and practicality of the proposed solution.
[0057] Experiments were conducted using simulated datasets and real hurricane datasets to evaluate the distance performance of the trajectory clustering method based on spatiotemporal Mahalanobis distance and density peaks in this invention. Since real hurricane trajectories lack ground truth labels for correct segmentation, the segmentation quality cannot be directly quantified. Simulated data, however, has explicit category ground truths, allowing for objective measurement of the impact of segmentation results on subsequent clustering accuracy using external evaluation metrics. This enables independent verification of the actual effectiveness of spatiotemporal Mahalanobis distance segmentation. Therefore, the simulated dataset was used to verify the effectiveness of spatiotemporal Mahalanobis distance segmentation. Finally, a real hurricane dataset was selected to comprehensively evaluate the overall performance and generalization ability of the trajectory clustering method based on spatiotemporal Mahalanobis distance and density peaks in practical applications.
[0058] See Figure 3a and Figure 3bTwo simulation datasets, ST-TD1 and ST-TD2, were constructed for evaluation experiments. Both datasets contain 50 trajectories generated from five different motion patterns, injected with the same spatiotemporal correlation noise. In ST-TD1, the motion patterns exhibit partial spatiotemporal overlap, used to test the segmentation method's ability to distinguish similar dynamics. In ST-TD2, the patterns are completely mixed spatiotemporally, designed to simulate the local density and pattern mixing scenarios caused by spatiotemporal heterogeneity in real hurricane trajectories, thus evaluating the robustness of the segmentation method. Adjusted Rand Index (ARI), Normalized Mutual Information (NMI), and Fowlkes-Mallows Index (FMI) were used as evaluation metrics on the simulation datasets. These metrics measure the consistency between the clustering results and the true labels, with values ranging from [0, 1], where higher values indicate better clustering performance.
[0059] The experiment used Euclidean distance and the trajectory clustering method based on spatiotemporal Mahalanobis distance and density peak value proposed in this invention to perform MDL segmentation on the simulated trajectory. The density peak value sub-trajectory segment clustering strategy proposed in this invention was uniformly applied to cluster the sub-trajectory segment sets generated after the two groups were segmented. Finally, the final clustering effect was evaluated using ARI, NMI, and FMI metrics. A better segmentation method should produce higher quality sub-trajectory segments, thus facilitating downstream clustering algorithms to identify the correct clusters and obtain higher external index scores.
[0060] In the comparative experiment, to ensure fairness, the segmented weight parameters were... , and All are set to 1, the nearest neighbor parameter of the clustering algorithm Perform a grid search within the range [2,50] and select the value that maximizes the ARI. The values correspond to the final performance. Table 1 shows a comparison of clustering metrics on the two simulation datasets.
[0061] Table 1. Performance comparison of different segmentation methods on simulation data
[0062]
[0063] The comparison results show that in ST-TD1, where there is partial spatiotemporal overlap, the spatiotemporal Mahalanobis distance segmentation outperforms the Euclidean distance segmentation in all clustering metrics. This indicates that by considering the correlation between spatiotemporal features, the spatiotemporal Mahalanobis distance segmentation can more accurately identify the dynamic changes in trajectories, achieve more precise segmentation, and provide higher-quality sub-trajectories for downstream clustering. In ST-TD2, where there is complete spatiotemporal overlap, although the performance decreases due to the complexity of the scene, the spatiotemporal Mahalanobis distance segmentation still outperforms the baseline method in terms of ARI and FMI metrics. This demonstrates that the spatiotemporal Mahalanobis distance segmentation has stronger robustness and effectiveness in handling locally dense and pattern-mixed scenes caused by spatiotemporal heterogeneity.
[0064] Two real hurricane datasets, the Atlantic Basin Hurricane Data and the Northeast and North Central Pacific Basin Hurricane Data, widely used in meteorology, were selected for comprehensive evaluation experiments. These datasets have large trajectory sample sizes, wide spatiotemporal spans, and complex dynamic patterns, effectively reflecting the spatiotemporal heterogeneity and density inhomogeneity of hurricane trajectories, making them ideal datasets for testing the practicality of clustering algorithms. Due to the lack of ground truth labels on the real datasets, the Silhouette Coefficient (SC), Davies-Bouldin Index (DBI), and Calinski-Harabasz Index (CHI) were used as evaluation metrics. DBI comprehensively considers the cohesion and separation of clusters; a smaller value indicates better results. SC measures the similarity of a sample to its own cluster and its dissimilarity to other clusters, with a value ranging from -1 to 1; a larger value indicates better results. CHI evaluates clustering quality by the ratio of inter-cluster dispersion to intra-cluster dispersion; a larger value indicates better results.
[0065] To ensure data quality and consistency in analysis, uniform preprocessing was performed on the raw data of the real hurricane dataset: 1) Track records from 1984 to 2024 were extracted to utilize data with higher precision under modern observation techniques; 2) Only tropical depressions in their development and maturity stages, namely tropical depressions (TD), tropical storms (TS), and hurricanes (HU), were retained, while data from the dissipation phase at the end of their life cycle were removed; 3) Short tracks with fewer than 12 sampling points were removed to ensure that each track contained sufficient dynamic information; 4) All WGS84 geographic coordinates were uniformly converted to the Lambert conformal conic projection (LCC) coordinate system, and spherical coordinates were converted to Cartesian coordinates in meters to ensure the geometric accuracy of spatiotemporal distance measurements. The statistical information of the preprocessed dataset is shown in Table 2, and the spatial distribution of the tracks can be found in [reference needed]. Figure 4a and Figure 4b As shown.
[0066] Table 2. Statistical information of the preprocessed trajectory dataset
[0067]
[0068] Comparative experiments were conducted on the TRACLUS, ST-TRACLUS, ST-SNNCA, and MIF-STKNNDC algorithms on the Atlantic and Pacific hurricane trajectory datasets. The neighborhood radius of the TRACLUS algorithm was also analyzed. The minimum number of samples is determined using the information entropy minimization method. Trajectory basis constraints Take the same value, and in The optimal value is obtained through grid search within an integer interval; the weight parameters of the distance function. , and All are set to 1. The neighborhood radius of the ST-TRACLUS algorithm. and time threshold The minimum number of samples is determined using methods such as minimizing information entropy; based on this, the minimum number of samples is derived from the average number of samples in the neighborhood. The range of values for ; and the weight parameters of the distance function. , and All values are set to the default value of 1. The time window parameters for the MIF-STKNNDC algorithm are set according to the paper's recommendations. Fixed at 2, nearest neighbor number Set at The value is tested within the specified range. The time segmentation threshold in the ST-SNNCA algorithm. The paper sets the hurricane trajectory data to 1200, and the time window is... Set to 1; neighborhood radius The minimum number of samples is determined using the information entropy minimization method, and is also derived based on the average number of samples in the neighborhood. The range of values; Hausdorff distance weights , and The nearest neighbor number is assigned as 1 in the STM-DP-TRACLUS algorithm. Also set in The spatiotemporal Mahalanobis distance weights are tested within a certain range. , and The default value is 1. The experimental results are shown in Table 3:
[0069] Table 3 Performance Comparison of Clustering Algorithms on Real Datasets
[0070]
[0071] The experimental results in Table 3 demonstrate the comprehensive performance advantage of the STM-DP-TRACLUS algorithm compared to other baseline algorithms. On the Atlantic and Pacific hurricane datasets, the method of this invention achieved the best performance in both DBI and SC metrics. The lowest DBI value indicates that the discovered clusters achieved the best balance between cohesion and segregation; simultaneously, the highest SC value indicates that most sub-trajectory segments have a higher similarity to their respective clusters than to other clusters, resulting in the most stable cluster structure. Although the ST-TRACLUS algorithm achieved the highest score on the CHI dataset on both datasets, this metric is sensitive to the shape and number of clusters, sometimes favoring more numerous and compact clusters. In contrast, the superior performance of this invention in DBI and SC more comprehensively reflects its ability to discover arbitrary-shaped, high-quality trajectory patterns, ensuring a globally optimal cluster structure. In summary, the STM-DP-TRACLUS algorithm, by combining the spatiotemporal Mahalanobis distance segmentation method and the density peak sub-trajectory segment clustering strategy, can more accurately and robustly identify physically meaningful hurricane motion patterns in complex real-world scenarios.
[0072] For the identified clusters in the Atlantic and Pacific datasets, representative trajectories were extracted using representative trajectory generation techniques, and their spatiotemporal features were analyzed. These representative trajectories summarize the core features of each cluster in terms of spatial path, temporal evolution, and intensity variation. Detailed spatiotemporal features are shown in Table 4, and the spatial distribution can be found in [reference needed]. Figure 5a and Figure 5b As shown.
[0073] Table 4 Spatiotemporal characteristics of representative trajectories
[0074]
[0075] In-depth analysis of representative trajectories reveals STM-DP-TRACLUS's ability to discover definite spatiotemporal characteristics and dynamic evolutionary patterns under unsupervised conditions. In the Atlantic dataset, STM-DP-TRACLUS not only spatially reconstructs classic hurricane paths but also accurately captures their seasonal and physical evolutionary characteristics in both temporal and intensity dimensions. T6 and T1 represent paths that cross the main development zone of the Atlantic, with average occurrence times in June and January, covering the early stages of the hurricane season and atypical occurrence periods. Their average intensity increases from tropical depression to tropical storm, replicating the typical early life cycle stage of hurricanes forming and developing over warm waters. T5 represents a path that formed in the Gulf of Mexico and made landfall in the United States. Its intensity weakened from tropical storm to tropical depression before and after landfall, reflecting the physical process of hurricane attenuation due to loss of energy sources after landfall.
[0076] The Pacific dataset also confirms the consistency between spatiotemporal and dynamic patterns. T3 represents a typical westward path occurring in September, the most active month of the eastern Pacific hurricane season, with its intensity remaining stable at tropical storm strength, reflecting the storm's mature stage over open warm waters. In contrast, T1 and T2 capture similar spatial behavior occurring at the end of the season and outside of seasonal patterns, with their intensity remaining at a weaker tropical depression level throughout, possibly representing the initial or final stages of a hurricane's life cycle, or weaker cyclones that failed to develop successfully.
[0077] The analysis of the above representative trajectories not only helps to understand the spatial distribution and seasonal variation of hurricanes, but also reveals the diversity and complexity of hurricane activity, fully verifying the effectiveness of the STM-DP-TRACLUS of this invention in processing complex, non-uniform real-world data, and demonstrating its application potential in geographic information science and meteorological data mining.
[0078] The trajectory clustering method based on spatiotemporal Mahalanobis distance and density peaks provided in this invention performs trajectory clustering through a spatiotemporal Mahalanobis distance segmentation method and a density peak sub-trajectory clustering strategy, while maintaining the time complexity of the clustering method at O(n log n). Simultaneously, it improves the quality and interpretability of clustering. Experimental verification shows that, on simulation data, spatiotemporal Mahalanobis distance segmentation can effectively improve the accuracy of downstream clustering, proving that its ability to characterize local dynamic features is superior to Euclidean distance; on real Atlantic and Pacific hurricane datasets, STM-DP-TRACLUS outperforms baseline methods such as TRACLUS and ST-TRACLUS in key indicators such as DBI and SC, verifying its robustness to complex and non-uniform trajectories; the generated representative trajectories are consistent with known meteorological laws, confirming the ability of the method of this invention to mine physically meaningful patterns under unsupervised conditions.
[0079] The trajectory clustering method based on spatiotemporal Mahalanobis distance and density peaks generates sub-trajectory segments that better reflect the local dynamic characteristics of hurricanes by modeling the spatiotemporal covariance structure. It designs a clustering strategy for density peak sub-trajectory segments based on spatiotemporal Mahalanobis k-nearest neighbors and fuzzy membership, which reduces parameter sensitivity and improves the robustness of clustering for data with uneven density. The scanline method is used to extract representative trajectories of each type of cluster, summarize their motion patterns, and enhance the interpretability and analytical value of the clustering results.
[0080] The design of a trajectory clustering method based on spatiotemporal Mahalanobis distance and density peaks addresses the specific spatiotemporal strong heterogeneity and extreme density inhomogeneity of spatiotemporal trajectory data. The underlying logic of the clustering method is reconstructed: an MDL cost function embedding the covariance matrix is constructed, incorporating spatiotemporal Mahalanobis distance into the logarithmic term of the information-theoretic coding criterion, enabling adaptive perception of the dynamic characteristics of hurricanes during segmentation; the density definition is reconstructed, using the topological relationship of neighbor numbers to replace the geometric relationship of absolute distance, achieving adaptation to density differences with extremely large spans—a fundamental improvement to the core logic of the original DPC algorithm; and a fuzzy membership function based on spatiotemporal Mahalanobis geometric distance is designed for cluster assignment, not only solving noise interference but also ensuring that the process from trajectory segmentation to cluster partitioning always takes place in a unified covariance-normalized manifold space, resulting in synergistic effects.
[0081] See the instruction manual appendix Figure 6 This embodiment also provides a trajectory clustering device based on spatiotemporal Mahalanobis distance and density peak, which is used to implement the above-described method embodiment. The device includes:
[0082] The trajectory segmentation unit 201 is used to divide the original trajectory into multiple initial trajectory segments based on the feature points of the spatiotemporal trajectory data, calculate the segmentation hypothesis length and the data fitting cost of the original trajectory based on the initial trajectory segments, determine the optimal segmentation point of the original trajectory by combining the segmentation hypothesis length and the data fitting cost, and divide the original trajectory into multiple sub-trajectory segments based on the optimal segmentation point to form a sub-trajectory segment set.
[0083] Cluster center selection unit 202 is used to calculate the spatiotemporal Mahalanobis local density of each sub-trajectory segment, measure the spatiotemporal Mahalanobis relative distance of each sub-trajectory segment based on the spatiotemporal Mahalanobis local density, and calculate the decision value and screen potential cluster centers by combining the spatiotemporal Mahalanobis local density and spatiotemporal Mahalanobis relative distance of each sub-trajectory segment.
[0084] The cluster partitioning unit 203 is used to calculate the membership degree of all non-potential center sub-trajectory segments to each potential cluster center, and to assign the non-potential center sub-trajectory segments to the cluster with the highest membership degree to obtain the sub-trajectory segment cluster partitioning result.
[0085] In one possible embodiment, the trajectory clustering device based on spatiotemporal Mahalanobis distance and density peak further includes a representative trajectory generation unit. The representative trajectory generation unit is used to: calculate the average direction vector of each sub-trajectory segment cluster, define the direction of the average direction vector as the principal axis of the corresponding sub-trajectory segment cluster; for each sub-trajectory segment cluster, project the endpoints of all sub-trajectory segments in the sub-trajectory segment cluster onto the principal axis and sort them to establish a scanning sequence, define the scanning line to move perpendicular to the principal axis, move the scanning line along the scanning sequence and extract representative trajectory points, connect and smooth all representative trajectory points to generate the representative trajectory of the sub-trajectory segment cluster.
[0086] All relevant content of each step involved in the above method embodiments can be referenced from the functional description of the corresponding functional module, and will not be repeated here.
[0087] In other embodiments of this application, an electronic device is disclosed, such as... Figure 7 As shown, the electronic device 300 may include: one or more processors 301; a memory 302; a display 303; one or more application programs (not shown); and one or more computer programs 304. These devices can be connected via one or more communication buses 305. The one or more computer programs 304 are stored in the memory and configured to be executed by the one or more processors 301. The one or more computer programs 304 include instructions that can be used to perform actions such as... Figure 1 And the various steps in the corresponding embodiments.
[0088] Through the above description of the embodiments, those skilled in the art will clearly understand that, for the sake of convenience and brevity, 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 can be divided into different functional modules to complete all or part of the functions described above. The specific working process of the system, device, and unit described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0089] In the embodiments of this application, the functional units can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0090] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the embodiments of this application, essentially, or the parts that contribute to the prior art, or all or part of the technical solutions, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as flash memory, portable hard disk, read-only memory, random access memory, magnetic disk, or optical disk.
[0091] The above description is merely a specific implementation of the embodiments of this application, but the protection scope of the embodiments of this application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the embodiments of this application should be covered within the protection scope of the embodiments of this application. Therefore, the protection scope of the embodiments of this application should be determined by the protection scope of the claims.
Claims
1. A trajectory clustering method based on spatiotemporal Mahalanobis distance and density peaks, characterized in that, include: The original trajectory is divided into multiple initial trajectory segments based on the feature points of the spatiotemporal trajectory data. The segmentation assumption length and the data fitting cost of the original trajectory are calculated based on the initial trajectory segments. The optimal segmentation point of the original trajectory is determined by combining the segmentation assumption length and the data fitting cost. The original trajectory is divided into multiple sub-trajectory segments based on the optimal segmentation point to form a sub-trajectory segment set. Calculate the spatiotemporal Mahalanobis local density of each sub-trajectory segment, measure the spatiotemporal Mahalanobis relative distance of each sub-trajectory segment based on the spatiotemporal Mahalanobis local density, and calculate the decision value by combining the spatiotemporal Mahalanobis local density and spatiotemporal Mahalanobis relative distance of each sub-trajectory segment to screen potential cluster centers. Calculate the membership degree of all sub-trajectories with non-potential centers to each potential cluster center, and assign the sub-trajectories with non-potential centers to the cluster with the highest membership degree to obtain the sub-trajectories clustering result; The spatiotemporal Markov local density calculation satisfies the following formula: ,in, Represents sub-trajectory segment Spacetime Mas Inverse nearest neighbor set, This indicates the preset number of neighbors. Represents sub-trajectory segment exist The ranking in Represents sub-trajectory segment Spacetime Mas Nearest neighbor set; The spatiotemporal Mahalanobis relative distance of a sub-trajectory segment is defined by the following formula: ,in, Represents sub-trajectory segment The relative distance, Represents sub-trajectory segment and The spacetime Mahalanobis geometric distance between them Represents sub-trajectory segment The spacetime Markovial local density, Represents sub-trajectory segment The spacetime Markovial local density.
2. The method according to claim 1, characterized in that, The cost of calculating the segmented hypothetical length based on the initial trajectory segment and the data fitting cost of the original trajectory includes: Define the spatiotemporal Mahalanobis distance between trajectory points and the spatiotemporal Mahalanobis geometric distance between trajectory segments in spatiotemporal trajectory data; The segmented hypothetical length of each initial trajectory segment is calculated based on the spatiotemporal Mahalanobis distance between the endpoints of the initial trajectory segments, and the data fitting cost of the original trajectory is calculated based on the spatiotemporal Mahalanobis geometric distance between the trajectory points within each initial trajectory segment.
3. The method according to claim 1, characterized in that, Determining the optimal segmentation points of the original trajectory by combining the assumed segmentation length and the data fitting cost includes: Based on the segmentation assumption length and the data fitting cost, an MDL cost function is constructed that satisfies: ,in, Segmentation scheme The assumed length of the segments below, Segmentation scheme Lower original trajectory Data fitting cost; A greedy iterative strategy is used to search for an approximate optimal solution to the MDL function to determine the optimal segmentation points of the original trajectory.
4. The method according to claim 1, characterized in that, Calculating the spatiotemporal Mahalanobis local density of each sub-trajectory segment includes: Calculate the spatiotemporal Mahalanobis geometric distance between each sub-trajectory segment and other trajectory segments; For each sub-trajectory segment, select the one with the closest spatiotemporal Mahalanobis geometric distance to that sub-trajectory segment. The spatiotemporal Mathematical structure of each sub-trajectory segment is constructed. Nearest neighbor set; According to the spatiotemporal Mathematical model of each sub-trajectory segment The nearest neighbor set constructs the spatiotemporal Markovian of each sub-trajectory segment. Inverse nearest neighbor set; For each sub-trajectory segment, calculate its spatiotemporal Markov model. The weighted sum of the inverse nearest neighbors yields the corresponding spatiotemporal Markov local density.
5. The method according to claim 1, characterized in that, The membership degree of a non-potential center's sub-trajectory segment to each potential cluster center is calculated according to the following formula: ,in, Represents sub-trajectory segment For the first Potential cluster centers membership degree This represents the total number of potential cluster centers. Indicates the first Potential cluster centers, Represents sub-trajectory segment To the center of potential clusters The spacetime Mahalanobis geometric distance.
6. The method according to claim 1, characterized in that, After obtaining the sub-trajectory segment clustering results, the following is also included: Calculate the average direction vector of each sub-trajectory segment cluster, and define the direction of the average direction vector as the principal axis of the corresponding sub-trajectory segment cluster; For each sub-trajectory segment cluster, the endpoints of all sub-trajectory segments within the sub-trajectory segment cluster are projected onto the main axis and sorted to establish a scan sequence. The scan line is defined to move perpendicular to the main axis. The scan line moves along the scan sequence and extracts representative trajectory points. All representative trajectory points are connected and smoothed to generate the representative trajectory of the sub-trajectory segment cluster.
7. The method according to claim 6, characterized in that, The scan line moves along the scan sequence and extracts representative trajectory points, including: Define the points in the scan sequence as scan positions; At each scanning position, count the number of sub-trajectory segments that intersect with the scan line, and calculate the average coordinates of the intersection points of the scan line and the sub-trajectory segments as representative trajectory points.
8. A trajectory clustering device based on spatiotemporal Mahalanobis distance and density peak, characterized in that, The device includes: The trajectory segmentation unit is used to divide the original trajectory into multiple initial trajectory segments based on the feature points of the spatiotemporal trajectory data, calculate the segmentation hypothesis length and the data fitting cost of the original trajectory based on the initial trajectory segments, determine the optimal segmentation point of the original trajectory by combining the segmentation hypothesis length and the data fitting cost, and divide the original trajectory into multiple sub-trajectory segments based on the optimal segmentation point to form a sub-trajectory segment set. The cluster center selection unit is used to calculate the spatiotemporal Mahalanobis local density of each sub-trajectory segment, measure the spatiotemporal Mahalanobis relative distance of each sub-trajectory segment based on the spatiotemporal Mahalanobis local density, and calculate the decision value by combining the spatiotemporal Mahalanobis local density and the spatiotemporal Mahalanobis relative distance of each sub-trajectory segment and screen potential cluster centers. The cluster partitioning unit is used to calculate the membership degree of all non-potential center sub-trajectory segments to each potential cluster center, and to assign the non-potential center sub-trajectory segments to the cluster with the highest membership degree to obtain the sub-trajectory segment cluster partitioning result; The spatiotemporal Markov local density calculation satisfies the following formula: ,in, Represents sub-trajectory segment Spacetime Mas Inverse nearest neighbor set, This indicates the preset number of neighbors. Represents sub-trajectory segment exist The ranking in Represents sub-trajectory segment Spacetime Mas Nearest neighbor set; The spatiotemporal Mahalanobis relative distance of a sub-trajectory segment is defined by the following formula: ,in, Represents sub-trajectory segment The relative distance, Represents sub-trajectory segment and The spacetime Mahalanobis geometric distance between them Represents sub-trajectory segment The spacetime Markovial local density, Represents sub-trajectory segment The spacetime Markovial local density.
9. The apparatus according to claim 8, characterized in that, It also includes a representative trajectory generation unit, which is used for: Calculate the average direction vector of each sub-trajectory segment cluster, and define the direction of the average direction vector as the principal axis of the corresponding sub-trajectory segment cluster; For each sub-trajectory segment cluster, the endpoints of all sub-trajectory segments within the sub-trajectory segment cluster are projected onto the main axis and sorted to establish a scan sequence. The scan line is defined to move perpendicular to the main axis. The scan line moves along the scan sequence and extracts representative trajectory points. All representative trajectory points are connected and smoothed to generate the representative trajectory of the sub-trajectory segment cluster.
Citation Information
Patent Citations
Track clustering method based on space-time weighting and density peak value
CN120892842A
Multi-stage spatial-temporal clustering method and system based on fused mahalanobis distance
CN121051489A