A Population Analysis Method Based on Density Adaptive Counting Network

By using feature extraction and auxiliary point generation networks based on the density adaptive counting network DACNet, the problem of insufficient crowd counting accuracy in high-density crowds and complex backgrounds is solved, achieving high accuracy and real-time performance in real-world counting.

CN119625640BActive Publication Date: 2025-10-28SOUTH CHINA NORMAL UNIV
View PDF 2 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

Existing crowd counting methods are not accurate enough when dealing with high-density crowds and complex backgrounds, especially when density changes are caused by changes in camera angle and distance, making it difficult to accurately estimate crowd size and location.

Method used

A density-adaptive counting network (DACNet) is used, which includes a feature extraction network, a feature selection network, an adaptive channel focusing module, and an auxiliary point generation network. Population analysis is performed using DACNet, and the adaptive channel focusing module and auxiliary point generation network are used to improve counting accuracy.

Benefits of technology

It effectively solves the problem of crowd density changes caused by camera perspective and complex backgrounds, improves the accuracy and real-time performance of crowd counting, and can accurately identify and count heads in high-density crowds.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119625640B_ABST
    Figure CN119625640B_ABST
Patent Text Reader

Abstract

This invention proposes a crowd analysis method based on a density-adaptive counting network, aiming to overcome the density and scale variations caused by camera perspective effects. DACNet combines feature extraction and selection networks, utilizing high-level semantic features as a spatial attention mechanism to reduce crowd noise. The adaptive channel focusing module enhances feature representation by integrating multiple weights. An auxiliary point generation network generates auxiliary points based on the actual crowd density, providing additional supervision signals and effectively addressing density variations. Furthermore, the auxiliary point generation network is introduced only during training and does not increase computational resource consumption during detection. Experimental results demonstrate that this method performs excellently in both crowd localization and counting, improving its applicability in real-world scenarios.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of population analysis, specifically designing a population analysis method based on a density adaptive counting network. Background Technology

[0002] With the acceleration of urbanization, the safety management of densely populated areas has become increasingly important. Crowd counting and localization technologies play a crucial role in public safety, traffic management, and business intelligence. Traditional crowd counting methods, such as sensor-based methods, typically rely on WiFi signals, radar, or visual image processing techniques. However, these methods face challenges in handling high-density crowd scenes because they struggle to accurately estimate crowd size and density, especially given changes in head-shoulder scale and density caused by variations in camera viewpoint and distance. In recent years, deep learning-based methods have made significant progress in crowd counting. These methods are generally categorized into three types: detection-based methods, mapping-based methods, and point-based methods. While 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 handling real-world crowd density variations. Specifically, existing methods fail to adequately account for changes in crowd density, leading to inaccurate matching between point proposals and real target points, limiting their application in real-world scenarios. Furthermore, when dealing with individuals in high-density crowds, existing technologies suffer from limited features available for each head due to the close proximity of individuals. Meanwhile, complex backgrounds, such as occlusion, camera angle, and distance, introduce significant background noise, further reducing the accuracy of crowd counting. Therefore, existing technologies still suffer from insufficient accuracy when processing crowd images with complex backgrounds and limited features. Based on this, this invention proposes a crowd analysis method based on a density-adaptive counting network. Summary of the Invention

[0003] To address the aforementioned problems in existing technologies, specifically the insufficient accuracy of current crowd counting methods when handling changes in crowd density in real-world scenarios, this invention proposes a crowd analysis method based on a density-adaptive counting network. This method aims to improve the accuracy of crowd analysis in the real world. A first aspect of this invention proposes a crowd analysis method based on a density-adaptive counting network, comprising:

[0004] Step S100: Acquire a crowd image using an image capture device as the input image;

[0005] Step S200: Input the input image into the trained density adaptive counting network DACNet for 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 consists of the first 13 layers of a VGG-16 network to capture multi-scale features of the image, which are represented as a set of feature maps F = {F1, F2, F3, F4}.

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

[0009] The feature selection unit is configured to select higher-order features F i+1 Features obtained by bicubic interpolation Using transposed convolution pairs To expand the convolution kernel, the kernel size is 3×3 and the stride is 2, resulting in feature F. att Using coordinate attention mechanism for F att Perform the transformation to generate feature F weight ; by low-level feature F i and F weight Multiplying them together yields the characteristic F'. i Where i = 1, 2, 3, 4;

[0010] The improved feature fusion unit is configured to process the upsampled P... i+1 With feature F' i By concatenating the features, we obtain feature P. i ;P i After processing by the merging layer, the final output feature P is obtained. i , i = 1, 2, 3, 4;

