Crowd analysis method based on density adaptive counting network

Through the method based on density adaptive counting network, the problem of insufficient accuracy of population counting in the prior art under high density and complex backgrounds is solved, and higher counting accuracy and real-time performance are achieved.

CN119625640AActive Publication Date: 2025-03-14SOUTH CHINA NORMAL UNIV
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411766555.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-04
Publication Date
2025-03-14
Estimated Expiration
2044-12-04

AI Technical Summary

Technical Problem

The existing population counting method is insufficient in dealing with high-density populations and complex backgrounds, making it difficult to effectively deal with population density changes and background noise.

Method used

A population analysis method based on density adaptive counting network (DACNet) is proposed, including feature extraction network, feature selection network, adaptive channel focus module and auxiliary point generation network. Through the combination of these modules, people's images under different density conditions can be adaptively processed.

Benefits of technology

Improves the accuracy of population counting, especially in high density and complex contexts, and can effectively identify and count heads in real-time environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119625640A_ABST
    Figure CN119625640A_ABST
Patent Text Reader

Abstract

The invention provides a crowd analysis method based on a density adaptive counting network, and aims to solve the problem of density and proportion change caused by a perspective effect of a camera. The DACNet combines feature extraction and a selection network, and uses advanced semantic features as a spatial attention mechanism to reduce crowd noise. The adaptive channel focusing module enhances the feature representation by integrating a plurality of weights. The auxiliary point generation network generates auxiliary points according to the actual crowd density, provides additional supervision signals and effectively deals with density changes, and the auxiliary point generation network is only introduced in the training period without increasing computing resource consumption in the detection process. Experimental results show that the method has excellent performance in the aspects of crowd positioning and counting, and the applicability in a real scene is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of crowd analysis, and specifically designs a crowd analysis method based on a density adaptive counting network. Background Art

[0002] With the acceleration of urbanization, the safety management of crowded areas has become increasingly important. Crowd counting and localization technologies play a key role in public safety, traffic management, and business intelligence. Traditional crowd counting methods, such as sensor-based methods, usually rely on WiFi signals, radar, or visual image processing techniques. However, these methods face challenges in dealing with high-density crowd scenes because they have difficulty in accurately estimating the size and density of the crowd, especially when the head-shoulder scale and density vary due to changes in camera viewing angle and distance. In recent years, deep learning-based methods have made significant progress in the field of crowd counting. These methods are generally divided into three categories: detection-based methods, mapping-based methods, and point-based methods. Although point-based methods are suitable for real-world scenarios due to their elegant end-to-end process and excellent localization capabilities, they still face challenges in dealing with changes in crowd density in the real world. Specifically, existing methods fail to fully consider the changes in crowd density, resulting in inaccurate matching between point proposals and true target points, limiting the application of these methods in real-world scenarios. In addition, when dealing with individuals in high-density crowds, existing technologies have limited features available for each head due to the close distance between individuals. At the same time, complex backgrounds, such as occlusion, camera angle and distance, introduce serious background noise, which further reduces the accuracy of crowd counting. Therefore, the prior art still has the problem of insufficient accuracy when processing crowd images with complex backgrounds and limited features. Based on this, the present invention proposes a crowd analysis method based on a density adaptive counting network. Summary of the invention

[0003] In order to solve the above problems in the prior art, that is, to solve the problem that the existing crowd counting methods are not accurate enough when processing changes in crowd density in actual scenes. The present invention proposes a crowd analysis method based on a density adaptive counting network, which is used to improve the accuracy of crowd analysis in the real world. In a first aspect of the present invention, a crowd analysis method based on a density adaptive counting network is proposed, and the method comprises:

[0004] Step S100, acquiring a crowd image based on an image capture device as an input image;

[0005] Step S200, inputting the input image into the trained density adaptive counting network DACNet to perform crowd analysis to obtain the number and location of the crowd;

[0006] The density adaptive counting network DACNet includes a feature extraction network, a feature selection network, an adaptive channel focusing module and an auxiliary point generation network;

