Method for constructing multi-dimensional dynamic perception and progressive focusing network model for crowd counting

By constructing a multidimensional dynamic perception and progressive focusing network model, the applicability problem of crowd counting in complex scenarios in existing technologies is solved, and the accuracy and robustness of crowd counting in complex scenarios are improved.

CN120976848BActive Publication Date: 2026-03-27SOUTH CENTRAL UNIVERSITY FOR NATIONALITIES
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-07-25
Publication Date
2026-03-27

AI Technical Summary

Technical Problem

Existing crowd counting methods mainly rely on simple mathematical models and network architectures, which have a narrow scope of application and are difficult to effectively handle crowd counting in complex and diverse scenarios.

Method used

A multidimensional dynamic perception and progressive focusing network model is constructed, including a front-end subnetwork, a main subnetwork, and a back-end subnetwork. Through multi-branch feature interaction, cross-layer feature fusion, and attention modeling, deep features and density maps are generated to achieve crowd counting in complex scenes.

Benefits of technology

It improves the accuracy and robustness of crowd counting, can adapt to the counting needs in complex and diverse scenarios, and significantly improves the counting effect.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120976848B_ABST
    Figure CN120976848B_ABST
Patent Text Reader

Abstract

The application provides a construction method of a multi-dimensional dynamic perception and progressive focusing network model for crowd counting, and relates to the technical field of computer vision, and comprises: a front-end sub-network used for shallow image feature extraction on a preprocessed input image to obtain image shallow features; a main body sub-network used for multi-branch feature interaction based on the image shallow features to generate deep features and cross-layer features, cross attention processing and multi-scale feature fusion on the deep features and the cross-layer features, cross-dimensional attention modeling on the fused features, and layer normalization output of depth features; and a rear-end sub-network used for high-dimensional feature construction and spatial resolution adjustment on the depth features to obtain intermediate features, feature optimization on the intermediate features, attention fusion and density decoding, and output of a density map and a target attention map. The network model can realize crowd counting in a wide-area scene.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of computer vision, and particularly relates to a construction method of a multi-dimensional dynamic perception and progressive focusing network model for crowd counting. BACKGROUND

[0002] Crowd counting aims to improve the statistical ability of the number of people in public places, traffic sites and commercial areas and the like through the application of computer vision technology, so as to meet the actual needs of urban planning, traffic control, public safety and the like. Therefore, crowd counting has important research value in the academic and industrial fields.

[0003] At present, the traditional manual feature crowd counting method depends on specific features of the crowd area, and mainly realizes rough statistics of individuals in the target area through simple mathematical models and network architectures, and is usually suitable for relatively simple scenes or small-scale environments, and has a narrow range of application. SUMMARY

[0004] Therefore, the present application provides a construction method of a multi-dimensional dynamic perception and progressive focusing network model for crowd counting.

[0005] In a first aspect, the present application provides a construction method of a multi-dimensional dynamic perception and progressive focusing network model for crowd counting, comprising a front-end sub-network, a main body sub-network and a back-end sub-network.

[0006] The front-end sub-network comprises a preprocessing module and a feature extraction module, the preprocessing module is used for preprocessing an input image, and the feature extraction module is used for shallow image feature extraction on the preprocessed input image to obtain image shallow features.

[0007] The main body sub-network comprises an Inception network module, an attention coupling module and a heterogeneous attention collaborator, the Inception network module is used for realizing multi-branch feature interaction based on the image shallow features to generate deep features and cross-layer features, the attention coupling module is used for cross-attention processing and multi-scale feature fusion on the deep features and the cross-layer features, and the heterogeneous attention collaborator is used for attention modeling across dimensions on the fused features, and cross-channel distribution calibration is implemented through layer normalization to output deep features.

[0008] The back-end sub-network comprises an adjusting module, an optimization module and a decoding module, the adjusting module is configured to perform high-dimensional feature construction and spatial resolution adjustment on the deep features to obtain intermediate features, the optimization module is configured to perform feature optimization on the intermediate features to obtain an initial attention map and optimized features, and the decoding module is configured to perform attention fusion and density decoding based on the optimized features and the initial attention map to output a density map and a target attention map.

[0009] In an embodiment, the feature extraction module comprises a first convolutional submodule and a second convolutional submodule.

[0010] The first convolutional submodule is configured to perform feature extraction on the preprocessed input image through multiple convolutional layers, and output initial shallow features, wherein each convolutional layer is processed using a batch normalization algorithm and an activation function.

[0011] The second convolutional submodule is configured to process the initial shallow features through a dynamic adaptive convolutional unit to obtain image shallow features with enhanced shallow details.

[0012] In an embodiment, the Inception network module comprises an InceptionA structure group, an InceptionB structure group and an InceptionC structure group connected in sequence, the InceptionA structure group comprises multiple cascaded InceptionA structures, the InceptionB structure group comprises at least one InceptionB structure, and the InceptionC structure group comprises multiple cascaded InceptionC structures, wherein the InceptionA structure, the InceptionB structure and the InceptionC structure belong to an Inception-v3 structure respectively.

[0013] The InceptionA structure is configured to perform feature extraction using a four-way parallel structure, and to concatenate four-way extracted features along a channel dimension; the InceptionB structure is configured to perform spatial down-sampling on output features of the InceptionA structure group using three-way heterogeneous convolution branches respectively, and to concatenate three-way output features along a channel dimension; the InceptionC structure is internally provided with a double-path 7x7 convolution decomposition into a 1x7 and a 7x1 convolution pair, which is combined with a 1x1 convolution for channel regulation, and output features of the last two InceptionC structures in the InceptionC structure group are used as the cross-layer features and the deep features.

[0014] In an embodiment, the attention coupling module comprises a feature concatenation submodule, an attention calculation submodule and an optimization submodule.

[0015] The feature splicing submodule is configured to splice the deep features and the cross-layer features along a channel dimension to generate spliced features, and then perform feature compression on the spliced features through a pre-processing convolution group to output compressed features;

[0016] The attention calculation submodule is configured to input the compressed features into a multi-head mixed convolution attention layer after reshaping the compressed features into a preset format, and process the input features through four groups of deep convolution branches with dynamic kernel sizes in the multi-head mixed convolution attention layer, and perform element-wise multiplication on the four groups of features after channel recombination and a value vector after linear projection to generate first fused features;

[0017] The optimization submodule is configured to process the first fused features through a multi-branch dilated convolution pyramid, and perform cross-scale fusion on four outputs after channel splicing through a 1x1 convolution to generate second fused features; wherein the first branch of the multi-branch dilated convolution pyramid deploys an average pooling, a 1x1 convolution, and an upsampling to model global semantics; the second branch uses a 1x1 convolution to retain the original features as an identity mapping; the third branch uses a 3x3 dilated convolution with an expansion rate of 2 to extract medium receptive field features; and the fourth branch uses a 3x3 dilated convolution with an expansion rate of 4 to capture a large range of context.