[0011] The merging layer is constructed based on a series of sequentially connected convolutional layers, batch normalization layers, and nonlinear activation functions.

[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 features P output by the feature selection network. i Where i = 1, 2, 3, 4, after upsampling and downsampling to the same dimension, a concatenation operation is performed to obtain the features. Features are captured through average pooling and max pooling operations. Spatial information is used to obtain two feature maps M. avg and M max ; M avg and M max The input is fed into N scale-aware networks (SAMs) of different scales, generating corresponding branch weights, represented as follows:

[0014]

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

[0016] The scale-aware network (SAM) is constructed based on sequentially connected convolutional layers, ReLU function, and sigmoid function. In this invention, the convolutional kernel size is 1×1 and 3×3.

[0017] The attention selection unit is configured to select N branch weights W c,n Starting from the first dimension, namely the channel dimension, we concatenate the data to obtain... Using the softmax function Soft attention selection is performed to adaptively select information from different scales, resulting in... Use block operations By splitting along the channel dimension, the reweighted branch weights W' are obtained. c,n ; Set the weight W' of each branch c,n All related to input features Multiplying them together yields 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 a given true point. Where M is the total number of truth point coordinates, and the local density ρ is calculated for each truth point. l The KD-tree algorithm is used to find the k nearest neighbor nodes to each truth value, and then the calculation is performed. where dist(t) l ,t j ) represents node t l ,t j The Euclidean distance between them, ε is a very small constant to avoid the denominator being zero; for each truth point t l Estimate the radii of the positive and negative auxiliary points:

[0020]

[0021] in and R represents the positive and negative radii. pos and R neg These represent the positive and negative radii of the baseline, with α and β being the adjustment parameters for the positive and negative radii.

[0022] The auxiliary point generation unit is configured to generate points at each truth point coordinate t. l Around the area, k is generated based on the adjusted radius of the auxiliary points. pos Positive auxiliary points and k neg One negative auxiliary point The range of positive auxiliary points is within Within, the generation range of negative auxiliary points is Inside; Positive auxiliary point and negative auxiliary points The coordinate generation method is as follows:

[0023]

[0024] in, and Is Random values ​​uniformly distributed within a range and Is Random values ​​that are uniformly distributed within a 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 as follows:

[0026]

[0027] Among them, L cls It is classification loss, L loc λ2, λ5, and λ6 are the localization loss, and λ6 are the weighting coefficients used to balance the different loss terms.

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

[0029]

[0030] Where Q is the number of all matching points. ξ represents the confidence prediction value, and ξ 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 These are the confidence prediction values ​​for the positive and negative auxiliary points, respectively, t l These are the coordinates of the actual target point. and λ1 and λ2 are the predicted coordinates of the positive and negative auxiliary points, respectively, and λ3 and λ4 are the weighting coefficients used to balance the loss term.

[0034] By minimizing the total loss L total The model is able to learn 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 as follows:

[0036] Step A100: Obtain the input crowd image and the corresponding ground truth image, and preprocess 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 their location coordinates, and generates positive and negative auxiliary points around each ground truth point.

[0038] Step A300: Based on the predicted crowd count image and the crowd location coordinates, and the ground truth image, obtain the classification loss L. cls and positioning loss L loc The auxiliary point loss is obtained by matching and counting the auxiliary points with the true points. and The total loss L is obtained by adding up all the losses. total Then, backpropagation is performed to update the parameters of the density adaptive counting network DACNet model;

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

[0040] In some preferred embodiments, the input crowd image is preprocessed, and the method is as follows:

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

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

[0043] In a second aspect, the present invention proposes a crowd analysis system based on a density adaptive counting network, 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 images of crowds 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 a trained density adaptive counting network (DACNet) for real-time processing to accurately estimate the number and location of people in each image; the result output module is configured to output the crowd count and location information in the crowd images from the DACNet model, which can then be used for real-time monitoring, security alarms, 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] A third aspect of the invention provides an apparatus 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 to implement the above-described population analysis method based on a density adaptive counting network.

[0048] The beneficial effects of this invention are:

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

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

[0051] (3) This invention provides an effective solution to the problem of counting people in the real world, while ensuring high accuracy and real-time performance. Attached Figure Description

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

[0053] Figure 1 This is a schematic diagram of a crowd analysis method based on density adaptive counting network according to an embodiment of the present invention;

[0054] Figure 2This is a schematic diagram of the framework of a population analysis system based on a density adaptive counting network according to an embodiment of the present invention;