[0007] The feature extraction network is composed of the first 13 layers of the VGG-16 network to capture the multi-scale features of the image, which are represented as a set of feature maps F = {F 1 ,F 2 ,F 3 ,F 4};

[0008] The feature selection network comprises a feature selection unit and an improved feature fusion unit;

[0009] The feature selection unit is configured to select the high-order feature F i+1 Perform bicubic interpolation to obtain features Use transposed convolution Expand the convolution kernel size to 3×3 and the step size to 2 to obtain the feature F att ; Use the coordinate attention mechanism to F att Transform and generate feature F weight ; By low-level feature F i and F weight Multiply them together to get the feature F' i , where i = 1, 2, 3, 4;

[0010] The improved feature fusion unit is configured to convert the up-sampled P i+1 With characteristic F' i Splice and get feature P i ;P i After the merging layer processing, the final output feature P is obtained i , i=1,2,3,4;

[0011] The merging layer is constructed based on a plurality of convolutional layers, batch normalization layers, and nonlinear activation functions connected in sequence;

[0012] The adaptive channel focusing module includes a multi-branch attention generation unit and an attention selection unit;

[0013] The multi-branch attention generation unit is configured to generate the feature P output by the feature selection network. i , where i = 1, 2, 3, 4, after up- and down-sampling to the same dimension, the splicing operation is performed to obtain the feature Capture features through average pooling and maximum pooling operations The spatial information of avg and M max ; M avg and Mmax Input into N scale-aware networks (SAM) of different scales to generate corresponding branch weights, expressed as:

[0014]

[0015] Where c=1,2,…,C represents The c-th channel of , n=1,2,…,N represents the n-th SAM, σ represents the sigmoid function operation, δ represents the ReLU function operation, con n Represents the convolution operation of the nth SAM;

[0016] The scale-aware network (SAM) is constructed based on sequentially connected convolutional layers, ReLU functions, and sigmoid functions. In the present invention, the convolution kernel sizes are 1×1 and 3×3;

[0017] The attention selection unit is configured to select N branch weights W c,n From the first dimension, that is, the channel dimension, we can get Through the softmax function Perform soft attention selection to adaptively select information from different scales and obtain Using block operations Split along the channel dimension to obtain the reweighted branch weight W' c,n ; Weight each branch W' c,n Both with input features Multiply them together to get N weighted features N weighted features Perform the addition operation to obtain the final feature output P';

[0018] The auxiliary point generation network includes an auxiliary point radius calculation unit, an auxiliary point generation unit, and a loss function calculation unit;

[0019] The auxiliary point radius calculation unit is configured to calculate the radius of the given true value point coordinates. Where M is the total number of true value point coordinates, and the local density ρ of each true value point is calculated. l ; According to the KD tree algorithm, find the k neighbor nodes closest to each true value point, and calculate where dist(t l ,t j ) represents node t l ,t j The Euclidean distance between the two points, ε is a small constant to avoid the denominator being 0; for each truth point t l Estimate the radii of positive and negative auxiliary points:

[0020]

[0021] in and Indicates positive and negative radius, R pos and R neg Indicates the positive and negative radius of the baseline, α and β are the adjustment parameters of the positive and negative radius;

[0022] The auxiliary point generating unit is configured to generate a plurality of auxiliary points at each true value point coordinate t l Around, generate k according to the adjusted auxiliary point radius pos Positive auxiliary points and k neg Negative auxiliary points The range of positive auxiliary points is The generation range of negative auxiliary points is within Inner; positive auxiliary point and negative auxiliary points The coordinate generation method is:

[0023]

[0024] in, and is A uniformly distributed random value in the range, and is A random value uniformly distributed in the range;

[0025] The loss function calculation unit is configured to calculate the matching loss L between the model prediction point and the real target point total , the calculation method is:

[0026]

[0027] Among them, L cls is the classification loss, L loc is the localization loss, λ 2 , 5 and λ 6 is the weight coefficient used to balance different loss terms;

