A multi-scale based feature extraction crowd counting method and system
By using a multi-scale feature extraction method and leveraging SAFMN and LSGA from the VGG-16 and MSGM modules, the robustness and accuracy issues of crowd counting algorithms under target scale differences are solved, achieving efficient crowd counting in complex scenarios.
Patent Information
- Application Number
- CN202510729540.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-03
- Publication Date
- 2025-12-05
- Estimated Expiration
- 2045-06-03
AI Technical Summary
Existing crowd counting algorithms suffer from poor robustness and counting accuracy when faced with significant differences in target scale, making them difficult to apply effectively in complex scenarios.
A multi-scale feature extraction method is adopted. Primary features are extracted through the VGG-16 backbone network and combined with SAFMN and LSGA in the MSGM module to perform multi-scale feature fusion and spatial correlation modeling, generate optimized feature maps, and finally predict the population density distribution.
It improves the feature extraction capability for multi-scale human head targets, enhances the model's generalization ability in complex scenarios, is suitable for real-time counting in high-density and multi-scale crowd scenarios, and significantly improves counting accuracy.
Smart Images

Figure CN120236251B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of crowd counting, in particular to a crowd counting method and system based on multi-scale feature extraction. BACKGROUND
[0002] Crowd counting technology can perform millisecond-level density measurement on the personnel distribution in the monitored area. When the detection value exceeds the preset safety threshold, the system triggers a multi-level early warning mechanism, forming a complete closed loop from risk identification to emergency intervention, significantly improving the safety and prevention and control capabilities of public places. Compared with traditional manual monitoring methods, crowd counting algorithms based on crowd counting algorithms show obvious advantages in accuracy and real-time response. This algorithm greatly improves the efficiency of information processing, reduces the economic and time cost of early warning decision-making, and provides a more solid guarantee for personnel safety in public places. In practical applications, this technology promotes the transformation of security mode from passive monitoring to active defense, and provides multi-dimensional data reports to provide strong decision support for security departments. In the security management of large-scale activities, this technology realizes precise modeling of personnel flow by combining multiple data sources, providing important technical support for the safety construction of smart cities.
[0003] As the core technology of intelligent sensing systems, crowd counting algorithms are crucial to the modernization of social governance. They can analyze crowd density, flow, and gathering trends in real time, providing decision-making basis for multiple fields. They play an important role in public safety, public health, commercial operations, and smart city construction, and have become an important technical support for the fine management and digital transformation of cities. Crowd counting algorithms collect and analyze crowd distribution data in real time, building a data fusion analysis system and providing accurate data decision-making basis for city management departments. This algorithm not only significantly improves the emergency response efficiency of large-scale public events, but also continuously expands its application boundaries through its unique knowledge transfer mechanism: supporting cell colony quantification analysis in biomedicine and realizing intelligent monitoring of livestock group size in precision agriculture. This technology is continuously empowering the digital transformation of industries and promoting the evolution of social governance towards a data-driven and intelligent mode.
[0004] In summary, as an important research direction in the field of computer vision, crowd counting technology has attracted much attention due to its practical application value in public security, urban planning, and business decision-making. However, in actual application scenarios, significant target size differences still have a significant impact on the robustness and counting accuracy of the algorithm. Therefore, in view of the above situation, there is an urgent need to provide a crowd counting method and system based on multi-scale feature extraction to overcome the shortcomings in current practical applications. SUMMARY
[0005] The present application aims to provide a multi-scale feature extraction-based crowd counting method and system, aiming to solve the problems in the above background art.
[0006] The present application is implemented as a multi-scale feature extraction-based crowd counting method, which comprises the following steps:
[0007] Step one: extract the primary features of the input image through the VGG-16 backbone network;
[0008] Step two: input the primary features into MSGM, which comprises SAFMN and LSGA;
[0009] Step three: use SAFMN to perform multi-scale feature fusion and modulation on the input primary features, and input the features output by SAFMN into LSGA, model the spatial correlation through a Gaussian position matrix, and generate an optimized feature map;
[0010] Step four: predict the crowd density distribution based on the optimized feature map, and calculate the number of crowds.
[0011] As a further scheme of the present application: the SAFMN comprises FMM, and the FMM comprises SAFM and CCM.
[0012] As a further scheme of the present application: the SAFM performs multi-scale feature extraction through the following steps:
[0013] Divide the input features into four groups in the channel dimension, and perform adaptive maximum pooling with different down-sampling rates respectively;
[0014] Aggregate the multi-scale features through 1x1 convolution, generate an attention map, and modulate the input features.
[0015] As a further scheme of the present application: the CCM realizes the expansion and compression of the channel dimension through 3x3 convolution and 1x1 convolution, and enhances the nonlinear expression ability in combination with the GeLU activation function.
[0016] As a further scheme of the present application: the LSGA models the spatial correlation through the following steps:
[0017] Treat the input features as independent pixel labels, and generate a spatial weight matrix through a two-dimensional Gaussian kernel;
[0018] Introduce a Gaussian position matrix into the attention mechanism to dynamically adjust the feature weights; introduce a spatial weight matrix based on a two-dimensional Gaussian function to quantify the spatial correlation between pixels, and the closer the distance to the center, the higher the weight in feature fusion, and the formula is:
[0019] ;
[0020] wherein, is the standard deviation, is the spatial position coordinate, h and w denote the height and width of the image respectively.
[0021] As a further scheme of the present application: the attention calculation process of the LSGA is:
[0022] ;
[0023] wherein, Q represents the query matrix respectively, X is the original input matrix, d is the dimension of each head in the multi-head attention mechanism, B is the relative position bias parameter, T means the transpose operation, Attention() refers to the output result of the attention mechanism, and Softmax() represents the normalization exponential function operation;
[0024] By replacing the relative position bias with the Gaussian absolute position, the attention relationship in the LSGA can be expressed as:
[0025] ;
[0026] wherein, G is the Gaussian position matrix.
[0027] As a further scheme of the present application: in the output result processing of the SAFMN, a hierarchical fusion strategy is adopted to integrate the cross-scale feature information, and the specific steps are as follows:
[0028] The original scale feature map and the high-level feature map with a large receptive field are added element by element to generate a fusion feature;
[0029] The fusion feature is sequentially input into a cascade module composed of point-wise convolution and global average pooling to realize channel dimension reduction and global context information extraction;
[0030] The refined feature is secondarily fused with the original feature, and a spatial-channel joint attention weight matrix is calculated through a Sigmoid activation function;
[0031] The input feature is dynamically calibrated by using the attention weight matrix, and an optimized feature representation is output.
[0032] A crowd counting system based on multi-scale feature extraction, which applies the crowd counting method based on multi-scale feature extraction as described above, the system comprises:
[0033] A backbone network module: the first thirteen layers of VGG-16 are adopted to perform primary feature extraction on the input image, and output a primary feature map;
[0034] MSGM: Includes SAFMN and LSGA, used for multi-scale feature fusion and optimization of primary feature maps, outputting optimized feature maps;
[0035] Density estimation module: used to calculate the population density distribution in the monitored area based on the optimized feature map, and thus obtain the population size.
[0036] As a further aspect of the present invention: the SAFM includes an adaptive max pooling layer group, a feature cascade layer and a 1×1 convolutional layer, used to achieve multi-scale feature aggregation and attention modulation; the CCM includes a 3×3 convolutional layer, a 1×1 convolutional layer and a GeLU activation layer, used to achieve cross-channel feature interaction.
[0037] As a further aspect of the present invention: the LSGA includes a layer normalization layer, a residual connection structure, a spatial relationship modeling layer based on a two-dimensional Gaussian function, and a multilayer perceptron, which are used to perform spatial recalibration and classification output on the feature map.
[0038] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0039] By combining the cross-scale feature aggregation of the SAFMN module and the Gaussian attention mechanism of the LSGA module, the problem of target scale differences in surveillance images is effectively solved, and the feature extraction capability for multi-scale human head targets is improved.
[0040] By suppressing background noise through feature fusion and attention mechanisms, the model's generalization ability in complex scenarios is enhanced, making it suitable for real-time counting needs in high-density, multi-scale crowd scenarios.
[0041] Ablation experiments show that, compared to using only the backbone network, introducing the SAFMN module reduces the MAE from 58.8 to 55.7 and the MSE from 102.1 to 94.3 on the ShanghaiTech-A dataset. Further adding the LSGA module to form the MSGM reduces the MAE to 53.9 and the MSE to 87.6, and also shows a significant improvement in accuracy on the ShanghaiTech-B dataset, proving the effectiveness of the method of this invention. Attached Figure Description
[0042] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0043] Figure 1This is a schematic diagram of the VGGNet network structure in this invention.
[0044] Figure 2 This is a schematic diagram of the improved spatial adaptive feature modulation module structure in this invention.
[0045] Figure 3 This is a schematic diagram of the SAFM module and CCM module in this invention.
[0046] Figure 4 This is a schematic diagram of the multi-scale feature context information fusion structure in this invention.
[0047] Figure 5 This is a schematic diagram of the LSA and LSGA structures in this invention.
[0048] Figure 6 This is a schematic diagram of the LSGA transformer module structure in this invention. Detailed Implementation
[0049] The technical solution of the present invention will now be clearly and completely described with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0050] The present invention will be further explained below with reference to specific embodiments.
[0051] Please see Figures 1-6 This invention provides a multi-scale feature extraction-based crowd counting method, which includes the following steps:
[0052] Step 1: Extract primary features from the input image using the VGG-16 backbone network;
[0053] Step 2: Input the primary features into the Multi-scale Gaussian Feature Extraction Module (MSGM), which includes a Spatially-Adaptive Feature Modulation (SAFMN) module and a Light Self-Gaussian Attention (LSGA) module; wherein the MSGM performs contextual association on the features extracted by the front-end network to capture multi-scale head target feature information;
[0054] First, the primary features extracted by the backbone network are learned through multi-scale representation learning using an improved SAFMN. Then, LSGA is introduced to recalibrate the feature space. Dynamic channel weighting effectively suppresses background noise interference, thereby improving the discriminative representation of target features. This cascaded structure achieves progressive optimization from multi-scale feature fusion to adaptive feature selection, significantly improving feature separability in complex scenarios.
[0055] Step 3: Use SAFMN to perform multi-scale feature fusion and modulation on the input primary features, and input the features output by SAFMN into LSGA. Model spatial correlation through Gaussian position matrix to generate optimized feature map;
[0056] Step 4: Predict the population density distribution based on the optimized feature map and calculate the population size.
[0057] A multi-scale feature extraction-based crowd counting system, employing the multi-scale feature extraction-based crowd counting method described above, the system comprising:
[0058] The backbone network module uses the first thirteen layers of VGG-16 to perform primary feature extraction on the input image and output a primary feature map.
[0059] MSGM: Includes SAFMN and LSGA, used for multi-scale feature fusion and optimization of primary feature maps, outputting optimized feature maps;
[0060] Density estimation module: used to calculate the population density distribution in the monitored area based on the optimized feature map, and thus obtain the population size.
[0061] In the embodiments of the present invention, the cross-scale feature aggregation of the SAFMN module and the Gaussian attention mechanism of the LSGA module effectively solve the problem of target scale differences in surveillance images and improve the feature extraction capability for multi-scale human head targets; by suppressing background noise through feature fusion and attention mechanism, the generalization ability of the model in complex scenes is enhanced, making it suitable for real-time counting needs in high-density, multi-scale crowd scenes.
[0062] In one embodiment of the present invention, please refer to Figures 1-6The VGG-16 network (BBN) was selected as the backbone network, responsible for extracting feature information and feeding these features into subsequent modules. This aims to further refine detailed features that are beneficial for capturing multi-scale crowd information, enhancing the network's ability to count crowds at multiple scales. VGGNet mainly consists of convolutional layers, max-pooling layers, fully connected layers, and softmax layers. Its core contribution lies in replacing large-size convolutional kernels with stacked 3×3 small convolutional kernels, increasing network depth while reducing the number of parameters, and significantly improving image classification performance by utilizing a deeper network structure. The network adopts a structure of consecutive convolutional layers and 2×2 max-pooling layers, with fully connected layers at the end. Although the computational cost is high due to the large number of parameters in the fully connected layers, VGGNet is still widely used as a benchmark model in computer vision tasks due to its simple structure and strong feature extraction capabilities.
[0063] To effectively address the semantic discrepancies and scale inconsistencies existing across feature maps at different levels, this chapter, building upon SAFMN, introduces a cross-scale feature aggregation mechanism. This mechanism adaptively fuses the large receptive field semantic features extracted from deep networks with the high-resolution spatial features from shallower layers. The overall process is as follows: Figure 2 As shown.
[0064] The SAFMN module combines Spatially-Adaptive Feature Modulation (SAFM) and Cross-Channel Mixing (CCM) into a Feature Mixing Module (FMM), proposing a network architecture based on SAFM and CCM modules. This carefully designed architecture first uses a 3×3 convolutional network to perform preliminary feature extraction on the input data, obtaining shallow features F0, which contain basic information and preliminary feature representations of the input data. Subsequently, the network utilizes stacked FMMs to perform deeper processing and transformation on the shallow features F0, further refining and mining the effective information within the features to generate deep features F1 with richer semantic information. Finally, the network organically fuses the shallow features F0 and deep features F1, fully utilizing their complementarity to jointly generate the final result, achieving more accurate prediction or classification.
[0065] Among them, the SAFM module is the core part, which uses local information to adaptively modulate features, so that the model can select the most suitable modulation mode for each pixel position, enhancing its adaptability to different regions; the CCM module is responsible for interacting with features from different channels, further enhancing the ability to restore image details.
[0066] The overall structure diagram of the SAFM network is as follows:Figure 3 As shown in the left-middle figure, the input features, normalized along the channel dimension, are first divided into four components, which are then fed into adaptive max-pooling layers. These downsampling layers have different downsampling rates of 0, 2, 4, and 8. Since the goal is to select discriminative features to learn nonlocal feature interactions, an adaptive max-pooling operator is applied to the input features to collect information. Given input features X, this process can be expressed as:
[0067] ;
[0068] in, Corresponding to the channel splitting operation, It is a 3×3 depthwise convolution. This indicates that upsampling to the original resolution at a specific level can be achieved quickly through the nearest interpolation. Features This indicates that the input features are pooled to... Size, Refers to the i-th sub-feature after channel segmentation; This indicates the aggregate representation of X0; express Aggregate representation.
[0069] Then, these extracted short-term or long-term features are aggregated by concatenating them along the channel dimension and performing a 1×1 convolution, which can be expressed as:
[0070] ;
[0071] in, Indicates a cascading operation. It is a 1×1 convolution.
[0072] In obtaining the aggregate representation Then, a nonlinear mapping is performed using an activation function to estimate the attention map, and the input x is adaptively adjusted based on the estimated attention through element-wise product. This process is shown in the following equation:
[0073] ;
[0074] in, This represents the GeLU activation function. It is an element-wise product. This represents X after adaptive adjustment.
[0075] CCM architecture as follows Figure 3 The right part consists of a 3x3 and a 1x1 convolution and a GeLU activation layer. The 3x3 convolution first increases the number of input feature channels by two times, and then the 1x1 convolution decreases the number of feature channels to the same level as the input.
[0076] SAFM and CCM are integrated into a unified Feature Hybrid Module (FMM) to select representative features. The FMM can then be represented as:
[0077] ;
[0078] in, It is a LayerNorm layer, and X, Y, and Z are intermediate features.
[0079] After obtaining the output of SAMFN, in order to effectively integrate cross-scale feature information and alleviate the semantic-scale inconsistency problem, this paper adopts a hierarchical fusion strategy to combine the original scale feature map F with the high-level feature map with a large receptive field. Perform collaborative processing. For example... Figure 4 As shown, the process includes the following steps: First, connect F with... First, element-wise addition is performed to generate fused features. Then, the generated fused features are sequentially input into a cascaded module consisting of pointwise convolution and global average pooling to achieve channel dimension reduction and global context information extraction, respectively. Finally, the refined features are combined with... After secondary fusion, the spatial-channel joint attention weight matrix is calculated using the Sigmoid activation function; finally, the input features are dynamically calibrated using an attention mechanism, and the optimized feature representation is output.
[0080] Finally, this paper introduces a Lightweight Self-Gaussian Attention (LSGA) module. This module combines CNN and Transformer to form a three-stage feature processing mechanism. In the feature extraction stage, convolutional layers are used for local perception to capture shallow semantic features such as image edges and textures. Secondly, in LGSA, the original input matrix is reused to replace the traditional key-value matrix generation operation. Finally, a spatial relationship modeling layer based on a two-dimensional Gaussian function is introduced to effectively characterize the correlation between the central region and its neighborhood in the feature map. The overall introduction of this model is as follows:
[0081] The original Light Self-Attention Mechanism (LSA) is as follows: Figure 5 As shown in (a) of the diagram. In the multi-head attention mechanism, a relative positional deviation parameter is introduced into each head, as shown in [the diagram]. Figure 5 As shown in (b) above, the LSA can then be represented as:
[0082] ;
[0083] Where Q represents the query matrix, X is the original input matrix, d is the dimension of each head in the multi-head attention mechanism, B is the relative position deviation parameter, T means transpose operation, Attention() refers to the output result of the attention mechanism, and Softmax() represents the normalized exponential function operation.
[0084] This invention abandons the traditional image patch labeling generation method, instead treating each pixel as an independent label to maintain the spatial correlation of HSI (hue, saturation, and brightness) data. For any spatial neighborhood in the input image, the spectral features of the central pixel dominate, while the contribution of neighboring pixels decays exponentially with spatial distance—a phenomenon consistent with the typical spatial autocorrelation law of HSI data. This model effectively quantifies the spatial correlation strength between pixels through the smooth decay characteristics of a Gaussian distribution, giving pixels closer to the center higher feature fusion weights. To this end, this paper constructs a spatial weight matrix based on a two-dimensional Gaussian kernel:
[0085] ;
[0086] in, Standard deviation Spatial location coordinates, h and w refer to the height and width of the image, respectively.
[0087] Replacing the relative position deviation with the Gaussian absolute position, the attention relationship in LSGA can be expressed as:
[0088] ;
[0089] Where G is the Gaussian position matrix.
[0090] The complete LSGA transformer module, such as Figure 6 As shown in the diagram, this module first performs layer normalization on the input feature map, and then performs a residual concatenation between the output data obtained through LSGA and the original input. Next, at the end of the module, normalization, multilayer perceptron processing, and another residual concatenation are performed sequentially. After processing by the LSGATransformer module twice, the feature map is fed into a linear layer for flattening, and finally, the feature classification output is achieved through this linear layer.
[0091] In one embodiment of the present invention, this solution mainly includes three models, namely:
[0092] Model 1: Backbone model, which consists of the first thirteen layers of VGG-16;
[0093] Model 2: Backbone+SAFMN model, which adds a spatial adaptive feature modulation module to Model 1;
[0094] Model 3: Backbone+MSGM model. This model adds a lightweight self-Gaussian attention module to Model 3, forming a complete branch structure.
[0095] Ablation experiments show that, compared to using only the backbone network, introducing the SAFMN module reduces the MAE from 58.8 to 55.7 and the MSE from 102.1 to 94.3 on the ShanghaiTech-A dataset; further adding the LSGA module to form the MSGM reduces the MAE to 53.9 and the MSE to 87.6, and also shows a significant improvement in accuracy on the ShanghaiTech-B dataset, proving the effectiveness of the method of this invention.
[0096] Table 1 Ablation Experiment Results
[0097]
[0098] To evaluate the counting performance of the population counting model, this invention uses two evaluation metrics: Mean Absolute Error (MAE) and Mean Squared Error (MSE).
[0099] (1) Mean Absolute Error: This metric calculates the absolute value of the crowd size estimation error frame by frame and averages it at the data level. It can objectively reflect the overall generalization ability of the model in the pixel-level density estimation task. The calculation process is shown in the formula:
[0100] ;
[0101] (2) Mean Squared Error: This index assigns a higher weight to outlier error through a secondary penalty mechanism, which can sensitively reflect the estimation bias of the model in extremely dense regions. The calculation process is shown in the following formula:
[0102] ;
[0103] Where n is the number of samples; The number of real people in the i-th image; Let be the number of people predicted by the model for the i-th image.
[0104] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A multi-scale based feature extraction crowd counting method, characterized in that, The method comprises the following steps: Step 1: extracting primary features of an input image through a VGG-16 backbone network; Step 2: inputting the primary features into a multi-scale high-frequency feature extraction module MSGM, wherein the multi-scale high-frequency feature extraction module MSGM comprises a spatial adaptive feature modulation network SAFMN and a light self-Gaussian attention module LSGA; Step 3: performing multi-scale feature fusion and modulation on the input primary features by using the spatial adaptive feature modulation network SAFMN, inputting the features output by the spatial adaptive feature modulation network SAFMN into the light self-Gaussian attention module LSGA, modeling spatial correlation by using a Gaussian position matrix, and generating an optimized feature map; Step 4: predicting a crowd density distribution based on the optimized feature map and calculating a crowd quantity; The spatial adaptive feature modulation network SAFMN comprises a feature mixing module FMM, and the feature mixing module FMM comprises a spatial adaptive feature modulation module SAFM and a cross-channel mixing module CCM; The spatial adaptive feature modulation module SAFM realizes multi-scale feature extraction through the following steps: dividing input features into four groups in the channel dimension, and performing adaptive maximum pooling with different down-sampling rates on the four groups respectively; aggregating multi-scale features by using a 1x1 convolution, generating an attention map and modulating the input features; In the output result processing of the spatial adaptive feature modulation network SAFMN, a hierarchical fusion strategy is adopted to integrate cross-scale feature information, and the specific steps are as follows: performing element-wise addition on an original scale feature map and a high-layer feature map with a large receptive field to generate a fusion feature; inputting the fusion feature into a cascaded module composed of a point-wise convolution and a global average pooling in sequence to realize channel dimension reduction and global context information extraction; performing secondary fusion on the refined feature and the original feature, calculating a spatial-channel joint attention weight matrix by using a Sigmoid activation function, and outputting an optimized feature representation. The cross-channel mixing module CCM realizes expansion and compression of the channel dimension by using a 3x3 convolution and a 1x1 convolution, and enhances the non-linear expression capability by using a GeLU activation function.
2. The multi-scale based feature extraction crowd counting method of claim 1, wherein, The light self-Gaussian attention module LSGA realizes spatial correlation modeling through the following steps:
3. The multi-scale based feature extraction crowd counting method of claim 1, wherein, regarding input features as independent pixel labels, generating a spatial weight matrix by using a two-dimensional Gaussian kernel; introducing a Gaussian position matrix into an attention mechanism to dynamically adjust feature weights; introducing a spatial weight matrix based on a two-dimensional Gaussian function to quantify the spatial correlation between pixels, and the closer the distance between pixels is to the center, the higher the weight of the pixels in feature fusion is, and the formula is: The attention calculation process of the light self-Gaussian attention module LSGA is as follows: ; wherein, is the standard deviation, is the spatial position coordinate, h and w denote the height and width of the image, respectively.
4. The multi-scale based feature extraction crowd counting method of claim 1, wherein, wherein Q represents a query matrix, X is an original input matrix, d is the dimension of each head in a multi-head attention mechanism, B is a relative position bias parameter, T means a transposition operation, Attention() refers to the output result of the attention mechanism, and Softmax() represents a normalized exponential function operation. ; The attention relationship in the light self-Gaussian attention module LSGA is represented as follows by replacing the relative position deviation with the Gaussian absolute position: ; where G is a Gaussian position matrix.
5. A multi-scale based feature extraction crowd counting system, comprising: The system comprises: a backbone network module: the first 13 layers of the deep convolutional neural network VGG-16 proposed by the Visual Geometry Group of the University of Oxford are adopted to perform primary feature extraction on the input image and output a primary feature map; a multi-scale Gaussian feature extraction module MSGM: comprising a spatial adaptive feature modulation network SAFMN and a light self-Gaussian attention module LSGA, which are used to perform multi-scale feature fusion and optimization on the primary feature map and output an optimized feature map; a density estimation module: used to calculate the crowd density distribution of the monitoring area according to the optimized feature map, and then obtain the number of crowds; The spatial adaptive feature modulation module SAFM comprises an adaptive max-pooling layer group, a feature concatenation layer and a 1×1 convolution layer, which are used to realize the aggregation and attention modulation of multi-scale features; the cross-channel mixing CCM comprises a 3×3 convolution layer, a 1×1 convolution layer and a GeLU activation layer, which are used to realize cross-channel feature interaction.
6. The multi-scale based feature extraction crowd counting system of claim 5, wherein, The light self-Gaussian attention module LSGA comprises a layer normalization layer, a residual connection structure, a spatial relationship modeling layer based on a two-dimensional Gaussian function and a multi-layer perceptron, which are used to perform spatial recalibration and classification output on the feature map.
Citation Information
Patent Citations
Dense crowd counting method based on multi-scale feature pyramid network
CN113011329A