[0055] Figure 3 This is a collection of crowd images and corresponding ground truth images according to one embodiment of the present invention;

[0056] Figure 4 This is a schematic diagram comparing the output results with the true results of a population analysis method based on density adaptive counting network according to an embodiment of the present invention;

[0057] Figure 5 This is a schematic diagram illustrating the dynamic counting results of campus pedestrian traffic using a density-adaptive counting network-based crowd analysis method according to an embodiment of the present invention.

[0058] Figure 6 This is a schematic diagram of the training process of a density-adaptive counting network-based crowd analysis method according to an embodiment of the present invention;

[0059] Figure 7 This is a trend diagram of the loss function of a density-adaptive counting network-based crowd analysis method according to an embodiment of the present invention;

[0060] Figure 8 This is a schematic diagram of the overall process of a population analysis method based on density adaptive counting network according to an embodiment of the present invention;

[0061] Figure 9 This is a network structure diagram of DACNet, a density adaptive counting network based on a crowd analysis method according to an embodiment of the present invention. Detailed Implementation

[0062] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, 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 embodiments of the present invention, not all embodiments. 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.

[0063] The present application will now be described in further detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are for illustrative purposes only and are not intended to limit the invention. It should be noted that, unless otherwise specified, the embodiments and features described herein can be combined with each other.

[0064] The training process of the density adaptive counting network DACNet in the first embodiment of the present invention is as follows: Figure 6 As shown, it includes the following steps:

[0065] Step A100: Obtain the input crowd image and the corresponding ground truth image, and preprocess the input crowd image;

[0066] In this embodiment, the images of the crowd to be analyzed and their corresponding label data are first acquired. In this invention, images are preferably selected from the UCF CC 50 and Beijing-BRT datasets, such as... Figure 3 As shown in (a) and (b) are the corresponding label images, the selected images are then preprocessed. The preprocessing process is as follows:

[0067] Each input image is randomly cropped into four 128×128 image blocks;

[0068] Each image patch is randomly flipped horizontally with a probability of 0.5;

[0069] Step A200: Input the preprocessed crowd image into the density adaptive counting network DACNet, and the network outputs the predicted crowd count image;

[0070] 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;

[0071] Figure 9 The network structure diagram of the density adaptive counting network DACNet is shown;

[0072] The feature extraction network consists of the first 13 layers of the VGG-16 network to capture 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 = {F1, F2, F3, F4}, with the sizes of F1 to F4 being 8×8, 16×16, 32×32, and 64×64, respectively.

[0073] The feature selection network includes feature selection units and improved feature fusion units;

[0074] The feature selection unit is configured to select higher-order features F i+1 Features obtained by bicubic interpolation Using transposed convolution pairs To expand the convolution kernel, the kernel size is 3×3 and the stride is 2, resulting in feature F. att Using coordinate attention mechanism for F att Perform the transformation to generate feature F weight ; by low-level feature F i and F weight Multiplying them together yields the characteristic F'. i Where i = 1, 2, 3, 4;

[0075] The improved feature fusion unit is configured to process the upsampled P... i+1 With feature F' i By splicing, we obtain the feature FP. i ;FP i After processing by the merging layer, the final output feature P is obtained. i , i = 1, 2, 3, 4, the dimensions of P1 to P4 are respectively: 8×8, 16×16, 32×32, 64×64;

[0076] The merging layer is constructed based on two convolutional layers, two batch normalization layers, and two sigmoid activation functions connected in sequence.

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

[0078] The multi-branch attention generation unit is configured to generate features P output by the feature selection network. i Where i = 1, 2, 3, 4, after upsampling and downsampling to the same dimension, a concatenation operation is performed to obtain the features. The dimensions are 16×16×16; features are captured through average pooling and max pooling operations. Spatial information is used to obtain two feature maps M. avg and M max ; M avg and M max The input is fed into two scale-aware networks (SAMs) at different scales, generating corresponding branch weights, as follows:

[0079]

[0080] Where c = 1, 2, 3 represents The channels, n=1,2 represent the corresponding SAM, σ represents the sigmoid function operation, δ represents the ReLU function operation, and con n This represents the convolution operation of the nth SAM;

[0081] The scale-aware network (SAM) is constructed based on sequentially connected convolutional layers, ReLU function, and sigmoid function. In this invention, the convolutional kernel size is 1×1 and 3×3.

