Adaptive valuing algorithm for moving target trajectory density spatial clustering hyper-parameter
The K-means algorithm adaptively sets the hyperparameters of the DBSCAN algorithm, which solves the problem of difficulty in setting hyperparameters of DBSCAN in multi-target motion trajectory clustering, improves classification accuracy and efficiency, and achieves stable clustering results.
Patent Information
- Application Number
- CN202310293823.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-24
- Publication Date
- 2024-09-24
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The DBSCAN algorithm has difficulty setting hyperparameters in multi-target motion trajectory clustering, which affects the classification accuracy. Existing methods mainly rely on experience or random attempts, which affects algorithm efficiency and accuracy.
Obtain the number of clusters through initial clustering with the K-means algorithm, calculate and determine the neighborhood distance threshold and density threshold, adaptively set the hyperparameters of the DBSCAN algorithm, and use the minimum mean in the K-means clustering result as the neighborhood distance threshold , and use 1/K of the number of new trajectory samples as the neighborhood density threshold to ensure the convergence of DBSCAN clustering results.
It realizes the adaptive values of DBSCAN hyperparameters, avoids the difficulty of manual settings, improves the accuracy and efficiency of clustering results, and ensures the stability and classification capabilities of the algorithm.
Smart Images

Figure CN118690214A
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of pattern recognition of mobile target trajectories such as vehicles and ships, and in particular relates to an adaptive value-taking algorithm for mobile target trajectory density space clustering hyperparameters. Background Art
[0002] With the establishment of road traffic safety infrastructure, a large amount of vehicle monitoring data has emerged. In the past, it was no longer practical to rely on manual methods to handle abnormal vehicle behaviors in complex traffic scenarios. Therefore, it has become an inevitable trend to use computer vision image technology to process massive monitoring data, filter irrelevant information, and extract vehicle motion feature information.
[0003] Extracting the motion characteristics and trajectory patterns of vehicles in complex traffic scenes is the premise for machine vision systems to analyze vehicle behavior. The methods for analyzing vehicle trajectory patterns can be mainly divided into clustering algorithms based on probability statistics and clustering methods based on sample distance.
[0004] Probabilistic statistical clustering algorithms mainly reproduce the observed trajectory data into predefined probability distribution models, such as Gaussian mixture models, latent Dirichlet distribution models, etc. Since the accuracy of probabilistic statistical clustering algorithms depends on the ability of experimental probability to express data, and the movement trajectory data of real-world objects lack clear category boundaries, this hinders the expression of actual trajectory patterns by probabilistic statistical clustering methods.
[0005] Sample distance clustering algorithms mainly divide trajectory samples into different categories based on the distance between trajectory samples or the distance between trajectory sample compositions, such as DBSCAN, K-means, and spectral clustering algorithms. Since the sample distance clustering method has strong classification ability, it is widely used in various mobile target detection scenarios, among which the classification ability of DBSCAN density space clustering method is particularly outstanding.
[0006] DBSCAN is a typical density clustering algorithm that can divide samples with a certain density into different clusters. Figure 1 The basic principle of DBSCAN density clustering algorithm is to divide clusters according to the compactness of sample distribution, and DBSCAN uses the neighborhood distance threshold of a sample and the number of samples within the neighborhood distance threshold of the sample (i.e., neighborhood density threshold) to describe the compactness of the sample. In other words, DBSCAN determines the classification of samples through the two parameters of neighborhood distance threshold and neighborhood density threshold, and the values of these two parameters will determine the accuracy of classification.
[0007] It can be seen that the biggest advantage of the DBSCAN algorithm is that it can remove noise, that is, it can filter out samples far away from the neighborhood distance threshold, and the calculation is simple. However, how to select a reasonable neighborhood distance threshold and neighborhood density threshold is a recognized problem, and is therefore also called a hyperparameter. Traditional methods mainly rely on experience or random attempts to select hyperparameter values, which not only affects the efficiency of the algorithm, but also makes it difficult to obtain reasonable values, which affects the classification accuracy.
[0008] In this regard, the present invention proposes a DBSCAN hyperparameter adaptive value algorithm for cluster analysis of vehicle motion trajectories, which solves the hyperparameter setting problem in DBSCAN applications. Summary of the invention
[0009] The technical problem to be solved by the present invention is to propose an adaptive algorithm model for the DBSCAN clustering algorithm of multi-target motion trajectories, which establishes two hyperparameters, namely, neighborhood distance threshold and neighborhood density threshold, based on the number of clusters obtained by initial clustering of the K-means algorithm.
[0010] The technical solution proposed by the present invention is: for trajectory samples A of multiple mobile targets, the distance set between each two trajectories in the sample is calculated, and the distance set is clustered using K-means to obtain K classes of the distance set, and the minimum mean in the clustering result is calculated, and then the integer of the minimum mean is used as the value of the neighborhood distance threshold, and then the distance samples and corresponding trajectory samples greater than the value in the K classes are eliminated using this value, and 1 / K of the number of new trajectory samples is used as the neighborhood density threshold, and finally the DBSCAN algorithm is used to cluster the K classes to obtain a converged clustering result.
[0011] Then according to the initial value and through The algorithm model calculates the number of samples N within the neighborhood distance threshold in the distance set, and takes N / 4 as the neighborhood density threshold. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] Attached Figure 1 :Schematic diagram of sampling of pairwise trajectory distances
[0013] Attached Figure 2 :K-means clustering restoration graph of trajectory set A
[0014] Attached Figure 3 : DBSCAN clustering diagram with adaptive hyperparameter values
[0015] Implementation
[0016] The adaptive value-taking algorithm of the mobile target trajectory density space clustering hyperparameter of the present invention is described in detail with reference to the accompanying drawings.
[0017] (1) Definition
[0018] Setting: The set of multiple moving target trajectory samples is A
[0019] The distance sample set between two trajectories in set A is D
[0020] The mean distance between two trajectories is Mu
[0021] The minimum distance between two trajectories is Mu-min.
[0022] The mathematical symbol for calculating the number of distance samples by permutation and combination is
[0023] The neighborhood distance threshold of DBSCAN is eps
[0024] The neighborhood density threshold of DBSCAN is Minpts
[0025] The number of samples within the neighborhood distance threshold is Num
[0026] (2) Process steps
[0027] ① Use the Euclidean distance formula to obtain the distance set D between two trajectories in the trajectory set A. The sampling method of the distance between two trajectories is as follows: Figure 1 Shown
[0028] ② Use K-means to cluster set D and get K clusters, denoted as C i |i=1,...,K Figure 2 is the K-means clustering restoration graph of trajectory set A
[0029] ③Calculate the mean distance Mu among K classes i , and find the minimum mean Mu-min
[0030] Right now:
[0031] Mu-min=MIN(Mu 1 , Mu 2 , ..., Mu K ) (2)
[0032] In the formula It is the mathematical symbol for calculating the number of distance samples through permutations and combinations.
[0033] Right now:
[0034] ④ Round the minimum mean Mu-min and use it as the neighborhood distance threshold in K classes
[0035] That is: eps = INT (Mu-min) (4)
[0036] ⑤ When the set A is large enough, remove the samples larger than eps in the K classes based on eps and remove the corresponding trajectory samples in the set A, and record the number of new distance samples in the K classes as Num i |i=1,...,K,and the number of samples in the new trajectory set A* is recorded as N*.
[0037] ⑥ When the trajectory samples of set A are large enough, the densities of the K classes will converge to be consistent, and it can be considered that the number of distance samples of all K classes Num i are equal, so:
[0038] Num i =N* / K (5)
[0039] ⑦ Taking N* / K as the neighborhood density threshold, we have:
[0040] Minpts=N* / K (6)
[0041] ⑧ When formula (4) is used as the neighborhood distance threshold and formula (6) is used as the neighborhood density threshold, when DBSCAN is used to cluster any of the K classes, all trajectories can be used as core points and can converge.
[0042] Attached Figure 3 It is the DBSCAN clustering diagram obtained by the method of the present invention
[0043] (3) Conclusion
[0044] In the DBSCAN algorithm, if the number of trajectories in the space with eps as the radius and a certain trajectory as the center is greater than or equal to MinPts, then the trajectory is a core point and a convergent clustering can be obtained.
[0045] Since the neighborhood distance threshold eps and neighborhood density threshold Minpts of DBSCAN are obtained autonomously by the algorithm, their values are adaptive and do not need to be set based on experience or manual attempts.
Claims
1. The adaptive value algorithm of the hyperparameter of the mobile target trajectory density space clustering belongs to the algorithm process for clustering the motion trajectories of multiple mobile targets, and its characteristics include the following steps: 1 For the motion trajectory sample A of the vehicle, the distance set D between each two trajectories is obtained according to the sampling method of FIG1; 2. Use K-means algorithm to perform initial clustering on set D and obtain K categories; 3 Calculate the mean distance Mu in each class through the following algorithm i and minimum mean Mu-min Mu-min = MIN(Mu1,Mu2,…,Mu K ) (2) In the formula This is the formula for calculating the number of distance samples through permutations and combinations:
4. Round the minimum mean Mu-min and use it as the neighborhood distance threshold in the K classes: eps=INT(Mu-min) (4) 5 Taking eps as the benchmark, remove the samples in K classes that are greater than eps, and remove the corresponding trajectory samples in set A, and record the number of new distance samples in K classes as Num i |i=1,…,K, let the number of samples of the new trajectory set A* be N*; 6 When there are enough trajectory samples in set A, the densities of the K classes will converge to be consistent, and it can be considered that the number of distance samples Num of all K classes is i are equal, so we can get: Num i =N* / K (5) 7 Taking N* / K as the neighborhood density threshold, we have: Minpts=N* / K (6) 8 Taking formula (4) as the neighborhood distance threshold and formula (6) as the neighborhood density threshold, and using the DBSCAN algorithm to cluster any of the K classes, a convergent clustering result as shown in Figure 3 can be obtained.
