spatiotemporal density peak clustering method based on local covariance and spatiotemporal shared nearest neighbors

By calculating the covariance matrix and local covariance Mahalanobis distance of spatiotemporal data, and combining a two-step allocation strategy and a local outlier factor, the problem of cluster center identification and outlier sample identification in spatiotemporal density peak clustering is solved, and more accurate spatiotemporal data clustering is achieved.

CN121456519BActive Publication Date: 2026-04-17NANCHANG INST OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
NANCHANG INST OF TECH
Filing Date
2026-01-05
Publication Date
2026-04-17

AI Technical Summary

Technical Problem

Existing spatiotemporal density peak clustering methods struggle to accurately identify cluster centers when processing spatiotemporal data, easily overlooking key features in the time dimension, leading to unreasonable sample allocation and an inability to effectively identify anomalous samples.

Method used

By defining the spatiotemporal nearest neighbors of samples, calculating the covariance matrix and local covariance Mahalanobis distance, constructing a spatiotemporal hybrid similarity matrix, and employing a two-step allocation strategy and local outlier factor to identify anomalous samples, the cluster center identification and sample attribution are optimized.

Benefits of technology

It achieves accurate clustering in spatiotemporal data, reduces error propagation, improves the reliability of cluster center identification and the ability to identify outliers, and enhances the accuracy of clustering results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121456519B_ABST
    Figure CN121456519B_ABST
Patent Text Reader

Abstract

The spatiotemporal density peak clustering method based on local covariance and spatiotemporal shared nearest neighbors provided by this invention includes: calculating the covariance matrix within the spatiotemporal nearest neighbor range of a sample; calculating the Mahalanobis distance of the local covariance between samples; calculating the local density of the spatiotemporal shared nearest neighbors of a sample; constructing a decision graph based on the local density of the spatiotemporal shared nearest neighbors of a sample and the Mahalanobis distance of the local covariance between samples, and selecting cluster centers; performing maximum similarity allocation based on the spatiotemporal mixed similarity matrix to obtain preliminary cluster division and edge samples; assigning edge samples to the nearest high-density cluster based on the Mahalanobis distance of the local covariance between samples; calculating the local outlier factor of a sample based on the local covariance Mahalanobis distance between the sample and the spatiotemporal nearest neighbor samples; identifying abnormal samples based on the local outlier factor; and removing abnormal samples from the clusters to obtain the final clustering result. Applying this method can fully represent the true spatiotemporal relationship between samples and improve the accuracy of spatiotemporal data clustering results.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data processing technology, and in particular to a spatiotemporal density peak clustering method based on local covariance and spatiotemporal shared nearest neighbors. Background Technology

[0002] With the continuous improvement of information infrastructure such as sensing, transmission, and storage, and driven by technologies such as big data, cloud computing, and the Internet of Things, various sensing terminals and business systems are gradually aggregating massive datasets from diverse sources. In this data environment, existing data processing and analysis methods face higher demands to further achieve effective extraction of key information. Cluster analysis, based on the fundamental assumption of "similarity within clusters and differences between clusters," can identify potential patterns in unlabeled data. This type of method requires no prior labels and can extract inherent patterns from massive amounts of data. It is widely used in fields such as earthquake monitoring, public health, traffic management, and environmental monitoring, providing data support and practical basis for researchers and policymakers.

[0003] As data formats continue to evolve, their dimensions expand and attribute relationships become closer, posing new adaptation challenges for traditional clustering methods. Take spatiotemporal data as an example; it integrates spatial location and time-series information, revealing the dynamic distribution and evolution of geographical entities. This type of data requires simultaneous consideration of spatial correlation, temporal continuity, and attribute consistency, making it far more complex than traditional data formats and placing higher demands on the comprehensive processing capabilities of clustering methods.

[0004] Among existing spatiotemporal clustering methods, density peak clustering (DPC) has fewer parameters and is simple and efficient, showing good application prospects. However, DPC still has obvious limitations when dealing with spatiotemporal data: applying DPC algorithm for classification does not fully represent the real spatiotemporal relationship between samples, and it is easy to ignore the key features of the time dimension. It is difficult to accurately identify the cluster center, and the division of clusters is prone to expanding the error range and cannot correct the previous bias, resulting in unreasonable sample allocation.

[0005] Therefore, it is necessary to provide a new spatiotemporal data clustering method to achieve a balanced representation between the temporal synchronization and spatial connectivity of spatiotemporal data, and to accurately cluster spatiotemporal data. Summary of the Invention

[0006] The purpose of this invention is to provide a spatiotemporal density peak clustering method based on local covariance and spatiotemporal shared nearest neighbors, so as to achieve a balanced expression between the temporal synchronization and spatial connectivity of spatiotemporal data and to accurately cluster spatiotemporal data.

[0007] In a first aspect, the spatiotemporal density peak clustering method based on local covariance and spatiotemporal shared nearest neighbors provided by the present invention includes: defining the spatiotemporal density peaks of samples. Nearest neighbors, in the space-time of the sample Calculate the covariance matrix within the nearest neighbor range; calculate the local covariance Mahalanobis distance between samples; measure the spatiotemporal shared nearest neighbors between samples, construct a spatiotemporal mixture similarity matrix between samples, and calculate the local density of the spatiotemporal shared nearest neighbors based on the spatiotemporal mixture similarity between samples; construct a decision graph based on the local density of the spatiotemporal shared nearest neighbors and the local covariance Mahalanobis distance between samples, and select cluster centers; perform maximum similarity allocation based on the spatiotemporal mixture similarity matrix to obtain preliminary cluster division and edge samples; assign edge samples to the nearest high-density cluster based on the local covariance Mahalanobis distance between samples, and further refine the decision graph based on the spatiotemporal relationship between samples. The local covariance Mahalanobis distance of the nearest neighbor samples is used to calculate the local outlier factor of the sample. Based on the local outlier factor, abnormal samples are identified and removed from the cluster to obtain the final clustering result.