[0018] In an embodiment, the heterogeneous attention coordinator includes an attention modeling submodule and a calibration submodule;

[0019] The attention modeling submodule is configured to model attention across dimensions through two parallel paths based on input of the second fused features, and adaptively fuse weights of the two parallel paths through learnable parameters to output third fused features;

[0020] The calibration submodule is configured to perform cross-channel distribution calibration on the third fused features through layer normalization to output the deep features.

[0021] In an embodiment, the attention modeling submodule includes a channel attention path, a spatial attention path, and a fusion path;

[0022] The channel attention path is configured to perform a global average pooling operation on input features to compress a spatial dimension into a single pixel point, generate a channel energy vector, perform cross-channel interaction on the channel energy vector through one-dimensional convolution with an adaptive kernel size, and generate a channel dimension weight after Sigmoid function normalization;

[0023] The spatial attention path is used for maximum pooling and average pooling of input features simultaneously, high response features of a head significant area and overall spatial distribution features are extracted respectively, the two are spliced along a channel dimension to form a joint feature map, spatial context modeling is performed through 7*7 large kernel convolution, spatial dimension weights are generated after batch normalization and Sigmoid activation;

[0024] The fusion path dynamically weights and fuses the channel dimension weights and the spatial dimension weights through a learnable coefficient, and adds a preset residual connection ratio of residual features, and outputs the third fusion feature.

[0025] In an embodiment, the adjustment module includes an InceptionD structure, an InceptionE structure and an upsampling sub-module, the InceptionD structure and the InceptionE structure belong to an Inception-v3 structure respectively;

[0026] The InceptionD structure is used for channel dimension expansion of the deep feature through a three-way heterogeneous convolution strategy, to generate a first high-dimensional feature;

[0027] The InceptionE structure is used for implementing multi-branch feature interaction processing, and outputs a second high-dimensional feature after channel splicing of four output features;

[0028] The upsampling sub-module performs 2 times spatial upsampling on the second high-dimensional feature through a nearest neighbor interpolation algorithm to generate the intermediate feature.

[0029] In an embodiment, the optimization module includes a first feature optimization branch and a second feature optimization branch;

[0030] The first feature optimization branch is used for implementing channel compression operation on the intermediate feature to generate an initial spatial weight matrix, and outputs a normalized initial attention map after Sigmoid function activation;

[0031] The second feature optimization branch generates the optimized feature by performing semantic optimization on the intermediate feature through the InceptionE structure.

[0032] In an embodiment, the decoding module includes an attention fusion sub-module and a density decoding sub-module;

[0033] The attention fusion sub-module is used for element-wise multiplication operation of the optimized feature and the initial attention map to generate an attention fusion feature;

[0034] The density decoding submodule is configured to perform channel compression on the attention fusion feature, generate an initial density response map, and perform activation processing on the initial density response map through a ReLU activation function, reshape the output feature map and the initial attention map into two-dimensional spatial distribution forms respectively, and output the density map and the target attention map.

[0035] In a second aspect, the present application further provides a network model training method, which is configured to train the model constructed by the method of the first aspect; the network model training method comprises:

[0036] obtaining a training sample set and the multi-dimensional dynamic perception and progressive focusing network model for crowd counting;

[0037] setting a weight value for each sample in the training sample set according to a dynamic threshold and a sample density value, the dynamic threshold being positively correlated with a training period, the sample density value being inversely correlated with the weight value when the sample density value is greater than the dynamic threshold, and the weight value being 1 when the sample density value is not greater than the dynamic threshold;

[0038] training the network model according to the weight value of each sample, the training sample set and a target loss function to obtain a target training model, wherein the target loss function is an addition function of a density map loss function and an attention map loss function.

[0039] The construction method of the multi-dimensional dynamic perception and progressive focusing network model for crowd counting according to the present application has the following beneficial effects relative to related technologies:

[0040] 1. In the present application, the multi-dimensional dynamic perception and progressive focusing network model for crowd counting is a deep learning model, and the crowd counting is realized through the deep learning model. Since the method based on deep learning has better generalization, it performs better in handling scene adaptability and scale diversity. Moreover, since the features are self-learned and do not need to be manually selected, the counting effect can be significantly improved. Therefore, the network model of the present application can be applied to crowd counting in complex scenes, and has a wide range of applications.

[0041] 2、The network model constructed in the application extracts image shallow features through the front-end sub-network. The main body sub-network realizes multi-branch feature interaction based on the image shallow features, generates deep features and cross-layer features, and performs cross-attention processing and multi-scale feature fusion on the deep features and the cross-layer features. The fused features are subjected to cross-dimension attention modeling, and cross-channel distribution calibration is implemented through layer normalization, and the deep features are output, realizing multi-granularity feature fusion of local details and global semantics, improving the capturing ability of the model for dense small targets, and improving the accuracy and robustness of crowd counting. Finally, the deep features are subjected to high-dimensional feature construction and spatial resolution adjustment through the back-end sub-network to obtain intermediate features, and the intermediate features are subjected to feature optimization to obtain initial attention maps and optimized features. The optimized features and the optimized features are subjected to attention fusion and density decoding to output a density map and a target attention map. Based on the density map, crowd counting can be realized, and based on the target attention map, the model can be optimized and updated, thereby further improving the accuracy and robustness of crowd counting. BRIEF DESCRIPTION OF DRAWINGS

[0042] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related art, the drawings needed to be used in the embodiment or related art description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.

[0043] Figure 1 Structure diagram of a multi-dimensional dynamic perception and progressive focusing network model for crowd counting in an embodiment of the present application;

[0044] Figure 2 Structure diagram of a multi-dimensional dynamic perception and progressive focusing network model for crowd counting in another embodiment of the present application;

[0045] Figure 3 Structure diagram of a dynamic adaptive convolution unit in an embodiment of the present application;

[0046] Figure 4 Structure diagram of an InceptionA structure in an embodiment of the present application;

[0047] Figure 5 Structure diagram of an InceptionB structure in an embodiment of the present application;

[0048] Figure 6 Structure diagram of an InceptionC structure in an embodiment of the present application;

[0049] Figure 7 Structure diagram of an attention coupling module in an embodiment of the present application;

[0050] Figure 8 A structural schematic diagram of a heterogeneous attention collaborator in an embodiment of the present application;

[0051] Figure 9 A structural schematic diagram of an InceptionD structure in an embodiment of the present application;

[0052] Figure 10 A structural schematic diagram of an InceptionE structure in an embodiment of the present application;

[0053] Figure 11 A flow schematic diagram of a network model training method in an embodiment of the present application.

[0054] Legend of reference signs:

[0055] 1 - front-end subnetwork, 11 - preprocessing module, 12 - feature extraction module, 121 - first convolutional submodule, 122 - second convolutional submodule, 2 - main subnetwork, 21 - Inception network module, 22 - attention coupling module, 23 - heterogeneous attention collaborator, 231 - attention modeling submodule, 232 - calibration submodule, 3 - back-end subnetwork, 31 - adjustment module, 32 - optimization module, 33 - decoding module. DETAILED DESCRIPTION

