Pedestrian trajectory clustering method based on density peak value and space-time sharing nearest neighbor

By introducing the idea of ​​space-time sharing nearest neighbors in trajectory clustering and combining the density peak method, the problem of large differences in data density in traditional clustering algorithms is solved, and more accurate trajectory clustering and prediction effects are achieved.

CN118981653APending Publication Date: 2024-11-19ANHUI NORMAL UNIV
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410974634.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-19
Publication Date
2024-11-19

AI Technical Summary

Technical Problem

The traditional density peak clustering algorithm fails to effectively consider the neighborhood influence of data points when processing local density and relative distances between data points, resulting in poor clustering effect when the degree of data density varies greatly.

Method used

The pedestrian trajectory clustering method based on density peaks and space-time sharing nearest neighbors is adopted. By calculating the spatiotemporal similarity, local density and relative distance between trajectory points, the point with a larger decision value is selected as the clustering center, and the trajectory points are allocated. To the nearest cluster center, use space-time sharing nearest neighbor idea to comprehensively measure similarities between trajectories.

Benefits of technology

It improves the accuracy and coherence of trajectory clustering, can more accurately reflect the actual movement patterns of pedestrians, and improves the accuracy of trajectory prediction, and is suitable for traffic flow management and pedestrian path planning in intelligent traffic systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118981653A_ABST
    Figure CN118981653A_ABST
Patent Text Reader

Abstract

The invention discloses a pedestrian trajectory clustering method based on a density peak value and space-time shared nearest neighbor, and the method comprises the steps: putting obtained pedestrian trajectory data into a trajectory data set, and calculating the space-time similarity between each pair of trajectory points in the trajectory data set; calculating the local similarity of the corresponding pair of track points based on the space-time similarity between each pair of track points; a similarity matrix is constructed; calculating the local density and the relative distance of each track point in the track data set based on the similarity matrix; and calculating a decision value of a corresponding track point, selecting a point with a larger decision value as a clustering center, and distributing other track points in the track data set X to a cluster where the nearest clustering center is located. In the pedestrian trajectory clustering process, the similarity between trajectories is comprehensively measured by using the thought of space-time sharing nearest neighbor, so that the clustering result is more coherent in space and time, and the actual moving mode of pedestrians can be reflected more accurately.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of trajectory clustering, and more specifically, the present invention relates to a pedestrian trajectory clustering method based on density peak and spatiotemporal shared nearest neighbors. Background Art

[0002] With the rapid development of the Internet and big data technology, data collection and processing capabilities have been significantly improved. Multiple data sources such as IoT devices, sensor networks, mobile devices, and social media platforms together constitute a huge data ecosystem.

[0003] Especially in urban transportation and intelligent transportation systems, the popularity of GPS receivers and embedded mobile devices has enabled a large amount of high-precision spatiotemporal data to be collected and processed in real time. Modern mobile devices, such as smartphones, tablets, and embedded devices equipped with GPS receivers and storage hardware, can continuously record the geographic location and movement trajectory of pedestrians.

[0004] By clustering pedestrian trajectories, we can identify densely populated areas, such as commercial areas, public transportation stations, and scenic spots. This information is very important for urban planning and traffic management, and can help decision makers optimize urban traffic planning, improve the flow of people, provide better transportation services and facilities, and prevent congestion. In addition, by clustering pedestrian trajectories, we can understand the consumer behavior and preferences of the crowd, help business decision makers optimize business layout, and provide personalized marketing services.

[0005] The traditional density peak clustering DPC algorithm is used for local density ρ i and the relative distance δ i The measurement does not consider the influence of the neighborhood of the data point. When the data density between clusters is very different, there will be allocation errors, which will eventually lead to poor clustering results. Summary of the invention

[0006] The present invention provides a pedestrian trajectory clustering method based on density peak and spatiotemporal shared nearest neighbors, aiming to improve the above problems.

[0007] The present invention is implemented as follows: a pedestrian trajectory clustering method based on density peak and spatiotemporal shared nearest neighbors, the method comprising the following steps:

[0008] (1) Put the acquired pedestrian trajectory data into the trajectory dataset and calculate the spatiotemporal similarity between each pair of trajectory points in the trajectory dataset X;

[0009] (2) Calculate the local similarity of the corresponding trajectory points based on the spatiotemporal similarity between each pair of trajectory points; and construct a similarity matrix;

[0010] (3) Calculate the local density ρ of each trajectory point in the trajectory dataset X based on the similarity matrix i and the relative distance δ i ;

[0011] (4) Based on the local density of trajectory points ρi and the relative distance δ i Calculate the decision value γ corresponding to the trajectory point i , choose the decision value γ i The larger point is used as the cluster center, and the other trajectory points in the trajectory dataset X are assigned to the cluster where the nearest cluster center is located.

[0012] Furthermore, the trajectory point P i With trajectory point P j The specific process of obtaining the spatiotemporal similarity between

[0013] (11) Obtain trajectory point P i and trajectory point P j The spatial shared nearest neighbor set Sn r (P i , P j ) and the time-shared nearest neighbor set Tn r (P i , P j );