[0008] The beneficial effects of the spatiotemporal density peak clustering method based on local covariance and spatiotemporal shared nearest neighbors provided by this invention are as follows: The covariance matrix is ​​calculated within the local spatiotemporal neighborhood, and the Mahalanobis distance of local covariance between samples is defined based on this matrix, automatically unifying the scale differences between time and space to improve the accuracy of similarity measurement; the calculation method of local density is optimized by utilizing the number of spatiotemporal shared nearest neighbors and the Mahalanobis distance of local covariance to enhance the reliability of cluster center identification; a two-step allocation and anomaly identification strategy is adopted, gradually determining and improving the sample attribution through allocation in two stages: maximum similarity and nearest high density; and then, local outlier factors are used to effectively identify anomalous samples, reducing sample error propagation and achieving accurate clustering.

[0009] In one possible implementation, the spatiotemporal nature of the sample is defined. Nearest neighbors, in the space-time of the sample Calculating the covariance matrix within the nearest neighbor range includes: definition and sample... The relationship between them satisfies the following formula Each sample is a sample spacetime Nearest neighbor set: , Indicates sample and The time Euclidean distance between them Indicates the time cutoff distance. The number of nearest neighbor samples is represented; the covariance matrix is ​​calculated according to the following formula: , Indicates sample The local covariance matrix, Indicates sample spacetime The total number of samples in the nearest neighbor set, Indicates sample The three-dimensional spacetime vector, Indicates sample The local mean vector, This represents the ridge regression regularization coefficient. It is a 3x3 identity matrix. This represents the transpose symbol.

[0010] In another possible embodiment, the Mahalanobis distance of the local covariance between samples is calculated according to the following formula:

[0011] ,in, The Mahalanobis distance represents the local covariance between samples. Represents a symmetric mean metric matrix. Indicates sample The inverse of the local covariance matrix.

[0012] In other possible embodiments, the spatiotemporal shared nearest neighbor local density of samples is calculated according to the following formula: ,in, Indicates sample The spatiotemporal shared nearest neighbor local density, where N represents the sample and Spatiotemporal shared nearest neighbor count, Indicates sample and Spatiotemporal mixing similarity, Indicates sample spacetime The total number of samples in the nearest neighbor set.

[0013] The process involves constructing a decision graph based on the spatiotemporal shared nearest neighbor local density and the Mahalanobis distance of the local covariance between samples, and selecting cluster centers. This includes: calculating the relative distance between samples based on the Mahalanobis distance of the local covariance between samples; constructing a decision graph with the spatiotemporal shared nearest neighbor local density and the relative distance as the horizontal and vertical axes; calculating decision values ​​based on the spatiotemporal shared nearest neighbor local density and the relative distance; and selecting cluster centers based on the decision values ​​of the samples.

[0014] The process of obtaining preliminary cluster and edge samples by maximizing similarity allocation based on the spatiotemporal hybrid similarity matrix includes: using the cluster center sample as the initial labeled node, traversing the spatiotemporal hybrid similarity matrix to find the maximum similarity path between the initial labeled node and the unlabeled node; assigning the unlabeled node to a cluster based on the similarity value between nodes in the spatiotemporal hybrid similarity matrix; clearing the assigned nodes from the spatiotemporal hybrid similarity matrix, and expanding the allocation along the maximum similarity path until all cross-cluster similarity values ​​are zero to complete the maximum similarity allocation; and recording the remaining unclassified samples after the maximum similarity allocation as edge samples.

[0015] Assigning edge samples to the nearest high-density cluster based on the local covariance Mahalanobis distance between samples includes: selecting the neighbor sample with the smallest distance based on the local covariance Mahalanobis distance between the neighbor sample and the corresponding edge sample; and assigning the cluster label of the neighbor sample to the edge sample to assign the edge sample to the nearest high-density cluster.

[0016] Based on samples and spatiotemporal The local covariance of nearest neighbor samples, calculated using Mahalanobis distance, determines the local outlier factor of a sample, including factors in the spatiotemporal relationship of the sample to be identified. Searching for the sample to be identified in the nearest neighbor samples and its spatiotemporal relationship The farthest distance between nearest neighbor samples is calculated; the farthest distance is compared with the local covariance Mahalanobis distance from each nearest neighbor sample to the sample to be identified, and the larger value is taken as the reachable distance from the nearest neighbor sample to the sample to be identified; the reachability density of the sample to be identified is calculated based on the reachability distance, and the local outlier factor is calculated based on the reachability density.

[0017] Identifying anomalous samples based on local outliers includes comparing local outliers with a preset outlier threshold. When a local outlier exceeds the outlier threshold, the corresponding sample is identified as an anomalous sample.

[0018] Secondly, the present invention also provides a spatiotemporal density peak clustering device based on local covariance and spatiotemporal shared nearest neighbors, comprising: a covariance matrix calculation unit for defining the spatiotemporal density peaks of samples. Nearest neighbors, in the space-time of the sample The system comprises the following units: a nearest neighbor covariance matrix calculation unit, a Mahalanobis distance calculation unit, a local density calculation unit, a cluster center selection unit, a cluster partitioning unit, and a cluster division unit. The cluster partitioning unit performs maximum similarity allocation based on the spatiotemporal similarity matrix to obtain preliminary cluster divisions and marginal samples. Marginal samples are assigned to the nearest high-density cluster based on the local Mahalanobis distance. The local covariance Mahalanobis distance of the nearest neighbor samples is used to calculate the local outlier factor of the sample. Based on the local outlier factor, abnormal samples are identified and removed from the cluster to obtain the final clustering result.

[0019] For the beneficial effects of the second aspect mentioned above, please refer to the description of the first aspect mentioned above. Attached Figure Description

[0020] Figure 1A flowchart illustrating a spatiotemporal density peak clustering method based on local covariance and spatiotemporal shared nearest neighbors provided in an embodiment of the present invention;

[0021] Figure 2a This invention provides a dataset for identification and comparison consisting of four spatiotemporal clusters with different densities, provided as an embodiment of the invention. A schematic diagram of the distribution in three-dimensional space;

[0022] Figure 2b This is a schematic diagram of a cluster center identification result obtained by applying the DPC algorithm according to an embodiment of the present invention;

[0023] Figure 2c A schematic diagram of the cluster center identification result obtained by applying the spatiotemporal density peak clustering method based on local covariance and spatiotemporal shared nearest neighbor, provided in an embodiment of the present invention;

[0024] Figure 3 A schematic diagram of the spatiotemporal distribution of seismic data used in an experiment, provided as an embodiment of the present invention;

[0025] Figure 4 A schematic diagram of seismic data clustering results obtained by applying a spatiotemporal density peak clustering method based on local covariance and spatiotemporal shared nearest neighbors, provided in an embodiment of the present invention;

