Crowd detection method in dense scenes

By using the backbone network to extract feature maps in dense scenes and perform confidence and binary map processing, combined with the scale map to calculate the detection frame position, the problem of poor detection results for high-density crowds is solved, and the detection effect is achieved in dense scenes and small targets. efficient detection.

CN114998826BActive Publication Date: 2024-09-10NORTHWESTERN POLYTECHNICAL UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210520490.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-12
Publication Date
2024-09-10
Estimated Expiration
2042-05-12

AI Technical Summary

Technical Problem

The existing technology has poor performance in high-density crowd scenes and small target detection, and it is difficult to extract facial features of dense crowd targets, resulting in a decline in detection performance.

Method used

Use the backbone network (such as VGG-16 or HRNet) to extract feature maps, realize crowd positioning and counting through confidence map and binary map processing, calculate the size and position of the detection frame based on the scale map, and use dot product operations and threshold learners to improve Detection effect.

Benefits of technology

The amount of calculation is small in ultra-high-density scenes, and it can achieve better detection results in dense scenes and small targets, improving the accuracy and efficiency of crowd detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114998826B
    Figure CN114998826B
Patent Text Reader

Abstract

The present application discloses a method for crowd detection in dense scenes. The method for crowd detection in dense scenes includes: inputting an RGB image into a backbone network to extract a feature map; processing the feature map to obtain a confidence map; processing the confidence map to obtain a binary map, and using the binary map to process to obtain crowd positioning and counting information; processing the feature map to obtain a size map; using the binary map and the size map to calculate the size and position of each detection frame, wherein the center point of each connected domain is a human head positioning point, and the number of the connected domains is the number of people in the RGB image. The present application can solve the problem of difficult crowd detection in dense crowd scenes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing technology, and in particular to a method for detecting crowds in densely populated scenes. Background Art

[0002] In recent years, security monitoring has played an increasingly important role in smart cities, and crowd analysis from a monitoring perspective has become increasingly important for building smart cities. Crowd counting, positioning, and detection are basic tasks that serve high-level tasks such as crowd flow prediction, urban planning, and space design.

[0003] Among them, crowd detection refers to detecting the head of a person in a crowd scene. Once the detection is achieved, the functions of crowd positioning and counting can be realized at the same time. Some crowd detection methods are extensions of the traditional target detection field, such as the detection method mentioned in the document "R. Stewart, M. Andriluka, and AYNg, 'End-to-end people detection in crowded scenes' in Proc. IEEE Conference on Computer Vision and Pattern Recognition, 2016, pp. 2325–2333." This method can achieve good results for crowd detection in low-density scenes, but this detection method has poor detection effects for high-density crowd scenes (such as more than 1,000 people in a picture) and small targets (less than 100 pixels).

[0004] The literature "S. Yang, P. Luo, C.-C. Loy, and X. Tang, 'Wider face: A face detection benchmark' Proc. IEEE Conference on Computer Vision and Pattern Recognition, 2016, pp. 5525–5533." WIDER FACE. Hu et al. proposed a small target detection framework in the literature "P. Hu and D. Ramanan, 'nding tinyfaces,' Proc. IEEE Conference on Computer Vision and Pattern Recognition, 2017, pp. 951–959." by analyzing the impact of image resolution, head size and environment, and significantly improved the detection performance in dense crowds. However, this method is designed for a single view. In extremely crowded crowds, it is difficult to extract the facial features of dense crowd targets, so many small targets will be lost. Summary of the invention

[0005] The main purpose of this application is to provide a crowd detection method in dense scenes to solve the problem of difficulty in crowd detection in dense scenes.

[0006] According to one aspect of an embodiment of the present application, a method for detecting a crowd in a dense scene is provided, comprising:

[0007] Step S1: Input the RGB image into the backbone network to extract the feature map;

[0008] Step S2: Processing the feature map to obtain a confidence map;

[0009] Step S3: Processing the confidence map to obtain a binary map, and using the binary map to obtain crowd positioning and counting information;