[0014] (12) Take the spatially shared nearest neighbor set Sn r (P i , P j ) and the time-shared nearest neighbor set Tn r (P i , P j ) of the intersection ST-n r (P i , P j ), the number of trajectory points in the intersection|ST-n r (P i , P j )| is the trajectory point P i With trajectory point P j The spatiotemporal similarity between

[0015] Time-sharing nearest neighbor set Tn r (P i , P j ) is the trajectory point P i The time distance nearest neighbor set tn r (P i ) and trajectory point P j The time distance nearest neighbor set tn r (P j )

[0016] Spatial shared nearest neighbor set Sn r (P i , P j ) is the trajectory point P i The spatial distance nearest neighbor set tn r (P i ) and trajectory point P j The spatial distance nearest neighbor set tn r (P j )

[0017] Furthermore, the trajectory point P i The time distance nearest neighbor set tn r (P i The specific process of obtaining ) is as follows:

[0018] Calculate other trajectory points P in the trajectory dataset X i With trajectory point P i The time distance TDist(P i , P l ), the first k time distances TDist(P i , P l ) is the trajectory point P i The nearest neighbor in time distance is put into the nearest neighbor set tn r (P i ).

[0019] Furthermore, the trajectory point P i and trajectory point P j The time distance TDist(P i , P l ) is calculated as:

[0020] TDist(P i , P l )=w1*|T i -T l |+w2*|T i -T l | 2

[0021] Among them, T i , T l Represent the trajectory point P i , trajectory point P l The timestamp of , w1 and w2 are weights;

[0022] If the trajectory point P i and trajectory point P l belong to the same trajectory, then let w1>w2; if the trajectory point P i and trajectory point Pl If they do not belong to the same trajectory, let w1<w2.

[0023] Furthermore, the trajectory point P i and trajectory point P j The local similarity Sim(P i , P j ) is calculated as follows:

[0024]

[0025] Among them, |ST-n r (P i , P j )| represents the trajectory point P i With trajectory point P j The spatiotemporal similarity between i , P k )、TDist(P i , P k ) represent the trajectory points P i and trajectory point P k The spatial distance and temporal distance of SDist(P k , P j )、TDist(P k , P j ) represent the trajectory points P j and trajectory point P k spatial distance and temporal distance.

[0026] Furthermore, the trajectory point P i The local density ρi The calculation formula is as follows:

[0027] The trajectory point P i The local similarities with other trajectory points in the trajectory dataset X are arranged in descending order, and the trajectory points corresponding to the first m highest local similarities are put into the set H(P i ), trajectory point P i The local density ρ i For the set H(P i ) and the trajectory point P i The sum of the local similarities.

[0028] Furthermore, the trajectory point P i The relative distance δ i The acquisition process is as follows:

[0029] Detection trajectory point P i Whether it is the trajectory point with the largest local density in the trajectory dataset X;

[0030] If the detection result is yes, calculate the trajectory point P i With other trajectory points P q The spatial distance SDist(P i , P q ) and time distance TDist(P i , P q ), and the maximum value of the sum of spatial distance and temporal distance is taken as the trajectory point P i The relative distance δ i .

[0031] Furthermore, if the trajectory point P i If it is not the trajectory point with the largest local density in the trajectory data set X, then find the trajectory point P with a local density greater than that of the trajectory point P. i The trajectory point P p , then calculate the trajectory point P i With trajectory point P p The spatial distance SDist(P i , P p ) and time distance TDist(P i , P p ), and the minimum value of the sum of spatial distance and temporal distance is taken as the trajectory point P i The relative distance δ i .

[0032] Furthermore, the trajectory point P i The spatial distance nearest neighbor set tn r (P i The specific process of obtaining ) is as follows:

[0033] Calculate other trajectory points P in the trajectory dataset X s With trajectory point P i The spatial distance SDist(P i , P s ), the first k spatial distances SDist(P i , P s ) is the trajectory point P i The spatial distance nearest neighbor is put into the spatial distance nearest neighbor set sn r (P i )middle.

[0034] In the process of pedestrian trajectory clustering, the idea of ​​spatiotemporal shared nearest neighbors is used to comprehensively measure the similarity between trajectories, making the clustering results more coherent in space and time and more accurately reflecting the actual movement patterns of pedestrians. In addition, the application of spatiotemporal shared nearest neighbors can also improve the accuracy of trajectory prediction. By considering the spatiotemporal relationship between trajectories, trajectory prediction can be better performed and applied to intelligent transportation systems to better manage traffic flow and perform pedestrian path planning. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] Figure 1 A flowchart of a pedestrian trajectory clustering method based on density peak and spatiotemporal shared nearest neighbors provided by an embodiment of the present invention;

[0036] Figure 2 The trajectory point P provided in the embodiment of the present invention i and trajectory point P j Schematic diagram of time-sharing nearest neighbor relationship;

[0037] Figure 3 The clustering results of different clustering algorithms in the S2 data set provided by the embodiment of the present invention, where (a) is the K-means clustering algorithm, (b) is the OPTICS clustering algorithm, (c) is the DPC clustering algorithm, and (d) is the STSNN-DPC clustering algorithm;