[0026] Figure 5 A schematic diagram of a spatiotemporal density peak clustering device based on local covariance and spatiotemporal shared nearest neighbors provided in an embodiment of the present invention;

[0027] Figure 6 This is a schematic diagram of an electronic device structure provided in an embodiment of the present invention. Detailed Implementation

[0028] 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.

[0029] This embodiment provides a spatiotemporal density peak clustering method based on local covariance and spatiotemporal shared nearest neighbors. See the appendix of the specification. Figure 1 The method includes:

[0030] S101: Define the spatiotemporal nature of the sample Nearest neighbors, in the space-time of the sample Calculate the covariance matrix within the nearest neighbor range.

[0031] In one possible implementation, the spatiotemporal nature of the sample is defined. Nearest neighbors, in the space-time of the sample Calculating the covariance matrix within the nearest neighbor range includes:

[0032] Definitions and Samples The relationship between them satisfies the following formula Each sample is a sample spacetime Nearest neighbor set: , Indicates sample and The time Euclidean distance between them Indicates the time cutoff distance. This indicates the number of nearest neighbor samples.

[0033] The covariance matrix is ​​calculated according to the following formula: , Indicates sample The local covariance matrix, Indicates sample spacetime The total number of samples in the nearest neighbor set, Indicates sample The three-dimensional spacetime vector, Indicates sample The local mean vector, This represents the ridge regression regularization coefficient. It is a 3x3 identity matrix. This represents the transpose symbol.

[0034] In one specific embodiment, according to the definition Selecting samples that meet the time constraints Then, according to the sample set obtained from the screening and the sample Sort by spatial distance in ascending order, and select the nearest one in turn. One sample as a sample spacetime If the nearest neighbor set has insufficient samples that meet the screening criteria... If there are 1, then all the samples obtained from the screening are considered as samples. spacetime Nearest neighbor set.

[0035] The local covariance matrix introduces the spatiotemporal characteristics of the samples. Nearest neighbor sets, utilizing only the covariance information within that region, capture local correlations in both temporal and spatial dimensions. The calculation of the local covariance matrix specifically satisfies the following formula: in, Indicates sample The local covariance matrix; Indicates sample spacetime The total number of samples in the nearest neighbor set; Indicates sample The three-dimensional spacetime vector, Indicates sample A three-dimensional spatiotemporal vector, which contains samples Time, longitude, and latitude attributes; Indicates sample The local mean vector; This represents the ridge regression regularization coefficient, whose value is... ; It is a 3-order identity matrix; The transpose operator is a fundamental operation for vectors or matrices, used to interchange the rows and columns of a vector.

[0036] Local covariance matrix based on samples spacetime The construction is based on nearest neighbors. First, the local vector mean of samples within the region is calculated. Then, the outer product of the deviations of each sample from this mean is calculated and summed. Finally, the result is used... Normalization is achieved by using it as the denominator. Ridge regression regularization coefficients are introduced. Ensure the local covariance matrix is ​​positive definite and invertible, and combine this with the identity matrix. A minor correction is made. The local covariance matrix calculation method designed in this invention can avoid the matrix singularity problem, ensure the stability of subsequent calculations, and not destroy the key spatiotemporal information originally recorded by the matrix.

[0037] S102: Calculate the Mahalanobis distance, the local covariance between samples.

[0038] In one possible implementation, the Mahalanobis distance of the local covariance between samples is calculated according to the following formula: ,in, The Mahalanobis distance represents the local covariance between samples. Represents a symmetric mean metric matrix. Indicates sample The inverse of the local covariance matrix.

[0039] The calculation of local covariance Mahalanobis distance introduces the local covariance matrix of the samples to measure the distance of similarity between two samples in their local spatiotemporal distribution. Its calculation... In the sample The inverse of the local covariance matrix and samples The inverse of the local covariance matrix Provides a local scaling factor in the metric space, and a symmetric average metric matrix. make sure It satisfies positive definiteness and symmetry. The metric weights of the aforementioned local covariance Mahalanobis distance can reflect the local fluctuation characteristics of time and space coordinates. When the local variance of a certain dimension is large, its proportion in the metric weight will decrease accordingly, avoiding misjudging the natural extended distribution characteristics of the data as a separation state between samples. When the local variance of a certain dimension is small and there is a clear main distribution direction, its proportion in the metric weight will increase significantly, so as to both amplify the differences of samples in that dimension and highlight the anisotropy of the data distribution.

[0040] The metric weights of the aforementioned local covariance Mahalanobis distance are entirely derived from the statistical information of the sample’s spatiotemporal nearest neighbors, without the need for manual pre-setting of spatiotemporal dimension weights. It can achieve dynamic adaptive matching of local features in different data regions. Compared with the fixed-weight distance calculation method in traditional density peak clustering, the local covariance Mahalanobis distance designed in this invention can dynamically adjust the metric scale according to the local density and distribution direction of the data, and better characterize the spatiotemporal relative positional relationship between samples.

[0041] S103: Measure the spatiotemporal shared nearest neighbors between samples, construct the spatiotemporal hybrid similarity matrix between samples, and calculate the local density of spatiotemporal shared nearest neighbors of samples based on the spatiotemporal hybrid similarity between samples.

[0042] In one possible implementation, the spatiotemporal shared nearest neighbor local density of samples is calculated according to the following formula: ,in, Indicates sample The spatiotemporal shared nearest neighbor local density, where N represents the sample and Spatiotemporal shared nearest neighbor count, Indicates sample and Spatiotemporal mixing similarity, Indicates sample spacetime The total number of samples in the nearest neighbor set.

[0043] This invention introduces temporal dimension information into local density estimation, defining a spatiotemporally shared nearest neighbor local density. By statistically analyzing the number of spatiotemporally shared nearest neighbors of sample pairs and calculating the similarity of samples in the spatiotemporal dimension based on local covariance Mahalanobis distance, a new local density calculation method is jointly constructed by combining the sum of similarities, the effective neighbor size, and the average similarity of the neighborhood, resulting in a spatiotemporally shared nearest neighbor local density that balances temporal synchronization and spatial connectivity.

[0044] In a specific embodiment, the spatiotemporal shared nearest neighbor local density is calculated through the following steps:

[0045] Measuring the spatiotemporal shared nearest neighbors between samples: , Indicates sample and Shared nearest neighbor set, Indicates sample spacetime nearest neighbor set Indicates sample spacetime Nearest neighbor set.

[0046] The spatiotemporal mixture similarity between samples is calculated based on the number of spatiotemporally shared nearest neighbors and the distance metric between samples: Indicates sample and Spatiotemporal mixing similarity, Indicates sample and The number of shared neighbors, This represents the median of the Mahalanobis distance, representing the local covariance among all samples. A spatiotemporal mixture similarity matrix is ​​constructed based on the spatiotemporal mixture similarity calculation results.

[0047] Calculate the spatiotemporal shared nearest neighbor local density: .

[0048] The spatiotemporal shared nearest neighbor set of samples incorporates a wealth of local structural information, helping to reveal the structural overlap characteristics between local regions and thus more effectively capturing the distribution patterns of samples in the spatiotemporal dimension. Spatiotemporal hybrid similarity is calculated by the number of spatiotemporal shared nearest neighbors between samples and the distance metric between samples: the distance metric between samples originates from the exponential decay of the local covariance Mahalanobis distance; the local covariance Mahalanobis distance is constructed using a joint local covariance estimate of temporal and spatial coordinates, with the covariance matrix subjected to minimum regularization to ensure invertibility, and the metric tensor is obtained by averaging the inverse covariance matrices between samples; the decay bandwidth is taken as the median of the global distance distribution to accommodate the differences between dense and sparse regions; spatiotemporal hybrid similarity ensures that samples that are spatiotemporally adjacent and close in distance receive higher weights, enhancing the discriminative power between clusters. The spatiotemporal shared nearest neighbor local density is composed of the sum of similarities, the number of spatiotemporal shared nearest neighbors, and the average similarity of the neighborhood: the sum of similarities reflects the global similarity; the effective neighbor size reflects the local sample density; and the average similarity of the neighborhood characterizes the local similarity. The spatiotemporal shared nearest neighbor local density combines temporal constraints and spatial connectivity, and characterizes the anisotropic structure through the Mahalanobis distance of local covariance. It can stably highlight high-density regions and improve the accuracy of cluster center identification.

[0049] In a specific embodiment, the relative distance between samples can be obtained based on the local covariance Mahalanobis distance as follows: ,in, Indicates the relative distance between samples. Indicates sample and The local covariance Mahalanobis distance This represents the spatiotemporal shared nearest neighbor local density of the sample. This represents the maximum value among the spatiotemporally shared nearest neighbor local densities corresponding to all samples.

[0050] S104: Construct a decision graph based on the spatiotemporal shared nearest neighbor local density of samples and the Mahalanobis distance of local covariance between samples, and select the cluster center.

[0051] In one possible embodiment, constructing a decision graph based on the spatiotemporal shared nearest neighbor local density of samples and the Mahalanobis distance of local covariance between samples and selecting cluster centers includes: calculating the relative distance between samples based on the Mahalanobis distance of local covariance between samples, constructing a decision graph with the spatiotemporal shared nearest neighbor local density and relative distance of samples as the horizontal and vertical axes; calculating decision values ​​based on the spatiotemporal shared nearest neighbor local density and relative distance, and selecting cluster centers according to the decision values ​​of samples.

[0052] For example, a decision map is constructed using the spatiotemporal shared nearest neighbor local density and relative distance of samples as the horizontal and vertical axes. Since the local density and relative distance of the density peak are more prominent, samples located in the upper right region of the decision map are more likely to be considered cluster centers. To reduce subjective interference, decision value variables are further calculated to quantitatively clarify the selection of cluster centers. The decision value calculation satisfies the following formula: , Indicates the decision value. Represents the spatiotemporal shared nearest neighbor local density. Representing relative distance, select decision value The largest number of samples are the cluster centers.

[0053] In one specific embodiment, the results of identifying cluster centers using the method of this invention are compared with those using the commonly used DPC algorithm in the prior art. See also Figure 2a The dataset used for identification and comparison consists of four spatiotemporal clusters with different densities. The distribution state in three-dimensional space. During cluster identification, the DPC algorithm calculates the local density of samples using a truncated kernel and a Gaussian kernel function. However, this algorithm has a significant limitation: insufficient sensitivity to sparse clusters. This deficiency directly leads to inadequate identification of sparse clusters. From... Figure 2b The results of the DPC algorithm shown indicate that it only successfully identified two centers in the lower, higher-density clusters, failing to detect the upper, sparse clusters. The spatiotemporal shared nearest neighbor local density calculation method proposed in this invention performs better in the identification task of four clusters. Figure 2c As shown, it can not only accurately identify all clusters, but also select the appropriate cluster center in each cluster.

[0054] S105: Based on the spatiotemporal hybrid similarity matrix, maximum similarity allocation is performed to initially divide the samples into clusters and marginal samples. Marginal samples are then assigned to the nearest high-density cluster based on the local covariance Mahalanobis distance between samples. This is done according to the relationship between the sample and the spatiotemporal... The local covariance Mahalanobis distance of the nearest neighbor samples is used to calculate the local outlier factor of the sample; outlier samples are identified based on the local outlier factor, and the outlier samples are removed from the cluster to obtain the final clustering result.

[0055] In one possible embodiment, the initial division of clusters and edge samples is obtained by performing maximum similarity allocation based on the spatiotemporal hybrid similarity matrix, including: taking the cluster center sample as the initial labeled node, traversing the spatiotemporal hybrid similarity matrix to find the maximum similarity path between the initial labeled node and the unlabeled node; assigning the unlabeled node to the cluster based on the similarity value between nodes in the spatiotemporal hybrid similarity matrix; clearing the assigned nodes in the spatiotemporal hybrid similarity matrix, and expanding the allocation along the maximum similarity path until the similarity value across all clusters is zero to complete the maximum similarity allocation; and recording the remaining unclassified samples after the maximum similarity allocation as edge samples.

[0056] In one possible embodiment, assigning an edge sample to the nearest high-density cluster based on the local covariance Mahalanobis distance between samples includes: selecting the neighbor sample with the smallest distance based on the local covariance Mahalanobis distance between the edge sample's neighbor samples and the corresponding edge sample; and assigning the cluster label of the neighbor sample to the edge sample to assign the edge sample to the nearest high-density cluster.