[0010] Step S4: Processing the feature map to obtain a size map;

[0011] Step S5: Utilizing the binary image and the size image to calculate the size and position of each detection frame, wherein the center point of each connected domain is a human head positioning point, and the number of the connected domains is the number of people in the RGB image.

[0012] Furthermore, in step S1, the backbone network includes VGG-16 or HRNet.

[0013] Furthermore, in step S1, the feature map extracted by the backbone network satisfies the relationship:

[0014] F = Φ(I; θ e )

[0015] Where, F is the feature map, Φ is the function of the feature extractor, θ e is the weight of the neural network where the feature extractor is located, I is the RGB image, I∈R H×W×3 , R is a real number, c is the number of channels of the feature map, and H and W are the height and width of the RGB image respectively.

[0016] Furthermore, the step S2 comprises:

[0017] Step S21: The number of channels of the feature map is changed to 720 through a 1×1 convolution layer;

[0018] Step S22: The size of the feature map is changed to (H / 2, w / 2) through a 2×2 deconvolution layer with a step size of 2;

[0019] Step S23: reducing the number of channels of the feature map to 32 through a 3×3 convolution layer;

[0020] Step S24: changing the size of the feature map to (H, W) through a deconvolution layer;

[0021] Step S25: Output the confidence map of a single channel through a 1×1 convolutional layer, and the confidence map satisfies the relationship:

[0022] C = ψ(F; θ c )

[0023] Where C is the confidence map, C∈R H×W , ψ is a function of the confidence predictor, θ c is the weight of the neural network in which the confidence predictor is located.

[0024] Furthermore, the step S3 comprises:

[0025] Step S31: performing a dot product operation on the feature map and the confidence map to obtain a new feature map;

[0026] Step S32: sending the obtained new feature map to a threshold learner to learn a threshold map;

[0027] Step S33: obtaining the binary image according to the threshold image and the confidence image;

[0028] Step S34: Obtain the crowd counting and positioning results through the binary image.

[0029] Furthermore, the new feature map satisfies the relationship:

[0030]

[0031] Among them, F filter is the new feature map, R is a real number, c is the number of channels of the feature map, H and W are the height and width of the RGB image respectively, represents the dot product operation, D is the downsampling operation, and C is the confidence map.

[0032] Furthermore, the threshold map satisfies the relationship:

[0033] T=Φ1(F filter θ t )

[0034] Where T is the threshold map, T∈R H×w , Φ1 is the function of the threshold learner, θ t is the weight of the neural network where the threshold learner is located.

[0035] Furthermore, the binary graph satisfies the relationship:

[0036]

[0037] Among them, B iij is the binary image, η is a function of the threshold image and the confidence image, C is the confidence image, and T is the threshold image.

[0038] Furthermore, the step S4 comprises:

[0039] Step S41: sending the feature map to four residual blocks in sequence, and changing the number of channels of the feature map to 32;

[0040] Step S44: Obtain a scale map as large as the RGB image through two deconvolution layers, and the scale map satisfies the relationship:

[0041] S = X(F; θ s )

[0042] Where S is the scale graph, S∈R H×W , R is a real number, H and W are the height and width of the RGB image, respectively, X is a function of the scale map predictor, F is the feature map, θ s is the weight of the neural network in which the scalogram predictor is located.

[0043] Furthermore, in step S5, each connected region in the binary graph represents a target, and for the kth target, the position of its center point is P k =(x k ,y k ), the initial size of the center point is (w k ,h k ), the width of the connected domain and the angle between the diagonal are calculated by the center point and the initial size, and the formula is as follows:

[0044]

[0045] in, is half the length of the diagonal of the connected domain, α is the angle between the width of the connected domain and the diagonal, and half the length of the diagonal of the final detection frame is σ′ k Determined by the scale map S, where σ′ k =S(x k ,y k ), and then the width and height of the final detection frame are obtained by angle α, where

[0046]

[0047] w′ k is the width of the final detection box, h′ k is the height of the final detection box.

[0048] Compared with the prior art, the technical solution of this application has at least the following technical effects:

[0049] The present invention has a small amount of calculation for crowd detection in ultra-high density scenes, can achieve better detection effects in coefficient scenes and dense scenes, and can achieve good detection effects in the case of small targets and targets with large scale changes. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0051] Figure 1 This is a flow chart of a method for detecting crowds in densely populated scenes disclosed in an embodiment of the present application. DETAILED DESCRIPTION

[0052] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0053] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit the exemplary embodiments according to the present application. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that when the terms "comprise" and / or "include" are used in this specification, it indicates the presence of features, steps, operations, devices, components and / or combinations thereof.

[0054] Unless otherwise specifically stated, the relative arrangement, numerical expressions and numerical values ​​of the parts and steps set forth in these embodiments do not limit the scope of the present application. At the same time, it should be understood that, for ease of description, the sizes of the various parts shown in the accompanying drawings are not drawn according to the actual proportional relationship. The technology, methods and equipment known to those of ordinary skill in the relevant art may not be discussed in detail, but in appropriate cases, the technology, methods and equipment should be considered as a part of the authorization specification. In all examples shown and discussed here, any specific value should be interpreted as being merely exemplary, rather than as a limitation. Therefore, other examples of exemplary embodiments may have different values. It should be noted that similar reference numerals and letters represent similar items in the following drawings, and therefore, once a certain item is defined in an accompanying drawing, it does not need to be further discussed in subsequent drawings.

[0055] See also Figure 1 As shown, according to an embodiment of the present application, a method for detecting a crowd in a dense scene is provided, and the method is suitable for detecting a crowd in a dense scene. The method mainly includes five steps, which will be described in detail below.

[0056] Step S1: Input the RGB image into the backbone network to extract the feature map.

[0057] In this step, the RGB image is input into the backbone network, which includes VGG-16 or HRNet. The RGB color mode is a color standard in the industry. It is obtained by changing the three color channels of red (R), green (G), and blue (B) and superimposing them on each other to obtain various colors. RGB represents the colors of the three channels of red, green, and blue. This standard almost includes all colors that human vision can perceive. The 16 in the VGG-16 network means that there are 16 layers containing parameters, with a total of about 138 million parameters. The VGG-16 network structure is very regular, without so many hyperparameters, and focuses on building a simple network. There are several convolutional layers followed by a pooling layer that can compress the image size, that is, all use small convolution kernels of 33 and maximum pooling layers of 22, which can simplify the structure of the convolutional neural network. HRNet can connect network structures such as image classification, image segmentation, object detection, face alignment, posture recognition, style transfer, ImageInpainting, super-resolution, optical flow, Depth estimation, edge detection, etc. Of course, in other embodiments of the present application, the backbone network can also be a network of any other process.

[0058] In this step, the feature map extracted by the backbone network satisfies the relationship:

[0059] F = Φ(I; θ e )

[0060] Among them, F is the feature map, Φ is the function of the feature extractor, θ e is the weight of the neural network where the feature extractor is located, I is the RGB image, I∈R H×W×3 , R is a real number, c is the number of channels of the feature map, and H and W are the height and width of the RGB image respectively.

[0061] Step S2: Process the feature map to obtain a confidence map.

[0062] This step is an important step in the present invention. The function of this step is to obtain a confidence map C∈R after processing the feature map F.H×W Specifically, this step includes:

[0063] Step S21: The number of channels of the feature map is changed to 720 through a 1×1 convolution layer;

[0064] Step S22: The size of the feature map is changed to (H / 2, w / 2) through a 2×2 deconvolution layer with a step size of 2;

[0065] Step S23: The number of channels of the feature map is reduced to 32 through a 3×3 convolution layer to reduce the amount of calculation;

[0066] Step S24: Change the size of the feature map to (H, W) through a deconvolution layer;

[0067] Step S25: Output the single-channel confidence map through a 1×1 convolution layer. It should be noted that in order to speed up the convergence speed and prevent overfitting, each convolution layer and deconvolution layer is followed by a batch normalization layer and a ReLU activation function layer.