[0038] Figure 4 The clustering results of different clustering algorithms in the Spiral data set provided by the embodiment of the present invention, wherein (a) is the K-means clustering algorithm, (b) is the OPTICS clustering algorithm, (c) is the DPC clustering algorithm, and (d) is the STSNN-DPC clustering algorithm;

[0039] Figure 5 The clustering results of the Lineblobs dataset provided by the embodiment of the present invention under different clustering algorithms, where (a) is the K-means clustering algorithm, (b) is the OPTICS clustering algorithm, (c) is the DPC clustering algorithm, and (d) is the STSNN-DPC clustering algorithm;

[0040] Figure 6 The clustering results of the Pathbased data set provided in the embodiment of the present invention under different clustering algorithms, where (a) is the K-means clustering algorithm, (b) is the OPTICS clustering algorithm, (c) is the DPC clustering algorithm, and (d) is the STSNN-DPC clustering algorithm;

[0041] Figure 7 The clustering results of the Students001 data set provided by the embodiment of the present invention under different clustering algorithms, where (a) is the K-means clustering algorithm, (b) is the OPTICS clustering algorithm, (c) is the DPC clustering algorithm, and (d) is the STSNN-DPC clustering algorithm;

[0042] Figure 8The clustering results of the Students002 data set provided by the embodiment of the present invention under different clustering algorithms, where (a) is the K-means clustering algorithm, (b) is the OPTICS clustering algorithm, (c) is the DPC clustering algorithm, and (d) is the STSNN-DPC clustering algorithm;

[0043] Fig. 9 The clustering results of different clustering algorithms in the ZARA01 scenario provided by the embodiment of the present invention, where (a) is the K-means clustering algorithm, (b) is the OPTICS clustering algorithm, (c) is the DPC clustering algorithm, and (d) is the STSNN-DPC clustering algorithm;

[0044] Fig.10 The clustering results of different clustering algorithms in the ZARA02 scenario provided in an embodiment of the present invention, where (a) is the K-means clustering algorithm, (b) is the OPTICS clustering algorithm, (c) is the DPC clustering algorithm, and (d) is the STSNN-DPC clustering algorithm. DETAILED DESCRIPTION

[0045] The specific implementation modes of the present invention are further explained in detail below by describing the embodiments with reference to the accompanying drawings, so as to help those skilled in the art to have a more complete, accurate and in-depth understanding of the inventive concept and technical solution of the present invention.

[0046] Figure 1 A flowchart of a pedestrian trajectory clustering method based on density peak and spatiotemporal shared nearest neighbors provided by an embodiment of the present invention, the method comprising the following steps:

[0047] (1) Put the acquired pedestrian trajectory data into the trajectory dataset X = {P1, P2, P3, ..., P n}, calculate the spatiotemporal similarity between each pair of trajectory points in the trajectory dataset X;

[0048] In the embodiment of the present invention, a trajectory point consists of a position, a timestamp and a trajectory ID. A pair of trajectory points P is extracted from the trajectory dataset X. i and trajectory point P j , trajectory point P i With trajectory point P j The specific process of obtaining the spatiotemporal similarity between them is as follows:

[0049] (11) Obtain trajectory point P i and trajectory point P j The spatial shared nearest neighbor set Sn r (P i , P j ) and the time-shared nearest neighbor set Tn r (P i, P j );

[0050] (12) Take the spatially shared nearest neighbor set Sn r (P i , P j ) and the time-shared nearest neighbor set Tn r (P i , P j ) of the intersection ST-n r (P i , P j ), ST-n r (P i , P j )=Sn r (P i , P j )∩Tn r (P i , P j ), the number of trajectory points in the intersection|ST-n r (P i , P j )| is the trajectory point P i With trajectory point P j The spatiotemporal similarity between them.

[0051] In the embodiment of the present invention, the trajectory point P i and trajectory point P j The time-shared nearest neighbor set Tn r (P i , P j ) is the trajectory point P i The time distance nearest neighbor set tn r (P i ) and trajectory point P j The time distance nearest neighbor set tn r (P j ), that is:

[0052] Tn r (P i , P j )=tn r (P i )∩tn r (P j )

[0053] Figure 2 is the trajectory point P i and trajectory point P j Schematic diagram of the time-shared nearest neighbor set. The trajectory points in the yellow circle and the purple circle represent the trajectory points P respectively. i and trajectory point P jThe trajectory point in the intersection area of ​​the two circles is the trajectory point P. i and trajectory point P j The time-shared nearest neighbor set. Through the trajectory point P i and trajectory point P j The time-shared nearest neighbor set Tn r (P i , P j ), obtain the trajectory point P i and trajectory point P j The temporal similarity measure between |Tn r (P i , P j )| is very important for temporal relationship modeling and the formation of clusters, because the temporal shared nearest neighbors reflect the proximity and similarity of data points in time.

