A method and system for detecting a crowd of people

By acquiring aerial top-down images and using the DBSCAN clustering algorithm, the first and second warning values ​​for crowd gathering are calculated, solving the problem of the inability to identify overall density in existing technologies and achieving a more accurate safety risk assessment.

CN119723459BActive Publication Date: 2025-11-18GUANGZHOU IMAPCLOUD INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411871652.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-18
Publication Date
2025-11-18
Estimated Expiration
2044-12-18

AI Technical Summary

Technical Problem

Existing technologies cannot effectively identify overall density when dealing with large gatherings caused by the movement of people, posing a security risk.

Method used

The system uses aerial top-down images for acquisition, filters target bounding boxes using a personnel detection model, and uses the DBSCAN clustering algorithm to determine the centroid as the core point, boundary point, or isolated point. It calculates the first and second warning values, and then calculates the weighted sum to obtain the target warning value for alarm purposes.

Benefits of technology

It improves the accuracy and reliability of crowd gathering detection, and can more comprehensively reflect the risk of overall crowd gathering, avoiding the limitations of single core point cluster analysis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119723459B_ABST
    Figure CN119723459B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of data processing, and relates to a personnel gathering detection method and system, wherein the method comprises: collecting an aerial overhead image, denoted as a target image; using a target frame to screen out images of personnel in the target image through a personnel detection model to obtain the center of gravity of each target frame; performing clustering processing on each center of gravity to obtain at least one object region, and determining each center of gravity as a core point, a boundary point or an isolated point; calculating a first early warning value; calculating a second early warning value; performing weighted summation on the first early warning value and the second early warning value to obtain a target early warning value, and performing alarm when the target early warning value is greater than a preset early warning threshold value. The present application evaluates the personnel gathering density in multiple aspects, and improves the accuracy and reliability of the gathering risk detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention generally relates to the field of data processing technology. More specifically, this invention relates to a method and system for detecting crowd gatherings. Background Technology

[0002] In some industrial production, safety management, and work environments, it is necessary to control the distance between people. For example, in environments with dense machinery, equipment, and production lines, work areas are often quite narrow. If people are too close together, it may increase the risk of accidental collisions or contact. In areas where chemicals are processed, stored, or transported, if people are too close together, it may increase the risk of chemical leaks, fires, or explosions. In the prevention and control of infectious diseases, maintaining an appropriate distance between people (usually 1-2 meters) can significantly reduce the risk of pathogens spreading through the air and droplets. Therefore, in certain environments, especially in places with frequent personnel movement, it is necessary to control the density of people.

[0003] Existing technologies typically use cameras to analyze the location and spacing of people in real time, issuing an alarm when the distance between two people falls below a preset safety threshold to alert management. Personnel detection models are commonly used algorithms for detecting people. They identify the location of people in an image and obtain their coordinates, then calculate the distance between them. Based on this distance data, it can be determined whether there is a gathering of people; if the distance between two people is less than a set safety threshold, an alarm is triggered.

[0004] However, due to the mobility of people, when a large number of people gather around a particular person, even if the distance between each person is greater than the safety threshold, the overall density may still pose a safety risk. Summary of the Invention

[0005] To address the technical problem that the mobility of people may lead to safety risks when multiple people gather, the present invention provides solutions in the following aspects.

[0006] In a first aspect, a method for detecting crowd gathering includes: acquiring an aerial view image, denoted as a target image; using a crowd detection model to filter out images of people in the target image using bounding boxes, wherein each person corresponds to a bounding box; obtaining the centroid of each bounding box; clustering each centroid according to its coordinates using a DBSCAN clustering algorithm to obtain at least one object region, and determining each centroid as a core point, boundary point, or isolated point, wherein the object region is a circle centered on the core point and with the maximum radius of the neighborhood corresponding to the DBSCAN clustering algorithm as its radius; and calculating a first warning value. a 1: ,in p iFor the first i The number of centroids in the corresponding object region for each core point. i It is a positive integer. n The number of core points p max The maximum value among all density values ​​of the core points. norm The normalization function is used to calculate the second warning value. a 2: ,in q j For including the first j The maximum value among the number of centroids in all object regions of a given boundary point. j It is a positive integer. m The number of boundary points, q max The maximum value among the density values ​​at the boundary points. s The number of isolated points is denoted by exp(), which is an exponential function with the natural exponent e as the base. The first and second warning values ​​are weighted and summed to obtain the target warning value, and an alarm is triggered when the target warning value is greater than the preset warning threshold.