[0028] The classification loss L cls and the localization loss L loc The calculation formula is:

[0029]

[0030] Among them, Q is the number of all matching points, Represents the confidence prediction value, ξ is a variable representing neg and pos.

[0031] The positive auxiliary point loss and negative auxiliary point loss The calculation formula is:

[0032]

[0033] in, and are the confidence prediction values ​​of the positive and negative auxiliary points, t l is the coordinate of the real target point, and are the predicted coordinates of the positive and negative auxiliary points, respectively, 3 and λ 4 is the weight coefficient used to balance the loss term.

[0034] By minimizing the total loss L total , the model can learn the ability to accurately predict the location of target points under different density conditions.

[0035] In some preferred embodiments, the density adaptive counting network DACNet is trained by:

[0036] Step A100, obtaining an input crowd image and a corresponding true value image, and preprocessing the input crowd image;

[0037] Step A200, input the preprocessed crowd image into the density adaptive counting network DACNet, the network outputs the predicted number of people and location coordinates, and generates positive and negative auxiliary points around each true value point;

[0038] Step A300, obtaining the classification loss L according to the predicted number and position coordinates of the crowd on the crowd counting image and the number and position coordinates of the crowd on the true value image cls and the localization loss L loc , the auxiliary point loss is obtained by counting the matching between the auxiliary point and the true value point and Add up all the losses to get the total loss L total , and then back-propagation is performed to update the parameters of the density adaptive counting network DACNet model;

[0039] Step A400, loop A100-A300 until a trained density adaptive counting network DACNet model is obtained.

[0040] In some preferred implementations, the input crowd image is preprocessed by:

[0041] Each input image is randomly cropped into four 128×128 image patches;

[0042] Each image block is randomly flipped horizontally with a probability of 0.5;

[0043] The second aspect of the present invention proposes a density-adaptive counting network crowd analysis system, comprising an image acquisition module, a data processing module, a result output module, and a power supply module;

[0044] The image acquisition module is configured to automatically capture crowd images in a predetermined monitoring area using an image sensor (such as a camera);

[0045] The data processing module is configured to input the acquired crowd images into the trained density adaptive counting network DACNet for real-time processing to accurately estimate the number and location of the crowd in each image; the result output module is configured to output the crowd counting and positioning information in the crowd image by the density adaptive counting network DACNet model, which can be used for real-time monitoring, security alarm or other intelligent analysis applications;

[0046] The power supply module is configured to supply power to the image acquisition module, the data processing module, and the result output module.

[0047] In a third aspect of the present invention, a device is proposed, comprising: at least one processor; and a memory communicatively connected to at least one of the processors; wherein the memory stores instructions executable by the processor, and the instructions are used to be executed by the processor to implement the above-mentioned crowd analysis method based on density adaptive counting network.

[0048] Beneficial effects of the present invention:

[0049] (1) The auxiliary point generation network proposed in the present invention effectively solves the problem of crowd density changes caused by camera viewing angle and shooting angle, and improves the counting accuracy.

[0050] (2) The density adaptive counting network DACNet proposed in this paper performs well in processing complex background noise and can accurately identify and count heads in crowd images.

[0051] (3) The present invention provides an effective solution to the problem of crowd counting in the real world while ensuring high accuracy and real-time performance. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] Other features, objects and advantages of the present application will become more apparent by reading the detailed description of non-limiting embodiments made with reference to the following drawings:

[0053] Figure 1It is a flow chart of a method for analyzing a crowd based on a density-adaptive counting network according to an embodiment of the present invention;

[0054] Figure 2 It is a schematic diagram of a framework of a density-adaptive counting network crowd analysis system according to an embodiment of the present invention;

[0055] Figure 3 is a collected crowd image and a corresponding true value image according to an embodiment of the present invention;

[0056] Figure 4 It is a schematic diagram comparing the output result and the true value result of the density adaptive counting network crowd analysis method according to an embodiment of the present invention;

[0057] Figure 5 It is a schematic diagram of the dynamic counting result of campus human flow based on the density adaptive counting network crowd analysis method according to an embodiment of the present invention;