[0054] In the embodiment of the present invention, the spatially shared nearest neighbor set Sn r (P i , P j ) is the trajectory point P i The spatial distance nearest neighbor set tn r (P i ) and trajectory point P j The spatial distance nearest neighbor set tn r (P j ), the trajectory point P i The time distance nearest neighbor set tn r (P i ) and trajectory point P j The time distance nearest neighbor set tn r (P j ) is obtained in the same way. i The time distance nearest neighbor set tn r (P i ) is used as an example to calculate other trajectory points P in the trajectory dataset X. l With trajectory point P i The time distance TDist(P i , P l ), the first k time distances TDist(P i , P l ) is the trajectory point P i The nearest neighbor in time distance is put into the nearest neighbor set tn r (P i ), where the time distance TDist(P i , P l ) is calculated as:

[0055] TDist(P i , P l )=w1*|T i -T l |+w2*|T i -T l | 2

[0056] Among them, T i , T l Represent the trajectory point P i , trajectory point P l timestamp, w1 and w2 are weights. If the trajectory point P i and trajectory point P l belong to the same trajectory, then let w1>w2; if the trajectory point P i and trajectory point P l If they do not belong to the same trajectory, let w1<w2.

[0057] In the embodiment of the present invention, the spatially shared nearest neighbor set Sn r (P i , P j ) is the trajectory point P i The spatial distance nearest neighbor set sn r (P i ) and trajectory point P j The spatial distance nearest neighbor set sn r (P j ), that is:

[0058] Sn r (P i , P j )=sn r (P i )∩sn r (P j )

[0059] Track point P i The spatial distance nearest neighbor set sn r (P i ) and trajectory point P j The spatial distance nearest neighbor set sn r (P j ) is obtained in the same way. i The spatial distance nearest neighbor set sn r (P i ) is used as an example to calculate other trajectory points P in the trajectory dataset X. s With trajectory point P i The spatial distance SDist(P i , P s), spatial distance SDist(P i , P s ) is the Hausdorff distance, the first k spatial distances SDist(P i , P s ) is the trajectory point P i The spatial distance nearest neighbor is put into the spatial distance nearest neighbor set sn r (P i )middle.

[0060] (2) Based on the spatiotemporal similarity between each pair of trajectory points, the local similarity of the corresponding trajectory points is calculated; and the similarity matrix S is constructed. n×n ;

[0061] In the embodiment of the present invention, at the trajectory point P i and trajectory point P j The space-time shared nearest neighbor set ST-n r (P i , P j ) is not empty, the trajectory point P is calculated based on the following formula i and trajectory point P j The local similarity Sim(P i , P j ), at the trajectory point P i and trajectory point P j The space-time shared nearest neighbor set ST-n r (P i , P j ) is empty, the local similarity Sim(P i , P j )=0,local similarity Sim(P i , P j ) is calculated as follows:

[0062]

[0063] Among them, SDist(P i , P k )、TDist(P i , P k ) represent the trajectory points P i and trajectory point P k The spatial distance and temporal distance of SDist(P k , P j )、TDist(P k , P j ) represent the trajectory points P j and trajectory point P k spatial distance and temporal distance.

[0064] (3) Based on the similarity matrix S n×n Calculate the local density ρ of each trajectory point in the trajectory dataset X i and the relative distance δ i ;

[0065] In the embodiment of the present invention, the trajectory point P i The local similarities with other trajectory points in the trajectory dataset X are arranged in descending order, and the trajectory points corresponding to the first m highest local similarities are put into the set H(P i ), that is, H(P i )={P1,P2,P3,…,P m}, trajectory point P i The local density ρ i For the set H(P i ) and the trajectory point P i The sum of the local similarities of Local density ρ i It combines the distance information and the time information of the data points, and uses the time-space shared nearest neighbors to obtain the cluster structure information. This comprehensive consideration makes ρ i It can fully reveal the intrinsic relationship between trajectory points and better describe the degree of aggregation of trajectory points.

[0066] In the embodiment of the present invention, the detection trajectory point P i Is it the trajectory point with the largest local density in the trajectory data set X? If the trajectory point P i is the trajectory point with the largest local density in the trajectory data set X, then calculate the trajectory point P i With other trajectory points P q The spatial distance SDist(P i , P q ) and time distance TDist(P i , P q ), and the maximum value of the sum of spatial distance and temporal distance is taken as the trajectory point P i The relative distance δ i , δ i =max q∈(X-i) [SDist(P i , P q )+TDist(P i , P q )]; On the contrary, if the trajectory point P i If it is not the trajectory point with the largest local density in the trajectory data set X, then find the trajectory point P with a local density greater than that of the trajectory point P. i The trajectory point P p , then calculate the trajectory point P i With trajectory point P p The spatial distance SDist(P i, P p ) and time distance TDist(P i , P i ), and the minimum value of the sum of spatial distance and temporal distance is taken as the trajectory point P i The relative distance δ i ,Right now

[0067] (4) Based on the local density ρ of the trajectory points i and the relative distance δ i Calculate the decision value γ corresponding to the trajectory point i , γ i =ρ i ×δ i , choose the decision value γ i The larger point is used as the cluster center, and the other trajectory points in the trajectory dataset X are assigned to the cluster where the nearest cluster center is located.