[0007] Preferably, clustering each centroid using the DBSCAN clustering algorithm to obtain at least one object region, and determining each centroid as a core point, boundary point, or isolated point includes: calculating the distance between each centroid based on its coordinates; determining that two centroids are adjacent points if the distance between them is less than the maximum radius of their neighborhood; determining that centroids with more than a preset threshold number of adjacent points are core points; determining that a circular region centered on the core point and with the first distance threshold as its radius is the object region corresponding to the core point; determining that centroids with more than a preset threshold number of adjacent points and adjacent to at least one core point are boundary points; and determining that centroids other than the core point and edge point are noise points.

[0008] Preferably, calculate the first k The center of gravity and the first t The formula for the distance between the centroids is:

[0009] ;

[0010] in, d For the first k The center of gravity and the first t The distance between the centers of gravity x k For the first k The x-coordinate of the centroid, y k For the first k The ordinate of the centroid, x tFor the first k The x-coordinate of the centroid, y t For the first k The ordinate of the centroid, k , t All are positive integers.

[0011] Preferably, it further includes: issuing an alarm in response to the distance between at least one pair of centroids being less than a preset distance threshold, wherein the distance threshold is less than the maximum radius of the neighborhood.

[0012] Preferably, the formula for calculating the target warning value is: A = η 1× a 1+ η 2× a 2; among which, η 1 is the first weighting coefficient of the preset size. η 2 is the second weighting coefficient with a preset size.

[0013] Preferably, the method further includes constructing the personnel detection model: constructing a training set, wherein the training set includes multiple training images, each training image includes multiple personnel, and each personnel is selected by a bounding box; constructing a neural network model; and training the neural network model based on the training set to obtain the personnel detection model.

[0014] Preferably, the neural network model is a neural network model based on the YOLO architecture.

[0015] Preferably, the target box is a rectangular box.

[0016] Preferably, obtaining the centroid of each target box includes: obtaining the coordinates of two opposite corners of the target box, wherein the coordinates of one of the two opposite corners is ( X 1, Y 1) The coordinates of the other angle are ( X 2, Y 2); Determine the coordinates of the centroid of the target bounding box ( X A , Y A ), where the coordinates of the centroid of the target bounding box are ( X A , Y A )satisfy: , .

[0017] In a second aspect, a crowd gathering detection system includes a processor and a memory, the memory storing a computer program, the processor executing the computer program to implement a crowd gathering detection method as described in any one of the above inventions.

[0018] The beneficial effects of this invention are as follows:

[0019] This invention detects clusters of people in close proximity (i.e., within the same target area). The person at the center is designated as a key point (i.e., a core point), and a first warning value is calculated based on points adjacent to the key point. Furthermore, by introducing a second warning value, this invention provides a more comprehensive density assessment of the area, including boundary points and isolated points, avoiding the limitations of single-core-point cluster analysis and thus improving the accuracy and reliability of overall cluster detection. By weighted summing of the first and second warning values, the overall risk of personnel clustering can be more accurately reflected. Attached Figure Description

[0020] The above and other objects, features, and advantages of exemplary embodiments of the present invention will become readily apparent upon reading the following detailed description with reference to the accompanying drawings. In the drawings, several embodiments of the invention are illustrated by way of example and not limitation, and like or corresponding reference numerals denote like or corresponding parts, wherein:

[0021] Figure 1 This is a schematic flowchart illustrating the steps of a method for detecting crowd gatherings according to an embodiment of the present invention;

[0022] Figure 2 This is a schematic diagram illustrating the density polymerization process of multiple centroids according to the present invention;

[0023] Figure 3 This is a schematic diagram illustrating the structure of a crowd gathering detection system according to this embodiment. Detailed Implementation

[0024] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0025] The specific embodiments of the present invention will now be described in detail with reference to the accompanying drawings.

[0026] Figure 1 This is a schematic flowchart illustrating the steps of a method for detecting crowd gatherings according to an embodiment of the present invention.

[0027] like Figure 1 As shown, a method for detecting crowd gatherings includes steps S1 to S2.

[0028] Step S1: Acquire an aerial view image and record it as the target image.