[0058] Figure 6 It is a schematic diagram of the training process of a density-adaptive counting network crowd analysis method according to an embodiment of the present invention; Figure 7 It is a loss function variation trend diagram of a density adaptive counting network crowd analysis method according to an embodiment of the present invention; Figure 8 It is a schematic diagram of the overall process of a density-adaptive counting network crowd analysis method according to an embodiment of the present invention; Fig. 9 It is a network structure diagram of a density adaptive counting network DACNet based on a density adaptive counting network crowd analysis method according to an embodiment of the present invention. DETAILED DESCRIPTION

[0059] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0060] The present application will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the relevant inventions, rather than to limit the invention. It should be noted that, in the absence of conflict, the embodiments in the present application and the features in the embodiments can be combined with each other.

[0061] The training process of the density adaptive counting network DACNet of the first embodiment of the present invention is as follows: Figure 6 As shown, the following steps are included:

[0062] Step A100, obtaining an input crowd image and a corresponding true value image, and preprocessing the input crowd image;

[0063] In this embodiment, the crowd image to be analyzed and the corresponding label data are first obtained. In the present invention, it is preferred to select images from the UCF CC 50 and Beijing-BRT datasets, such as Figure 3 (a) is shown in the figure, (b) is the corresponding label image, and then the selected image is preprocessed. The preprocessing process is as follows:

[0064] Each input image is randomly cropped into four 128×128 image patches;

[0065] Each image block is randomly flipped horizontally with a probability of 0.5;

[0066] Step A200, inputting the preprocessed crowd image into the density adaptive counting network DACNet, and the network outputs a predicted crowd counting image;

[0067] In this embodiment, the density adaptive counting network DACNet includes a feature extraction network, a feature selection network, an adaptive channel focusing module, and an auxiliary point generation network;

[0068] Fig. 9 The network structure diagram of the density adaptive counting network DACNet is shown;

[0069] The feature extraction network consists of the first 13 layers of the VGG-16 network to capture the multi-scale features of the image. The VGG-16 network has been pre-trained using the ImageNet dataset. The output features are represented as a set of feature maps F = {F 1 ,F 2 ,F 3 ,F 4}, F 1 ~F 4 The sizes are: 8×8, 16×16, 32×32, 64×64;

[0070] The feature selection network includes a feature selection unit and an improved feature fusion unit;

[0071] The feature selection unit is configured to select the high-order feature F i+1 Perform bicubic interpolation to obtain features Use transposed convolution Expand the convolution kernel size to 3×3 and the step size to 2 to obtain the feature F att ; Use the coordinate attention mechanism to F attTransform and generate feature F weight ; By low-level feature F i and F weight Multiply them together to get the feature F' i , where i = 1, 2, 3, 4;

[0072] The improved feature fusion unit is configured to convert the up-sampled P i+1 With feature F' i Splice and get feature FP i FP i After the merging layer processing, the final output feature P is obtained i , i=1,2,3,4,P 1 ~P 4 The sizes are: 8×8, 16×16, 32×32, 64×64;

[0073] The merging layer is constructed based on two convolutional layers, two batch normalization layers, and two Sigmoid activation functions connected in sequence;

[0074] The adaptive channel focusing module includes a multi-branch attention generation unit and an attention selection unit;

[0075] The multi-branch attention generation unit is configured to generate the feature P output by the feature selection network. i , where i = 1, 2, 3, 4, after up- and down-sampling to the same dimension, the splicing operation is performed to obtain the feature The size is 16×1616×16; features are captured through average pooling and maximum pooling operations The spatial information of avg and M max ; M avg and M max Input into two scale-aware networks (SAM) of different scales to generate corresponding branch weights, expressed as:

[0076]

[0077] Where c=1,2,3 means channels, n = 1, 2 represents the corresponding SAM, σ represents the sigmoid function operation, δ represents the ReLU function operation, con n Represents the convolution operation of the nth SAM;