[0068] The present invention introduces the time dimension of the trajectory into the idea of ​​time-shared nearest neighbors to make the temporal matching of similar trajectories more accurate, thereby improving the accuracy of the clustering results. By combining the time-shared nearest neighbors with the space-shared nearest neighbors, the time-space shared nearest neighbors are obtained. In the process of pedestrian trajectory clustering, the idea of ​​time-space shared nearest neighbors is used to comprehensively measure the similarities between trajectories, so that the clustering results are more coherent in space and time, and can more accurately reflect the actual movement patterns of pedestrians. In addition, the application of time-space shared nearest neighbors can also improve the accuracy of trajectory prediction. By considering the time-space relationship between trajectories, trajectory prediction can be better performed and applied to intelligent transportation systems to better manage traffic flow and perform pedestrian path planning.

[0069] The pedestrian trajectory clustering method based on density peak and spatiotemporal shared nearest neighbors proposed in this invention is referred to as the STSNN-DPC algorithm. In order to verify the effectiveness of the STSNN-DPC algorithm, extensive experimental evaluations were carried out, and classic synthetic data sets and real-world data sets were used to test its performance. In addition, we also compared STSNN-DPC with traditional K-means, OPTICS, and DPC clustering algorithms to evaluate their relative performance. In order to intuitively show the actual clustering effect of each clustering algorithm, the clustering results are presented in the form of a color map. Each clustering cluster is marked with a different color, so that the clustering effects of different algorithms can be observed more clearly. By comparing the clustering results of different algorithms, the performance advantages of the STSNN-DPC algorithm over other algorithms can be evaluated.

[0070] Evaluation indicators play an important role in the calculation of clustering results. They can provide quantitative measures of clustering quality, measure the quality and consistency of clustering results, and compare the performance of different clustering algorithms on the same data set. Therefore, in this section, we will introduce three clustering evaluation indicators used in three experiments, namely adjusted mutual information (AMI), adjusted Rand index (ARI), and normalized mutual information (NMI).

[0071] Adjusted mutual information (AMI) is a clustering evaluation index used to evaluate the consistency between clustering results and true labels. AMI is adjusted based on mutual information to solve the problem of mutual information deviation under different numbers of clusters and samples. The value range of AMI is [-1,1]. The larger the value, the closer the two clustering results are. Adjusted Rand Index (ARI) is an improvement on the Rand Index (RI). By adjusting the expected value of random assignment, it solves the deviation problem of the Rand Index when the sample distribution is uneven. The value range of ARI is [-1,1], where 1 represents a completely consistent clustering result, 0 represents the consistency of the clustering result with the random assignment, and -1 represents the clustering result is completely opposite to the true label. Normalized mutual information (NMI) is based on the concept of information theory and is used to measure the similarity between clustering results and true labels. The value range is [0,1], where 1 represents a completely consistent clustering result and 0 represents no correlation between the clustering result and the true label.

[0072] The main parameter that needs to be set for the K-means algorithm is the number of clusters K. The appropriate K value will be selected in subsequent experiments. The OPTICS algorithm has two parameters ε and minpts. The selection of ε usually needs to be adjusted according to the characteristics of the specific data set, and minpts is set to between 1% and 5% of the total number of samples in the data set. The DPC algorithm only needs to determine the truncation distance d c The size of is usually set between 1% and 2% of the total number of samples.

[0073] Several widely used synthetic datasets are selected to evaluate the performance of various clustering algorithms. These synthetic datasets include S2, Spiral, lineblobs, and Pathbased datasets. These datasets have differences in overall distribution and the number of points and clusters. They can simulate different scenarios so that the performance of different clustering algorithms can be compared in different scenarios. By selecting these diverse synthetic datasets, we are able to more comprehensively evaluate the applicability of clustering algorithms in the real world. The S2 dataset has a complex structure and multiple clusters, which can simulate high-dimensional datasets in the real world. The Spiral dataset has a spiral shape, which is a challenge for algorithms that can handle nonlinear boundaries. The lineblobs dataset contains linearly separable clusters and is suitable for evaluating the performance of linear clustering algorithms. The Pathbased dataset has an irregular shape and variable density, which is a challenge for algorithms that can handle noise and uneven density. By testing these diverse synthetic datasets, we can better understand the strengths and weaknesses of clustering algorithms and choose the algorithm that best suits a specific scenario. Such evaluations help guide clustering tasks in real applications and provide a deep understanding of algorithm performance.

[0074] For each dataset, K-means, OPTICS, DPC and STSNN-DPC clustering algorithms were used for clustering, and different clustering results were obtained. Then, the values ​​of the adjusted mutual information (AMI), adjusted Rand index (ARI) and normalized mutual information (NMI) evaluation indicators of these clustering results were calculated to compare the performance of different clustering algorithms. By comparing the values ​​of these indicators, we can determine which clustering algorithm performs better on each dataset. Higher AMI, ARI and NMI values ​​indicate that the clustering results have higher consistency and correlation with the true labels, while lower values ​​indicate poor quality of clustering results. Such comparative analysis can help us understand the advantages and disadvantages of different clustering algorithms on different datasets and provide guidance for clustering tasks in practical applications. This evaluation method helps to select the clustering algorithm that is most suitable for specific datasets and tasks, and provides a deep understanding of the algorithm performance.