[0057] In one possible implementation, based on the sample and spatiotemporal... The local covariance of nearest neighbor samples, calculated using Mahalanobis distance, determines the local outlier factor of a sample, including factors in the spatiotemporal relationship of the sample to be identified. Searching for the sample to be identified in the nearest neighbor samples and its spatiotemporal relationship The farthest distance between nearest neighbor samples is calculated; the farthest distance is compared with the local covariance Mahalanobis distance from each nearest neighbor sample to the sample to be identified, and the larger value is taken as the reachable distance from the nearest neighbor sample to the sample to be identified; the reachability density of the sample to be identified is calculated based on the reachability distance, and the local outlier factor is calculated based on the reachability density.

[0058] In one specific embodiment, a two-step allocation strategy is designed, comprising two stages: a maximum similarity allocation stage and a recent high-density allocation stage, to assign samples to different clusters.

[0059] Specifically, in the maximum similarity allocation stage, the selected cluster center samples are used as initial labeled nodes. The spatiotemporal mixture similarity matrix is ​​traversed to find the edge with the highest similarity between the initial labeled node and the unlabeled node, thus obtaining the maximum similarity path. At this point, the similarity value of each node in the spatiotemporal mixture similarity matrix reflects their relationship with other nodes, with the highest similarity value representing the closest relationship. Based on these relationships, unlabeled nodes are assigned to the corresponding clusters. After allocation, the columns corresponding to the assigned nodes in the spatiotemporal mixture similarity matrix are cleared to avoid duplicate processing. As the iteration progresses, the maximum similarity path calculated by the spatiotemporal shared nearest neighbor local density and local covariance Mahalanobis distance is expanded until all cross-cluster similarity values ​​are zero. The remaining unclassified samples after the maximum similarity allocation is recorded as edge samples. By maximizing the expansion of the similarity path, regions with high similarity can be quickly covered, thus efficiently completing the initial cluster division.

[0060] Edge samples typically have low density surrounding them, making direct classification difficult. During the most recent high-density assignment phase, the local covariance Mahalanobis distance between all neighbors of the edge sample and the corresponding edge sample is used. The neighbor sample with the smallest distance is selected as the reference, and its cluster label is assigned to the current edge sample. The local covariance Mahalanobis distance considers the local structure of the samples in the spatiotemporal dimension, more accurately reflecting the distance relationships between samples. In this way, edge samples are assigned to the nearest high-density region, improving assignment accuracy and ensuring more precise cluster boundaries.

[0061] In one possible embodiment, all neighbors of an edge sample are the spatiotemporal neighbors of the edge sample. All samples in the nearest neighbor set; Step S102 calculates the local covariance Mahalanobis distance between each sample. The local covariance Mahalanobis distance between the edge sample and its neighbor sample can be obtained from the calculation results of step S102.

[0062] In one specific embodiment, after all samples have been assigned, outlier identification is performed to identify misassigned abnormal samples, thereby improving the reliability of the clustering results. The outlier identification strategy designed in this invention includes: calculating the reachability distance using the Mahalanobis distance of the samples' local covariance, and calculating the reachability density of the samples based on the reachability distance. The local outlier factor is obtained based on the density difference between a sample and its nearest neighbors. Outliers are determined based on whether the local outlier factor exceeds a set outlier threshold.

[0063] The reachable distance can be calculated using the following formula: ,in, Indicates sample and The reachable distance; Indicates sample Its farthest The Mahalanobis distance of the local covariance of the nearest neighbors can quantify the samples at a local scale. The density relative to the surrounding environment; Indicates sample and The local covariance Mahalanobis distance.

[0064] The reachability density can be calculated using the following formula: ,in, This represents the reachability density, which is calculated by averaging the reachable distances and then taking the reciprocal. The larger the reachable distance, the smaller the reachability density. Indicates sample spacetime The total number of samples in the nearest neighbor set.

[0065] The technique for local outlier factors satisfies the following formula: ,in, Indicates sample Neighbor density, a measure of neighbor samples The degree of congestion in the local area; Indicates sample Its own density; Indicates sample The local outlier factor is essentially the expected density ratio. If the average density of the nearest neighbor samples is significantly higher than the density of the sample itself, the sample is considered an outlier.

[0066] In one possible embodiment, identifying anomalous samples based on local outliers includes: comparing the local outlier with a preset outlier threshold; when the local outlier is greater than the outlier threshold, the corresponding sample is determined to be an anomalous sample.

[0067] In a specific embodiment, outlier samples are identified based on local outlier factors, satisfying the following formula: ,in, This indicates the set abnormal threshold; samples exceeding this threshold are considered abnormal.

[0068] In the anomaly identification process, the farthest distance between a sample and its nearest neighbors is first found and used as the neighborhood scale to ensure coverage of all relatively distant samples and capture the global relationships between samples. This scale is then compared with the Mahalanobis distance (the local covariance of each nearest neighbor to the sample), and the larger value is taken as the reachable distance. The average of all reachable distances is then calculated to avoid misclassifying marginal samples as anomalies. Reachability density is calculated based on the reciprocal of the reachable distance between samples to measure the tightness of their surroundings. A lower reachability density indicates a significant difference between the sample and other samples in its neighborhood, making it a potential anomaly. Finally, the sum of the reachability density ratios of a sample and its nearest neighbors is calculated, and the average of these ratios is the local outlier factor. A larger local outlier factor indicates a sparser neighborhood environment and a more pronounced difference in distribution from other samples in the neighborhood. When the local outlier factor exceeds a set threshold, the corresponding sample is identified as an anomaly and removed from the cluster, thereby strengthening the cluster boundary and reducing the impact of misassignment.

[0069] To evaluate the clustering performance of the spatiotemporal density peak clustering method based on local covariance and spatiotemporal shared nearest neighbors (LCSN-STDPC) of this invention, a comparative experiment was conducted using one classic spatiotemporal clustering algorithm and three state-of-the-art spatiotemporal clustering algorithms based on DPC improvements (ST-ADPTC, STSNN-DPC, ST-CFSFDP, and ST-DBSCAN). The comparative experiments were carried out on four artificially generated datasets. To further verify the applicability and practical value of the spatiotemporal density peak clustering method based on local covariance and spatiotemporal shared nearest neighbors on real spatiotemporal data, it was applied to the identification of foreshocks and aftershocks in earthquake event sequences.

[0070] Table 1 Key information of the synthetic dataset