[0056] The technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the scope of protection of the present application.

[0057] In some embodiments, as shown in FIG. 1, the present application provides a construction method of a multi-dimensional dynamic perception and progressive focusing network model (MDDPN) for crowd counting, which comprises a front-end subnetwork 1, a main subnetwork 2 and a back-end subnetwork 3. Figure 1

[0058] The front-end subnetwork 1 comprises a preprocessing module 11 and a feature extraction module 12. The preprocessing module 11 is used for preprocessing an input image, and the feature extraction module 12 is used for shallow image feature extraction on the preprocessed input image to obtain image shallow features. In the application, the preprocessing module 11 can preprocess the data set in batches. The preprocessing can include data enhancement and standardization processing. The feature extraction module 12 can process the preprocessed input image through multiple layers of convolution to obtain image shallow features. ​

[0059] Exemplarily, the data enhancement processing procedure can be as follows: first, the input image is subjected to grayscale detection, and if it is a grayscale image, it is converted into an RGB image; then, each picture is subjected to random horizontal flipping with a probability of 50%, and then random position cropping is performed, and k sub-images are taken out from each picture. The standardization processing procedure is as follows: the statistical mean and standard deviation of the data set are used as the standardization parameters, the image is scaled to M*N as the input of the feature extraction module 12, and finally the input parameters are (X, Y, M, N), representing batch dimension, channel number, height and width, respectively. X is the batch number, Y is the input image channel number, generally 3 for an RGB image, consistent with the sample used in the present scheme. The height and width need to be multiples of 8 to avoid rounding errors. The dimension of the image shallow feature can be (X, 192, M / 2, N / 2).

[0060] The main body sub-network 2 comprises an Inception network module 21, an attention coupling module 22 and a heterogeneous attention collaborator 23. The Inception network module 21 is configured to realize multi-branch feature interaction based on the image shallow feature, to generate deep features and cross-layer features. The attention coupling module 22 is configured to perform cross-attention processing and multi-scale feature fusion on the deep features and the cross-layer features. The heterogeneous attention collaborator 23 is configured to perform cross-dimension attention modeling on the fused features, and to implement cross-channel distribution calibration through layer normalization, to output deep features.

[0061] The Inception network module 21 comprises a plurality of Inception structures, which improve the multi-scale fusion and perception capabilities of the model basis, and construct a multi-scale feature pyramid, to realize multi-branch feature interaction, to generate deep features and cross-layer features. The attention coupling module 22 realizes multi-granularity association of local details and global context through cross-attention processing and multi-scale feature fusion on the deep features and the cross-layer features, which significantly improves the feature response strength of dense small targets, and is conducive to improving the accuracy of crowd counting. The heterogeneous attention collaborator 23 can be decoupled and optimized through channel-spatial dual domains, and the attention contribution degrees of the channel domain and the spatial domain are balanced through the layer normalization strategy, to perform cross-dimension attention modeling on the fused features, so that the model can dynamically focus on the head saliency region, while suppressing the feature bias caused by interference factors such as illumination changes and complex backgrounds. The dimension of the deep features is (X, 768, M / 4, N / 4).

[0062] The back-end subnetwork 3 includes an adjustment module 31, an optimization module 32, and a decoding module 33. The adjustment module 31 is used to construct high-dimensional features and adjust the spatial resolution of the deep features to obtain intermediate features. The optimization module 32 is used to optimize the intermediate features to obtain an initial attention map and optimized features. The decoding module 33 is used to perform attention fusion and density decoding based on the optimized features and the initial attention map, outputting a density map and a target attention map. The density map can have a dimension of X×M / 4×N / 4, and the target attention map can have a dimension of X×M / 4×N / 4.

[0063] It is understandable that the subsequent sub-network 3 implements the prediction output. After the density map is output by the subsequent sub-network 3, the density integral is performed on the density map to obtain the final crowd count value, thus realizing crowd counting. The target attention map can be used for focused training of the model. Based on the target attention map, the model can be optimized and updated, which helps to further improve the accuracy and robustness of crowd counting.

[0064] The aforementioned multidimensional dynamic perception and progressive focusing network model for crowd counting is a deep learning model. Crowd counting is achieved through a deep learning model. Since deep learning-based methods are more generalizable, they perform better in dealing with issues such as scene adaptability and scale diversity. Furthermore, since the features are self-learning and do not require manual selection, the counting effect can be significantly improved. Therefore, the network model of this application can be applied to crowd counting in complex scenarios and has a wide range of applications.

[0065] Furthermore, the network model provided in this application extracts shallow image features through a front-end sub-network 1. The main sub-network 2 uses these shallow image features to achieve multi-branch feature interaction, generating deep and cross-layer features. Cross-attention processing and multi-scale feature fusion are then applied to these deep and cross-layer features. Cross-dimensional attention modeling is performed on the fused features, and layer normalization is used for cross-channel distribution calibration to output deep features. This achieves multi-granularity feature fusion of local details and global semantics, improving the model's ability to capture dense small targets and enhancing the accuracy and robustness of crowd counting. Finally, a back-end sub-network 3 constructs high-dimensional features and adjusts the spatial resolution of the deep features to obtain intermediate features. Feature optimization is performed on these intermediate features to obtain an initial attention map and optimized features. Attention fusion and density decoding are then performed on the optimized features to output a density map and a target attention map. Crowd counting can be achieved based on the density map, while the model can be optimized and updated based on the target attention map, further improving the accuracy and robustness of crowd counting.

[0066] In some embodiments, such as Figure 2 As shown, the feature extraction module 12 includes: a first convolutional submodule 121 and a second convolutional submodule 122.

[0067] The first convolutional submodule 121 is used to extract features from the preprocessed input image through multiple convolutional layers and output initial shallow features. Each convolutional layer is processed using a batch normalization algorithm and an activation function.

[0068] The first convolutional submodule 121 may contain m convolutional layers, where m can be between 3 and 5, for example, 5.

[0069] For example, with m=5, the input RGB image P is first processed through 5 layers of ordinary convolutions, outputting feature D1. The specific parameters of the convolutional layers are as follows: the first layer, Conv2d_1a, has a kernel size of 3×3, a stride of 2, padding of 1, and 32 output channels; the second layer, Conv2d_2a, has a kernel size of 3×3, a stride of 1, padding of 1, and 32 output channels; the third layer, Conv2d_3a, has a kernel size of 3×3, a stride of 1, padding of 1, and 64 output channels; the fourth layer, Conv2d_4a, has a kernel size of 1×1, a stride of 1, padding of 0, and 80 output channels; and the fifth layer, Conv2d_5a, has a kernel size of 3×3, a stride of 1, padding of 1, and 192 output channels. Each convolutional layer is processed using batch normalization (bn) and the ReLU activation function.

[0070] The second convolutional submodule 122 is used to process the initial shallow features through a dynamic adaptive convolutional unit to obtain shallow image features with enhanced shallow details.