[0075] Table 1 shows the clustering results of four clustering algorithms, K-means, OPTICS, DPC and STSNN-DPC, on four synthetic datasets, and gives the corresponding AMI, ARI and NMI values. From the results in Table 1, it can be seen that in these four synthetic datasets, the STSNN-DPC algorithm performs better than other clustering algorithms. In the Spiral dataset, the clustering results of OPTICS, DPC and STSNN-DPC are completely consistent with the real clustering results, so the values ​​of AMI, ARI and NMI are all 1, which shows that these algorithms can accurately capture the clustering structure of the data on the Spiral dataset. Considering the results of the four synthetic datasets, the STSNN-DPC algorithm has achieved good performance in all evaluation indicators, showing its robustness and superiority on different datasets.

[0076] Table 1 Evaluation index values ​​of different clustering algorithms on different synthetic datasets

[0077]

[0078] Next, we will show the clustering results of these synthetic datasets in the experiment. Points of different colors in the figure are assigned to different clusters (where gray points represent noise points). Figure 3 The clustering results of the S2 dataset under different clustering algorithms are shown. Figure 3 (a), 3(b), 3(c), and 3(d) are the clustering result diagrams of K-means, OPTICS, DPC, and STSNN-DPC algorithms, respectively (in the clustering results of different data sets under different clustering algorithms, each subgraph is Figure 3 (a), 3(b), 3(c), and 3(d) have the same meaning). It can be observed from the figure that the three clustering algorithms, K-means, OPTICS, and DPC, all have certain recognition errors. In the K-means and OPTICS algorithms, the two clusters in the upper left corner cannot be correctly identified, resulting in the elongated cluster in the upper left corner being scattered into different classes. This shows that the K-means and OPTICS algorithms have certain defects when processing the S2 dataset. For the DPC clustering algorithm, the two clusters in the upper left corner can be correctly identified as two classes, but the algorithm only considers the distance of the point location and does not make full use of the neighborhood information. Therefore, some trajectory points are incorrectly assigned to different classes. These observations show that when processing the S2 dataset, the K-means, OPTICS, and DPC clustering algorithms all have certain limitations and cannot fully and accurately identify all clustering structures. The clustering results of the Spiral dataset under different clustering algorithms are shown in Figure 4 Shown in Figure 4It can be observed that the three clustering algorithms, OPTICS, DPC, and STSNN-DPC, can accurately identify the clustering structure and correctly assign the trajectory points to the corresponding clusters. However, compared with these algorithms, the K-means algorithm performs poorly on the Spiral dataset, and its clustering results are significantly different from the true results. The K-means algorithm is often limited when dealing with non-spherical clustering structures and is prone to assigning data points to the wrong clusters.

[0079] Figure 5 The clustering results of Lineblobs dataset under different clustering algorithms are shown. It can be observed from the figure that the STSNN-DPC algorithm considering neighbor information can accurately identify 3 clusters, which is completely consistent with the real clustering results. In contrast, the performance of the other three clustering algorithms on this dataset is relatively poor. Similarly, Figure 6 The clustering results of the Pathbased dataset under different clustering algorithms are shown. As can be seen from the figure, the STSNN-DPC algorithm also shows good clustering performance for this dataset with irregular shapes. Compared with the other three clustering algorithms, it can more accurately identify the clustering structure. These observations further confirm the superiority of the STSNN-DPC algorithm in processing datasets with complex shapes. It can effectively utilize neighbor information and capture the local characteristics of the data, thereby improving the accuracy of the clustering results. Figure 5 and Figure 6 From the analysis, we can conclude that the STSNN-DPC algorithm has better clustering performance when processing irregular shaped data sets such as Lineblobs and Pathbased, and its recognition ability is stronger than other clustering algorithms.

[0080] Three different application scenarios of the UCY pedestrian trajectory dataset were selected to test the performance of the STSNN-DPC algorithm. The UCY dataset is a classic benchmark dataset that includes three scenarios: UNIV, ZARA01, and ZARA02 (in the UNIV scenario, two pedestrian sample sets are used, namely Students001 and Students002 sample sets. These two sample sets are collections of multiple student trajectories in different time periods). Each scene records the movement trajectory of pedestrians from a bird's-eye view. The sampling frequency of the dataset is 2.5FPS, and a total of 1536 pedestrians are included. These scenes mainly show the interaction between pedestrians and are relatively dense pedestrian environments. By testing the STSNN-DPC algorithm on these scenarios, its performance in processing dense pedestrian trajectory data can be evaluated. Through experiments on the UCY dataset, the performance of the STSNN-DPC algorithm in complex, real-world pedestrian trajectory data can be verified. The selection of these test scenarios enables us to have a more comprehensive understanding of the effect of the algorithm under different pedestrian densities and interaction modes. Such dataset selection and experimental design help provide an in-depth understanding and evaluation of the performance of the STSNN-DPC algorithm, and provide a valuable reference for the development and optimization of practical pedestrian trajectory analysis and monitoring applications.