[0078] The scale-aware network (SAM) is constructed based on sequentially connected convolutional layers, ReLU functions, and sigmoid functions. In the present invention, the convolution kernel sizes are 1×1 and 3×3;

[0079] The attention selection unit is configured to convert the two branch weights W c,n From the first dimension, that is, the channel dimension, we can get Through the softmax function Perform soft attention selection to adaptively select information from different scales and obtain Using block operations Split along the channel dimension to obtain the reweighted branch weight W' c,n ; Weight each branch W' c,n Both with input features Multiply them together to get 2 weighted features The two weighted features Perform the addition operation to obtain the final feature output P', with a size of 16×16;

[0080] The auxiliary point generation network includes an auxiliary point radius calculation unit, an auxiliary point generation unit, and a loss function calculation unit;

[0081] The auxiliary point radius calculation unit is configured to calculate the radius of the given true value point coordinates. Where M = 2000 is the total number of true value point coordinates, and the local density ρ of each true value point is calculated l ; According to the KD tree algorithm, find the two neighbor nodes closest to each true value point, and calculate where dist(t l ,t j ) represents node t l ,t j The Euclidean distance between the two points, ε is a small constant to avoid the denominator being 0, and is set to 0.0001 in the present invention; for each truth point t l Estimate the radii of positive and negative auxiliary points:

[0082]

[0083] in and Indicates positive and negative radius, R pos and R neg represents the positive and negative radii of the baseline, which are 3 and 10 respectively, α and β are the adjustment parameters of the positive and negative radii, which are 100 and 50 respectively;

[0084] The auxiliary point generating unit is configured to generate a plurality of auxiliary points at each true value point coordinate t l Around, generate 2 positive auxiliary points according to the adjusted auxiliary point radius and 2 negative auxiliary points The range of positive auxiliary points is The generation range of negative auxiliary points is within Inner; positive auxiliary point and negative auxiliary points The coordinate generation method is:

[0085]

[0086] in, and is A uniformly distributed random value in the range, and is A random value uniformly distributed in the range;

[0087] Step A300, calculating the loss function L according to the predicted number and position coordinates of the crowd on the crowd counting image and the number and position coordinates of the crowd on the true value image total , and then back-propagation is performed to update the parameters of the density adaptive counting network DACNet model;

[0088] The loss function L total , the calculation method is:

[0089]

[0090] Among them, L cls is the classification loss, L loc is the localization loss, λ 2 =0.0002, λ 5 = 0.3 and λ 6 =0.2 is the weight coefficient used to balance different loss terms;

[0091] The classification loss L cls and the localization loss L loc The calculation formula is:

[0092]

[0093] Among them, Q = 3000 is the number of all matching points, Represents the confidence prediction value, ξ is a variable representing neg and pos.

[0094] The positive auxiliary point loss and negative auxiliary point loss The calculation formula is:

[0095]

[0096] in, and are the confidence prediction values ​​of the positive and negative auxiliary points, t lis the coordinate of the real target point, and are the predicted coordinates of the positive and negative auxiliary points, respectively, 3 = 0.00015 and λ 4 = 0.0002 is the weight coefficient used to balance the loss term. By minimizing the total loss L total , the model can learn the ability to accurately predict the location of target points under different density conditions.

[0097] Step A400, loop A100-A300 until a trained density adaptive counting network DACNet model is obtained.

[0098] Figure 7 The changing trends of classification loss, regression loss, mean absolute error, and mean square error are shown as the number of training rounds changes.

[0099] Figure 8 The overall process diagram of the method of the present invention is shown, including the model training process and the model detection process.

[0100] The crowd analysis method based on density adaptive counting network of the second embodiment of the present invention is as follows: Figure 1 As shown, the following steps are included:

[0101] Step S100, acquiring a crowd image based on an image capture device as an input image;

[0102] In this embodiment, the crowd image to be analyzed is preferably acquired by a camera device, wherein the camera device is existing and will not be described in detail here.

[0103] Step S200, input the input image into the trained density adaptive counting network DACNet to perform crowd analysis to obtain the number and location of the crowd.