[0071] For example, such as Figure 3 As shown, the feature D1 output by the first convolutional submodule 121 is input to the Dynamic Adaptive Convolutional Unit (DACU), and the final output is the shallow image feature C2 with enhanced shallow details. The specific process is as follows: First, D1 generates a skip connection D1_s to preserve high-resolution edge details. Then, two 3×3 convolutional layers and batch normalization are used to process D1 to generate intermediate features D2. The convolutional parameters can be: the first layer Conv2d_1b, kernel size 3×3, stride 1, padding 1, output channels 192; the second layer Conv2d_2b, kernel size 3×3, stride 1, padding 1, output channels 192; after each convolutional layer, batch normalization (bn) and the ReLU activation function are used. The generated feature D2 is then subjected to global average pooling to generate a channel weight vector, which is normalized using the Sigmoid function and multiplied channel-by-channel with D2 to obtain the shallow dynamic attention-weighted feature D3. Finally, D3 is added to the input feature D1_s through a residual connection, and the optimized feature C2 is output after ReLU activation, which is the shallow feature of the image.

[0072] In this embodiment, in order to solve the scale sensitivity problem caused by the dependence of the related method on single-level abstract features, a dynamic adaptive convolution unit is embedded in the front-end network, and a double-path calibration strategy of residual jump connection and composite attention mechanism is adopted, which not only retains the high-resolution edge, corner and other detail information in the shallow features, but also strengthens the texture robustness of the occluded area through attention-guided local receptive field adjustment, effectively solving the detail loss and semantic fragmentation problem caused by excessive downsampling of traditional single-branch network. In addition, the adaptive attention mechanism is used to enhance the expression of shallow texture details, so that the model can focus on the texture details in the shallow features, effectively capture the subtle differences of edge, texture and other basic visual information, and improve the richness and delicacy of feature representation. This mechanism not only enhances the description ability of shallow features to texture details, provides better basic input for subsequent deep feature extraction, but also suppresses the interference of irrelevant areas through adaptive weight distribution, optimizes feature expression while retaining key texture information, and finally helps to improve the crowd recognition accuracy and improve the overall performance of the model.

[0073] In an embodiment, as shown in FIG. 1, the Inception network module 21 includes an InceptionA structure group, an InceptionB structure group and an InceptionC structure group connected in sequence. Figure 2 As shown in FIG. 2, the InceptionA structure group includes a plurality of cascaded InceptionA structures, the InceptionB structure group includes at least one InceptionB structure, and the InceptionC structure group includes a plurality of cascaded InceptionC structures. Figures 4 to 6 As shown in FIG. 2, the InceptionA structure group includes a plurality of cascaded InceptionA structures, the InceptionB structure group includes at least one InceptionB structure, and the InceptionC structure group includes a plurality of cascaded InceptionC structures.

[0074] The InceptionA structure is used for feature extraction by four parallel structures, and the four extracted features are spliced along the channel dimension; the InceptionB structure is used for spatial downsampling of the output features of the InceptionA structure group by three heterogeneous convolution branches, and the three output features are spliced along the channel dimension; the double 7x7 convolution in the InceptionC structure is decomposed into a 1x7 and a 7x1 convolution pair, and a 1x1 convolution is used for channel control, and the output features of the last two InceptionC structures in the InceptionC structure group are used as cross-layer features and deep features.

[0075] wherein the multi-branch feature interaction can be achieved by x cascaded InceptionA structures, y InceptionB structures and z InceptionC structures to generate deep features with cross-scale perception ability. The InceptionA structure is a basic structure for shallow feature extraction, and the number x ranges from 2 to 4. The InceptionB structure is a down-sampling structure, and y is generally taken as 1-2 for the accuracy of generating a density map. The InceptionC structure is a large receptive field structure, and z is taken as 4-6. It should be noted that the Inception network module 21 retains the middle layer feature information through the cross-layer skip connection in the processing process.

[0076] Exemplarily, x = 3, y = 1, z = 4, and the processing process of the Inception network module 21 is as follows: the image shallow feature C2 is input into the first level InceptionA structure, and the first level InceptionA structure internally adopts a four-way parallel structure for feature extraction: the first way uses 1x1 convolution to compress the channel to 64 dimensions; the second way is expanded to 64 channels through 1x1 convolution and 5x5 convolution after dimension reduction; the third way adopts 1x1 convolution and double-layer 3x3 convolution stacking to generate 96 channel features; and the fourth way implements 3x3 maximum pooling and then outputs 32 channels through 1x1 convolution. The four-way features are spliced along the channel dimension to output a 256-dimensional feature map E1. The second level InceptionA structure expands the fourth pooling branch channel to 64 on the basis of the previous InceptionA structure, and outputs a 288-dimensional feature E2. The third level InceptionA structure maintains the same structure, outputs a 288-dimensional feature E3, and completes the transition from shallow features to middle features. The feature E3 is input into the InceptionB structure to implement spatial down-sampling, and the InceptionB structure adopts a three-way heterogeneous convolution strategy: the first way is directly down-sampled by 3x3 convolution with a step of 2; the second way is implemented by stacking 1x1 convolution and 3x3 convolution with a step of 2; and the third way uses 3x3 maximum pooling with a step of 2. The three-way outputs are spliced along the channel to generate a 768-dimensional feature E4. Then, the four InceptionC structures process E4 in a cascaded manner: each InceptionC structure is internally provided with a double-way 7x7 convolution decomposed into a 1x7 and a 7x1 convolution pair, and a 1x1 convolution is used for channel regulation, while maintaining 768 channels and enhancing the head feature response in the horizontal and vertical directions. The output features of the last two InceptionC structures are used as cross-layer features E5 and deep features E6.

[0077] In this embodiment, the InceptionA structure, the InceptionB structure and the InceptionC structure correspond to the requirements of shallow feature extraction, down-sampling optimization and large receptive field feature capture respectively, and the cooperation of the InceptionA structure group, the InceptionB structure group and the InceptionC structure group can provide the attention coupling module 22 with hierarchical rich feature input.

[0078] In some embodiments, the attention coupling module 22 includes a feature splicing sub-module, an attention calculation sub-module and an optimization sub-module.

[0079] The feature splicing sub-module is used to splice the deep features and the cross-layer features along the channel dimension to generate spliced features, and then perform feature compression through the preprocessing convolution group to output compressed features. The feature splicing sub-module is used to realize multi-scale feature splicing. For example, as shown in FIG. 7, the feature splicing sub-module can splice the deep features E6 and the cross-layer features E5 along the channel dimension to generate spliced features E7_a. Then, the feature compression is performed through the preprocessing convolution group. The specific process can be as follows: first, a 3×3 grouped convolution is used to implement spatial context modeling on E7_a, and then a batch normalization and a GELU activation function are used to generate nonlinear features E7_b; then, a 1×1 convolution is used to compress the channel number, and compressed features E7_c are output. Figure 7

