Crowd counting method, device, electronic device, and storage medium
By performing feature interaction and distribution modulation on multi-modal data, and dynamically adjusting the preset model algorithm, it solves the accuracy problem of crowd count calculation under insufficient fitting, missing data or noise interference, and achieves more efficient and reliable crowd counting. .
Patent Information
- Application Number
- CN202410543567.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-06
- Publication Date
- 2024-08-30
- Estimated Expiration
- 2044-05-06
AI Technical Summary
In the existing technology, the crowd number calculation results are inaccurate when the preset model algorithm is insufficiently fitted and/or data is missing and/or data noise interferes.
By extracting features from at least two modal data, performing neural network calculation of the interactive features, generating distributed modulation parameters, which are used to fuse modulation preset model algorithms and dynamically adjust processing parameters to adapt to data changes.
The accuracy and robustness of crowd number calculations are improved, and the accuracy of calculation results can be maintained even when the preset model is insufficiently fitted and data is missing or noise interferes.
Smart Images

Figure CN118135495B
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of data processing technology, and in particular to a method, device, electronic device, storage medium and computer program for counting people. Background Art
[0002] In the field of computer vision, the crowd counting task aims to estimate the number of people in social scenarios such as real-time crowd monitoring, traffic control, and public area crowd flow analysis using algorithms specifically targeting crowd density. In order to ensure public safety, such as preventing stampedes, crowd density monitoring is particularly important, and the crowd counting task can effectively achieve crowd density monitoring.
[0003] In the related art, the implementation method of the crowd counting task is mainly to extract features from image data containing a crowd based on a preset model algorithm, generate a crowd density map according to the extracted features, and calculate the number of people based on the crowd density map. However, after the preset model algorithm used in the related art is trained, the crowd number calculation ability of the preset model algorithm is solidified, which leads to the problem of inaccurate crowd number calculation results when the preset model algorithm is insufficiently fitted and / or data is missing and / or data noise interference is encountered in the related art. Summary of the invention
[0004] The present disclosure provides a method, device, electronic device, storage medium and computer program for counting a crowd, the main purpose of which is to solve the problem of inaccurate calculation results of the number of people in the related art when a preset model algorithm is not well-fitted and / or data is missing and / or data noise interferes.
[0005] According to a first aspect of the present disclosure, a method for counting people is provided, comprising:
[0006] Based on a preset model algorithm, feature extraction is performed on at least two modal data respectively to obtain a first modal feature corresponding to the first modal data and a second modal feature corresponding to the second modal data, wherein the at least two modal data include the first modal data and the second modal data;
[0007] Interacting the first target channel data in the first modal feature and the second target channel data in the second modal feature to obtain the first modal feature after interaction and the second modal feature after interaction, respectively, wherein the first target channel data corresponds to the second target channel data one by one;
[0008] Performing neural network calculations on the first modal feature after the interaction and the second modal feature after the interaction respectively to obtain a first distributed modulation parameter corresponding to the first modal feature after the interaction and a second distributed modulation parameter corresponding to the second modal feature after the interaction;
[0009] Performing fusion modulation on the first processing parameters in the first batch of normalized layers based on the first distribution modulation parameters and performing fusion modulation on the second processing parameters in the second batch of normalized layers based on the second distribution modulation parameters to obtain a post-modulation preset model algorithm, wherein the preset model algorithm includes the first batch of normalized layers and the second batch of normalized layers;
[0010] The target number of the target population is calculated based on the preset model algorithm after modulation.
[0011] Optionally, performing neural network calculation on the first modal feature after interaction and the second modal feature after interaction respectively to obtain a first distributed modulation parameter corresponding to the first modal feature after interaction and a second distributed modulation parameter corresponding to the second modal feature after interaction includes:
[0012] Performing neural network calculation on the first modal feature after the interaction based on a first preset parameter modulation generation algorithm to obtain a first distributed modulation parameter; and
[0013] Based on a second preset parameter modulation generation algorithm, a neural network calculation is performed on the second modal feature after the interaction to obtain a second distributed modulation parameter.
[0014] Optionally, performing feature extraction on at least two modal data based on a preset model algorithm to obtain a first modal feature corresponding to the first modal data and a second modal feature corresponding to the second modal data includes:
[0015] Extracting features from the first modal data based on a first feature extraction network to obtain the first modal features; and
[0016] Performing feature extraction on the second modality data based on a second feature extraction network to obtain the second modality feature, wherein the preset model algorithm includes the first feature extraction network and the second feature extraction network, the first feature extraction network includes the first batch of normalization layers, and the second feature extraction network includes the second batch of normalization layers.
[0017] Optionally, the first processing parameters in the first batch of normalized layers are fused and modulated based on the first distributed modulation parameters, and the second processing parameters in the second batch of normalized layers are fused and modulated based on the second distributed modulation parameters to obtain a post-modulation preset model algorithm, including:
[0018] Performing fusion modulation on the first distributed modulation parameter and the first processing parameter based on a first preset fusion algorithm to obtain a modulated first processing parameter, and performing fusion modulation on the second distributed modulation parameter and the second processing parameter based on a second preset fusion algorithm to obtain a modulated second processing parameter;
[0019] The first processing parameters in the first batch of normalized layers are updated to the first processing parameters after modulation, and the second processing parameters in the second batch of normalized layers are updated to the second processing parameters after modulation, so as to obtain the post-modulation preset model algorithm.
[0020] Optionally, before interacting the first target channel data in the first modal feature and the second target channel data in the second modal feature, the method includes:
[0021] Calculating a first data distribution of each first channel data in the first modal feature, and calculating a second data distribution of each second channel data in the second modal feature;
[0022] Comparing the first data distributions with the second data distributions corresponding thereto one by one, to obtain respective comparison results, wherein the respective comparison results are used to indicate the distribution difference between the respective first channel data and the second channel data corresponding thereto;
[0023] Selecting a preset number of target comparison results with the largest distribution differences among the comparison results;
[0024] The preset number of first target channel data is determined in the first channel data according to the target comparison result, and the preset number of second target channel data is determined in the second channel data according to the target comparison result.
[0025] Optionally, the interacting the first target channel data in the first modal feature and the second target channel data in the second modal feature includes:
[0026] Calculating a first average distribution of all the first channel data in the first modal feature and calculating a second average distribution of all the second channel data in the second modal feature;
[0027] Select any first target channel data from the preset number of first target channel data, and select second target channel data corresponding to the any first target channel data from the preset number of second target channel data;
[0028] Comparing a first data distribution corresponding to any of the first target channel data with the first average distribution for distribution difference to obtain a first comparison result, and comparing a second data distribution of the second target channel data corresponding to any of the first target channel data with the second average distribution to obtain a second comparison result;
[0029] When it is determined that the distribution difference displayed by the first comparison result is greater than the distribution difference displayed by the second comparison result, determining the first modal feature as a receiver, so that the first modal feature receives the second target channel data corresponding to any one of the first target channel data for feature splicing;
[0030] When it is determined that the distribution difference shown by the second comparison result is greater than the distribution difference shown by the first comparison result, the second modal feature is determined as the receiver, so that the second modal feature receives any one of the first target channel data for feature splicing until the interaction between the preset number of first target channel data and the preset number of second target channel data is completed.
[0031] Optionally, after interacting the first target channel data in the first modal feature and the second target channel data in the second modal feature to obtain the first modal feature after interaction and the second modal feature after interaction, the method includes:
[0032] Calculating a first weight corresponding to the first modal feature after the interaction based on a preset gating network and calculating a second weight corresponding to the second modal feature after the interaction based on the preset gating network;
[0033] Normalizing the first weight and the second weight to obtain a processed first weight and a processed second weight;
[0034] Performing weighted fusion based on the processed first weight, the processed second weight, the first modal feature after interaction, and the second modal feature after interaction to obtain a multimodal data probability density map;
[0035] The target number of the target population is calculated according to the multimodal data probability density map.
[0036] According to a second aspect of the present disclosure, there is provided a crowd counting device, comprising:
[0037] an extraction unit, configured to perform feature extraction on at least two modal data respectively based on a preset model algorithm to obtain a first modal feature corresponding to the first modal data and a second modal feature corresponding to the second modal data, wherein the at least two modal data include the first modal data and the second modal data;
[0038] an interaction unit, configured to interact the first target channel data in the first modal feature and the second target channel data in the second modal feature, to obtain the first modal feature after interaction and the second modal feature after interaction, respectively, wherein the first target channel data and the second target channel data correspond one to one;
[0039] A first calculation unit is used to perform neural network calculation on the first modal feature after interaction and the second modal feature after interaction, respectively, to obtain a first distribution modulation parameter corresponding to the first modal feature after interaction and a second distribution modulation parameter corresponding to the second modal feature after interaction;
[0040] A modulation unit, configured to perform fusion modulation on a first processing parameter in a first batch of normalized layers based on the first distributed modulation parameter and to perform fusion modulation on a second processing parameter in a second batch of normalized layers based on the second distributed modulation parameter, so as to obtain a post-modulation preset model algorithm, wherein the preset model algorithm includes the first batch of normalized layers and the second batch of normalized layers;
[0041] The second calculation unit is used to calculate the target number of the target population based on the modulated preset model algorithm.
[0042] Optionally, the first computing unit is further used for:
[0043] Performing neural network calculation on the first modal feature after the interaction based on a first preset parameter modulation generation algorithm to obtain a first distributed modulation parameter; and
[0044] Based on a second preset parameter modulation generation algorithm, a neural network calculation is performed on the second modal feature after the interaction to obtain a second distributed modulation parameter.
[0045] Optionally, the extraction unit is further configured to:
[0046] Extracting features from the first modal data based on a first feature extraction network to obtain the first modal features; and
[0047] Performing feature extraction on the second modality data based on a second feature extraction network to obtain the second modality feature, wherein the preset model algorithm includes the first feature extraction network and the second feature extraction network, the first feature extraction network includes the first batch of normalization layers, and the second feature extraction network includes the second batch of normalization layers.
[0048] Optionally, the modulation unit includes:
[0049] The modulation module is used to perform fusion modulation on the first distributed modulation parameter and the first processing parameter based on a first preset fusion algorithm to obtain a modulated first processing parameter and to perform fusion modulation on the second distributed modulation parameter and the second processing parameter based on a second preset fusion algorithm to obtain a modulated second processing parameter;
[0050] The updating module is used to update the first processing parameters in the first batch of normalized layers to the first processing parameters after modulation and to update the second processing parameters in the second batch of normalized layers to the second processing parameters after modulation, so as to obtain the preset model algorithm after modulation.
[0051] Optionally, the device comprises:
[0052] a third calculation unit, configured to calculate a first data distribution of each first channel data in the first modal feature, and calculate a second data distribution of each second channel data in the second modal feature;
[0053] a comparison unit, used for comparing the first data distributions with the second data distributions corresponding thereto one by one, to obtain comparison results, wherein the comparison results are used to indicate the distribution difference between the first channel data and the second channel data corresponding thereto;
[0054] A selection unit, configured to select a preset number of target comparison results having the largest distribution differences from among the comparison results;
[0055] A determination unit is used to determine the preset number of first target channel data in the first channel data according to the target comparison result and to determine the preset number of second target channel data in the second channel data according to the target comparison result.
[0056] Optionally, the interaction unit includes:
[0057] a calculation module, configured to calculate a first average distribution of all the first channel data in the first modal feature and calculate a second average distribution of all the second channel data in the second modal feature;
[0058] A selection module, configured to select any first target channel data from the preset number of first target channel data, and select second target channel data corresponding to the any first target channel data from the preset number of second target channel data;
[0059] A comparison module, configured to compare a first data distribution corresponding to any of the first target channel data with the first average distribution for distribution difference to obtain a first comparison result, and to compare a second data distribution of a second target channel data corresponding to any of the first target channel data with the second average distribution to obtain a second comparison result;
[0060] A determination module, configured to determine that the first modal feature is a receiver when it is determined that the distribution difference displayed by the first comparison result is greater than the distribution difference displayed by the second comparison result, so that the first modal feature receives the second target channel data corresponding to any one of the first target channel data for feature splicing;
[0061] The determination module is also used to determine that the second modal feature is the receiver when it is determined that the distribution difference shown by the second comparison result is greater than the distribution difference shown by the first comparison result, so that the second modal feature receives any one of the first target channel data for feature splicing until the interaction between the preset number of first target channel data and the preset number of second target channel data is completed.
[0062] Optionally, the device comprises:
[0063] a fourth calculation unit, configured to calculate a first weight corresponding to the first modal feature after the interaction based on a preset gating network and to calculate a second weight corresponding to the second modal feature after the interaction based on the preset gating network;
[0064] A processing unit, configured to perform normalization processing on the first weight and the second weight to obtain a processed first weight and a processed second weight;
[0065] A fusion unit, configured to perform weighted fusion based on the processed first weight, the processed second weight, the first modal feature after interaction, and the second modal feature after interaction to obtain a probability density map of multimodal data;
[0066] A fifth calculation unit is used to calculate the target number of the target population according to the multimodal data probability density map.
[0067] According to a third aspect of the present disclosure, there is provided an electronic device, including:
[0068] at least one processor; and
[0069] a memory communicatively connected to the at least one processor; wherein,
[0070] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method described in the first aspect.
[0071] According to a fourth aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable the computer to execute the method described in the first aspect.
[0072] According to a fifth aspect of the present disclosure, a computer program product is provided, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements the method as described in the first aspect above.
[0073] The method, device, electronic device, storage medium and computer program for counting people provided by the present disclosure respectively extract features of at least two modal data based on a preset model algorithm to obtain a first modal feature corresponding to the first modal data and a second modal feature corresponding to the second modal data, wherein the at least two modal data include the first modal data and the second modal data; interact the first target channel data in the first modal feature and the second target channel data in the second modal feature to respectively obtain the first modal feature after interaction and the second modal feature after interaction, wherein the first target channel data and the second target channel data correspond one to one; respectively The first modal feature after interaction and the second modal feature after interaction are subjected to neural network calculation to obtain a first distribution modulation parameter corresponding to the first modal feature after interaction and a second distribution modulation parameter corresponding to the second modal feature after interaction; the first processing parameters in the first batch of normalization layers are fused and modulated based on the first distribution modulation parameters, and the second processing parameters in the second batch of normalization layers are fused and modulated based on the second distribution modulation parameters to obtain a preset model algorithm after modulation, wherein the preset model algorithm includes the first batch of normalization layers and the second batch of normalization layers; the target number of the target population is calculated based on the preset model algorithm after modulation. Compared with the related art, the first modal feature and the second modal feature are extracted from at least two modal data based on a preset model algorithm, the first channel data and the second channel data are interacted with each other for the first modal feature and the second modal feature to obtain the first modal feature after interaction and the second modal feature after interaction, neural network calculation is performed on the first modal feature after interaction and the second modal feature after interaction to obtain the first distributed modulation parameter and the second distributed modulation parameter, the first processing parameter and the second processing parameter respectively corresponding to each other in the preset model algorithm are fused and modulated based on the first distributed modulation parameter and the second distributed modulation parameter to obtain the preset model algorithm after modulation, and the modulation is performed based on the modulation. The preset model algorithm after modulation calculates the target number of the target population, that is, the preset model algorithm or the preset model algorithm after modulation modulates and fuses the first processing parameter and the second processing parameter in the preset model algorithm or the preset model algorithm after modulation in the process of calculating the target number each time, thereby realizing the dynamic improvement of the population number calculation ability of the preset model algorithm or the preset model algorithm after modulation, and then the preset model algorithm or the preset model algorithm after modulation can adapt to the situation of insufficient fitting of the preset model algorithm and / or missing data and / or data noise interference, thereby solving the problem of inaccurate calculation results of the population number in the related technology when encountering insufficient fitting of the preset model algorithm and / or missing data and / or data noise interference. BRIEF DESCRIPTION OF THE DRAWINGS
[0074] The accompanying drawings constituting a part of the present invention are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the accompanying drawings:
[0075] Figure 1 A schematic diagram of a crowd counting method provided by an embodiment of the present disclosure;
[0076] Figure 2 A schematic diagram of a multimodal interaction process provided by an embodiment of the present disclosure;
[0077] Figure 3 A schematic diagram of a data-driven modulation process provided by an embodiment of the present disclosure;
[0078] Figure 4 A schematic diagram of a preset model algorithm network structure provided in an embodiment of the present disclosure;
[0079] Figure 5 A schematic diagram of the structure of a crowd counting device provided by an embodiment of the present disclosure;
[0080] Figure 6 A schematic diagram of the structure of another crowd counting device provided by an embodiment of the present disclosure;
[0081] Figure 7 A schematic block diagram of an exemplary electronic device 300 provided for an embodiment of the present disclosure. DETAILED DESCRIPTION
[0082] The present invention will be described in detail below with reference to the accompanying drawings and in combination with embodiments. It should be noted that the embodiments and features in the embodiments of the present invention can be combined with each other without conflict.
[0083] The following detailed description is an exemplary description, which is intended to provide further detailed description of the present invention. Unless otherwise specified, all technical terms used in the present invention have the same meaning as those generally understood by those skilled in the art to which the present invention belongs. The terms used in the present invention are only for describing specific embodiments, and are not intended to limit the exemplary embodiments according to the present invention.
[0084] In addition, the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein.
[0085] The following describes the crowd counting method, apparatus, electronic device, storage medium, and computer program according to the embodiments of the present disclosure with reference to the accompanying drawings.
[0086] In order to at least solve the technical problem in the related art that the calculation result of the number of people is inaccurate when the preset model algorithm is insufficiently fitted and / or data is missing and / or data noise interferes, this embodiment provides a method for counting people.
[0087] Figure 1 The following is a flow chart of a method for counting people provided by an embodiment of the present disclosure. Figure 1 As shown, the method comprises the following steps:
[0088] Step 101, performing feature extraction on at least two modal data based on a preset model algorithm to obtain a first modal feature corresponding to the first modal data and a second modal feature corresponding to the second modal data, wherein the at least two modal data include the first modal data and the second modal data;
[0089] As a refinement of the above step 101, feature extraction is performed on at least two modal data based on the preset model algorithm to obtain the first modal feature and the second modal feature, so as to reduce the data dimension of the first modal data and the second modal data and highlight important information in the first modal data and the second modal data, and the at least two modal data include the first modal data and the second modal data.
[0090] In some embodiments, the preset model algorithm includes but is not limited to a preset model algorithm including a dual-stream feature extraction network, and the preset model algorithm including a dual-stream feature extraction network is used to perform feature extraction on the first modal data and the second modal data respectively. The foregoing description of the preset model algorithm is merely exemplary and does not constitute a limitation of the present disclosure.
[0091] In some embodiments, the first modal data may be but not limited to visible light data, thermal infrared data, ultraviolet light data, microwave data, radar data, etc. Similarly, the second modal data may be but not limited to visible light data, thermal infrared data, ultraviolet light data, microwave data, radar data, etc. It should be understood that the foregoing description of the first modal data and the second modal data is merely exemplary and does not constitute a limitation of the present disclosure.
[0092] In some embodiments, the first modal data is preferably visible light data, namely, RGB modal data; and the second modal data is preferably thermal infrared data, namely, T modal data.
[0093] Step 102, interacting the first target channel data in the first modal feature and the second target channel data in the second modal feature to obtain the first modal feature after interaction and the second modal feature after interaction, respectively, wherein the first target channel data and the second target channel data correspond one to one;
[0094] As a refinement of the above step 102, the first target channel data in the first modal feature and the second target channel data in the second modal feature are interacted to obtain the first modal feature after interaction and the second modal feature after interaction, respectively. That is, the first modal feature is corrected based on the second target channel data to obtain the first modal feature after interaction, or the second modal feature is corrected based on the first target channel data to obtain the second modal feature after interaction. The first modal feature and the second modal feature are enhanced through the interaction between the first target channel data and the second target channel data.
[0095] Step 103, performing neural network calculation on the first modal feature after interaction and the second modal feature after interaction respectively, to obtain a first distributed modulation parameter corresponding to the first modal feature after interaction and a second distributed modulation parameter corresponding to the second modal feature after interaction.
[0096] As a refinement of the above-mentioned step 103, the first distribution modulation parameters include but are not limited to the mean and variance of the first modal feature after the interaction, and the first distribution modulation parameters are used to represent the data distribution of the first modal feature after the interaction. The second distribution modulation parameters include but are not limited to the mean and variance of the second modal feature after the interaction, and the second distribution modulation parameters are used to represent the data distribution of the first modal feature after the interaction, that is, the first distribution modulation parameters represent the distribution characteristics of the first modal feature after the interaction, and the second distribution modulation parameters represent the distribution characteristics of the second modal feature after the interaction.
[0097] Step 104, fusing and modulating the first processing parameters in the first batch of normalized layers based on the first distributed modulation parameters and fusing and modulating the second processing parameters in the second batch of normalized layers based on the second distributed modulation parameters, to obtain a post-modulation preset model algorithm, wherein the preset model algorithm includes the first batch of normalized layers and the second batch of normalized layers;
[0098] As a refinement of the above step 104, the first processing parameters in the first batch of normalized layers in the preset model algorithm are fused modulated based on the first distributed modulation parameters, and the second processing parameters in the second batch of normalized layers in the preset model algorithm are fused modulated based on the second distributed modulation parameters to obtain the modulated preset model algorithm, that is, the first processing parameters and the second processing parameters are fused modulated based on the first distributed modulation parameters and the second distributed modulation parameters respectively to update the performance of the preset model algorithm, wherein the first processing parameters include but are not limited to scaling factors and shift factors in the first batch of normalized layers, and the second processing parameters include but are not limited to scaling factors and shift factors in the second batch of normalized layers.
[0099] Step 105, calculating the target number of the target population based on the modulated preset model algorithm.
[0100] As a refinement of the above-mentioned step 105, the target number of the target population is calculated by using the modulated preset model algorithm adjusted by step 104, so that even if the preset model algorithm is insufficiently fitted and / or the collected target population data is missing and / or the collected target population data is subject to noise interference, the calculated target number is sufficiently accurate.
[0101] The method for counting people provided by the present disclosure extracts features from at least two modal data based on a preset model algorithm to obtain a first modal feature corresponding to the first modal data and a second modal feature corresponding to the second modal data, wherein the at least two modal data include the first modal data and the second modal data; interacts the first target channel data in the first modal feature and the second target channel data in the second modal feature to obtain a first modal feature after interaction and a second modal feature after interaction, wherein the first target channel data and the second target channel data correspond one to one; performs neural network calculation on the first modal feature after interaction and the second modal feature after interaction to obtain a first distribution modulation parameter corresponding to the first modal feature after interaction and a second distribution modulation parameter corresponding to the second modal feature after interaction; performs fusion modulation on the first processing parameter in the first batch of normalization layers based on the first distribution modulation parameter and performs fusion modulation on the second processing parameter in the second batch of normalization layers based on the second distribution modulation parameter to obtain a preset model algorithm after modulation, wherein the preset model algorithm includes the first batch of normalization layers and the second batch of normalization layers; and calculates the target number of the target population based on the preset model algorithm after modulation. Compared with the related art, the first modal feature and the second modal feature are extracted from at least two modal data based on a preset model algorithm, the first channel data and the second channel data are interacted with each other for the first modal feature and the second modal feature to obtain the first modal feature after interaction and the second modal feature after interaction, neural network calculation is performed on the first modal feature after interaction and the second modal feature after interaction to obtain the first distributed modulation parameter and the second distributed modulation parameter, the first processing parameter and the second processing parameter respectively corresponding to each other in the preset model algorithm are fused and modulated based on the first distributed modulation parameter and the second distributed modulation parameter to obtain the preset model algorithm after modulation, and the modulation is performed based on the modulation. The preset model algorithm after modulation calculates the target number of the target population, that is, the preset model algorithm or the preset model algorithm after modulation modulates and fuses the first processing parameter and the second processing parameter in the preset model algorithm or the preset model algorithm after modulation in the process of calculating the target number each time, thereby realizing the dynamic improvement of the population number calculation ability of the preset model algorithm or the preset model algorithm after modulation, and then the preset model algorithm or the preset model algorithm after modulation can adapt to the situation of insufficient fitting of the preset model algorithm and / or missing data and / or data noise interference, thereby solving the problem of inaccurate calculation results of the population number in the related technology when encountering insufficient fitting of the preset model algorithm and / or missing data and / or data noise interference.
[0102] As a refinement of the embodiment of the present disclosure, when executing step 103 to perform neural network calculations on the first modal feature after interaction and the second modal feature after interaction, respectively, to obtain first distributed modulation parameters corresponding to the first modal feature after interaction and second distributed modulation parameters corresponding to the second modal feature after interaction, the following implementation methods may also be adopted but are not limited to, for example: performing neural network calculations on the first modal feature after interaction based on a first preset parameter modulation generation algorithm to obtain first distributed modulation parameters; and performing neural network calculations on the second modal feature after interaction based on a second preset parameter modulation generation algorithm to obtain second distributed modulation parameters.
[0103] As a refinement of the above embodiment, a neural network calculation is performed on the first modal feature after the interaction based on the first preset parameter modulation generation algorithm to obtain a first distributed modulation parameter, that is, the first modal feature after the interaction is input into the first preset parameter modulation generation algorithm, and the first distributed modulation parameter is obtained after calculation by the first preset parameter modulation generation algorithm. Similarly, the second modal feature after the interaction is input into the second preset parameter modulation generation algorithm, and the second distributed modulation parameter is obtained after calculation by the second preset parameter modulation generation algorithm, wherein the first preset parameter modulation generation algorithm can adopt but is not limited to a network structure with two convolutional layers and one fully connected layer, and the second preset parameter modulation generation algorithm can adopt but is not limited to a network structure with two convolutional layers and one fully connected layer. It should be understood that the aforementioned limitation on the network structure of the first preset parameter modulation generation algorithm and the second preset parameter modulation generation algorithm is only exemplary, and the embodiments of the present disclosure do not limit the specific network structures of the two, and do not limit the network structures of the two to be the same.
[0104] As a refinement of the above embodiment, when executing step 101 to extract features from at least two modal data based on a preset model algorithm to obtain a first modal feature corresponding to the first modal data and a second modal feature corresponding to the second modal data, the following implementation methods may also be used but are not limited to, for example: extracting features from the first modal data based on a first feature extraction network to obtain the first modal feature; and extracting features from the second modal data based on a second feature extraction network to obtain the second modal feature, wherein the preset model algorithm includes the first feature extraction network and the second feature extraction network, the first feature extraction network includes the first batch of normalization layers, and the second feature extraction network includes the second batch of normalization layers.
[0105] As a refinement of the above embodiment, the preset model algorithm is a model algorithm of a dual-stream feature extraction network including the first feature extraction network and the second feature extraction network, the first batch of normalization layers are a component of the first feature extraction network, and the second batch of normalization layers are a component of the second feature extraction network. Based on the first feature extraction network, feature extraction is performed on the first modal data to obtain the first modal feature; and based on the second feature extraction network, feature extraction is performed on the second modal data to obtain the second modal feature, thereby realizing feature extraction of multimodal data.
[0106] As a refinement of the above embodiment, when executing step 104 to perform fusion modulation on the first processing parameters in the first batch of normalized layers based on the first distributed modulation parameters and to perform fusion modulation on the second processing parameters in the second batch of normalized layers based on the second distributed modulation parameters to obtain the post-modulation preset model algorithm, the following implementation methods may also be adopted but are not limited to, for example: performing fusion modulation on the first distributed modulation parameters and the first processing parameters based on the first preset fusion algorithm to obtain the first processing parameters after modulation and performing fusion modulation on the second distributed modulation parameters and the second processing parameters based on the second preset fusion algorithm to obtain the second processing parameters after modulation; updating the first processing parameters in the first batch of normalized layers to the first processing parameters after modulation and updating the second processing parameters in the second batch of normalized layers to the second processing parameters after modulation to obtain the post-modulation preset model algorithm.
[0107] In order to facilitate the understanding of the steps involved in the above-mentioned embodiment, the present embodiment provides an exemplary description. It is necessary to understand that the process of fusion modulation of the first processing parameter is the same as the process of fusion modulation of the second processing parameter. For the sake of clarity and conciseness, the present embodiment exemplifies the process of fusion modulation of the first processing parameter, and the fusion modulation process of the second processing parameter is not repeated in this embodiment. The exemplary description of the fusion modulation of the first processing parameter is as follows: when the step of the first feature extraction network performing feature extraction on the first modal data reaches the last layer in the convolution module of the first feature extraction network, the first feature extraction network uses the last convolution layer to output the first modal feature after interaction, and inputs the first modal feature after interaction into the first preset parameter modulation generation algorithm. After the first preset parameter modulation generation algorithm calculates the first modal feature after interaction, the first distribution modulation parameter is obtained.
[0108] In order to more clearly show the calculation process of the first distributed modulation parameter, formula (1) is as follows:
[0109] Formula (1)
[0110] in, is the first distributed modulation parameter and is the mean, is the variance, F is the first modal feature after the interaction, and formula (1) shows the process of calculating the first modal feature after the interaction via two convolution layers and one fully connected layer.
[0111] After obtaining the first distributed modulation parameter, the first distributed modulation parameter and the first processing parameter are fused and modulated based on a first preset fusion algorithm to obtain a modulated first processing parameter, wherein the first preset fusion algorithm is shown in formula (2) and formula (3):
[0112] Formula (2)
[0113] Formula (3)
[0114] in, The first distributed modulation parameter has the same meaning as in formula (1), represents the first processing parameter and is the scaling factor, is the shift factor. By evolving the above formula, the multiplier before x is As the new “mean” , the remainder in formula (1) As the new “variance” . Eventually Updated to ,Will Updated to in, , is the first processing parameter after modulation.
[0115] In summary, the above-mentioned fusion modulation process includes the multimodal feature map, that is, the first modal feature after the interaction is input into the trusted data driving modulation module, the relevant parameters corresponding to each channel in the first batch of normalization layers in the first feature extraction network are fused and modulated, and the modulated output is obtained by integrating the output of the data dimension and the model dimension. γ , β , constructing a new normalized Gaussian distribution of each channel dimension. Wherein, the trusted data driven modulation module includes the first preset parameter modulation generation algorithm and the first preset fusion algorithm.
[0116] As a refinement of the above embodiment, before the first target channel data in the first modal feature and the second target channel data in the second modal feature are interacted, the method may also adopt but is not limited to the following implementation methods, for example: calculating the first data distribution of each first channel data in the first modal feature, and calculating the second data distribution of each second channel data in the second modal feature; performing distribution difference comparison on the first data distributions corresponding to the second data distributions one by one to obtain each comparison result, wherein each comparison result is used to represent the distribution difference between each first channel data and the second channel data corresponding to the first channel data; selecting a preset number of target comparison results with the largest distribution difference from each comparison result; determining the preset number of first target channel data in the first channel data according to the target comparison result and determining the preset number of second target channel data in the second channel data according to the target comparison result.
[0117] As a refinement of the above embodiment, when executing step 102 to interact with the first target channel data in the first modal feature and the second target channel data in the second modal feature, the method can adopt but is not limited to the following implementation methods, for example: calculating the first average distribution of all the first channel data in the first modal feature and calculating the second average distribution of all the second channel data in the second modal feature; selecting any first target channel data from the preset number of first target channel data, and selecting the second target channel data corresponding to any first target channel data from the preset number of second target channel data; comparing the first data distribution corresponding to any first target channel data with the first average distribution to obtain a first comparison result, and A second data distribution of second target channel data corresponding to a first target channel data is compared with the second average distribution to obtain a second comparison result; when it is determined that the distribution difference shown by the first comparison result is greater than the distribution difference shown by the second comparison result, the first modal feature is determined to be a receiver, so that the first modal feature receives the second target channel data corresponding to any first target channel data for feature splicing; when it is determined that the distribution difference shown by the second comparison result is greater than the distribution difference shown by the first comparison result, the second modal feature is determined to be a receiver, so that the second modal feature receives any first target channel data for feature splicing, until the interaction between the preset number of first target channel data and the preset number of second target channel data is completed.
[0118] In short, based on the distribution difference of the corresponding channel data between the first modal feature and the second modal feature, a preset number of groups with the largest distribution difference are selected as the channel data to be interacted, and the data distribution corresponding to the channel data to be interacted in each modal feature is compared with the average distribution of all channel data in the corresponding modal feature, that is, the distribution distance between the data distribution corresponding to the channel data to be interacted in each modality and the corresponding average distribution is compared to determine the interaction direction of the channel data between the modal features, and the modal feature that differs greatly from the average distribution is set as the recipient.
[0119] As a refinement of the above embodiment, after the first target channel data in the first modal feature and the second target channel data in the second modal feature are interacted to obtain the first modal feature after interaction and the second modal feature after interaction respectively, the method can also adopt but is not limited to the following implementation methods, for example: calculating the first weight corresponding to the first modal feature after interaction based on a preset gating network and calculating the second weight corresponding to the second modal feature after interaction based on the preset gating network; normalizing the first weight and the second weight to obtain the processed first weight and the processed second weight; weighted fusion is performed based on the processed first weight, the processed second weight, the first modal feature after interaction and the second modal feature after interaction to obtain a multimodal data probability density map; and calculating the target number of the target population according to the multimodal data probability density map.
[0120] In short, the first modal feature after interaction and the second modal feature after interaction are input into the preset gating network to obtain the first weight and the second weight, and the first weight and the second weight are normalized based on the softmax layer to obtain the processed first weight and the processed second weight, and the sum of the processed first weight and the processed second weight is 1, and then the processed first weight, the processed second weight, the first modal feature after interaction and the second modal feature after interaction are weighted fused, and the weighted fusion process is shown in formula (4):
[0121] Formula (4)
[0122] in, is the first modal feature after the interaction, and its type is visible light data, is the second modal feature after the interaction, and its type is thermal infrared data. ω RGB is the first weight after the processing, ω Tis the processed second weight, and F is the multimodal data probability density map. The target quantity is obtained by accumulating the pixel density value integrals in the multimodal data probability density map.
[0123] In a specific implementation of the disclosed embodiment, the construction of a preset model algorithm including a dual-stream feature extraction network includes: using the ResNet101 network as the backbone, setting a dual-stream feature extraction network for the preset model algorithm to extract features of multimodal data, and generating a population probability density map for each modal data, wherein the two feature extraction networks are initialized using the same pre-trained parameters. A channel data dynamic interaction module is set for the preset model algorithm to utilize the channel data dynamic interaction module to perform multimodal feature information interaction, synergistically improve the single-branch feature extraction effect, and reduce model uncertainty, wherein the channel data dynamic interaction module specifically functions to select n groups with the largest distribution differences as objects to be interacted with based on the distribution differences between corresponding channels between modalities, in order to more intuitively display the interaction process between multimodal channel data, Figure 2 A schematic diagram of a multimodal interaction process provided by an embodiment of the present disclosure, Figure 2 Shown The parameters corresponding to the average distribution, the Batch Norm layer is the batch normalization layer; then, by comparing the distribution difference between the channel to be interacted and the overall distribution of all channels within the modality, the internal distribution distances of the two modalities are compared to determine the interaction direction between the modalities, and the modality with a larger difference from the average distribution is set as the receiver. In the channel data dynamic interaction layer, a trusted data-driven modulation module is set, and the trusted data-driven modulation module is used to perform adaptive fine-tuning based on the input data, that is, the first modal feature or the second modal feature, and obtain the preset model network after modulation by fusing the new and old parameters, that is, by fusing the first distribution modulation parameters with the first processing parameters or by fusing the second distribution modulation parameters with the first processing parameters, so that the preset model network after modulation can better adapt to various data distribution situations to cope with different scenarios. In order to more clearly show the aforementioned fusion modulation process, Figure 3 A schematic diagram of a data-driven modulation process provided by an embodiment of the present disclosure. The preset model algorithm also includes a decision-level multimodal fusion module for adaptively fusing the first modal features after the interaction and the second modal features after the interaction. The multimodal fusion mechanism specifically inputs the multimodal features extracted by the dual-stream feature extraction network into the preset gating network to obtain the pixel-level weights corresponding to the modality. , and normalized by the softmax layer. Then, the feature maps obtained from the output layers of the two branch networks are weighted fused. The model changes with the input features, enabling the model to adaptively fuse multimodal information. Channel-level interactions between different modal features reduce model uncertainty, and adaptively fine-tune parameters through the modulation module driven by trusted data to reduce data uncertainty. This preset model algorithm avoids the disadvantage of using only a single modality image for counting under poor imaging conditions, and can flexibly cope with more unpredictable multimodal imaging scenarios in crowd counting tasks, with greater robustness and reliability.
[0124] Figure 4 A schematic diagram of a preset model algorithm network structure provided in an embodiment of the present disclosure, based on Figure 4 , this embodiment provides a specific feasible network structure of the preset model algorithm, including: using the common ResNet101 convolutional neural network as the front-end network architecture, and adding a hole convolution layer as the back-end network on its basis. Through the last regression layer, the density map with an input size of 1 / 8 of the original image is directly output, and then the output results of the two branches, i.e., the two feature extraction networks, are weighted and fused to obtain the final density map, i.e., the multimodal data probability density map. When the feature extraction reaches the last layer in the convolution module, the network uses the multimodal feature map output by this layer to enter the trusted data-driven modulation module, and performs fusion modulation on the relevant parameters corresponding to each channel in the batch normalization layer in the original network, so as to obtain the modulated γ and β by synthesizing the output of the data dimension and the model dimension, and construct a new normalized Gaussian distribution of each channel dimension. In order to better utilize the information of RGB and T modes, a channel data dynamic interaction module is added after Conv2_3, Conv3_4, Conv4_23, and Conv5_3 in the dual-branch trunk feature extraction network. In the channel data dynamic interaction module, according to the distribution differences between the corresponding channels between the modalities, n groups with the largest distribution differences are selected as the objects to be interacted; then, the distribution distances within the two modalities are compared through the distribution differences between the channels to be interacted within the modality and the overall distribution of all channels to determine the direction of interaction between the modalities, and the modality with a large difference from the average distribution is set as the receiver. After the output of the dilated convolution layer, the decision-level adaptive fusion module is used to perform weighted fusion on the output results of the two branches. For example, a gating network is used to assign specific weights to the two modalities according to the corresponding input data, so as to perform weighted fusion on the feature maps output by the two counting branch regression layers, thereby obtaining the final density map, i.e., the probability density map of the multimodal data.
[0125] In an optional embodiment, in order to improve the stability and robustness of the preset model algorithm, the diversity of training data is increased during the training of the preset model algorithm. The following implementation methods may be adopted but are not limited to, for example: a strategy of randomly flipping and cropping training images is adopted. For images with a size larger than 680×640, they are first adjusted to a size smaller than 680×640. At the same time, we also improve the accuracy of annotations by manually supplementing annotations. The Adam optimization algorithm is used in training, the batch size is set to 4, the learning rate is set to 10-6 to train the network in the first 10 cycles, and the learning rate is set to 10-5 to train the network in 20 cycles. The true value density map is generated using the geometric adaptive Gaussian kernel method.
[0126] Furthermore, the density map of the two-branch fusion network, i.e., the probability density map of the multimodal data, is obtained through the preset model algorithm. The density map represents the probability of a person appearing in the image, and contains both spatial distribution feature information and population feature information. The number of people in the corresponding image or image module is obtained by accumulating the pixel density value integrals in the crowd density map, i.e., the probability density map of the multimodal data. The mean square error is used in network model training to measure the difference between the estimated density map and the true density map.
[0127] In order to preserve the spatial information about the distribution of the population while performing the density map, i.e., the multimodal data probability density map performance estimation task, it is necessary to calculate the density of each pixel at each location in the image. The performance of the density map is evaluated using the mean absolute error (MAE) and the root mean square error (RMSE), and the calculation process is shown in the following formulas (5) and (6):
[0128] Formula (5)
[0129] Formula (6)
[0130] in, N is the number of images, is the estimated count of the test image, The actual count of the corresponding image annotations.
[0131] For each region’s counting error, calculate l The GMAE of the level is shown in the following formula (7):
[0132] Formula (7)
[0133] in and They represent the estimated count of the jth region of the ith image and the actual count of the corresponding image annotation, respectively.
[0134] GMAE can be used to evaluate the performance of different regions. GMAE(0) is equivalent to MAE. Specifically, a given image is divided into The regions are not overlapped and the counting error is measured for each region separately.
[0135] This paper verifies the effectiveness of the proposed method on two bi-optical datasets: RGBT-CC and Drone-RGBT datasets.
[0136] The RGBT-CC dataset is a large-scale crowd counting dataset containing 2030 pairs of manually annotated RGB-T images. The dataset covers various social scenes, including shopping malls, streets, train stations, etc. The dataset samples include bright scenes and dark scenes, with a total of 138,389 pedestrian markers, and an average of 68 people per image. Among them, the training set contains 1030 pairs of images, the validation set contains 200 pairs of images, and the test set contains 800 pairs of images. This dataset uses a geometrically adaptive Gaussian kernel to generate the dataset ground-truth.
[0137] The Drone-RGBT dataset is a multimodal dataset collected by drones. It is also the first drone crowd counting dataset that combines RGB and T data. The dataset contains 3,600 pairs of images taken at different locations, with an average of 48.8 people per image. Compared with other crowd counting datasets, the Drone-RGBT dataset has more diversity in terms of lighting, perspective, and background. To improve the accuracy of the annotations, the dataset has undergone data augmentation and manual supplementary annotations. The training set contains 2,285 pairs of images and the test set contains 1,395 pairs of images. Similar to RGBT-CC, the Drone-RGBT dataset also uses a geometrically adaptive Gaussian kernel to generate the dataset ground-truth.
[0138] The method proposed in this disclosure compares multiple crowd counting methods on the RGBT-CC dataset and the Drone-RGBT dataset. Specifically, the method proposed in this disclosure is compared with the single-modal crowd counting methods MCNN, SANet, CSRNet, BL, SASNet and MAN, using the "early fusion" results of RGB and T as network input; at the same time, it is also compared with the multi-modal methods CSRNet+IADM and BL+IADM.
[0139] On the RGBT-CC dataset, the experimental results 1 are shown in Table 1. All experimental indicators including GAME(0), GAME(1), GAME(2), GAME(3) and RMSE are 13.12, 17.55, 22.11, 26.15 and 22.19 respectively. The experimental results are better than other comparison methods. Compared with the unimodal crowd counting method, the method proposed in the present invention achieves better evaluation results. Compared with the multimodal crowd counting method, the method proposed in the present invention improves the evaluation index GMAE by 4.82 and 2.49, and improves the evaluation index RMSE by 8.72 and 5.99. It is proved that the method proposed in the present invention can effectively and dynamically combine the advantages of multimodal data and better utilize the complementary characteristics of visible light images and thermal infrared images.
[0140] Table 1 is a comparison table of experimental results based on the RGBT-CC dataset
[0141]
[0142] On the Drone-RGBT dataset, the experimental results 2 are shown in Table 2. All experimental indicators GAME(0), GAME(1), GAME(2), GAME(3) and RMSE are 9.09, 10.35, 12.94, 14.83 and 14.63 respectively. The experimental results are still better than other comparison methods. Compared with the unimodal crowd counting method, the method proposed in the present invention achieves better evaluation results. Compared with the multimodal crowd counting method, the method proposed in the present invention improves the evaluation indicators GMAE by 1.70 and 1.38, and improves the evaluation indicators RMSE by 2.61 and 1.81. Therefore, the method proposed in the present invention can be applied to RGB-T datasets in various scenarios and perspectives, which further verifies the effectiveness of the method.
[0143] Table 2 is a comparison table of experimental results based on the Drone-RGBT dataset
[0144]
[0145] The experimental results 3 adopted by the embodiment of the present invention are shown in Table 3, which shows the test performance of the variant DRMF (w / o DM) of the method proposed in the present disclosure on the RGBT-CC dataset. DRMF (w / o DM) represents the network without the dynamic data modulation module. The experimental results show that the method proposed in the present disclosure achieves better results than its variants, and also verifies that the dynamic data modulation module can significantly improve the performance of the density map estimation task.
[0146] Table 3 is a comparison table of experimental results of DRMF (w / o DM) algorithm and DRMF algorithm
[0147]
[0148] In summary, the embodiments of the present disclosure can achieve the following effects:
[0149] 1. By modulating and fusing the first processing parameter and the second processing parameter in the preset model algorithm or the preset model algorithm after modulation, the crowd quantity calculation capability of the preset model algorithm or the preset model algorithm after modulation is dynamically improved, so that the preset model algorithm or the preset model algorithm after modulation can adapt to the situation where the preset model algorithm is insufficiently fitted and / or data is missing and / or data noise interferes, thereby solving the problem of inaccurate crowd quantity calculation results in the related technology when encountering the situation where the preset model algorithm is insufficiently fitted and / or data is missing and / or data noise interferes.
[0150] 2. Channel-level interaction between different modal features reduces model uncertainty, and data uncertainty is reduced through data adaptive fine-tuning. The crowd counting network, i.e., the preset model algorithm, avoids the disadvantage of using only a single modality image for counting under poor imaging conditions, and can flexibly cope with more unpredictable multimodal imaging scenarios in crowd counting tasks, with greater robustness and reliability.
[0151] 3. Using a simple module structure and an adaptive update mechanism, the output of the integrated data dimension and model dimension is used to obtain modulated data, which reduces data uncertainty and obtains a more reliable and robust crowd counting effect.
[0152] 4. Through the trusted data-driven modulation module combined with the channel dynamic interaction module, model uncertainty and data uncertainty are modeled respectively to flexibly adapt to more unpredictable multimodal imaging scenarios in crowd counting tasks.
[0153] Corresponding to the above crowd counting method, the present invention also provides a crowd counting device. Since the device embodiment of the present invention corresponds to the above method embodiment, details not disclosed in the device embodiment can be referred to the above method embodiment, and will not be repeated in the present invention.
[0154] Figure 5 A schematic diagram of a crowd counting device provided by an embodiment of the present disclosure is shown in FIG. Figure 5 As shown, including:
[0155] An extraction unit 21 is used to perform feature extraction on at least two modal data based on a preset model algorithm to obtain a first modal feature corresponding to the first modal data and a second modal feature corresponding to the second modal data, wherein the at least two modal data include the first modal data and the second modal data;
[0156] An interaction unit 22 is used to interact the first target channel data in the first modal feature and the second target channel data in the second modal feature to obtain the first modal feature after interaction and the second modal feature after interaction, respectively, and the first target channel data corresponds to the second target channel data one by one;
[0157] A first calculation unit 23 is used to perform neural network calculation on the first modal feature after interaction and the second modal feature after interaction, respectively, to obtain a first distribution modulation parameter corresponding to the first modal feature after interaction and a second distribution modulation parameter corresponding to the second modal feature after interaction;
[0158] A modulation unit 24, configured to perform fusion modulation on the first processing parameters in the first batch of normalized layers based on the first distributed modulation parameters and to perform fusion modulation on the second processing parameters in the second batch of normalized layers based on the second distributed modulation parameters, to obtain a post-modulation preset model algorithm, wherein the preset model algorithm includes the first batch of normalized layers and the second batch of normalized layers;
[0159] The second calculation unit 25 is used to calculate the target number of the target population based on the modulated preset model algorithm.
[0160] The crowd counting device provided by the present disclosure extracts features of at least two modal data based on a preset model algorithm to obtain a first modal feature corresponding to the first modal data and a second modal feature corresponding to the second modal data, wherein the at least two modal data include the first modal data and the second modal data; interacts the first target channel data in the first modal feature and the second target channel data in the second modal feature to obtain a first modal feature after interaction and a second modal feature after interaction, wherein the first target channel data and the second target channel data correspond one to one; performs neural network calculation on the first modal feature after interaction and the second modal feature after interaction to obtain a first distribution modulation parameter corresponding to the first modal feature after interaction and a second distribution modulation parameter corresponding to the second modal feature after interaction; performs fusion modulation on the first processing parameter in the first batch of normalization layers based on the first distribution modulation parameter and performs fusion modulation on the second processing parameter in the second batch of normalization layers based on the second distribution modulation parameter to obtain a preset model algorithm after modulation, wherein the preset model algorithm includes the first batch of normalization layers and the second batch of normalization layers; calculates the target number of the target population based on the preset model algorithm after modulation. Compared with the related art, the first modal feature and the second modal feature are extracted from at least two modal data based on a preset model algorithm, the first channel data and the second channel data are interacted with each other for the first modal feature and the second modal feature to obtain the first modal feature after interaction and the second modal feature after interaction, neural network calculation is performed on the first modal feature after interaction and the second modal feature after interaction to obtain the first distributed modulation parameter and the second distributed modulation parameter, the first processing parameter and the second processing parameter respectively corresponding to each other in the preset model algorithm are fused and modulated based on the first distributed modulation parameter and the second distributed modulation parameter to obtain the preset model algorithm after modulation, and the modulation is performed based on the modulation. The preset model algorithm after modulation calculates the target number of the target population, that is, the preset model algorithm or the preset model algorithm after modulation modulates and fuses the first processing parameter and the second processing parameter in the preset model algorithm or the preset model algorithm after modulation in the process of calculating the target number each time, thereby realizing the dynamic improvement of the population number calculation ability of the preset model algorithm or the preset model algorithm after modulation, and then the preset model algorithm or the preset model algorithm after modulation can adapt to the situation of insufficient fitting of the preset model algorithm and / or missing data and / or data noise interference, thereby solving the problem of inaccurate calculation results of the population number in the related technology when encountering insufficient fitting of the preset model algorithm and / or missing data and / or data noise interference.
[0161] Figure 6 A schematic diagram of the structure of another crowd counting device provided by an embodiment of the present disclosure is shown in FIG. Figure 6 As shown, the first calculation unit 23 is also used for:
[0162] Performing neural network calculation on the first modal feature after the interaction based on a first preset parameter modulation generation algorithm to obtain a first distributed modulation parameter; and
[0163] Based on a second preset parameter modulation generation algorithm, a neural network calculation is performed on the second modal feature after the interaction to obtain a second distributed modulation parameter.
[0164] Furthermore, in a possible implementation of the embodiment of the present disclosure, as Figure 6 As shown, the extraction unit 21 is also used for:
[0165] Extracting features from the first modal data based on a first feature extraction network to obtain the first modal features; and
[0166] Performing feature extraction on the second modality data based on a second feature extraction network to obtain the second modality feature, wherein the preset model algorithm includes the first feature extraction network and the second feature extraction network, the first feature extraction network includes the first batch of normalization layers, and the second feature extraction network includes the second batch of normalization layers.
[0167] Furthermore, in a possible implementation of the embodiment of the present disclosure, as Figure 6 As shown, the modulation unit 24 includes:
[0168] The modulation module 241 is used to perform fusion modulation on the first distributed modulation parameter and the first processing parameter based on a first preset fusion algorithm to obtain a modulated first processing parameter, and to perform fusion modulation on the second distributed modulation parameter and the second processing parameter based on a second preset fusion algorithm to obtain a modulated second processing parameter;
[0169] The updating module 242 is used to update the first processing parameters in the first batch of normalized layers to the first processing parameters after modulation and to update the second processing parameters in the second batch of normalized layers to the second processing parameters after modulation, so as to obtain the post-modulation preset model algorithm.
[0170] Furthermore, in a possible implementation of the embodiment of the present disclosure, as Figure 6 As shown, the device comprises:
[0171] A third calculation unit 26, configured to calculate a first data distribution of each first channel data in the first modal feature, and calculate a second data distribution of each second channel data in the second modal feature;
[0172] A comparison unit 27, used for comparing the first data distributions with the second data distributions corresponding thereto one by one, to obtain comparison results, wherein the comparison results are used to indicate the distribution difference between the first channel data and the second channel data corresponding thereto;
[0173] A selection unit 28, configured to select a preset number of target comparison results having the largest distribution differences from among the comparison results;
[0174] The determination unit 29 is used to determine the preset number of first target channel data in the first channel data according to the target comparison result and to determine the preset number of second target channel data in the second channel data according to the target comparison result.
[0175] Furthermore, in a possible implementation of the embodiment of the present disclosure, as Figure 6 As shown, the interaction unit 22 includes:
[0176] A calculation module 221, configured to calculate a first average distribution of all the first channel data in the first modal feature and calculate a second average distribution of all the second channel data in the second modal feature;
[0177] A selection module 222, configured to select any first target channel data from the preset number of first target channel data, and select second target channel data corresponding to the any first target channel data from the preset number of second target channel data;
[0178] A comparison module 223 is used to compare the first data distribution corresponding to any of the first target channel data with the first average distribution to obtain a first comparison result, and to compare the second data distribution of the second target channel data corresponding to any of the first target channel data with the second average distribution to obtain a second comparison result;
[0179] A determination module 224 is used to determine that the first modal feature is a receiver when it is determined that the distribution difference displayed by the first comparison result is greater than the distribution difference displayed by the second comparison result, so that the first modal feature receives the second target channel data corresponding to any one of the first target channel data for feature splicing;
[0180] The determination module 224 is also used to determine that the second modal feature is the receiver when it is determined that the distribution difference shown by the second comparison result is greater than the distribution difference shown by the first comparison result, so that the second modal feature receives any one of the first target channel data for feature splicing until the interaction between the preset number of first target channel data and the preset number of second target channel data is completed.
[0181] Furthermore, in a possible implementation of the embodiment of the present disclosure, as Figure 6 As shown, the device comprises:
[0182] A fourth calculation unit 210, configured to calculate a first weight corresponding to the first modal feature after the interaction based on a preset gating network and to calculate a second weight corresponding to the second modal feature after the interaction based on the preset gating network;
[0183] A processing unit 211 is used to perform normalization processing on the first weight and the second weight to obtain a processed first weight and a processed second weight;
[0184] A fusion unit 212, configured to perform weighted fusion based on the processed first weight, the processed second weight, the first modal feature after interaction, and the second modal feature after interaction to obtain a multimodal data probability density map;
[0185] The fifth calculating unit 213 is used to calculate the target number of the target population according to the multimodal data probability density map.
[0186] It should be noted that the above explanation of the method embodiment is also applicable to the device of this embodiment, and the principle is the same, which is no longer limited in this embodiment.
[0187] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.
[0188] Figure 7 A schematic block diagram of an example electronic device 300 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.
[0189] like Figure 7As shown, the device 300 includes a computing unit 301, which can perform various appropriate actions and processes according to a computer program stored in a ROM (Read-Only Memory) 302 or a computer program loaded from a storage unit 308 to a RAM (Random Access Memory) 303. In the RAM 303, various programs and data required for the operation of the device 300 can also be stored. The computing unit 301, the ROM 302, and the RAM 303 are connected to each other via a bus 304. An I / O (Input / Output) interface 305 is also connected to the bus 304.
[0190] A number of components in the device 300 are connected to the I / O interface 305, including: an input unit 306, such as a keyboard, a mouse, etc.; an output unit 307, such as various types of displays, speakers, etc.; a storage unit 308, such as a disk, an optical disk, etc.; and a communication unit 309, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 309 allows the device 300 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0191] The computing unit 301 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 301 include, but are not limited to, a CPU (Central Processing Unit), a GPU (Graphic Processing Units), various dedicated AI (Artificial Intelligence) computing chips, various computing units running machine learning model algorithms, a DSP (Digital Signal Processor), and any appropriate processor, controller, microcontroller, etc. The computing unit 301 performs the various methods and processes described above, such as a method for crowd counting. For example, in some embodiments, the method for crowd counting may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 308. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 300 via the ROM 302 and / or the communication unit 309. When the computer program is loaded into the RAM 303 and executed by the computing unit 301, one or more steps of the method described above may be performed. Alternatively, in other embodiments, the computing unit 301 may be configured to execute the aforementioned crowd counting method in any other appropriate manner (eg, by means of firmware).
[0192] Various embodiments of the systems and techniques described above herein may be implemented in digital electronic circuit systems, integrated circuit systems, FPGAs (Field Programmable Gate Arrays), ASICs (Application-Specific Integrated Circuits), ASSPs (Application Specific Standard Products), SOCs (System On Chips), CPLDs (Complex Programmable Logic Devices), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include: being implemented in one or more computer programs that may be executed and / or interpreted on a programmable system including at least one programmable processor that may be a dedicated or general-purpose programmable processor that may receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0193] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0194] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or apparatus. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any suitable combination of the foregoing. More specific examples of machine-readable storage media may include an electrical connection based on one or more wires, a portable computer disk, a hard disk, RAM, ROM, EPROM (Electrically Programmable Read-Only-Memory) or flash memory, optical fiber, CD-ROM (Compact Disc Read-Only Memory), optical storage device, magnetic storage device, or any suitable combination of the foregoing.
[0195] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (Cathode-Ray Tube) or LCD (Liquid Crystal Display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0196] The systems and techniques described herein may be implemented in a computing system that includes a backend component (e.g., as a data server), or a computing system that includes a middleware component (e.g., an application server), or a computing system that includes a frontend component (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: LAN (Local Area Network), WAN (Wide Area Network), the Internet, and blockchain networks.
[0197] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship between the client and the server is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services ("Virtual Private Server", or "VPS" for short). The server may also be a server of a distributed system, or a server combined with a blockchain.
[0198] It should be noted that artificial intelligence is a discipline that studies how computers can simulate certain human thought processes and intelligent behaviors (such as learning, reasoning, thinking, planning, etc.), and includes both hardware-level and software-level technologies. Artificial intelligence hardware technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, and big data processing; artificial intelligence software technologies mainly include computer vision technology, speech recognition technology, natural language processing technology, as well as machine learning / deep learning, big data processing technology, knowledge graph technology, and other major directions.
[0199] It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0200] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0201] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0202] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0203] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the relevant field should understand that the specific implementation methods of the present invention can still be modified or replaced by equivalents. Any modification or equivalent replacement that does not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.
Claims
1. A method for counting people, characterized in that: include: Based on a preset model algorithm, feature extraction is performed on at least two modal data respectively to obtain a first modal feature corresponding to the first modal data and a second modal feature corresponding to the second modal data, wherein the at least two modal data include the first modal data and the second modal data; Interacting the first target channel data in the first modal feature and the second target channel data in the second modal feature to obtain the first modal feature after interaction and the second modal feature after interaction, respectively, wherein the first target channel data corresponds to the second target channel data one by one; Performing neural network calculation on the first modal feature after the interaction and the second modal feature after the interaction respectively, to obtain a first distribution modulation parameter corresponding to the first modal feature after the interaction and a second distribution modulation parameter corresponding to the second modal feature after the interaction, wherein the first distribution modulation parameter is the mean and variance of the first modal feature after the interaction, and the first distribution modulation parameter is used to represent the data distribution of the first modal feature after the interaction, and the second distribution modulation parameter is the mean and variance of the second modal feature after the interaction, and the second distribution modulation parameter is used to represent the data distribution of the second modal feature after the interaction; Performing fusion modulation on the first processing parameters in the first batch of normalized layers based on the first distribution modulation parameters and performing fusion modulation on the second processing parameters in the second batch of normalized layers based on the second distribution modulation parameters to obtain a post-modulation preset model algorithm, wherein the preset model algorithm includes the first batch of normalized layers and the second batch of normalized layers; The target number of the target population is calculated based on the preset model algorithm after modulation.
2. The method according to claim 1, characterized in that: The neural network calculation is performed on the first modal feature after the interaction and the second modal feature after the interaction to obtain the first distribution modulation parameter corresponding to the first modal feature after the interaction and the second distribution modulation parameter corresponding to the second modal feature after the interaction, respectively, including: Performing neural network calculation on the first modal feature after the interaction based on a first preset parameter modulation generation algorithm to obtain a first distributed modulation parameter; and Based on a second preset parameter modulation generation algorithm, a neural network calculation is performed on the second modal feature after the interaction to obtain a second distributed modulation parameter.
3. The method according to claim 1, characterized in that Based on the preset model algorithm, feature extraction is performed on at least two modal data respectively to obtain a first modal feature corresponding to the first modal data and a second modal feature corresponding to the second modal data, including: Extracting features from the first modal data based on a first feature extraction network to obtain the first modal features; and Performing feature extraction on the second modality data based on a second feature extraction network to obtain the second modality feature, wherein the preset model algorithm includes the first feature extraction network and the second feature extraction network, the first feature extraction network includes the first batch of normalization layers, and the second feature extraction network includes the second batch of normalization layers.
4. The method according to claim 3, characterized in that The method of fusing and modulating the first processing parameters in the first batch of normalized layers based on the first distributed modulation parameters and fusing and modulating the second processing parameters in the second batch of normalized layers based on the second distributed modulation parameters to obtain a post-modulation preset model algorithm includes: Performing fusion modulation on the first distributed modulation parameter and the first processing parameter based on a first preset fusion algorithm to obtain a modulated first processing parameter, and performing fusion modulation on the second distributed modulation parameter and the second processing parameter based on a second preset fusion algorithm to obtain a modulated second processing parameter; The first processing parameters in the first batch of normalized layers are updated to the first processing parameters after modulation, and the second processing parameters in the second batch of normalized layers are updated to the second processing parameters after modulation, so as to obtain the post-modulation preset model algorithm.
5. The method according to claim 1, characterized in that Before interacting the first target channel data in the first modal feature and the second target channel data in the second modal feature, the method includes: Calculating a first data distribution of each first channel data in the first modal feature, and calculating a second data distribution of each second channel data in the second modal feature; Comparing the first data distributions with the second data distributions corresponding thereto one by one, to obtain respective comparison results, wherein the respective comparison results are used to indicate the distribution difference between the respective first channel data and the second channel data corresponding thereto; Selecting a preset number of target comparison results with the largest distribution differences among the comparison results; The preset number of first target channel data is determined in the first channel data according to the target comparison result, and the preset number of second target channel data is determined in the second channel data according to the target comparison result.
6. The method according to claim 5, characterized in that The interacting the first target channel data in the first modal feature and the second target channel data in the second modal feature includes: Calculating a first average distribution of all the first channel data in the first modal feature and calculating a second average distribution of all the second channel data in the second modal feature; Select any first target channel data from the preset number of first target channel data, and select second target channel data corresponding to the any first target channel data from the preset number of second target channel data; Comparing a first data distribution corresponding to any of the first target channel data with the first average distribution for distribution difference to obtain a first comparison result, and comparing a second data distribution of the second target channel data corresponding to any of the first target channel data with the second average distribution to obtain a second comparison result; When it is determined that the distribution difference displayed by the first comparison result is greater than the distribution difference displayed by the second comparison result, determining the first modal feature as a receiver, so that the first modal feature receives the second target channel data corresponding to any one of the first target channel data for feature splicing; When it is determined that the distribution difference shown by the second comparison result is greater than the distribution difference shown by the first comparison result, the second modal feature is determined as the receiver, so that the second modal feature receives any one of the first target channel data for feature splicing until the interaction between the preset number of first target channel data and the preset number of second target channel data is completed.
7. The method according to claim 1, characterized in that After the first target channel data in the first modal feature and the second target channel data in the second modal feature are interacted to obtain the first modal feature after interaction and the second modal feature after interaction, the method includes: Calculating a first weight corresponding to the first modal feature after the interaction based on a preset gating network and calculating a second weight corresponding to the second modal feature after the interaction based on the preset gating network; Normalizing the first weight and the second weight to obtain a processed first weight and a processed second weight; Performing weighted fusion based on the processed first weight, the processed second weight, the first modal feature after interaction, and the second modal feature after interaction to obtain a multimodal data probability density map; The target number of the target population is calculated according to the multimodal data probability density map.
8. A crowd counting device, characterized in that: include: an extraction unit, configured to perform feature extraction on at least two modal data respectively based on a preset model algorithm to obtain a first modal feature corresponding to the first modal data and a second modal feature corresponding to the second modal data, wherein the at least two modal data include the first modal data and the second modal data; an interaction unit, configured to interact the first target channel data in the first modal feature and the second target channel data in the second modal feature, to obtain the first modal feature after interaction and the second modal feature after interaction, respectively, wherein the first target channel data and the second target channel data correspond one to one; A first calculation unit is used to perform neural network calculation on the first modal feature after the interaction and the second modal feature after the interaction, respectively, to obtain a first distribution modulation parameter corresponding to the first modal feature after the interaction and a second distribution modulation parameter corresponding to the second modal feature after the interaction, wherein the first distribution modulation parameter is a mean and a variance of the first modal feature after the interaction, and the first distribution modulation parameter is used to represent the data distribution of the first modal feature after the interaction, and the second distribution modulation parameter is a mean and a variance of the second modal feature after the interaction, and the second distribution modulation parameter is used to represent the data distribution of the second modal feature after the interaction; A modulation unit, configured to perform fusion modulation on a first processing parameter in a first batch of normalized layers based on the first distributed modulation parameter and to perform fusion modulation on a second processing parameter in a second batch of normalized layers based on the second distributed modulation parameter, so as to obtain a post-modulation preset model algorithm, wherein the preset model algorithm includes the first batch of normalized layers and the second batch of normalized layers; The second calculation unit is used to calculate the target number of the target population based on the modulated preset model algorithm.
9. An electronic device, characterized in that: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 7.
10. A non-transitory computer-readable storage medium storing computer instructions, characterized in that: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-7.
Citation Information
Patent Citations
Multi-modal remote sensing target robust identification method based on double-layer optimization learning
CN116434037A
Training method of traffic prediction model, and traffic prediction method and device
CN116595364A