[0071]

[0072] Table 1 contains four spatiotemporal datasets of varying sizes and cluster structures. - Key parameters. It contains four clusters of different sizes and interconnected linear anomaly samples, with each cluster showing significant differences in temporal attributes. It consists of two sparse and morphologically distinct clusters. Composed of two L-shaped clusters with similar densities, it can be regarded as a combination of spatially extended clusters and temporally extended clusters; the clusters on the left have a complete structure, while the clusters on the right are extremely sparse at the splice point. Four spatiotemporal clusters with different densities and morphologies were presented. To evaluate the consistency between the clustering results and the true labels, three common external evaluation metrics were used: Adjusted Mutual Information (AMI), Adjusted Rand Index (ARI), and FM Index (FMI). These metrics typically range from 0 to 1, with values ​​closer to 1 indicating a higher degree of match between the cluster labels and the actual categories. For cluster analysis of earthquake sequences, the DB Index (DBI) and CH Index (CHI) were introduced as quantitative assessment tools for internal structure. DBI measures the compactness of samples within clusters and the separability between clusters; a smaller value indicates more concentrated cluster divisions and clearer boundaries. CHI, on the other hand, reflects the discriminative power of the cluster structure by calculating the ratio of inter-cluster variance to intra-cluster variance; a larger CHI value indicates a more defined cluster structure and better aggregation. To comprehensively analyze cluster quality, outlier samples were considered as independent clusters and included in the metric calculation.

[0073] Table 2. Metrics of the 5 algorithms on synthetic datasets

[0074]

[0075] Based on the results in Table 2, the optimal values ​​of AMI, ARI, and FMI for the five spatiotemporal clustering algorithms on the four composite datasets are highlighted in bold. It can be seen that the LCSN-STDPC algorithm achieves the highest scores on all datasets and all evaluation metrics, significantly outperforming other comparative algorithms in terms of clustering accuracy and result consistency. This indicates that the algorithm can stably recover the true cluster structure under different synthetic scenarios, demonstrating robust and superior clustering performance. In comparison, the ST-DBSCAN algorithm ranks second overall, achieving suboptimal results on most datasets, while the ST-ADPTC, STSNN-DPC, and ST-CFSFDP algorithms have relatively weaker overall performance, further highlighting the advantages of the LCSN-STDPC algorithm.

[0076] Spatiotemporal clustering experiments using the LCSN-STDPC algorithm on earthquake datasets aim to uncover their potential spatiotemporal structural features, identify the location of the mainshock, and assist in inferring related foreshock and aftershock activity patterns. Foreshocks typically refer to earthquake events that occur before the mainshock, while aftershocks are a series of earthquakes that follow the mainshock. Spatiotemporal clustering analysis of such earthquake sequences helps to deepen the understanding of the triggering mechanisms of strong earthquakes, thereby improving the practicality of earthquake prediction. Although existing spatial clustering techniques are widely used for identifying foreshocks and aftershocks, these methods fail to fully integrate the temporal information of earthquake events. Therefore, the LCSN-STDPC algorithm, which considers both spatiotemporal characteristics, is employed to reveal earthquake clustering patterns across a comprehensive spatiotemporal dimension.

[0077] The seismic data used in the experiment came from the National Earthquake Science Data Center, covering the period from January 2008 to August 2009, encompassing seismic activity within China. The analysis focused on mining the spatiotemporal clustering characteristics within short periods to explore the structure and sequence relationships of earthquake swarms. Figure 3 It shows the spatiotemporal distribution of 1,329 earthquakes of magnitude 4.0 or above during this period.

[0078] The experiment evaluated the clustering performance of five algorithms on the seismic dataset using two metrics: DBI and CHI. Table 3 shows the evaluation results of each algorithm, with the best values ​​highlighted in bold. The results show that the LCSN-STDPC algorithm performs best on both metrics, maintaining high consistency within clusters while exhibiting good inter-cluster separability, which helps to clearly reveal the sequence characteristics of foreshocks, mainshocks, and aftershocks. In contrast, although the ST-DBSCAN algorithm performs better on DBI, indicating a more compact cluster structure, its CHI value is lower than that of the ST-ADPTC and STSNN-DPC algorithms, reflecting that there is still room for improvement in its cluster discrimination ability. The STSNN-DPC algorithm ranks second in the CHI metric, showing that it has a certain ability to separate clusters, but its DBI value is the highest among all methods, indicating that the internal structure of the clusters is relatively loose and the cohesion between samples is insufficient, thus affecting the clustering quality.

[0079] Table 3. Performance metrics of the five algorithms on the earthquake dataset.

[0080]

[0081] The LCSN-STDPC algorithm successfully identified [various types of data] when performing spatiotemporal clustering analysis on seismic data. Figure 4 Five typical earthquake clusters are shown. The spatiotemporal density peak clustering method based on local covariance and spatiotemporal shared nearest neighbors provided by this invention calculates the covariance matrix within the local spatiotemporal neighborhood. Based on this, it defines the Mahalanobis distance of local covariance between samples, automatically unifying the temporal and spatial scale differences to improve the accuracy of similarity measurement. It optimizes the calculation method of local density using the number of spatiotemporal shared nearest neighbors and the Mahalanobis distance of local covariance to enhance the reliability of cluster center identification. A two-step allocation and anomaly identification strategy is adopted, gradually determining and refining the sample attribution through two stages: allocation based on maximum similarity and nearest high density. Then, local outlier factors are used to effectively identify anomalous samples, reducing the propagation of errors. Experimental results show that the spatiotemporal density peak clustering method based on local covariance and spatiotemporal shared nearest neighbors exhibits superior clustering performance on multiple datasets and shows promising prospects for application in earthquake datasets.