[0080] The attention calculation sub-module is used to input the compressed features into the multi-head mixed convolution attention layer after reshaping into a preset format, and process the input features through four groups of deep convolution branches with dynamic kernel size in the multi-head mixed convolution attention layer. After the four groups of features are recombined in the channel, an element-wise product is performed with the value vector after linear projection to generate first fused features.

[0081] The attention calculation sub-module is used to realize multi-head mixed convolution attention calculation. For example, the features E7_c are reshaped into a B×N×C form (N=H×W, B is the batch dimension, and C is the channel dimension), and are input into the multi-head mixed convolution attention layer. The layer includes four groups of deep convolution branches with dynamic kernel size: the first branch uses a 3×3 convolution kernel (padding=1) to extract local details; the second branch uses a 5×5 convolution kernel (padding=2) to capture medium-range context; the third branch deploys a 7×7 convolution kernel (padding=3) to model long-range dependencies; and the fourth branch applies a 9×9 convolution kernel (padding=4) to establish global association. After the four groups of features are recombined in the channel, an element-wise product is performed with the value vector after linear projection to generate first fused features E7_d.

[0082] ​The optimization submodule processes the first fused feature using a multi-branch dilated convolutional pyramid. The four outputs are concatenated and then fused across scales using 1×1 convolutions to generate the second fused feature. Specifically, the first branch of the multi-branch dilated convolutional pyramid deploys average pooling, 1×1 convolutions, and upsampling to model global semantics. The second branch uses 1×1 convolutions to preserve the original features as an identity mapping. The third branch uses 3×3 dilated convolutions with a dilation rate of 2 to extract medium receptive field features. The fourth branch uses 3×3 dilated convolutions with a dilation rate of 4 to capture a wide range of context.

[0083] The optimization submodule is used to implement multi-branch dilated convolution optimization. For example, the first fused feature E7_d is input to the multi-branch dilated convolution pyramid, and the following operations are performed in parallel: the first path deploys average pooling, 1×1 convolution, and upsampling to model global semantics; the second path uses 1×1 convolution to preserve the original features as an identity mapping; the third path uses 3×3 dilated convolution with a dilation rate of 2 to extract moderate receptive field features; and the fourth path uses 3×3 dilated convolution with a dilation rate of 4 to capture a wide range of context. The four outputs are concatenated and then fused across scales using 1×1 convolution to generate the second fused feature E7.

[0084] It is understandable that multi-branch hybrid convolution enables bidirectional interaction between deep and shallow features across resolutions, and combined with multi-dilation rate dilated convolution to construct a local-global perception network. While expanding the feature fusion field of view, spatial pyramid pooling is used to capture multi-scale head distribution patterns, which significantly improves the feature response intensity of dense small targets.

[0085] In this embodiment, the parallel cross-attention coupling module 22 constructs a multi-granularity association mechanism between local details and global context. It takes deep feature E6 (containing global semantic information) and cross-layer feature E5 (preserving mid-level local details) as inputs and performs cross-attention calculation between the two through a parallel structure within the module. This allows global semantics to guide the feature focus of local details, while local detail information feeds back into the semantic refinement of the global context. In this way, the contribution of features of different granularities is dynamically balanced during the multi-scale feature fusion process, and finally, feature E7 with rich local detail representation and global semantic association is generated, which effectively enhances the hierarchical expression capability and cross-scale interaction efficiency of features.

[0086] In some embodiments, such as Figure 2 and Figure 8 As shown, the heterogeneous attention coordinator 23 includes an attention modeling submodule 231 and a calibration submodule 232.

[0087] The attention modeling submodule 231 performs cross-dimensional attention modeling based on the second fusion feature of the input, and adaptively fuses the weights of the two parallel paths through learnable parameters to output the third fusion feature.

[0088] The calibration sub-module 232 is configured to perform cross-channel distribution calibration on the third fused feature, and output a deep feature.

[0089] In this embodiment, the attention modeling sub-module 231 performs cross-dimension attention modeling (such as channel and spatial dimension attention mechanisms) on the second fused feature E7 through two parallel paths, optimizes the channel-spatial dual domain by decoupling, balances the attention contribution of the channel domain and the spatial domain through the hierarchical normalization strategy, enables the model to dynamically focus on the head saliency region, and suppresses feature deviation caused by interference factors such as illumination changes and complex backgrounds. In addition, the dependence and interaction mode of the feature in different dimensions are captured through different paths, and then the attention weights output by the two paths are adaptively weighted and fused by means of the learnable parameters a and b, to output the third fused feature. The third fused feature is processed by layer normalization (LayerNorm) to calibrate the cross-channel feature distribution and ensure the numerical stability of the channel features, and finally a deep feature C3 with multi-dimensional attention correlation and normalized distribution is output, which effectively enhances the semantic expression ability and cross-dimension collaboration of the feature.

[0090] In some embodiments, the attention modeling sub-module 231 includes a channel attention path, a spatial attention path, and a fusion path.

[0091] The channel attention path is configured to perform a global average pooling operation on the input feature, compress the spatial dimension into a single pixel point, generate a channel energy vector, perform cross-channel interaction on the channel energy vector through one-dimensional convolution with an adaptive kernel size (the kernel size is dynamically calculated based on the number of channels to ensure that the weight calculation of each channel can fuse the context information of the adjacent four channels, and avoid information loss caused by dimension reduction of the fully connected layer), and generate a channel dimension weight after Sigmoid function normalization. The numerical distribution of the channel dimension weight (channel attention mask matrix) Mc presents a significantly high response to the corresponding channel of the head key region, and the background interference channel is suppressed.

[0092] The spatial attention path adopts a dual-modal pooling strategy. The spatial attention path is configured to perform maximum pooling and average pooling on the input feature at the same time, extract high response features of the head saliency region and overall spatial distribution features, respectively, concatenate the two features along the channel dimension to form a joint feature map, and perform spatial context modeling through 7x7 large kernel convolution. After batch normalization and Sigmoid, the input feature is simultaneously subjected to maximum pooling and average pooling, and the spatial dimension weight is generated after the head saliency region is activated.

[0093] It can be understood that the joint feature map can effectively associate the geometric constraint relationship between the hairline contour and the shoulder position through 7x7 large kernel convolution for spatial context modeling. After batch normalization and Sigmoid activation, the spatial attention mask generates a gradient transition zone at the occlusion boundary and maintains a high activation value in the center area of the head to generate a spatial dimension weight (channel attention mask matrix) Ms, forming accurate pixel-level positioning guidance.

[0094] The fusion path dynamically weights and fuses the channel dimension weight and the spatial dimension weight through a learnable coefficient, adds a preset residual connection ratio of residual features, and performs layer normalization processing to output the third fusion feature.

[0095] In applications, the attention masks output by the two paths are dynamically weighted and fused through a learnable coefficient , In the fusion, a certain residual connection ratio of the original features is reserved, the coefficient is , to prevent feature distortion caused by excessive filtering and enhance the robustness of the module to illumination changes. The fused features are processed by layer normalization, and the third fusion feature C3' is finally output. The calculation formula is as follows:

[0096]

[0097] wherein represents a channel-by-channel / spatial broadcast product. The third fusion feature is processed by layer normalization (LayerNorm) to implement cross-channel distribution calibration, and finally outputs the depth feature C3.

[0098] In some embodiments, as shown in Figure 9 and Figure 10 , the adjustment module 31 includes an InceptionD structure, an InceptionE structure, and an upsampling sub-module, and the InceptionD structure and the InceptionE structure belong to an Inception-v3 structure respectively.

[0099] The InceptionD structure is used to expand the channel dimension of the depth feature through a three-way heterogeneous convolution strategy to generate a first high-dimensional feature. The InceptionE structure is used to implement multi-branch feature interaction processing, and the four-way features output after channel splicing are output as a second high-dimensional feature. The upsampling sub-module performs 2x spatial upsampling on the second high-dimensional feature through a nearest neighbor interpolation algorithm to generate an intermediate feature.

[0100] Exemplarily, the input feature C3 (dimension X X 768 X M / 4 X N / 4) is first subjected to deep semantic enhancement by an InceptionD block, wherein the InceptionD module maintains the spatial resolution at 32 X 32 by a three-way heterogeneous convolution strategy, and expands the channel dimension to 1280, to generate a first high-dimensional feature F1. Subsequently, F1 is input into an InceptionE module to implement multi-branch feature interaction: the first branch adopts 1 X 1 convolution to compress the channel to 320 dimensions; the second branch uses a 1 X 3 and 3 X 1 convolution pair, and cooperates with 1 X 1 convolution to generate 384-channel features by channel regulation and stacking; the third branch uses 1 X 1 convolution to connect 3 X 3 convolution and a 1 X 3 and 3 X 1 convolution pair to output 384 channels; the fourth branch directly performs 3 X 3 max-pooling on the input feature and adjusts the channel to 192 by 1 X 1 convolution. The four-way features are spliced along the channel to output a second high-dimensional feature F2 (dimension 32 X 2048 X 16 X 16). The second high-dimensional feature F2 is subjected to 2 times spatial up-sampling by a nearest neighbor interpolation algorithm to generate an intermediate feature F3 (dimension X X 2048 X M / 4 X N / 4). By finally generating an intermediate feature with adaptive spatial size and rich channel information, an input feature with high-dimensional semantics and reasonable spatial resolution is provided for the subsequent optimization module 32.

[0101] In some embodiments, as shown in FIG. 3, the optimization module 32 includes a first feature optimization branch and a second feature optimization branch. Figure 2

[0102] The first feature optimization branch is used to implement a channel compression operation on the intermediate feature to generate an initial spatial weight matrix, and output a normalized initial attention map after Sigmoid function activation. The second feature optimization branch performs semantic optimization on the intermediate feature by an InceptionE structure to generate an optimized feature.

[0103] Exemplarily, after the intermediate feature F3 is input into the optimization module 32, it is divided into the first feature optimization branch and the second feature optimization branch. The first feature optimization branch implements a channel compression operation on F3: using 1 X 1 convolution to reduce the 2048-dimensional channel to 1 dimension to generate an initial spatial weight matrix F4 (dimension X X 1 X M / 4 X N / 4), and output a normalized initial attention map C4 (dimension X X 1 X M / 4 X N / 4, value range 0-1) after Sigmoid function activation; the second feature optimization branch F3 is input into InceptionE for final semantic optimization to finally generate an optimized feature F5 (dimension X X 2048 X M / 4 X N / 4).

[0104] ​In this embodiment, the optimization module 32 includes a first feature optimization branch and a second feature optimization branch. The first branch performs a channel compression operation on the intermediate feature to generate an initial spatial weight matrix, and then performs normalization processing through a Sigmoid function activation to output an initial attention map of the focused spatial key region. The second branch performs semantic enhancement optimization on the intermediate feature by means of a multi-branch feature interaction mechanism of the InceptionE structure to generate optimized features that fuse multi-scale context information. The two branches process the intermediate feature from the perspectives of spatial attention modeling and semantic feature optimization, respectively, to provide the subsequent decoding module 33 with an initial attention map with spatial weight guidance and semantic-rich optimized features.

[0105] In some embodiments, as shown in FIG. 3, the decoding module 33 includes an attention fusion sub-module and a density decoding sub-module. Figure 2

[0106] The attention fusion sub-module is configured to perform an element-wise multiplication operation on the optimized feature and the initial attention map to generate an attention fusion feature. The density decoding sub-module is configured to perform channel compression on the attention fusion feature to generate an initial density response map, and to perform activation processing on the initial density response map through a ReLU activation function. The output feature map and the initial attention map are reshaped into two-dimensional spatial distribution forms, respectively, to output a density map and a target attention map.

[0107] The attention fusion sub-module performs an element-wise multiplication operation on the optimized feature F5 and the initial attention map C4 to generate an attention fusion feature F6, and the calculation formula is F6 = F5 C4, where denotes a broadcast multiplication along the spatial dimension. The density decoding sub-module performs channel compression and non-linear mapping on the feature F6 to generate a density map and a target attention map: first, a 1x1 convolution is performed to reduce the 2048-dimensional channel to 1 dimension to generate an initial density response map F7 (dimension Xx1xM / 4xN / 4); then, the ReLU activation function is used to eliminate negative value interference and ensure the non-negativity of the physical meaning of the density value; finally, the feature map and the attention map are reshaped into two-dimensional spatial distribution forms to output a density map C5 (dimension XxM / 4xN / 4) and a target attention map C6 (dimension XxM / 4xN / 4).

[0108] ​In this embodiment, the attention fusion sub-module generates attention fusion features with spatial attention guidance by performing element-wise multiplication operation between the optimized features and the initial attention map, so that the optimized features focus on the key regions according to the weight distribution of the initial attention map in the spatial dimension; the density decoding sub-module first performs channel compression (such as reducing the channel dimension by global pooling or 1x1 convolution) on the attention fusion features to generate an initial density response map, then enhances the nonlinear response through the ReLU activation function, and finally reshapes the output feature map and the initial attention map into two-dimensional spatial distribution forms respectively, so as to output the density map (representing the target density distribution) and the target attention map (highlighting the spatial weight distribution of the key region), and complete the decoding process from the features to the final target output.

[0109] In some embodiments, as shown in FIG. 13, the present application also provides a network model training method. The network model training method is used to train the multi-dimensional dynamic perception and progressive focusing network model for crowd counting according to any one of the above solutions. The network model training method comprises the following steps: S1101 to S1103. Figure 11

[0110] S1101: Obtain a training sample set and a multi-dimensional dynamic perception and progressive focusing network model for crowd counting.