[0104] like Figure 4 Shown is the comparison between the true value image and the crowd analysis image predicted by the model.

[0105] In this embodiment, the learning rate of the density adaptive counting network DACNet is set to 0.00005.

[0106] A crowd analysis system based on a density adaptive counting network according to a third embodiment of the present invention is as follows: Figure 2 As shown, it includes an image acquisition module, a data processing module, a result output module, and a power supply module;

[0107] The image acquisition module is configured to automatically capture crowd images in a predetermined monitoring area using a camera;

[0108] The data processing module is configured to input the acquired crowd images into the trained density adaptive counting network DACNet for real-time processing to accurately estimate the number and location of the crowd in each image;

[0109] The result output module is configured as a density adaptive counting network DACNet model to output crowd counting and positioning information in the crowd image, which can be used for real-time monitoring, security alarms or other intelligent analysis applications;

[0110] The power supply module is configured to supply power to the image acquisition module, the data processing module, and the result output module.

[0111] like Figure 5 As shown, the system of the present invention is used to detect the number of people in real time, record the average number of people every 5 minutes, and display the change of the number of people in real time.

[0112] So far, the technical solutions of the present invention have been described in conjunction with the preferred embodiments shown in the accompanying drawings. However, it is easy for those skilled in the art to understand that the protection scope of the present invention is obviously not limited to these specific embodiments. Without departing from the principle of the present invention, those skilled in the art can make equivalent changes or substitutions to the relevant technical features, and the technical solutions after these changes or substitutions will fall within the protection scope of the present invention.

Claims

1. A crowd analysis method based on density adaptive counting network, characterized in that: The method comprises the following steps: Step S100, acquiring a crowd image based on an image capture device as an input image; Step S200, inputting the input image into the trained density adaptive counting network DACNet to perform crowd analysis to obtain the number and location of the crowd; The density adaptive counting network DACNet includes a feature extraction network, a feature selection network, an adaptive channel focusing module and an auxiliary point generation network.

2. The crowd analysis method of density adaptive counting network according to claim 1, characterized in that: The feature extraction network consists of the first 13 layers of the VGG-16 network to capture the multi-scale features of the image, which are represented as a set of feature maps F = {F1, F2, F3, F4}.

3. The crowd analysis method of density adaptive counting network according to claim 1, characterized in that: The feature selection network comprises a feature selection unit and an improved feature fusion unit; The feature selection unit is configured to select the high-order feature F i+1 Perform bicubic interpolation to obtain features Use transposed convolution Expand the convolution kernel size to 3×3 and the step size to 2 to obtain the feature F att ; Use the coordinate attention mechanism to F att Transform and generate feature F weight ; By low-level feature F i and F weight Multiply them together to get the feature F' i , where i = 1, 2, 3, 4; The improved feature fusion unit is configured to convert the up-sampled P i+1 With characteristic F' i Splice and get feature P i ;P i After the merging layer processing, the final output feature P is obtained i , i=1,2,3,4; The merging layer is constructed based on a plurality of convolutional layers, batch normalization layers, and non-linear activation functions connected in sequence.

4. The crowd analysis method of density adaptive counting network according to claim 1, characterized in that: The adaptive channel focusing module includes a multi-branch attention generation unit and an attention selection unit; The multi-branch attention generation unit is configured to generate the feature P output by the feature selection network. i , where i = 1, 2, 3, 4, after up- and down-sampling to the same dimension, the splicing operation is performed to obtain the feature Capturing features through average pooling and max pooling operations The spatial information of avg and M max ; M avg and M max Input into N scale-aware networks (SAM) of different scales to generate corresponding branch weights, expressed as: Where c=1,2,…,C represents The c-th channel of , n=1,2,…,N represents the n-th SAM, σ represents the sigmoid function operation, δ represents the ReLU function operation, con n Represents the convolution operation of the nth SAM; The scale-aware network (SAM) is constructed based on sequentially connected convolutional layers, ReLU functions, and sigmoid functions. In the present invention, the convolution kernel sizes are 1×1 and 3×3; The attention selection unit is configured to select N branch weights W c,n From the first dimension, that is, the channel dimension, we can get Through the softmax function Perform soft attention selection to adaptively select information from different scales and obtain Using block operations Split along the channel dimension to obtain the reweighted branch weight W' c,n ; Weight each branch W' c,n Both with input features Multiply them together to get N weighted features N weighted features Perform the addition operation to obtain the final feature output P'.