[0082] This invention addresses a series of technical challenges by employing a spatiotemporal density peak clustering method based on local covariance and spatiotemporally shared nearest neighbors. Introducing local covariance Mahalanobis distance in spatiotemporal data scenarios presents several technical obstacles that traditional methods cannot overcome: Mahalanobis distance typically relies on a stable global covariance structure to ensure the reliability of scale adjustment and distance measurement. However, spatiotemporal data exhibits significant local heterogeneity at different locations and time periods, and its local distribution often lacks a unified covariance characteristic, making it difficult to accurately reflect the true spatiotemporal relationships by directly applying Mahalanobis distance with a global or fixed covariance structure. Furthermore, the estimation of local covariance is limited by factors such as limited neighborhood data volume, inconsistent time spans, and large spatial density differences, easily leading to degenerate matrices or highly unbalanced eigenvalue distributions, thus making distance calculation numerically unstable. More importantly, when constructing a local covariance matrix independently for each sample, the metric space dynamically changes with the sample location, and the distances between different samples no longer possess a unified metric basis for direct comparison. This undermines the consistency requirement of global ranking in density peak clustering, potentially causing conflicts between δ values ​​and density ranking. The method of this invention systematically designs the stability of local covariance, symmetry strategy, scale balance and metric consistency to eliminate the structural contradictions caused by spatiotemporal heterogeneity; otherwise, the core discrimination mechanism of the algorithm will not be valid.

[0083] The calculation of local density of samples suffers from a fundamental problem with traditional density estimation methods: they cannot simultaneously characterize spatiotemporal structure. Time and space differ in their rates of change, scale variations, and distribution structures. Simply treating time as an additional dimension in the calculation often leads to distortion of the neighborhood structure: spatial relationships are weakened in regions with large time spans, while time-dense regions may excessively amplify local spatial noise, making it difficult to correctly identify cluster centers using density features. Furthermore, spatiotemporal shared neighbor relationships lack stable symmetry—two samples may share neighbors temporally but not necessarily have equal spatial connectivity, resulting in irregular jumps in the shared neighbor matrix, making it difficult to maintain continuity and orderability in density estimation. The dimensions and magnitudes of variation among various indicators, such as the number of shared neighbors, local covariance Mahalanobis distance, and average neighborhood similarity, are inconsistent, making simple superposition for density calculation impossible. Such simple superposition easily leads to density ordering distortion, disrupting the crucial step of center point identification. The method of this invention constructs a similarity matrix based on local covariance Mahalanobis distance, a neighborhood size correction mechanism, and an average similarity adjustment strategy, so that local density can achieve a balanced expression between temporal synchronization and spatial connectivity, thereby solving the fundamental problem that traditional density estimation methods cannot simultaneously characterize spatiotemporal structure.

[0084] A similarity matrix based on local covariance Mahalanobis distance, a neighborhood size correction mechanism, and an average similarity adjustment strategy are constructed to achieve a balanced expression of local density between temporal synchronization and spatial connectivity.

[0085] See the instruction manual appendix Figure 5 This embodiment also provides a spatiotemporal density peak clustering device based on local covariance and spatiotemporal shared nearest neighbors, which is used to implement the above method embodiment. The device includes:

[0086] Covariance matrix calculation unit 201 is used to define the spatiotemporal characteristics of the samples. Nearest neighbors, in the space-time of the sample Calculate the covariance matrix within the nearest neighbor range.

[0087] Mahalanobis distance calculation unit 202 is used to calculate the local covariance Mahalanobis distance between samples.

[0088] The local density calculation unit 203 is used to measure the spatiotemporal shared nearest neighbors between samples, construct the spatiotemporal hybrid similarity matrix between samples, and calculate the spatiotemporal shared nearest neighbor local density of samples based on the spatiotemporal hybrid similarity between samples.

[0089] Cluster center selection unit 204 is used to construct a decision graph and select cluster centers based on the spatiotemporal shared nearest neighbor local density and the local covariance Mahalanobis distance between samples.

[0090] Cluster partitioning unit 205 is used to perform maximum similarity allocation based on the spatiotemporal hybrid similarity matrix to obtain preliminary cluster partitioning and edge samples. Edge samples are assigned to the nearest high-density cluster based on the local covariance Mahalanobis distance between samples, according to the sample and spatiotemporal... The local covariance Mahalanobis distance of the nearest neighbor samples is used to calculate the local outlier factor of the sample. Based on the local outlier factor, abnormal samples are identified and removed from the cluster to obtain the final clustering result.

[0091] 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.

[0092] In other embodiments of this application, an electronic device is disclosed, such as... Figure 6 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.

[0093] 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.

[0094] 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.

[0095] 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.

[0096] 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 spatio-temporal density peak clustering method based on local covariance and spatio-temporal shared neighbors, characterized in that, include: Defining a spatiotemporal sample Nearest neighbors, in a spatiotemporal sample Computing a covariance matrix over a neighborhood, wherein each sample includes temporal data and spatial data of a seismic event occurrence; Calculate the Mahalanobis distance, the local covariance between samples; The spatiotemporal shared nearest neighbor of samples is measured, a spatiotemporal hybrid similarity matrix between samples is constructed, and the spatiotemporal shared nearest neighbor local density of samples is calculated based on the spatiotemporal hybrid similarity between samples. A decision graph is constructed based on the spatiotemporal shared nearest neighbor local density of samples and the Mahalanobis distance of local covariance between samples, and the cluster center is selected. Based on the spatiotemporal hybrid similarity matrix, maximum similarity allocation is performed to initially divide the samples into clusters and marginal samples. Marginal samples are then assigned to the nearest high-density cluster based on the Mahalanobis distance of the local covariance between samples. Finally, based on the relationship between the sample and the spatiotemporal... The local covariance Mahalanobis distance of the nearest neighbor samples is used to calculate the local outlier factor of the sample. Based on the local outlier factor, abnormal samples are identified and removed from the cluster to obtain the final clustering result. Define the spatiotemporal of the sample Nearest neighbors, in the space-time of the sample Calculating the covariance matrix within the nearest neighbor range includes: Definitions and Samples The relationship between them satisfies the following formula Each sample is a sample spacetime Nearest neighbor set: , Indicates sample and The time Euclidean distance between them Indicates the time cutoff distance. Indicates the number of nearest neighbor samples; The covariance matrix is ​​calculated according to the following formula: , Indicates sample The local covariance matrix, Indicates sample spacetime The total number of samples in the nearest neighbor set, Indicates sample The three-dimensional spacetime vector, Indicates sample The local mean vector, This represents the ridge regression regularization coefficient. It is a 3x3 identity matrix. Indicates the transpose symbol; The Mahalanobis distance, the local covariance between samples, is calculated according to the following formula: ,in, The Mahalanobis distance represents the local covariance between samples. Represents a symmetric mean metric matrix. Indicates sample The inverse of the local covariance matrix; The spatiotemporal shared nearest neighbor local density of samples is calculated according to the following formula: ,in, Indicates sample The spatiotemporal shared nearest neighbor local density, where N represents the sample and Spatiotemporal shared nearest neighbor count, Indicates sample and Spatiotemporal mixing similarity, Indicates sample spacetime The total number of samples in the nearest neighbor set; A decision graph is constructed based on the spatiotemporal shared nearest neighbor local density and the Mahalanobis distance of local covariance between samples, and cluster centers are selected, including: The relative distance between samples is calculated based on the Mahalanobis distance of the local covariance between samples, and a decision graph is constructed with the spatiotemporal shared nearest neighbor local density and relative distance of the samples as the horizontal and vertical axes. Decision values ​​are calculated based on the spatiotemporal shared nearest neighbor local density and relative distance, and cluster centers are selected based on the decision values ​​of the samples.