[0068] The final confidence map satisfies the relationship:

[0069] C = ψ(F; θ c )

[0070] Among them, C is the confidence map, C∈R H×W , ψ is a function of the confidence predictor, θ c is the weight of the neural network where the confidence predictor is located, Indicates the confidence that the target is at position (i, j).

[0071] Step S3: Process the confidence map to obtain a binary map, and use the binary map to obtain crowd location and counting information. This step segments the confidence map by learning a pixel-level threshold map, which can effectively improve the detection effect of small targets and eliminate the influence of overlapping adjacent targets.

[0072] Step S31: A new feature map is obtained by performing a dot product operation on the feature map and the confidence map, wherein the new feature map satisfies the relationship:

[0073]

[0074] Among them, F filter is the new feature map, R is a real number, c is the number of channels of the feature map, H and W are the height and width of the RGB image respectively, represents the dot product operation, D represents the downsampling operation, and C represents the confidence map.

[0075] Step S32: Send the obtained new feature map to the threshold learner to learn a threshold map, where the first three layers of the threshold learner are used to reduce the number of channels, and each layer uses a 3×3 convolution kernel followed by batch normalization and Relu activation function. The last two layers use 3×3 and 1×1 convolution kernels, followed by batch normalization, Relu activation function and average pooling layer. Finally, a customized activation function f(x) is passed, and the activation function f(x) is defined as follows:

[0076]

[0077] At this time, the threshold graph satisfies the relationship:

[0078] T=Φ1(F filter θ t )

[0079] Where T is the threshold map, T∈R H×W , Φ1 is the function of the threshold learner, θ t is the weight of the neural network where the threshold learner is located.

[0080] Step S33: Then, a binary image is obtained according to the threshold image and the confidence image, wherein the binary image satisfies the relationship:

[0081]

[0082] in, is a binary image, η is a function of the threshold image and the confidence image, C is the confidence image, and T is the threshold image.

[0083] Step S3:4: Obtain the results of crowd counting and positioning through the binary image. Surround each connected domain in the binary image with a minimum rectangular frame, the center point of each rectangular frame is the positioning point, and the number of connected domains in the binary image is the number of people in the input image.

[0084] Step S4: Process the feature map to obtain a size map; the size map can be used to represent the scale information of the target.

[0085] Step S41: Send the feature map to four residual blocks in sequence, and change the number of channels of the feature map to 32;

[0086] Step S42: A scale map as large as the RGB image is obtained through two deconvolution layers (each deconvolution layer is followed by a Relu activation function), and the scale map satisfies the relationship:

[0087] S = X(F; θ s )

[0088] Among them, S is the scale graph, S∈R H×W, R is a real number, H and W are the height and width of the RGB image respectively, X is the function of the scale map predictor, F is the feature map, θ s is the weight of the neural network where the scalogram predictor is located.

[0089] Step S5: The size and position of each detection frame are calculated using the binary image and the size image, wherein the center point of each connected domain is the human head positioning point, and the number of connected domains is the number of people in the RGB image.

[0090] In this step, each connected region in the binary graph represents a target. For the kth target, the position of its center point is P k =(x k ,y k ), the initial size of the center point is (w k ,h k ), the width of the connected domain and the angle between the diagonals are calculated by the center point and the initial size. The formula is as follows:

[0091]

[0092] in, is half the length of the diagonal of the connected domain, α is the angle between the width of the connected domain and the diagonal, and σ′ is half the length of the diagonal of the final detection box. k Determined by the scale graph S, where σ′ k =S(x k ,y k ), and then the width and height of the final detection frame are obtained by angle α, where

[0093]

[0094] w′ k is the width of the final detection box, h′ k is the height of the final detection box.

[0095] In order to verify the effect of the present invention, the following simulation experiment can be used to further illustrate:

[0096] (1) Simulation conditions

[0097] The present invention is simulated by using PYCHARM software on an Intel i7-10700F 2.90 GHz CPU, 16 GB memory, a WINDOWS 10 operating system and an RTX 3090.