[0081] As shown in Table 2, the clustering results of the four clustering algorithms, K-means, OPTICS, DPC and STSNN-DPC, on three real sample sets in the UNIV, ZARA01 and ZARA02 scenarios are observed, and the corresponding AMI, ARI and NMI values ​​are given. By comparing the results of these clustering algorithms, it can be found that the STSNN-DPC algorithm achieves better clustering effects when processing these real pedestrian trajectory datasets, has higher performance and adaptability, can more accurately identify the clustering structure in the dataset and automatically adapt to different data characteristics. In order to intuitively compare the performance advantages of different clustering algorithms on different synthetic datasets.

[0082] Table 2 Evaluation index values ​​of different clustering algorithms on real pedestrian trajectory datasets

[0083]

[0084] The clustering results of the real pedestrian trajectory dataset in the experiment will be shown. In the figure, points of different colors are assigned to different clusters (where gray points represent noise points). By visualizing the clustering results, we can more clearly observe and compare the clustering effects of different algorithms on real pedestrian trajectory data. Figure 7The clustering effect of different algorithms on real pedestrian trajectory data on the Students001 dataset is shown. By observing the clustering results in the figure, some conclusions can be drawn. Among them, the clustering results of the STSNN-DPC algorithm show more obvious regional characteristics, and the clustering in the central area is tighter. This shows that pedestrians stay longer and there are more people at this location. This result further verifies the advantages of our STSNN-DPC algorithm in pedestrian trajectory clustering. It can better identify and characterize the activity areas and gathering points of pedestrians, helping us understand the distribution and behavior patterns of pedestrian flows. This is of great significance to fields such as urban planning, traffic management, and place design.

[0085] exist Figure 8 In Figure 2, the clustering results of the Students002 dataset are shown. Figure 8 (a), (b), and (c) represent the clustering results of K-means, OPTICS, and DPC algorithms, respectively. All three algorithms identify the thin arc in the upper left corner as a separate category. However, in fact, the thin arc is a path leading to the central area in the actual map and should be clustered in combination with other neighborhood trajectory points. However, in Figure 8 In (d), it can be observed that the STSNN-DPC algorithm identifies the elongated arc part and the central part as the same class, which is more in line with the actual situation. This result further illustrates that in the clustering process, considering neighbor information is crucial to improving the accuracy and interpretability of clustering results.

[0086] Fig. 9 and Fig.10 The clustering results of the four algorithms in the ZARA01 and ZARA02 scenarios are shown. In both scenarios, the figure shows clusters of thin and long trajectories around the central area, which actually represent multiple paths leading to different buildings in the central area. Observing the clustering results in these two scenarios, it can be found that the STSNN-DPC algorithm identifies these thin and long trajectory clusters as the same class as different parts of the central area, rather than treating them as separate clusters. This result shows that the STSNN-DPC algorithm is more in line with the actual situation in the clustering process of large pedestrian trajectory datasets. The STSNN-DPC algorithm can better capture the spatial and temporal associations between pedestrian trajectories by considering the neighbor relationships between pedestrian trajectories. Therefore, when applied to large pedestrian trajectory datasets, it can more accurately identify the association between thin and long trajectory clusters and the central area, thereby providing clustering results that are more in line with the actual situation.

[0087] By conducting comparative experiments on multiple synthetic datasets and real pedestrian trajectory datasets, and comparing with other algorithms, it is concluded that the STSNN-DPC algorithm can find cluster centers more accurately, and can effectively process datasets of various forms and distributions, with higher clustering accuracy, and is more in line with actual conditions. In summary, the STSNN-DPC algorithm proposed in this paper has achieved significant improvements and optimizations in spatiotemporal trajectory clustering. This method can improve accuracy and adaptability when clustering pedestrian trajectory data, which is of great significance for the analysis and application of pedestrian trajectory data.

[0088] The present invention has been described exemplarily. Obviously, the specific implementation of the present invention is not limited to the above-mentioned method. As long as various non-substantial improvements are made using the method concept and technical solution of the present invention, or the concept and technical solution of the present invention are directly applied to other occasions without improvement, they are all within the protection scope of the present invention.

Claims

1. A pedestrian trajectory clustering method based on density peak and spatiotemporal shared nearest neighbors, characterized in that: The method comprises the following steps: (1) Put the acquired pedestrian trajectory data into the trajectory dataset and calculate the spatiotemporal similarity between each pair of trajectory points in the trajectory dataset X; (2) Calculate the local similarity of the corresponding trajectory points based on the spatiotemporal similarity between each pair of trajectory points; and construct a similarity matrix; (3) Calculate the local density ρ of each trajectory point in the trajectory dataset X based on the similarity matrix i and the relative distance δ i ; (4) Based on the local density ρ of the trajectory points i and the relative distance δ i Calculate the decision value γ corresponding to the trajectory point i , choose the decision value γ i The larger point is used as the cluster center, and the other trajectory points in the trajectory dataset X are assigned to the cluster where the nearest cluster center is located.