[0111] S1102: Set a weight value for a sample in the training sample set according to a dynamic threshold and a sample density value. The dynamic threshold is positively correlated with a training period. In a case where the sample density value is greater than the dynamic threshold, the sample density value is inversely correlated with the weight value. In a case where the sample density value is not greater than the dynamic threshold, the weight value is 1.

[0112] wherein the dynamic threshold th is first defined as a curriculum learning controller:

[0113]

[0114] The threshold maintains a low value at the beginning of training, forcing the model to prioritize learning the prediction task in low-density, simple regions. As the training period epoch increases linearly, th gradually expands the coverage of difficult samples. Then the weight calculation function controls the weight of samples with different density values through the Sigmoid smooth transition and Relu activation:

[0115]

[0116] wherein weights represents the weight value assigned to the sample when calculating the loss, γ is a transition factor that controls the weight decay slope from easy to difficult samples. labels is the label count value, which is the total number of people in the training label map. The operation mechanism is as follows:

[0117] ​When labels≤th, ReLU(labels−th)=0, and weights=1, the loss contribution of simple samples is completely preserved. When labels>th, the Sigmoid term σ(·) generates a decay coefficient between 0 and 1, so that the loss weight of difficult samples is nonlinearly reduced with the difference between labels and th, and the greater the difference, the smaller the weight.

[0118] S1103: Training the network model according to the weight values of each sample, the training sample set and the target loss function to obtain a target training model, wherein the target loss function is a sum function of the density map loss function and the attention map loss function.

[0119] It can be understood that the final model loss is composed of two parts: the density map loss and the attention map loss.

[0120] First, the density map loss, the tensor calculation method of the dynamically weighted density loss is as follows:

[0121]

[0122] The MSE loss is calculated for the predicted density map tensor and the label tensor, and the result is weighted element by element with the weight tensor weightsij, and then summed and normalized by dividing by the sum of all values of the weight tensor. Where i, j are the row and column numbers of the tensor, weightsij represents the weight value of the i-th row and j-th column of the weight tensor weights. Labelsij represents the label count value of the i-th row and j-th column of the label count tensor weights, and C3ij represents the depth feature value of the i-th row and j-th column of the depth feature C3.

[0123] Then, the attention map segmentation loss is:

[0124]

[0125] Where fbs is the binary attention label obtained by processing the label map using a Gaussian kernel. The attention map generated by the model is constrained to focus on the effective head region in the spatial dimension.

[0126] The target loss function is the sum of the two loss functions, and the formula is as follows:

[0127]

[0128] Where, is an adjustable hyperparameter.

[0129] It can be understood that by supervising the model training in the above manner, a target training model is obtained, so that a high-quality density map can be generated by the target training model and its density integral can be used to obtain the final count value, thereby achieving accurate crowd counting.

[0130] The network model training method adopts an intelligent progressive focusing training mechanism and a multi-task loss optimization. In a density map regression process, a dynamic threshold is defined as a course learning controller to construct a dynamic difficulty regulation mechanism. Training stages are automatically divided according to the complexity of the density distribution. In the early stage of training, sparse area feature learning is strengthened to establish a basic perception ability. Then, dense samples are progressively introduced, and an adaptive gradient reweighting strategy is adopted. The contribution weight of the loss in different density intervals is adjusted to balance the model convergence speed, thereby systematically solving the optimization deviation problem caused by the gradient suppression of the traditional mean square error function on the sparse area, and realizing the breakthrough of the generalization performance of the model in different crowd density scenes.

[0131] In some embodiments, the electronic device provided by the embodiments of the present application includes a processor and a memory; the memory has a computer program stored therein, wherein the computer program, when executed by the processor, implements the functions of the multi-dimensional dynamic perception and progressive focusing network model for crowd counting or the network model training method.

[0132] Specifically, the processor may, for example, include a general-purpose microprocessor, an instruction set processor, and / or a related chipset, and / or a special-purpose microprocessor (such as an application-specific integrated circuit (ASIC)), etc. The processor can also include on-board memory for cache purposes. The processor can be a single processing unit or multiple processing units for executing the network model functions of the embodiments of the present application, or a single processing unit or multiple processing units for different actions according to the method processes of the embodiments of the present application.

[0133] The memory may, for example, be any medium capable of containing, storing, communicating, propagating or transmitting instructions. For example, the memory may include, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared or semiconductor systems, devices, devices or propagation media. Specific examples of memory include magnetic storage devices such as magnetic tapes or hard disk drives (HDD); optical storage devices such as compact discs (CD-ROM); and also random access memory (RAM) or flash memory; and / or wired / wireless communication links.

[0134] The present application also provides a computer readable medium having a computer program stored thereon, which, when executed by a processor, implements the functions of the multi-dimensional dynamic perception and progressive focusing network model for crowd counting or the network model training method. The computer readable medium can be included in the devices / apparatuses / systems described in the above embodiments; or it can exist separately and not be assembled into the devices / apparatuses / systems. The computer readable medium carries one or more programs, which, when executed, implement the functions of the multi-dimensional dynamic perception and progressive focusing network model for crowd counting or the network model training method.

[0135] It will be appreciated by those skilled in the art that features of the various embodiments and / or claims of the present application can be combined and / or interchanged, even though such combinations and / or interchanges are not expressly disclosed in the present application. Specifically, features of the various embodiments and / or claims of the present application can be combined and / or interchanged, even though such combinations and / or interchanges are not expressly disclosed in the present application. All of these combinations and / or interchanges are within the scope of the present application. Accordingly, the scope of the present application should be determined by the appended claims and equivalents thereof, rather than by the description of the embodiments of the application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the present application.

Claims

1. A method for constructing a multidimensional dynamic sensing and progressive focusing network model for crowd counting, characterized in that, The multi-dimensional dynamic perception and progressive focusing network model for crowd counting comprises a front-end sub-network, a main body sub-network and a rear-end sub-network; The front-end sub-network comprises a preprocessing module and a feature extraction module, the preprocessing module is used for preprocessing an input image, and the feature extraction module is used for shallow image feature extraction on the preprocessed input image to obtain image shallow features; The main body sub-network comprises an Inception network module, an attention coupling module and a heterogeneous attention coordinator, the Inception network module is used for realizing multi-branch feature interaction based on the image shallow features to generate deep features and cross-layer features; the attention coupling module is used for cross-attention processing and multi-scale feature fusion on the deep features and the cross-layer features, and the heterogeneous attention coordinator is used for attention modeling across dimensions on the fused features and cross-channel distribution calibration through layer normalization to output deep features; wherein the attention coupling module comprises a feature splicing sub-module, an attention calculation sub-module and an optimization sub-module; the feature splicing sub-module is used for splicing the deep features and the cross-layer features along the channel dimension to generate spliced features, and then performing feature compression on the spliced features through a preprocessing convolution group to output compressed features; the attention calculation sub-module is used for inputting the compressed features into a multi-head mixed convolution attention layer after reshaping into a preset format, and processing the input features through four groups of deep convolution branches with dynamic kernel sizes of the multi-head mixed convolution attention layer, and performing element-wise multiplication on the four groups of features after channel recombination and the value vector after linear projection to generate first fused features; the optimization sub-module is used for processing the first fused features through a multi-branch hollow convolution pyramid, and performing cross-scale fusion on four-way outputs after channel splicing through a 1x1 convolution to generate second fused features; wherein the first branch of the multi-branch hollow convolution pyramid deploys average pooling, 1x1 convolution and up-sampling to model global semantics; the second branch uses a 1x1 convolution to retain the original features as an identity mapping; the third branch uses a 3x3 hollow convolution with an expansion rate of 2 to extract medium receptive field features; and the fourth branch uses a 3x3 hollow convolution with an expansion rate of 4 to capture a large range of context. The rear-end sub-network comprises an adjustment module, an optimization module and a decoding module, the adjustment module is used for high-dimensional feature construction and spatial resolution adjustment on the deep features to obtain intermediate features, the optimization module is used for feature optimization on the intermediate features to obtain an initial attention map and optimized features, and the decoding module is used for attention fusion and density decoding based on the optimized features and the initial attention map to output a density map and a target attention map.

