A Multi-Population Aggregation Detection Method and System Based on K-Value-Free Clustering
By adopting K-value clustering method and YOLOv5 human detection network in the cluster detection, combined with the idea of the K-Means algorithm, the problem of difficulty in detecting multi-group aggregation in the existing technology is solved, and the flexibility of accurate detection of multi-groups and cluster detection is achieved.
Patent Information
- Application Number
- CN202310960446.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-01
- Publication Date
- 2025-07-01
- Estimated Expiration
- 2043-08-01
AI Technical Summary
The existing method of gathering the crowds is difficult to effectively detect the aggregation of multiple groups, and requires setting the K value in advance, which is highly sensitive and difficult to adapt to the randomness of gathering the crowds.
Using a method based on K-value clustering, the pre-trained YOLOv5 human body detection network is used, combined with the idea of the K-Means algorithm, there is no need to set the number of clusters in advance, and the preset threshold screening is used to realize the cluster detection of multiple groups.
Accurate detection of multi-group aggregation is achieved, the sensitivity to K value is reduced, and the flexibility and accuracy of cluster detection is enhanced.
Smart Images

Figure CN117132930B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer vision, and particularly to a multi-group gathering detection method and system based on K-value-free clustering. Background Art
[0002] Clustering is one of the most widely used techniques in machine learning, which is used to divide the samples in a dataset into several usually non-overlapping subsets, and each subset is called a "cluster". In machine learning, each "cluster" may correspond to some potential concepts or categories. Distance-based clustering is a commonly used clustering method, which calculates the distances between all samples and the "cluster center", and for each sample, it is assigned to the cluster where the "cluster center" with the closest distance is located. Currently, the common distance-based clustering algorithms include K-Means. However, since K-Means requires setting K categories in advance, and the division of people in gathering detection is random and the number of gathering groups is not known in advance, it is difficult to apply the K-Means algorithm to gathering detection. K-value-free clustering adopts the idea of the K-Means algorithm, but does not require knowing the number of clusters, that is, the K value, in advance. If the distance between points is less than the set distance threshold, the point is clustered with the closest adjacent point. By setting the distance threshold between points, some noise points near the cluster can also be filtered out. Applying the K-value-free clustering method to gathering detection can achieve the detection of multi-group gatherings and filter out the people not near the gathering crowd at the same time. The advantages are that it does not require knowing the number of sample categories in advance and can filter out some noise near the cluster.
[0003] Gathering detection has a wide range of applications in the field of computer vision. However, the current existing gathering detection judgment strategy is to delimit the detection area through a mask and count the number of people in the area, and judge as a gathering when the set threshold is reached. This judgment strategy can only be used for the judgment of a large group and is difficult to be applied to the judgment of multi-group gatherings. Therefore, in order to solve the above problems existing in the current gathering algorithms, this paper proposes a multi-group gathering detection method based on K-value-free clustering.
[0004] Chinese Patent Invention No. 202111049489.8 discloses a "Gathering Detection Method", and the technical solution adopted by it is: determining the people with gathering behavior through dimensionality reduction decomposition processing of coordinates. The technical solution provided by the present invention is to use pre-trained YOLOv5 as the human detection network and obtain the final clustering result, that is, how many groups of group gathering events have occurred, through the multi-group gathering detection method based on K-value-free clustering. Summary of the Invention
[0005] In view of the problems in the existing crowd detection method that the K value needs to be specified in advance and is sensitive to numerical selection, making it difficult to be applied to crowd detection, the present invention provides a multi-group crowd detection method and system based on K-value-free clustering. The technical solution adopted by the present invention is as follows:
[0006] In the first aspect of the present invention, a multi-group crowd detection method based on K-value-free clustering is provided, which specifically includes the following steps:
[0007] S1, using a pre-trained 2D detection network as a human detection network to obtain human bounding boxes;
[0008] S2, obtaining the coordinates of the human bounding boxes from the human bounding boxes in step S1;
[0009] S3, performing calculation processing on the coordinates of the human bounding boxes in step S2 to obtain the coordinates of the two-dimensional center points of the bounding boxes;
[0010] S4, according to the coordinates of the two-dimensional center points of the bounding boxes obtained in step S3, traversing the center points and calculating the distance between any two center points;
[0011] S5, if the distance calculated in step S4 is less than the first preset threshold, then classify the corresponding two center points into the same cluster and mark these two points as clustered points; through continuous iterative comparison, obtain multiple groups of roughly classified clusters;
[0012] S6, calculating the centroid coordinates of each group of clusters in step S5 to obtain the centroid coordinates (x1, y1), (x2, y2), (x3, y3), (x4, y4),...(x n , y n );
[0013] S7, calculating the Euclidean distance between the centroids of any two groups of clusters in step S6. If the distance between the centroids of the two groups of clusters is less than the second preset threshold, then merge the two groups of clusters into one group of clusters. Through continuous iterative judgment, obtain the final one group of clusters;
[0014] S8, judging the number of center points in each group of clusters obtained in step S7. If it is less than the minimum number of points forming a cluster, then delete the cluster; at the same time, classify all unclassified points into one cluster, and then output the final clustering result and perform visualization.
[0015] Compared with the prior art, the present invention adopts the idea of the K-Means algorithm, does not require setting the number of clusters in advance, and provides a better solution for the randomness of the number of groups in crowd detection; it has a certain filtering effect on the noisy personnel near the clustering groups, ensuring the accuracy of multi-group clustering; aiming at the problem that the existing crowd detection algorithms are difficult to solve the problem of multi-group aggregation detection, a solution method is proposed, which expands the application scope of the crowd detection algorithm.
[0016] As a preferred solution, in the step S1, specifically, YOLOv5 is adopted as the human detection network.
[0017] As a preferred solution, in the S2 step, the human bounding box coordinates are specifically: (x1, y1, x2, y2)0(x1, y1, x2, y2)1(x1, y1, x2, y2)2……··(x1, y1, x2, y2) n ; where the index 0 represents the coordinates of the first bounding box (x1, y1, x2, y2)0, which includes the upper-left coordinates x1, y1, and the lower-right coordinates x2, y2. The index 1 represents the coordinates of the second bounding box (x1, y1, x2, y2)1, which includes the upper-left coordinates x1, y1, and the lower-right coordinates x2, y2, and so on. The index n represents the coordinates of the (n + 1)th bounding box (x1, y1, x2, y2) n which includes the upper-left coordinates x1, y1, and the lower-right coordinates x2, y2.
[0018] As a preferred solution, in the step S3, specifically, the human bounding box coordinates obtained in step S2 are substituted into the following calculation formulas: x = (x1 + x2) / 2, y = (y1 + y2) / 2; finally, the center point coordinates (x, y)0(x, y)1(x, y)2......(x, y) are obtained n .
[0019] As a preferred solution, in the step S4, the distance calculation formula for the center points is specifically:
[0020]
[0021] where dist is the distance between two center points, x1, x2 are the abscissas of the center points, and y1, y2 are the ordinates of the center points.
[0022] As a preferred solution, in the step S6, the centroid coordinates are specifically calculated by the following formula:
[0023] x = (x1 + x2 +.. + x n ) / n, y = (y1 + y2 +.. + y n ) / n;
[0024] Among them, x represents the abscissa of the centroid, y represents the ordinate of the centroid, x1, x2,..x n represents the abscissas of all center points within a group of clusters, y1, y2,..y n represents the ordinates of all center points within a group of clusters, and n represents the number of all center points within a group of clusters.
[0025] As a preferred solution, in the step S7, the Euclidean distance is specifically calculated by the following formula:
[0026]
[0027] Among them, dist represents the Euclidean distance between the centroids of any two groups of clusters, x1, x2 represent the abscissas of the centroids of different clusters, and y1, y2 represent the ordinates of the centroids of different clusters.
[0028] The second aspect of the present invention provides a multi-group crowd gathering detection system based on K-value-free clustering, including a human body detection module, a first coordinate generation module, a second coordinate generation module, a distance calculation module, a first clustering module, a third coordinate generation module, a second clustering module, and a clustering result generation module connected in sequence;
[0029] The human body detection module uses a pre-trained 2D detection network as the human body detection network to obtain a human body bounding box;
[0030] The first coordinate generation module is used to obtain the coordinates of the human body bounding box from the human body bounding box;
[0031] The second coordinate generation module is used to perform calculation processing on the coordinates of the human body bounding box to obtain the coordinates of the two-dimensional center point of the bounding box;
[0032] The distance calculation module is used to traverse the center points according to the obtained coordinates of the two-dimensional center point of the bounding box and calculate the distance between any two center points;
[0033] The first clustering module is used to classify two center points smaller than the first preset threshold into the same cluster and mark these two points as clustered points; through continuous iterative comparison, multiple groups of roughly classified clusters are obtained;
[0034] The third coordinate generation module is used to calculate the centroid coordinates of each group of clusters to obtain the centroid coordinates (x1, y1), (x2, y2), (x3, y3), (x4, y4)...(x n ,y n );
[0035] The second clustering module is used to calculate the Euclidean distance between the centroids of any two clusters. If the distance between the centroids of two clusters is less than the second preset threshold, the two clusters are merged into one cluster. Through continuous iterative judgment, a final cluster is obtained;
[0036] The clustering result generation module is used to judge the number of central points in each obtained cluster. If it is less than the minimum number of points that make up a cluster, the cluster is deleted; at the same time, all unclassified points are grouped into one cluster, and then the final clustering result is output and visualized.
[0037] The third aspect of the present invention also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the foregoing multi-population gathering detection method based on K-value-free clustering are implemented.
[0038] The fourth aspect of the present invention also provides a computer device, including a storage medium, a processor, and a computer program stored in the storage medium and executable by the processor. When the computer program is executed by the processor, the steps of the foregoing multi-population gathering detection method based on K-value-free clustering are implemented.
[0039] Compared with the prior art, the beneficial effects of the present invention are:
[0040] The present invention designs a multi-population gathering detection method and system based on K-value-free clustering. By adopting the idea of the K-Means algorithm, it is not necessary to set the number of clusters in advance, providing a better solution for the randomness of the number of groups in gathering detection; through preset threshold screening, it has a certain filtering effect on the noise personnel near the clustering groups, ensuring the accuracy of multi-population clustering. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] Figure 1 It is a flowchart of a multi-population gathering detection method based on K-value-free clustering provided by an embodiment of the present invention;
[0042] Figure 2 It is a connection diagram of YOLOv5 and a clustering function provided by an embodiment of the present invention;
[0043] Figure 3 It is a block diagram of a multi-population gathering detection system based on K-value-free clustering provided by an embodiment of the present invention;
[0044] Figure 4 It is a visualization diagram of the clustering result provided by an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0045] The drawings are only for illustrative purposes and cannot be construed as a limitation of this patent;
[0046] It should be clear that the described embodiments are only a part of the embodiments of this application, rather than all of them. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in this application without creative efforts belong to the scope protected by the embodiments of this application.
[0047] The terms used in the embodiments of this application are only for the purpose of describing specific embodiments and are not intended to limit the embodiments of this application. The singular forms "a", "the" and "said" used in the embodiments of this application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more of the associated listed items.
[0048] When the following description refers to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. On the contrary, they are merely examples of devices and methods consistent with some aspects of this application as detailed in the appended claims. In the description of this application, it should be understood that the terms "first", "second", "third", etc. are only used to distinguish similar objects and do not have to be used to describe a specific order or sequence, nor can they be understood as indicating or implying relative importance. For those of ordinary skill in the art, the specific meanings of the above terms in this application can be understood according to specific circumstances.
[0049] In addition, in the description of this application, unless otherwise specified, "a plurality" means two or more. "And / or" describes the association relationship of associated objects and indicates that three relationships can exist. For example, A and / or B can represent three situations: A exists alone, A and B exist simultaneously, and B exists alone. The character " / " generally represents an "or" relationship between the associated objects before and after. The following further elaborates on the present invention in conjunction with the accompanying drawings and embodiments.
[0050] The following further elaborates on the present invention in conjunction with the accompanying drawings and embodiments.
[0051] Embodiment 1
[0052] Please refer to Figures 1 to 3 , a multi-group crowd detection method based on K-value-free clustering, specifically including the following steps:
[0053] S1, using a pre-trained 2D detection network as the human detection network to obtain human bounding boxes;
[0054] In a specific embodiment, in the step S1, specifically, YOLOv5 is used as the human detection network.
[0055] S2. Obtain the human body bounding box coordinates from the human body bounding box in step S1;
[0056] In a specific embodiment, in step S2, the human body bounding box coordinates are specifically: (x1, y1, x2, y2)0(x1, y1, x2, y2)1(x1, y1, x2, y2)2……··(x1, y1, x2, y2) n ; where the index 0 represents the coordinates of the first bounding box (x1, y1, x2, y2)0 which contains the upper left coordinates x1, y1 and the lower right coordinates x2, y2, the index 1 represents the coordinates of the second bounding box (x1, y1, x2, y2)1 which contains the upper left coordinates x1, y1 and the lower right coordinates x2, y2, and so on. The index n represents the coordinates of the (n + 1)-th bounding box (x1, y1, x2, y2) n which contains the upper left coordinates x1, y1 and the lower right coordinates x2, y2.
[0057] S3. Perform calculation processing on the human body bounding box coordinates in step S2 to obtain the coordinates of the two-dimensional center point of the bounding box;
[0058] In a specific embodiment, in step S3, specifically substitute the human body bounding box coordinates obtained in step S2 into the following calculation formulas: x = (x1 + x2) / 2, y = (y1 + y2) / 2; finally obtain the center point coordinates (x, y)0(x, y)1(x, y)2......(x, y) n .
[0059] S4. According to the coordinates of the two-dimensional center points of the bounding boxes obtained in step S3, traverse the center points and calculate the distance between any two center points;
[0060] In a specific embodiment, in step S4, the distance calculation formula for the center points is specifically:
[0061]
[0062] where dist is the distance between two center points, x1, x2 are the abscissas of the center points, and y1, y2 are the ordinates of the center points.
[0063] S5. If the distance calculated in step S4 is less than the first preset threshold, then classify the corresponding two center points into the same cluster and mark these two points as clustered points; through continuous iterative comparison, obtain multiple groups of roughly classified clusters;
[0064] It should be noted that the first preset threshold depends on the classification requirements for the input data. If it is desired to group some points that are relatively close together, then the distance can be set smaller, such as 1. The unit of this distance depends on the unit of the input data. It can be 1 meter or 1 pixel. Note: This is only the threshold used for function testing. Since the crowd detection is based on image pixels to judge the distance, generally the first preset threshold is set to 60 - 80 pixels.
[0065] S6. Calculate the centroid coordinates of each group of clusters in step S5 to obtain the centroid coordinates (x1, y1), (x2, y2), (x3, y3), (x4, y4),... (x n , y n );
[0066] In a specific embodiment, in step S6, the centroid coordinates are specifically calculated by the following formula:
[0067] x = (x1 + x2 +.. + x n ) / n, y = (y1 + y2 +.. + y n );
[0068] Where x represents the abscissa of the centroid, y represents the ordinate of the centroid, x1, x2,.. x n represent the abscissas of all center points within a group of clusters, and y1, y2,.. y n represent the ordinates of all center points within a group of clusters, and n represents the number of all center points within a group of clusters.
[0069] S7. Calculate the Euclidean distance between the centroids of any two groups of clusters in step S6. If the distance between the centroids of two groups of clusters is less than the second preset threshold, then merge the two groups of clusters into one group of clusters. Through continuous iterative judgment, the final one group of clusters is obtained;
[0070] In a specific embodiment, in step S7, the Euclidean distance is specifically calculated by the following formula:
[0071]
[0072] Where dist represents the Euclidean distance between the centroids of any two groups of clusters, and x1, x2 represent the abscissas of the centroids of different clusters, and y1, y2 represent the ordinates of the centroids of different clusters.
[0073] It should be noted that the second preset threshold is set to 80 - 100 pixels.
[0074] S8. Determine the number of center points in each group of clusters obtained in step S7. If the number is less than the minimum number of points required to form a cluster, delete the cluster. At the same time, classify all unclassified points into one cluster, and then output the final clustering result and visualize it.
[0075] It should be noted that the minimum number of points is set to 3 - 7.
[0076] Embodiment 2
[0077] Please refer to Figure 4 , A multi - population gathering detection system based on K - value - free clustering, including a human body detection module 1, a first coordinate generation module 2, a second coordinate generation module 3, a distance calculation module 4, a first clustering module 5, a third coordinate generation module 6, a second clustering module 7, and a clustering result generation module 8 connected in sequence;
[0078] The human body detection module 1 uses a pre - trained 2D detection network as the human body detection network to obtain the human body bounding box;
[0079] The first coordinate generation module 2 is used to obtain the human body bounding box coordinates from the human body bounding box;
[0080] The second coordinate generation module 3 is used to perform calculation processing on the human body bounding box coordinates to obtain the coordinates of the two - dimensional center point of the bounding box;
[0081] The distance calculation module 4 is used to traverse the center points according to the obtained coordinates of the two - dimensional center points of the bounding boxes and calculate the distance between any two center points;
[0082] The first clustering module 5 is used to classify two center points with a distance less than the first preset threshold into the same cluster and mark these two points as clustered points; through continuous iterative comparison, multiple groups of roughly classified clusters are obtained;
[0083] The third coordinate generation module 6 is used to calculate the centroid coordinates of each group of clusters, and obtain the centroid coordinates (x 1, y1), (x2, y2), (x3, y3), (x4, y4),...(x n , y n );
[0084] The second clustering module 7 is used to calculate the Euclidean distance between the centroids of any two groups of clusters. If the distance between the centroids of two groups of clusters is less than the second preset threshold, the two groups of clusters are merged into one group of clusters. Through continuous iterative judgment, the final group of clusters is obtained;
[0085] The clustering result generation module 8 is used to determine the number of center points in each group of clusters obtained. If the number is less than the minimum number of points forming a cluster, the cluster is deleted; at the same time, all unclassified points are grouped into one cluster, and then the final clustering result is output and visualized.
[0086] Embodiment 3
[0087] A computer-readable storage medium stores a computer program thereon. When the computer program is executed by a processor, the steps of a multi-group congregation detection method based on K-value-free clustering in Embodiment 1 are implemented.
[0088] Embodiment 4
[0089] A computer device includes a storage medium, a processor, and a computer program stored in the storage medium and executable by the processor. When the computer program is executed by the processor, the steps of a multi-group congregation detection method based on K-value-free clustering in Embodiment 1 are implemented.
[0090] Obviously, the above embodiments of the present invention are merely examples for clearly explaining the present invention, rather than limitations on the implementation manners of the present invention. For those of ordinary skill in the art, other different forms of changes or modifications can be made based on the above description. It is not necessary and impossible to enumerate all implementation manners here. Any modifications, equivalent replacements, and improvements made within the spirit and principle of the present invention shall be included within the protection scope of the claims of the present invention.
Claims
1. A multi-group crowd gathering detection method based on K-value-free clustering, characterized in that, Specifically, it includes the following steps: S1. Use a pre-trained 2D detection network as the human detection network to obtain the human bounding box; S2. Obtain the human bounding box coordinates from the human bounding box in step S1; S3. Calculate and process the human bounding box coordinates in step S2 to obtain the coordinates of the two-dimensional center point of the bounding box; S4. According to the coordinates of the two-dimensional center point of the bounding box obtained in step S3, traverse the center points and calculate the distance between any two center points; S5. If the distance calculated in step S4 is less than the first preset threshold, classify the corresponding two center points into the same cluster and mark these two points as clustered points; through continuous iterative comparison, obtain multiple groups of roughly classified clusters; S6. Calculate the centroid coordinates of each group of clusters in step S5 to obtain the centroid coordinates (x1, y1), (x2, y2), (x3, y3), (x4, y4),... (x n , y n ); S7. Calculate the Euclidean distance between the centroids of any two groups of clusters in step S6. If the distance between the centroids of the two groups of clusters is less than the second preset threshold, merge the two groups of clusters into one group of clusters. Through continuous iterative judgment, obtain the final group of clusters; S8. Judge the number of center points in each group of clusters obtained in step S7. If it is less than the minimum number of points forming a cluster, delete the cluster; at the same time, classify all unclassified points into one cluster, then output the final clustering result and perform visualization; In step S6, the centroid coordinates are specifically calculated by the following formula: x = (x1 + x2 +.. + x n ) / n, y = (y1 + y2 +.. + y n ) / n; Among them, x represents the abscissa of the centroid, y represents the ordinate of the centroid, x1, x2,..x n represents the abscissas of all center points within a group of clusters, y1, y2,..y n represents the ordinates of all center points within a group of clusters, and n represents the number of all center points within a group of clusters; In step S7, the Euclidean distance is specifically calculated by the following formula: Among them, dist represents the Euclidean distance between the centroids of any two groups of clusters, x1 and x2 represent the abscissas of the centroids of different clusters, and y1 and y2 represent the ordinates of the centroids of different clusters.
2. The multi-group congregation detection method based on K-value-free clustering according to claim 1, wherein, In step S1, specifically, YOLOv5 is used as the human detection network.
3. A multi-group crowd detection method based on K-value-free clustering according to claim 1, characterized in that, In the step S2, the human body bounding box coordinates are specifically: (x1, y1, x2, y2)0(x1, y1, x2, y2)1(x1, y1, x2, y2)2........(x1, y1, x2, y2) n ; where the index 0 represents the coordinates of the first bounding box (x1, y1, x2, y2)0, which includes the upper left coordinates x1, y1 and the lower right coordinates x2, y2. The index 1 represents the coordinates of the second bounding box (x1, y1, x2, y2)1, which includes the upper left coordinates x1, y1 and the lower right coordinates x2, y2, and so on. The index n represents the coordinates of the (n + 1)-th bounding box (x1, y1, x2, y2) n including the upper left coordinates x1, y1 and the lower right coordinates x2, y2.
4. The multi-group crowd gathering detection method based on K-value-free clustering according to claim 1, characterized in that In the step S3, specifically, substitute the human body bounding box coordinates obtained in step S2 into the following calculation formulas: x = (x1 + x2) / 2, y = (y1 + y2) / 2; finally, obtain the center point coordinates (x, y)0(x, y)1(x, y)2......(x, y) n .
5. A multi-group crowd gathering detection method based on K-value-free clustering according to claim 1, characterized in that, In step S4, the calculation formula for the distance between the center points is specifically: Among them, dist is the distance between two center points, x1 and x2 are the abscissas of the center points, and y1 and y2 are the ordinates of the center points.
6. A multi-group crowd gathering detection system based on K-value-free clustering, characterized in that, It includes a human detection module (1), a first coordinate generation module (2), a second coordinate generation module (3), a distance calculation module (4), a first clustering module (5), a third coordinate generation module (6), a second clustering module (7), and a clustering result generation module (8) connected in sequence; The human detection module (1) uses a pre-trained 2D detection network as the human detection network to obtain the human bounding box; The first coordinate generation module (2) is used to obtain the human bounding box coordinates from the human bounding box; The second coordinate generation module (3) is used to calculate and process the human bounding box coordinates to obtain the coordinates of the two-dimensional center point of the bounding box; The distance calculation module (4) is used to traverse the center points and calculate the distance between any two center points according to the obtained coordinates of the two-dimensional center point of the bounding box; The first clustering module (5) is used to classify two center points less than the first preset threshold into the same cluster and mark these two points as clustered points; through continuous iterative comparison, obtain multiple groups of roughly classified clusters; The third coordinate generation module (6) is used to calculate the centroid coordinates of each group of clusters, and obtain the centroid coordinates (x1, y1), (x2, y2), (x3, y3),... (x n , y n ) of each group of clusters. Specifically, the centroid coordinates are calculated by the following formula: x = (x1 + x2 +.. + x n ) / n, y = (y1 + y2 +.. + y n ) / n; Among them, x represents the abscissa of the centroid, y represents the ordinate of the centroid, x1, x2,..x n represents the abscissas of all center points within a group of clusters, y1, y2,..y n represents the ordinates of all center points within a group of clusters, and n represents the number of all center points within a group of clusters; The second clustering module (7) is used to calculate the Euclidean distance between the centroids of any two groups of clusters. If the distance between the centroids of two groups of clusters is less than the second preset threshold, the two groups of clusters are merged into one group of clusters. Through continuous iterative judgment, the final one group of clusters is obtained. The Euclidean distance is specifically calculated by the following formula: where dist represents the Euclidean distance between the centroids of any two groups of clusters, x1 and x2 represent the abscissas of the centroids of different clusters, and y1 and y2 represent the ordinates of the centroids of different clusters; The clustering result generation module (8) is used to judge the number of center points in each group of clusters obtained. If it is less than the minimum number of points forming a cluster, the cluster is deleted; at the same time, all unclassified points are grouped into one cluster, and then the final clustering result is output and visualized.
7. A computer-readable storage medium storing a computer program thereon, characterized in that: When the computer program is executed by a processor, it implements the steps of a multi-group congregation detection method based on K-value-free clustering according to any one of claims 1 to 5.
8. A computer device, characterized in that: It includes a storage medium, a processor, and a computer program stored in the storage medium and executable by the processor. When the computer program is executed by the processor, it implements the steps of a multi-group congregation detection method based on K-value-free clustering according to any one of claims 1 to 5.
Citation Information
Patent Citations
Model detection method
CN115200582A
Power grid thunder and lightning early warning method, device, recording medium and system
CN113705693A
Abnormal behavior detection method, device and system and computer readable storage medium
CN114238952A