2. The pedestrian trajectory clustering method based on density peak and spatiotemporal shared nearest neighbors as claimed in claim 1, characterized in that: Track point P i With trajectory point P j The specific process of obtaining the spatiotemporal similarity between is as follows: (11) Obtain trajectory point P i and trajectory point P j The spatial shared nearest neighbor set Sn r (P i ,P j ) and the time-shared nearest neighbor set Tn r (P i ,P j ); (12) Take the spatially shared nearest neighbor set Sn r (P i ,P j ) and the time-shared nearest neighbor set Tn r (P i ,P j ) of the intersection ST-n r (P i ,P j ), the number of trajectory points in the intersection|ST-n r (P i ,P j )| is the trajectory point P i With trajectory point P j The spatiotemporal similarity between Time-sharing nearest neighbor set Tn r (P i ,P j ) is the trajectory point P i The time distance nearest neighbor set tn r (P i ) and trajectory point P j The time distance nearest neighbor set tn r (P j ) Spatial shared nearest neighbor set Sn r (P i ,P j ) is the trajectory point P i The spatial distance nearest neighbor set tn r (P i ) and trajectory point P j The spatial distance nearest neighbor set tn r (P j ) 3. The pedestrian trajectory clustering method based on density peak and spatiotemporal shared nearest neighbors as claimed in claim 2, characterized in that: Track point P i The time distance nearest neighbor set tn r (P i The specific process of obtaining ) is as follows: Calculate other trajectory points P in the trajectory dataset X l With trajectory point P i The time distance TDist(P i ,P l ), the first k time distances TDist(P i ,P l ) is the trajectory point P i The nearest neighbor in time distance is put into the nearest neighbor set tn r (P i ).

4. The pedestrian trajectory clustering method based on density peak and spatiotemporal shared nearest neighbors as claimed in claim 3, characterized in that: Track point P i and trajectory point P j The time distance TDist(P i ,P l ) is calculated as: TDist(P i ,P l )=w1*|·T i -T l |+w2*|T i -T l | 2 Among them, T i , T l Represent the trajectory point P i , trajectory point P l The timestamp of , w1 and w2 are weights; If the trajectory point P i and trajectory point P l belong to the same trajectory, then let w1>w2; if the trajectory point P i and trajectory point P l If they do not belong to the same trajectory, let w1<w2.

5. The pedestrian trajectory clustering method based on density peak and spatiotemporal shared nearest neighbors as claimed in claim 4, characterized in that: Track point P i and trajectory point P j The local similarity Sim(P i ,P j ) is calculated as follows: Among them, |ST-n r (P i ,P j )| represents the trajectory point P i With trajectory point P j The spatiotemporal similarity between i ,P k )、TDist(P i ,P k ) represent the trajectory points P i and trajectory point P k The spatial distance and temporal distance of SDist(P k ,P j )、TDist(P k ,P j ) represent the trajectory points P j and trajectory point P k spatial distance and temporal distance.

6. The pedestrian trajectory clustering method based on density peak and spatiotemporal shared nearest neighbors as claimed in claim 1, characterized in that: Track point P i The local density ρ i The calculation formula is as follows: The trajectory point P i The local similarities with other trajectory points in the trajectory dataset X are arranged in descending order, and the trajectory points corresponding to the first m highest local similarities are put into the set H(P i ), trajectory point P i The local density ρ i For the set H(P i ) and the trajectory point P i The sum of the local similarities.

7. The pedestrian trajectory clustering method based on density peak and spatiotemporal shared nearest neighbors as claimed in claim 1, characterized in that: Track point P i The relative distance δ i The acquisition process is as follows: Detection trajectory point P i Whether it is the trajectory point with the largest local density in the trajectory dataset X; If the detection result is yes, calculate the trajectory point P i With other trajectory points P q The spatial distance SDist(P i ,P q ) and time distance TDist(P i ,P q ), and the maximum value of the sum of spatial distance and temporal distance is taken as the trajectory point P i The relative distance δ i .

8. The pedestrian trajectory clustering method based on density peak and spatiotemporal shared nearest neighbors as claimed in claim 7, characterized in that: If the trajectory point P i If it is not the trajectory point with the largest local density in the trajectory data set X, then find the trajectory point P with a local density greater than that of the trajectory point P. i The trajectory point P p , then calculate the trajectory point P i With trajectory point P p The spatial distance SDist(P i ,P p ) and time distance TDist(P i ,P p ), and the minimum value of the sum of spatial distance and temporal distance is taken as the trajectory point P i The relative distance δ i .

9. The pedestrian trajectory clustering method based on density peak and spatiotemporal shared nearest neighbors as claimed in claim 2, characterized in that: Track point P i The spatial distance nearest neighbor set tn r (P i The specific process of obtaining ) is as follows: Calculate other trajectory points P in the trajectory dataset X s With trajectory point P i The spatial distance SDist(P i ,P s ), the first k spatial distances SDist(P i ,P s ) is the trajectory point P i The spatial distance nearest neighbor is put into the spatial distance nearest neighbor set sn r (P i )middle.

Citation Information

Cited By

  • Human body image file gathering method based on space-time relation

    CN121545180A