[0082] The attention selection unit is configured to select the two branch weights W c,n Starting from the first dimension, namely the channel dimension, we concatenate the data to obtain... Using the softmax function Soft attention selection is performed to adaptively select information from different scales, resulting in... Use block operations By splitting along the channel dimension, the reweighted branch weights W' are obtained. c,n ; Set the weight W' of each branch c,n All related to input features Multiplying them together yields two weighted features. Two weighted features Perform the addition operation to obtain the final feature output P', which has a size of 16×16;

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

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

[0085]

[0086] in and R represents the positive and negative radii. pos and R neg The positive and negative radii of the baseline are represented by 3 and 10, respectively, and α and β are the adjustment parameters for the positive and negative radii, respectively, which are 100 and 50.

[0087] The auxiliary point generation unit is configured to generate points at each truth point coordinate t. l Around the target, generate two positive auxiliary points based on the adjusted auxiliary point radius. and 2 negative auxiliary points The range of positive auxiliary points is within Within, the generation range of negative auxiliary points is Inside; Positive auxiliary point and negative auxiliary points The coordinate generation method is as follows:

[0088]

[0089] in, and Is Random values ​​uniformly distributed within a range and Is Random values ​​that are uniformly distributed within a range;

[0090] Step A300: Calculate the loss function L based on the predicted crowd count and location coordinates in the crowd counting image and the ground truth image. total Then, backpropagation is performed to update the parameters of the density adaptive counting network DACNet model;

[0091] The loss function L total The calculation method is as follows:

[0092]

[0093] Among them, L cls It is classification loss, L loc λ2 = 0.0002, λ5 = 0.3 and λ6 = 0.2 are the weighting coefficients used to balance the different loss terms;

[0094] The classification loss L cls and positioning loss L loc The calculation formula is:

[0095]

[0096] Where Q = 3000 is the number of all matching points. ξ represents the confidence prediction value, and ξ is a variable representing neg and pos.

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

[0098]

[0099] in, and These are the confidence prediction values ​​for the positive and negative auxiliary points, respectively, t l These are the coordinates of the actual target point. and λ3 = 0.00015 and λ4 = 0.0002 are the predicted coordinates of the positive and negative auxiliary points, respectively, and are the weighting coefficients used to balance the loss term. By minimizing the total loss L... total The model is able to learn to accurately predict the location of target points under different density conditions.

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

[0101] Figure 7 It shows the changing trends of the four values—classification loss, regression loss, mean absolute error, and mean squared error—as the number of training epochs changes.

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

[0103] The second embodiment of the population analysis method based on density adaptive counting networks of the present invention, such as... Figure 1 As shown, it includes the following steps:

[0104] Step S100: Acquire a crowd image using an image capture device as the input image;

[0105] In this embodiment, it is preferable to acquire images of the crowd to be analyzed using a camera device. The camera device is existing and will not be described in detail here.

[0106] Step S200: Input the input image into the trained density adaptive counting network DACNet for crowd analysis to obtain the number and location of the crowd.

[0107] like Figure 4 As shown, this is a comparison between the ground truth image and the crowd analysis image predicted by the model.

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

[0109] A third embodiment of the present invention provides a population analysis system based on a density-adaptive counting network, such as... Figure 2 As shown, it includes an image acquisition module, a data processing module, a result output module, and a power supply module;

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

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

[0112] The result output module is configured to output crowd counting and location information in crowd images from the Density Adaptive Counting Network (DACNet) model, which can then be used for real-time monitoring, security alarms, or other intelligent analysis applications.

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

[0114] 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 changes in the number of people in real time.

[0115] The technical solution of the present invention has been described above with reference to the preferred embodiments shown in the accompanying drawings. However, it will be readily understood by those skilled in the art that the scope of protection of the present invention is obviously not limited to these specific embodiments. Without departing from the principles 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 such changes or substitutions will all fall within the scope of protection of the present invention.

Claims