[0098] (2) Simulation content

[0099] The data used in the simulation are two public datasets, NWPU-Crowd and FDST. The NWPU dataset was proposed by Wang et al. in the paper “Q.Wang, J.Gao, W.Lin, and X.Li,'NWPU-Crowd:A large-scale benchmark for crowd counting and localization,'IEEE Transactions on Pattern Analysis and Machine Intelligence, vol.43, no.6, pp.2141-2149, 2020.” in 2020. It is the largest and most challenging crowd dataset. FDST is a dataset proposed by Fang et al. in “Y.Fang, B.Zhan, W.Cai, S.Gao, and B.Hu,“Locality-constrainedspatial transformer network for video crowd counting,” in Proc.IEEE International Conference on Multimedia and Expo, 2019, pp.814–819.”

[0100] In order to prove the effectiveness of the algorithm, Faster RCNN and Tiny Faces algorithms were selected as comparison algorithms. Faster RCNN is an object detection method proposed in the paper "S. Ren, K. He, R. Girshick, and J. Sun, 'Faster r-cnn: Towards real-time object detection with region proposal networks, 'IEEE Transactions on Pattern Analysis and Machine Intelligence, vol. 39, no. 6, pp. 1137-1149, 2017." Tiny Faces is a face detection method proposed in the paper "P. Hu and D. Ramanan, 'Finding tiny faces, 'in Proc. IEEE Conference on Computer Vision and Pattern Recognition, 2017, pp. 951–959." Using Precision, Recall and AP as evaluation indicators (iou ≥ 0.5), the comparison results on the dataset NWPU-Crowd are shown in Table 1 (the highest value is marked in red), where A0-A5 represent the target size of [1,10], (10,10 2 ],(10 2 ,10 3 ],(10 3 ,10 4 ](10 4 ,10 5 ], greater than 10 5 .

[0101] Table 1: Comparison of experimental results

[0102]

[0103] The comparison results on the FDST dataset are shown in Table 2 (the highest value is marked in red), where A1-A4 represent the target sizes of (10,10 2 ],(10 2 ,10 3 ],(10 3 ,10 4 ](10 4 ,10 5 ].

[0104] Table 2: Comparison of experimental results

[0105]

[0106] It can be seen from Table 1 that the precision and AP of the present invention on the NWPU-Crowd dataset are optimal, and the recall is optimal when the target size is small. It can be seen from Table 2 that all indicators of the present invention are optimal on the FDST dataset. The experimental comparison is sufficient to show the superiority of the present invention in crowd detection in dense scenes.

[0107] In summary, the present invention proposes a concise and novel end-to-end framework to realize crowd detection in high-density scenes, and can also realize the functions of crowd positioning and counting. Compared with the existing methods, the present invention has a small amount of calculation for crowd detection in ultra-high-density scenes, can achieve better detection effects in both coefficient scenes and dense scenes, and can achieve good detection effects in the case of small targets and large changes in target scale.

[0108] For ease of description, spatially relative terms such as "above", "above", "on the upper surface of", "above", etc. may be used here to describe the spatial positional relationship between a device or feature and other devices or features as shown in the figure. It should be understood that spatially relative terms are intended to include different orientations of the device in use or operation in addition to the orientation described in the figure. For example, if the device in the accompanying drawings is inverted, the device described as "above other devices or structures" or "above other devices or structures" will be positioned as "below other devices or structures" or "below other devices or structures". Thus, the exemplary term "above" can include both "above" and "below". The device can also be positioned in other different ways (rotated 90 degrees or in other orientations), and the spatially relative descriptions used here are interpreted accordingly.

[0109] In addition, it should be noted that the use of terms such as "first" and "second" to limit components is only for the convenience of distinguishing the corresponding components. Unless otherwise stated, the above terms have no special meaning and therefore cannot be understood as limiting the scope of protection of this application.