2. The method according to claim 1, characterized in that, Preliminary clustering and marginal samples are obtained by maximizing similarity allocation based on the spatiotemporal hybrid similarity matrix, including: Using the cluster center sample as the initial labeled node, the spatiotemporal hybrid similarity matrix is ​​traversed to find the maximum similarity path between the initial labeled node and the unlabeled node; Unlabeled nodes are assigned to clusters based on the similarity values ​​between nodes in the spatiotemporal hybrid similarity matrix; After the nodes have been assigned, they are cleared from the spatiotemporal hybrid similarity matrix and the assignment is extended along the maximum similarity path until the similarity value of all cross-clusters is zero to complete the maximum similarity assignment. The remaining unclassified samples after the maximum similarity assignment are recorded as edge samples.

3. The method according to claim 2, characterized in that, Edge samples are assigned to the nearest high-density cluster based on the Mahalanobis distance of local covariance between samples, including: The neighbor sample with the smallest distance is selected based on the local covariance Mahalanobis distance between the neighbor samples of the edge sample and the corresponding edge sample. Assign the cluster label of the neighbor sample to the edge sample to assign the edge sample to the nearest high-density cluster.

4. The method according to claim 1, characterized in that, Based on samples and spatiotemporal The Mahalanobis distance, calculated from the local covariance of nearest neighbor samples, determines the local outlier factor of a sample, including: In the spatiotemporal space of the sample to be identified Searching for the sample to be identified in the nearest neighbor samples and its spatiotemporal relationship The farthest distance between nearest neighbor samples; The farthest distance is compared with the local covariance Mahalanobis distance from each nearest neighbor sample to the sample to be identified, and the larger value is taken as the reachable distance from the nearest neighbor sample to the sample to be identified. The reachability density of the sample to be identified is calculated based on the reachability distance, and the local outlier factor is calculated based on the reachability density.

5. The method according to claim 1, characterized in that, Identifying outlier samples based on local outlier factors includes: The local outlier is compared with a preset outlier threshold. When the local outlier is greater than the outlier threshold, the corresponding sample is identified as an outlier.

6. A spatiotemporal density peak clustering device based on local covariance and spatiotemporal shared nearest neighbors, characterized in that, The device includes: The covariance matrix calculation unit is used to define the spatiotemporal characteristics of the samples. Nearest neighbors, in the space-time of the sample The covariance matrix is ​​calculated within the nearest neighbor range, where each sample includes temporal and spatial data of the earthquake event. The Mahalanobis distance calculation unit is used to calculate the Mahalanobis distance of the local covariance between samples. The local density calculation unit is used to measure the spatiotemporal shared nearest neighbors between samples, construct the spatiotemporal hybrid similarity matrix between samples, and calculate the spatiotemporal shared nearest neighbor local density of samples based on the spatiotemporal hybrid similarity between samples. The cluster center selection unit is used to construct a decision graph and select cluster centers based on the spatiotemporal shared nearest neighbor local density and the Mahalanobis distance of local covariance between samples. The cluster partitioning unit is used to perform maximum similarity allocation based on the spatiotemporal hybrid similarity matrix to obtain preliminary clusters and edge samples. Edge samples are assigned to the nearest high-density cluster based on the local covariance Mahalanobis distance between samples. This is done according to the relationship between the sample and the spatiotemporal... The local covariance Mahalanobis distance of the nearest neighbor samples is used to calculate the local outlier factor of the sample. Based on the local outlier factor, abnormal samples are identified and removed from the cluster to obtain the final clustering result. Define the spatiotemporal of the sample Nearest neighbors, in the space-time of the sample Calculating the covariance matrix within the nearest neighbor range includes: Definitions and Samples The relationship between them satisfies the following formula Each sample is a sample spacetime Nearest neighbor set: , Indicates sample and The time Euclidean distance between them Indicates the time cutoff distance. Indicates the number of nearest neighbor samples; The covariance matrix is ​​calculated according to the following formula: , Indicates sample The local covariance matrix, Indicates sample spacetime The total number of samples in the nearest neighbor set, Indicates sample The three-dimensional spacetime vector, Indicates sample The local mean vector, This represents the ridge regression regularization coefficient. It is a 3x3 identity matrix. Indicates the transpose symbol; The Mahalanobis distance, the local covariance between samples, is calculated according to the following formula: ,in, The Mahalanobis distance represents the local covariance between samples. Represents a symmetric mean metric matrix. Indicates sample The inverse of the local covariance matrix; The spatiotemporal shared nearest neighbor local density of samples is calculated according to the following formula: ,in, Indicates sample The spatiotemporal shared nearest neighbor local density, where N represents the sample and Spatiotemporal shared nearest neighbor count, Indicates sample and Spatiotemporal mixing similarity, Indicates sample spacetime The total number of samples in the nearest neighbor set; A decision graph is constructed based on the spatiotemporal shared nearest neighbor local density and the Mahalanobis distance of local covariance between samples, and cluster centers are selected, including: The relative distance between samples is calculated based on the Mahalanobis distance of the local covariance between samples, and a decision graph is constructed with the spatiotemporal shared nearest neighbor local density and relative distance of the samples as the horizontal and vertical axes. Decision values ​​are calculated based on the spatiotemporal shared nearest neighbor local density and relative distance, and cluster centers are selected based on the decision values ​​of the samples.

Citation Information

Patent Citations

  • Seismic event time and space gathering mode extraction method based on shared density

    CN103869367A

  • Multi-stage spatial-temporal clustering method and system based on fused mahalanobis distance

    CN121051489A