1. A population analysis method based on density adaptive counting networks, characterized in that, The method includes the following steps: Step S100: Acquire a crowd image using an image capture device as the input image; Step S200: Input the input image into the trained density adaptive counting network DACNet for 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; 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 features P output by the feature selection network. i Where i = 1, 2, 3, 4, after upsampling and downsampling to the same dimension, a concatenation operation is performed to obtain the features. Features are captured through average pooling and max pooling operations. Spatial information is used to obtain two feature maps M. avg and M max ; M avg and M max The input is fed into N scale-aware networks (SAMs) of different scales, generating corresponding branch weights, represented as follows: Where c = 1, 2, ..., C represents The c-th channel, n = 1, 2, ..., N represents the n-th SAM, σ represents the sigmoid function operation, δ represents the ReLU function operation, and con n This represents the convolution operation of the nth SAM; The scale-aware network (SAM) is constructed based on sequentially connected convolutional layers, ReLU function, and sigmoid function, with convolutional kernel sizes of 1×1 and 3×3; The attention selection unit is configured to select N branch weights W c,n Starting from the first dimension, namely the channel dimension, we concatenate the data to obtain... Using the softmax function Soft attention selection is performed to adaptively select information from different scales, resulting in... Use block operations By splitting along the channel dimension, we obtain the reweighted branch weights W′. c,n ; assign weight W′ to each branch c,n All related to input features Multiplying them together yields N weighted features. N weighted features Perform the addition operation to obtain the final feature output P′; 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 in the actual detection process, that is, it will not increase the computing resources for detection. The auxiliary point radius calculation unit is configured to calculate the radius of a given true point. Where M is the total number of truth point coordinates, and the local density ρ is calculated for each truth point. l The KD-tree algorithm is used to find the k nearest neighbor nodes to each truth value, and then the calculation is performed. where dist(t) l ,t j ) represents node t l ,t j The Euclidean distance between them, ε is a very small constant to avoid the denominator being zero; for each truth point t l Estimate the radii of the positive and negative auxiliary points: in and R represents the positive and negative radii. pos and R neg These represent the positive and negative radii of the baseline, with α and β being the adjustment parameters for the positive and negative radii. The auxiliary point generation unit is configured to generate points at each truth point coordinate t. l Around the area, k is generated based on the adjusted radius of the auxiliary points. pos Positive auxiliary points and k neg One negative auxiliary point The range of positive auxiliary points is within Within, the generation range of negative auxiliary points is Inside; Positive auxiliary point and negative auxiliary points The coordinate generation method is as follows: in, and Is Random values ​​uniformly distributed within a range and Is Random values ​​that are uniformly distributed within a 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 as follows: Among them, L cls It is classification loss, L loc λ2, λ5, and λ6 are the localization loss, and λ6 are the weighting coefficients used to balance the different loss terms. The classification loss L cls and positioning loss L loc The calculation formula is: Where Q is the number of all matching points. ξ represents the confidence prediction value, and is a variable representing neg and pos; The positive auxiliary point loss and negative auxiliary point loss The calculation formula is: in, and These are the confidence prediction values ​​for the positive and negative auxiliary points, respectively, t l These are the coordinates of the actual target point. and λ1 and λ2 are the predicted coordinates of the positive and negative auxiliary points, respectively, and λ3 and λ4 are the weighting coefficients used to balance the loss term.

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

3. The population analysis method using a density-adaptive counting network according to claim 1, characterized in that, The feature selection network includes a feature selection unit and an improved feature fusion unit; The feature selection unit is configured to select higher-order features F i+1 Features obtained by bicubic interpolation Using transposed convolution pairs To expand the convolution kernel, the kernel size is 3×3 and the stride is 2, resulting in feature F. att Using coordinate attention mechanism for F att Perform the transformation to generate feature F weight ; by low-level feature F i and F weight Multiplying them together yields the feature F′. i Where i = 1, 2, 3, 4; The improved feature fusion unit is configured to process the upsampled P... i+1 With feature F′ i By concatenating the features, we obtain feature P. i ;P i After processing by the merging layer, the final output feature P is obtained. i , i = 1, 2, 3, 4; The merging layer is constructed based on multiple sequentially connected convolutional layers, batch normalization layers, and nonlinear activation functions.

4. The crowd analysis method based on density adaptive counting networks according to claim 1, characterized in that, The density-adaptive counting network DACNet is trained as follows: Step A100: Obtain the input crowd image and the corresponding ground truth image, and preprocess 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 their location coordinates, and generates positive and negative auxiliary points around each ground truth point. Step A300: Based on the predicted crowd count image and the crowd location coordinates, and the ground truth image, obtain the classification loss L. cls and positioning loss L loc The auxiliary point loss is obtained by matching and counting the auxiliary points with the true points. and The total loss L is obtained by adding up all the losses. total Then, backpropagation is performed to update the parameters of the density adaptive counting network DACNet model; Step A400, loop through A100-A300 until the trained density adaptive counting network DACNet model is obtained.

5. The crowd analysis method based on density adaptive counting network according to claim 4, characterized in that, The method for preprocessing the input crowd image is as follows: Each input image is randomly cropped into four 128×128 image blocks; each image block is randomly horizontally flipped with a probability of 0.5.

Citation Information

Patent Citations

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

    CN117953425A

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

    CN119048993A