2. The method for constructing a multi-dimensional dynamic perception and progressive focusing network model for crowd counting as claimed in claim 1 wherein, The feature extraction module comprises a first convolution sub-module and a second convolution sub-module; The first convolution sub-module is used for feature extraction on the preprocessed input image through a plurality of convolution layers, and outputs initial shallow features, wherein each convolution layer is processed using a batch normalization algorithm and an activation function after processing; The second convolutional submodule is configured to process the initial shallow feature through a dynamic adaptive convolution unit to obtain a shallow feature with enhanced details.

3. The method for constructing multi-dimensional dynamic perception and progressive focusing network model for crowd counting as claimed in claim 1 wherein, The Inception network module comprises an InceptionA structure group, an InceptionB structure group and an InceptionC structure group connected in sequence, the InceptionA structure group comprises a plurality of cascaded InceptionA structures, the InceptionB structure group comprises at least one InceptionB structure, and the InceptionC structure group comprises a plurality of cascaded InceptionC structures, wherein the InceptionA structure, the InceptionB structure and the InceptionC structure belong to an Inception-v3 structure respectively. The InceptionA structure is configured to extract features in a four-way parallel structure and splice the four-way extracted features along a channel dimension; the InceptionB structure is configured to perform spatial down-sampling on the output features of the InceptionA structure group through three-way heterogeneous convolution branches respectively, and splice the three-way output features along a channel dimension; and the InceptionC structure is internally provided with a double-path 7x7 convolution decomposition into a 1x7 and a 7x1 convolution pair, which is combined with a 1x1 convolution for channel regulation, and the output features of the last two InceptionC structures in the InceptionC structure group are taken as the cross-layer feature and the deep feature.

4. The method for constructing a multi-dimensional dynamic perception and progressive focusing network model for crowd counting as claimed in claim 1 wherein, The heterogeneous attention coordinator comprises an attention modeling submodule and a calibration submodule. The attention modeling submodule is configured to model attention across dimensions through two parallel paths based on the input second fusion feature, and adaptively fuse the weights of the two parallel paths through learnable parameters to output a third fusion feature. The calibration submodule is configured to perform cross-channel distribution calibration on the third fusion feature through layer normalization to output the deep feature.

5. The method for construction of multi-dimensional dynamic perception and progressive focusing network model for crowd counting as claimed in claim 4 wherein, The attention modeling submodule comprises a channel attention path, a spatial attention path and a fusion path. The channel attention path is configured to perform a global average pooling operation on the input feature to compress a spatial dimension into a single pixel point, generate a channel energy vector, perform cross-channel interaction on the channel energy vector through one-dimensional convolution with an adaptive kernel size, and generate a channel dimension weight after Sigmoid function normalization. The spatial attention path is configured to perform maximum pooling and average pooling on the input feature simultaneously to extract high response features of a head significant area and overall spatial distribution features respectively, splice the two features along a channel dimension to form a joint feature map, perform spatial context modeling through 7x7 large kernel convolution, and generate a spatial dimension weight after batch normalization and Sigmoid activation. The fusion path is configured to dynamically weight and fuse the channel dimension weight and the spatial dimension weight through a learnable coefficient, add a preset residual connection ratio of a residual feature, and output the third fusion feature.

6. The method for constructing multi-dimensional dynamic perception and progressive focusing network model for crowd counting as claimed in claim 1 wherein, The adjusting module comprises an InceptionD structure, an InceptionE structure and an up-sampling sub-module, and the InceptionD structure and the InceptionE structure belong to an Inception-v3 structure respectively; The InceptionD structure is configured to perform channel dimension expansion on the deep features through a three-way heterogeneous convolution strategy to generate first high-dimensional features; The InceptionE structure is configured to implement multi-branch feature interaction processing and output second high-dimensional features after channel concatenation of four-way features outputted; The up-sampling sub-module is configured to perform 2 times spatial up-sampling on the second high-dimensional features through a nearest neighbor interpolation algorithm to generate the intermediate features.

7. The method for constructing multi-dimensional dynamic perception and progressive focusing network model for crowd counting as claimed in claim 1 wherein, The optimization module comprises a first feature optimization branch and a second feature optimization branch; The first feature optimization branch is configured to perform channel compression operation on the intermediate features to generate an initial spatial weight matrix, and output a normalized initial attention map after Sigmoid function activation; The second feature optimization branch is configured to perform semantic optimization on the intermediate features through the InceptionE structure to generate the optimized features.

8. The method for constructing a multi-dimensional dynamic perception and progressive focusing network model for crowd counting as claimed in claim 7 wherein, The decoding module comprises an attention fusion sub-module and a density decoding sub-module; The attention fusion sub-module is configured to perform element-wise multiplication operation on the optimized features and the initial attention map to generate attention fusion features; The density decoding sub-module is configured to perform channel compression on the attention fusion features to generate an initial density response map, and perform activation processing on the initial density response map through a ReLU activation function, reshape the output feature map and the initial attention map into two-dimensional spatial distribution forms respectively, and output the density map and the target attention map.

9. A network model training method, comprising: The network model training method is configured to train the model constructed by the method according to any one of claims 1 to 8. The network model training method comprises: obtaining a training sample set and the multi-dimensional dynamic perception and progressive focusing network model for crowd counting; setting a weight value of each sample in the training sample set according to a dynamic threshold and a sample density value, wherein the dynamic threshold is positively correlated with a training period, the sample density value is inversely correlated with the weight value when the sample density value is greater than the dynamic threshold, and the weight value is 1 when the sample density value is not greater than the dynamic threshold; training the network model according to the weight value of each sample, the training sample set and a target loss function to obtain a target training model, wherein the target loss function is a sum function of a density map loss function and an attention map loss function.

Citation Information

Patent Citations

  • Crowd counting method based on attention feature fusion and multi-column feature enhancement

    CN118644821A

  • DGCC-Net model-based crowd counting method

    CN120220065A