[0029] It should be noted that the perspective is vertically downward, which allows the distribution of people in the image to be viewed as being on a single plane. This perspective simplifies spatial calculations, making the measurement of relative distances between people more intuitive and accurate.

[0030] Step S2: Use the bounding box of the people detection model to filter out the images of people in the target image.

[0031] Each person corresponds to a bounding box. The people detection model is usually a pre-trained deep learning model whose task is to identify all human targets in an image and generate a bounding box (or target box) for each target.

[0032] In one embodiment, constructing the person detection model includes: constructing a training set, wherein the training set includes multiple training images, each training image includes multiple people, and each person is selected by a bounding box; constructing a neural network model; and training the neural network model based on the training set to obtain the person detection model.

[0033] In one embodiment, the neural network model is a YOLO (You Only Look Once) architecture neural network model. YOLO is a real-time object detection system that predicts object bounding boxes and categories using a single neural network.

[0034] Step S3: Obtain the centroid of each target box; based on the coordinates of each centroid, perform clustering processing on each centroid using the DBSCAN clustering algorithm to obtain at least one object region, and determine each centroid as a core point, boundary point, or isolated point.

[0035] In this context, any object region is a circle centered on the core point and with the radius of the maximum radius of the neighborhood corresponding to the DBSCAN (Density-Based Spatial Clustering of Applications with Noise) clustering algorithm.

[0036] In one embodiment, clustering centroids using the DBSCAN clustering algorithm to obtain at least one object region and determining each centroid as a core point, boundary point, or isolated point includes: calculating the distance between centroids based on their coordinates; determining two centroids as adjacent points if the distance between them is less than the maximum radius of their neighborhood; determining centroids with a number of adjacent points greater than a preset threshold as core points; determining a circular region centered on the core point and with a radius equal to the first distance threshold as the object region corresponding to the core point; determining centroids with a number of adjacent points greater than a preset threshold and adjacent to at least one core point as boundary points; and determining centroids other than core points and edge points as noise points.

[0037] It's important to note that DBSCAN is a density-based clustering algorithm. Its basic idea is to analyze the density of data points to divide the data into different clusters (i.e., object regions) and identify noise points (points that don't belong to any cluster). Core points are the centers of clusters, surrounded by sufficient density to expand into a new cluster. Boundary points cannot themselves act as core points to expand clusters, but they are connected to core points and belong to a cluster. That is, although boundary points are not dense enough to form a new cluster, they are classified into a cluster due to their adjacency with core points. Isolated points, also called noise points, do not belong to any cluster and lack sufficient density to form one. An object region refers to the clustered area formed by expanding outwards from the core point using the DBSCAN algorithm. An object region (i.e., a cluster) is a set of density-connected points; each cluster consists of a core point and its surrounding boundary points.

[0038] Figure 2 This is a schematic diagram illustrating the density polymerization process of multiple centroids according to the present invention.

[0039] like Figure 2 As shown, the circular dashed line represents the object region, the center of the circular dashed line (i.e., the center point) is the core point, points not at the center but inside the circular dashed line (centroids) are boundary points, and points outside the circular dashed line are noise points. Multiple object regions may overlap, and a boundary point may be a neighbor of multiple core points. It should be noted that if a centroid has a sufficient number of neighboring points, then this centroid and its neighbors belong to the same object region (or the same cluster); if a centroid has too few neighbors, then this centroid is considered noise or a boundary point.

[0040] In one embodiment, the distance between any two points is calculated, for example, calculating the distance between the first and second points. k The center of gravity and the first t For example, the distance between the centers of gravity includes:

[0041] ;

[0042] in, d For the first k The center of gravity and the first t The distance between the centers of gravity x k For the first k The x-coordinate of the centroid, y k For the first k The ordinate of the centroid, x t For the first k The x-coordinate of the centroid, y t For the first k The ordinate of the centroid, k , t All are positive integers.

[0043] In one embodiment, the target box is a rectangle. In this embodiment, obtaining the centroid of each target box includes: obtaining the coordinates of two opposite corners of the target box, wherein the coordinate of one of the two opposite corners is (…). X 1, Y 1) The coordinates of the other angle are ( X 2, Y 2); Determine the coordinates of the centroid of the target bounding box ( X A , Y A ), where the coordinates of the centroid of the target bounding box are ( X A , Y A )satisfy: , .