[0110] The above are only preferred embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. A crowd detection method in a dense scene, characterized in that: include: Step S1: Input the RGB image into the backbone network to extract the feature map; Step S2: Processing the feature map to obtain a confidence map; Step S3: Processing the confidence map to obtain a binary map, and using the binary map to obtain crowd positioning and counting information; Step S4: Processing the feature map to obtain a scale map; Step S41: sending the feature map to four residual blocks in sequence, and changing the number of channels of the feature map to 32; Step S44: Obtain a scale map as large as the RGB image through two deconvolution layers, and the scale map satisfies the relationship: S=X(F;θ s ) Where S is the scale graph, S∈R H×W , R is a real number, H and W are the height and width of the RGB image, respectively, X is a function of the scale map predictor, F is the feature map, θ s is the weight of the neural network in which the scalogram predictor is located; Step S5: using the binary image and the scale image to calculate the size and position of each detection frame, wherein the center point of each connected domain is the human head positioning point, and the number of the connected domains is the number of people in the RGB image; Each connected region in the binary graph represents a target. For the kth target, the position of its center point is P k =(x k ,y k ), the initial size of the center point is (w k ,h k ), the width of the connected domain and the angle between the diagonal are calculated by the center point and the initial size, and the formula is as follows: in, is half the length of the diagonal of the connected domain, α is the angle between the width of the connected domain and the diagonal, and half the length of the diagonal of the final detection frame is σ ′ k Determined by the scale map S, where σ ′ k =S(x k ,y k ), and then the width and height of the final detection frame are obtained by angle α, where w ′ k is the width of the final detection box, h ′ k is the height of the final detection box.

2. The crowd detection method in a dense scene according to claim 1, characterized in that: In step S1, the backbone network includes VGG-16 or HRNet.

3. The crowd detection method in a dense scene according to claim 1, characterized in that: In step S1, the feature map extracted by the backbone network satisfies the relationship: F=Φ(I;θ e ) Where, F is the feature map, Φ is the function of the feature extractor, θ e is the weight of the neural network where the feature extractor is located, I is the RGB image, I∈R H×W×3 , R is a real number, c is the number of channels of the feature map, and H and W are the height and width of the RGB image respectively.

4. The crowd detection method in a dense scene according to claim 3, characterized in that: The step S2 comprises: Step S21: The number of channels of the feature map is changed to 720 through a 1×1 convolution layer; Step S22: The size of the feature map is changed to (H / 2, w / 2) through a 2×2 deconvolution layer with a step size of 2; Step S23: reducing the number of channels of the feature map to 32 through a 3×3 convolution layer; Step S24: changing the size of the feature map to (H, W) through a deconvolution layer; Step S25: Output the confidence map of a single channel through a 1×1 convolutional layer, and the confidence map satisfies the relationship: C=ψ(F;θ c ) Where C is the confidence map, C∈R H×W , ψ is a function of the confidence predictor, θ c is the weight of the neural network in which the confidence predictor is located.

5. The crowd detection method in a dense scene according to claim 1, characterized in that: The step S3 comprises: Step S31: performing a dot product operation on the feature map and the confidence map to obtain a new feature map; Step S32: sending the obtained new feature map to a threshold learner to learn a threshold map; Step S33: obtaining the binary image according to the threshold image and the confidence image; Step S34: Obtain the crowd counting and positioning results through the binary image.

6. The crowd detection method in a dense scene according to claim 5, characterized in that: The new feature map satisfies the relationship: Among them, F filter is the new feature map, R is a real number, c is the number of channels of the feature map, H and W are the height and width of the RGB image respectively, represents the dot product operation, D is the downsampling operation, and C is the confidence map.

7. The crowd detection method in a dense scene according to claim 6, characterized in that: The threshold map satisfies the relationship: T=Φ1(F filter ;θ t ) Where T is the threshold map, T∈R H×W , Φ1 is the function of the threshold learner, θ t is the weight of the neural network where the threshold learner is located.

8. The crowd detection method in a dense scene according to claim 6, characterized in that: The binary graph satisfies the relationship: Among them, B ij is the binary image, η is a function of the threshold image and the confidence image, C is the confidence image, and T is the threshold image.