5. The crowd analysis method of density adaptive counting network according to claim 1, characterized in that: The auxiliary point generation network includes an auxiliary point radius calculation unit, an auxiliary point generation unit, and a loss function calculation unit; The auxiliary point generation network is only used during model training and will not be used during the actual detection process, that is, it will not increase the computing resources of the detection; The auxiliary point radius calculation unit is configured to calculate the radius of the given true value point coordinates. Where M is the total number of true value point coordinates, and the local density ρ of each true value point is calculated. l ; According to the KD tree algorithm, find the k neighbor nodes closest to each true value point, and calculate where disr(t l ,t j ) represents node t l ,t j The Euclidean distance between the two points, ε is a small constant to avoid the denominator being 0; for each truth point t l Estimate the radii of positive and negative auxiliary points: in and Indicates positive and negative radius, R pos and R neg Indicates the positive and negative radius of the baseline, α and β are the adjustment parameters of the positive and negative radius; The auxiliary point generating unit is configured to generate a plurality of auxiliary points at each true value point coordinate t l Around, generate k according to the adjusted auxiliary point radius pos Positive auxiliary points and k neg Negative auxiliary points The range of positive auxiliary points is The generation range of negative auxiliary points is within Inner; positive auxiliary point and negative auxiliary points The coordinate generation method is: in, and is A uniformly distributed random value in the range, and is A random value uniformly distributed in the range; The loss function calculation unit is configured to calculate the matching loss L between the model prediction point and the real target point total , the calculation method is: Among them, L cls is the classification loss, L loc is the positioning loss, λ2, λ5 and λ6 are weight coefficients used to balance different loss terms; The classification loss L cls and the localization loss L loc The calculation formula is: Among them, Q is the number of all matching points, Represents the confidence prediction value, ξ is a variable representing neg and pos. The positive auxiliary point loss and negative auxiliary point loss The calculation formula is: in, and are the confidence prediction values ​​of the positive and negative auxiliary points, t l is the coordinate of the real target point, and are the predicted coordinates of the positive and negative auxiliary points, respectively, and λ3 and λ4 are the weight coefficients used to balance the loss term.

6. The crowd analysis method based on density adaptive counting network according to claim 1 is characterized in that: The density adaptive counting network DACNet, its training method is: Step A100, obtaining an input crowd image and a corresponding true value image, and preprocessing the input crowd image; Step A200, input the preprocessed crowd image into the density adaptive counting network DACNet, the network outputs the predicted number of people and location coordinates, and generates positive and negative auxiliary points around each true value point; Step A300, obtaining the classification loss L according to the predicted number and position coordinates of the crowd on the crowd counting image and the number and position coordinates of the crowd on the true value image cls and the localization loss L loc , the auxiliary point loss is obtained by counting the matching between the auxiliary point and the true value point and Add up all the losses to get the total loss L total , and then back-propagation is performed to update the parameters of the density adaptive counting network DACNet model; Step A400, loop A100-A300 until a trained density adaptive counting network DACNet model is obtained.

7. Preprocessing the input crowd image according to claim 6, characterized in that: The method is: Each input image is randomly cropped into four 128×128 image patches; Each image patch is randomly flipped horizontally with probability 0.5.

Citation Information

Patent Citations

  • Crowd density estimation method based on double-track heterogeneous type

    CN117953425A

  • Crowd counting method and system based on double-path multi-scale fusion network

    CN118644486A

  • Crowd counting method based on adaptive global perception and multi-scale feature fusion

    CN119048993A