[0044] In another embodiment, the target bounding box is a circular box. In this embodiment, the coordinates of the center of the target bounding box are determined as the centroid coordinates of the target bounding box.

[0045] Step S4: Calculate the first warning value.

[0046] The formula for calculating the first warning value is as follows: , a 1 is the first warning value. p i For the first i The number of centroids in the object region corresponding to each core point i It is a positive integer. n The number of core points p max The maximum value among all density values ​​of the core points. normThis is the normalization function.

[0047] It should be noted that even if the distance between individuals remains within an acceptable range, continuous movement and gathering of people can still lead to a sharp increase in density in certain areas, thereby creating potential safety hazards. The number of centroids in the object area corresponding to the core point reflects the compactness of the population gathering; the more centroids in the object area corresponding to the core point, the more compact the population gathering in that area. Based on this, the average value of the centroid data in all object areas corresponding to the core point (i.e., This reflects the density of people clustering across all object areas, representing the maximum density value among all core points. p max This reflects the maximum density of people gathering. Among them, the maximum value... p max The larger the value, the greater the safety hazard; the average value (i.e. The higher the initial warning value, the greater the potential safety hazard. Therefore, the higher the initial warning value, the greater the potential safety hazard.

[0048] Step S5: Calculate the second warning value.

[0049] The formula for calculating the second warning value is as follows: , a 2 is the second warning value. q j For including the first j The maximum value among the number of centroids in all object regions of a given boundary point. j It is a positive integer. m The number of boundary points, q max The maximum value among the density values ​​at the boundary points. s The number of isolated points is given by exp(), which is an exponential function with the natural exponent e as the base.

[0050] It should be noted that, for a given boundary point, the maximum number of centroids across all object regions including that boundary point reflects the density and population concentration of that region. This maximum value effectively reflects the "worst-case" or "most extreme" situation in the system. If a boundary point corresponds to an area with an extremely high number of centroids, it indicates that the area may face high risk or pressure. Therefore, using the maximum value as a measure ensures early warning under the most risky conditions. The number of isolated points indicates the overall security of the region corresponding to the target image. Based on this, the formula... Larger or more isolated points s The smaller the value, the greater the potential safety hazard, and the higher the second warning value.

[0051] Step S6: The first warning value and the second warning value are weighted and summed to obtain the target warning value, and an alarm is triggered when the target warning value is greater than the preset warning threshold.

[0052] The formula for calculating the target warning value is as follows: A = η 1× a 1+ η 2× a 2; η 1 is the first weighting coefficient of the preset size. η 2 represents a second weighting coefficient of a preset size. In one embodiment, the first weighting coefficient... η The value of 1 is 0.8, the second weighting coefficient. η The value of 2 is 0.2.

[0053] Figure 3 This is a schematic diagram illustrating the structure of a crowd gathering detection system according to an embodiment of the present invention.

[0054] This invention also provides a crowd gathering detection system. For example... Figure 3 As shown, the system includes a processor and a memory, the memory storing computer program instructions, which, when executed by the processor, implement a method for detecting crowd gathering according to the first aspect of the present invention.

[0055] In this invention, the aforementioned memory can be any tangible medium containing or storing a program that can be used or combined with an instruction execution system, apparatus, or device. For example, a computer-readable storage medium can be any suitable magnetic or magneto-optical storage medium, such as Resistive Random Access Memory (RRAM), Dynamic Random Access Memory (DRAM), Static Random Access Memory (SRAM), Enhanced Dynamic Random Access Memory (EDRAM), High-Bandwidth Memory (HBM), Hybrid Memory Cube (HMC), etc., or any other medium that can be used to store desired information and can be accessed by an application, module, or both. Any such computer storage medium can be part of a device or accessible to or connected to a device. Any application or module described in this invention can be implemented using computer-readable / executable instructions that can be stored or otherwise maintained by such a computer-readable medium.

[0056] In the description of this specification, "multiple" or "several" means at least two, such as two, three or more, unless otherwise explicitly specified.

[0057] While this specification has shown and described numerous embodiments of the invention, it will be apparent to those skilled in the art that such embodiments are provided by way of example only. Many modifications, alterations, and alternatives will occur to those skilled in the art without departing from the spirit and essence of the invention. It should be understood that various alternatives to the embodiments of the invention described herein may be employed in the practice of this invention.

Claims

1. A method for detecting crowd gatherings, characterized in that, include: Collect aerial top-view images and record them as target images; The people detection model uses bounding boxes to filter out the images of people in the target image, with each person corresponding to a bounding box. Obtain the centroid of each target bounding box; based on the coordinates of each centroid, perform clustering processing on each centroid using the DBSCAN clustering algorithm to obtain at least one object region, and determine each centroid as a core point, boundary point, or isolated point, wherein the object region is a circle with the core point as the center and the maximum radius of the neighborhood corresponding to the DBSCAN clustering algorithm as the radius; Calculate the first warning value a 1: ,in p i For the first i The number of centroids in the object region corresponding to each core point i It is a positive integer. n The number of core points p max The maximum value among all density values ​​of the core points. norm This is the normalization function; Calculate the second warning value a 2: ,in q j For including the first j The maximum number of centroids in all object regions of a given boundary point. j It is a positive integer. m The number of boundary points, s The number of isolated points is given by exp(), which is an exponential function with the natural exponent e as the base. The first and second warning values ​​are weighted and summed to obtain the target warning value, and an alarm is triggered when the target warning value is greater than the preset warning threshold.

2. The method for detecting crowd gathering according to claim 1, characterized in that, The DBSCAN clustering algorithm is used to cluster each centroid to obtain at least one object region, and each centroid is determined to be a core point, boundary point, or isolated point, including: The distance between each centroid is calculated based on its coordinates. If the distance between two centroids is less than the maximum radius of their neighborhood, the two centroids are determined to be adjacent points. The centroid is determined by identifying the number of adjacent points greater than a preset threshold. The object region corresponding to the core point is defined as a circular region centered on the core point and with the maximum radius of the neighborhood as the radius. The centroid of a point whose number of adjacent points is greater than a preset threshold and which is adjacent to at least one core point is defined as a boundary point. The centroids other than the core and edge points are defined as isolated points.

3. The method for detecting crowd gathering according to claim 2, characterized in that, Calculate the first k The center of gravity and the first t The formula for the distance between the centroids is: ; in, d For the first k The center of gravity and the first t The distance between the centers of gravity x k For the first k The x-coordinate of the centroid, y k For the first k The ordinate of the centroid, x t For the first t The x-coordinate of the centroid, y t For the first t The ordinate of the centroid, k , t All are positive integers.

4. The method for detecting crowd gathering according to claim 3, characterized in that, Also includes: An alarm is triggered in response to the distance between at least one pair of centroids being less than a preset distance threshold, wherein the distance threshold is less than the maximum radius of the neighborhood.

5. The method for detecting crowd gathering according to claim 1, characterized in that, The formula for calculating the target warning value is: A = η 1× a 1+ η 2× a 2; in, η 1 is the first weighting coefficient of the preset size. η 2 is the second weighting coefficient with a preset size.

6. The method for detecting crowd gathering according to claim 1, characterized in that, This also includes constructing the personnel detection model: Construct a training set, wherein the training set includes multiple training images, each training image includes multiple people, and each person is selected by a bounding box; Construct a neural network model; The neural network model is trained using the training set to obtain the personnel detection model.

7. The method for detecting crowd gathering according to claim 1, characterized in that, The neural network model is a YOLO architecture neural network model.

8. The method for detecting crowd gathering according to claim 1, characterized in that, The target box is a rectangle.

9. A method for detecting crowd gatherings according to claim 8, characterized in that, Obtaining the centroid of each target box includes: Obtain the coordinates of two opposite corners of the target bounding box, wherein the coordinates of one of the two opposite corners are ( X 1, Y 1) The coordinates of the other angle are ( X 2, Y 2); Determine the coordinates of the centroid of the target bounding box. X A , Y A ), where the coordinates of the centroid of the target bounding box are ( X A , Y A )satisfy: , .

10. A crowd gathering detection system, comprising a processor and a memory, wherein the memory stores a computer program, characterized in that, The processor executes the computer program to implement a method for detecting crowd gatherings as described in any one of claims 1-9.

Citation Information

Patent Citations

  • Personnel gathering detection method, apparatus and device

    CN111666821A

  • Personnel gathering area detection method, device, equipment, medium and product

    CN117671584A