A spatial pyramid crowd counting method based on semantic refinement

By introducing the spatial pyramid structure of semantic refinement into the crowd counting algorithm, combined with the multi-scale module and the semantic enhancement module, the scale change and information loss problems of crowd counting in dense scenes are solved, and high-quality density map prediction and crowd number are achieved. accurate count.

CN114897768BActive Publication Date: 2024-09-24ANHUI BOHELI BIG DATA SERVICE CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202210303312.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-24
Publication Date
2024-09-24
Estimated Expiration
2042-03-24

AI Technical Summary

Technical Problem

Existing crowd counting algorithms are difficult to accurately assess the number of crowds due to problems such as scale changes, occlusions, and background clutter when processing dense scenes. Moreover, there is information loss during the multi-scale feature extraction process, which affects the quality of the density map.

Method used

Design a spatial pyramid crowd counting method based on semantic refinement, extract basic features through the VGG-16 backbone network, combine the spatial pyramid multi-scale module and semantic enhancement module to capture multi-scale features and obtain details through pixel-level subtraction and activation functions The information weight map enhances feature expression, uses shallow texture features to compensate for the missing information of the feature map, and finally generates a density map through atrous convolution.

Benefits of technology

It improves the output quality of density maps, enhances the comprehensiveness of feature extraction and the precision of density maps, enables accurate counting of crowds in dense scenes, and reduces the impact of background interference and noise.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114897768B
    Figure CN114897768B
Patent Text Reader

Abstract

The present invention claims protection for a spatial pyramid crowd counting method based on semantic refinement, which belongs to the field of computer vision technology. The method proposes a new codec model, called a semantic refinement spatial pyramid network. The method mainly includes the following steps: first, a series of convolutional neural layers are used as the front end of the network to obtain deeper features without increasing additional computing costs. In addition, the spatial pyramid multi-scale module is a spatial pyramid structure with multiple receptive fields, which is used to capture multi-scale features. Then, the semantic enhancement module is used to refine the multi-scale features captured by the network, which uses deep semantic information to optimize and fuse multi-scale features. Finally, the details of the feature map are compensated using shallow texture information to improve the quality of the density map. The present invention aims to establish a scale-aware counting network to accurately estimate the number of individuals in a crowd.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of computer vision, and in particular to a crowd counting method. Background Art

[0002] Crowd counting plays a vital role in the field of computer vision, which aims to accurately predict the number of individuals present in dense scenes. Crowd counting algorithms can be widely used in many fields, including urban planning, public safety, and surveillance. However, accurately estimating the number of people in a crowd becomes a very challenging task due to severe occlusion, scale variations, and background clutter. All of the above problems become particularly difficult as the density of the crowd increases.

[0003] In recent years, crowd counting algorithms based on Convolutional Neural Network (CNN) have achieved exciting performance because CNN models have overwhelming feature extraction performance capabilities. Unfortunately, the scale variation of crowd counting has not been well addressed. These methods usually use multi-column architectures to handle scale variations to enhance feature learning, which means that the input is fed into each column to capture multi-scale features. Zhang designed a three-branch method based on CNN, using convolution kernels of three scales. However, many redundant parameters are introduced into the model, making the network more complex and difficult to train. Sam et al. trained a classifier to select the most appropriate regression path for each image patch, which results in the network being unable to be trained end-to-end. In addition, Sindagi et al. designed a network structure to capture local and global features and merge them, which can produce density maps with smaller errors. Although multi-scale convolution kernels are widely used in multi-column network structures, the resulting feature maps still suffer from severe information loss. Popular segmentation methods solve the above problem by connecting the output feature maps of different layers, which shows that fusing multiple features at different layers through skip connections is very effective. Inspired by the above methods, our goal is to design a new multi-column structure network, where each column has a receptive field of different sizes and uses deep semantic information to refine multi-scale features. Following Chen et al., our method focuses on avoiding the loss of image details during feature extraction. When the network layers become deeper and deeper, the extracted features are often incomprehensible. Due to the pooling or convolution within the network backbone, detailed information related to the head boundary is ignored. Therefore, this method ensures the comprehensiveness of the network extracted features by fusing shallow detail features and high-level semantic features. Finally, the features extracted from the backbone network and branches are fused in series to obtain the completeness of the features.

[0004] After searching, the application publication number CN111242036A, a crowd counting method based on a multi-scale convolutional neural network with an encoding-decoding structure, is characterized in that it includes the following steps: considering the perspective distortion of the image, using an adaptive Gaussian filter to calculate the true value density map of the image; using the encoding-decoding structure to build a multi-scale convolutional neural network model, the loss function of the multi-scale convolutional neural network model includes pixel space loss and counting error description; training and testing the built multi-scale convolutional neural network model to obtain a trained multi-scale convolutional neural network model; inputting the image to be estimated into the trained multi-scale convolutional neural network model to predict the crowd density map; performing regression estimation on the crowd density map to obtain the number of people in the image to be estimated. The method invented by this patent can retain the scale features and the context information of the image, and can improve the output quality of the density map. This method uses a multi-column parallel structure to capture multi-scale features, which can indeed solve the problem of scale change to a certain extent, but this method ignores that in the process of capturing multi-scale features, a lot of detail information will be lost, which has an impact on the final generation of the density map. The semantic enhancement module proposed by our method uses the backbone network and the extracted multi-scale to perform pixel-level subtraction operations to obtain the lost detail information, and then obtains the weight map of the lost detail information through the Sigmoid activation function. The weight map is then multiplied with the extracted multi-scale features to enhance the expression of the multi-scale features.

[0005] CN113011329A, a method for counting dense crowds based on a multi-scale feature pyramid network, aims to solve the problem of density map estimation and crowd counting in complex crowded scenes. The invention uses a feature extraction module to extract features from crowd images; uses a feature pyramid fusion module to effectively capture multi-scale context information in crowd images, and further obtains better feature expressions; uses a feature attention perception module to focus on high-density positions in crowd images to reduce background interference; uses a bilinear difference to restore the image to its original size; outputs a predicted density map and counts the number of heads, effectively solving the problem of difficulty in counting crowds in dense scenes due to large changes in head scale, serious crowd occlusion, and poor lighting conditions, and improves the robustness of the model to noise, and can achieve accurate crowd counting and high-quality prediction of density maps. Since the invention uses a grouped convolution module, it has a faster reasoning speed. The method uses dilated convolutions with different dilation rates to capture multi-scale features, and uses an attention mechanism to reduce background interference, but the method ignores the shallow texture information, which is very helpful for the final generated density map. Our method uses the texture features extracted by the backbone network at a shallow level to supplement the detail information of the extracted multi-scale features, which can enrich the completeness of the feature map and make the final generated density map more refined. Summary of the invention

[0006] The present invention aims to solve the above problems of the prior art. A spatial pyramid crowd counting method based on semantic refinement is proposed. The technical solution of the present invention is as follows:

[0007] A spatial pyramid crowd counting method based on semantic refinement comprises the following steps:

[0008] Step 1: Obtain a crowd image dataset and divide it into a training set and a test set. Crop the training set to obtain the input image, and then enter the VGG-16-based backbone network to extract basic features.

[0009] Step 2: Design a Spatial Pyramid Multi-scale Module (SPMM). SPMM has multiple parallel branches with different receptive fields. These parallel branches with different receptive fields form a spatial pyramid structure, which captures multi-scale features in crowd images based on the basic features in step 1.

[0010] Step 3: Design a semantic enhancement module (SEM). SEM performs pixel-level subtraction operations on the basic features extracted by the backbone network and the multi-scale features extracted by SPMM. After dimensionality reduction and activation function, a weight map with lost detail information is obtained. The weight map is then multiplied with the corresponding multi-scale features to obtain enhanced features.

[0011] Step 4: Use the texture features extracted at the shallow layer by the backbone network in step 1 to compensate for the detail information of the enhanced features obtained in step 3, so as to enrich the detail information of the feature map;

[0012] Step 5: Input the feature map obtained in step 4 into the decoding structure composed of a series of dilated convolutions to generate the final density map. By integrating the density map, the number of individuals predicted by the network can be obtained.

[0013] Furthermore, the step 1: obtaining a crowd image dataset and dividing it into a training set and a test set, cropping the training set to obtain an input image, and the input image enters a backbone network based on VGG-16 to extract basic features, specifically includes the following steps:

[0014] A1: Crop the crowd image from the training set in the dataset into an input image I of size 576×768;

[0015] A2: Input image I into the backbone network consisting of the first 13 layers of VGG-16 to extract features. The features extracted from the 7th layer are F7, and the features extracted from the 13th layer are called basic features, and F v If Fv It can be defined as:

[0016] F v =f vgg (I) (4)

[0017] where f vgg Backbone network, F v It is the basic feature extracted by the backbone network.

[0018] Furthermore, the step 2 designs a spatial pyramid multi-scale module (SPMM). The SPMM has multiple parallel branches with different receptive fields. These parallel branches with different receptive fields form a spatial pyramid structure, which captures multi-scale features in crowd images based on the basic features of step 1. Specifically, the following steps are included:

[0019] B1: According to step A2, the basic feature F v Input to the SPMM module with four parallel branches. Specifically, the first branch of SPMM is a dilated convolution with a kernel size of 3×3 and a dilation rate of 6, the second branch is a dilated convolution with a kernel size of 3×3 and a dilation rate of 12, the third branch is a dilated convolution with a kernel size of 3×3 and a dilation rate of 18, and the fourth branch is a global adaptive average pooling layer with an output feature map size of 1×1.

[0020] B2: The SPMM with four branches can capture multi-scale features by utilizing the receptive fields of different sizes in different branches, with F s i Indicates that s represents the scale, and the value range of i is 1, 2, 3, and 4, which correspond to the four different branches of SPMM. s 1 、F s 2 、F s 3 、F s 4 They represent the features extracted by SPMM from the first branch to the fourth branch respectively.

[0021] Furthermore, the step 3 designs a semantic enhancement module (SEM), which performs a pixel-level subtraction operation on the basic features extracted by the backbone network and the multi-scale features extracted by the SPMM, and then obtains a weight map of lost detail information after dimensionality reduction and activation function, and then multiplies the weight map with the corresponding multi-scale features to obtain enhanced features, which specifically includes the following steps:

[0022] C1: Extract the basic features F in step A2 v Input to the 1×1 convolutional layer for dimensionality reduction, the purpose is to make F v The F extracted in step B2 s 1 、F s 2 、F s 3 、F s 4 The dimensions are the same;

[0023] C2: Next, let the basic feature F obtained after dimensionality reduction in step C1 v And the multi-scale feature F extracted in step B2 s 1 、F s 2 、F s 3 、F s 4 Perform a subtraction operation. Our method considers the features obtained by the subtraction operation to be the lost detail features, which are called contrast features.

[0024] C3: Then, a 1×1 convolutional layer is used to reduce the dimension of the contrast features extracted in step C2;

[0025] C4: Next, the reduced-dimensional contrast features extracted in step C3 are input into the Sigmoid activation function to obtain a weight map M that loses detail information. i , defined as follows:

[0026] M i =Sigmoid(C 1×1 (C 1×1 (F s i )-F v )),i∈{1,2,3,4} (5)

[0027] where F s i are the features of four different scales extracted in step B2, F v is the basic feature extracted in step A2, C 1×1 It is a 1×1 convolutional layer and Sigmoid is the activation function.

[0028] C5: Finally, the weight map M obtained by C4 i The four features F of different scales extracted from step B2 s iMultiply pixel by pixel to optimize the multi-scale features using the lost detail information weight map. The features obtained after optimization are consistent with the basic features F extracted in step A2. v Fusion is performed in the channel direction to ensure the completeness of feature extraction and obtain enhanced features F sem The definition is as follows:

[0029] F sem =[M i *F s i |F v ],i∈{1,2,3,4} (6)

[0030] Among them, * represents pixel-by-pixel multiplication, and [.|.] represents the pixel-wise fusion operation.

[0031] Furthermore, the step 4: using the texture features extracted at the shallow layer by the backbone network in step 1 to compensate for the detail information of the enhanced features obtained in step 3, so as to enrich the detail information of the feature map, specifically comprises the following steps:

[0032] D1: Enhanced feature F extracted from step C5 sem Upsample by 4 times to make its size consistent with feature F7 extracted from layer 7 of the backbone network;

[0033] D2: Enhanced feature F after upsampling in D1 sem It is spliced ​​with F7 in the channel direction, and then a 3×3 convolutional layer is used to fuse the features. The shallow texture information is used to make up for the lack of head edge information in the feature map, preparing for the subsequent generation of high-quality density maps.

[0034] Furthermore, in step 5, the feature map obtained in step 4 is input into a decoding structure composed of a series of dilated convolutions to generate a final density map. By integrating the density map, the number of individuals predicted by the network can be obtained, which specifically includes:

[0035] E1: The features of the shallow and deep layers fused in step D2 are input into a series of decoders composed of dilated convolutions to obtain the final density map.

[0036] E2: Specifically, the decoder consists of six layers of dilated convolutions and one layer of 1×1 convolutions. The dilated convolution structures all have a convolution kernel of 3×3 and a dilation rate of 2. The difference is that the number of channels keeps decreasing, namely 512, 512, 512, 256, 128, and 64. The feature map with 64 channels is reduced to 1 by a 1×1 convolution layer to obtain the final density map.

[0037] E3: In order to obtain the number of people predicted by the network for a dense crowd image, we only need to perform an integral operation on the density map.

[0038] The advantages and beneficial effects of the present invention are as follows:

[0039] The method of the present invention first proposes a new codec model, called semantically refined spatial pyramid network. A fully convolutional network is used as the front end to support input images of flexible sizes. A large number of convolutional filters (such as 3×3) are used to limit the complexity of the network. In addition, in order to capture the multi-scale features in crowd images, we proposed SPMM. In addition, SEM is also applied to refine the multi-scale features so that the network can adaptively fuse these features. In addition, shallow texture features are obtained to enrich the multi-scale features and make up for the lack of pixel information in the network. The main advantages and beneficial effects are as follows:

[0040] According to step 2 of claim 1: design a spatial pyramid multi-scale module (Spatial Pyramid Multi-scale Module, SPMM), SPMM has multiple parallel branches with different receptive fields, these parallel branches with different receptive fields form a spatial pyramid structure, and capture multi-scale features in crowd images based on the basic features extracted by the backbone network.

[0041] According to step 3 of claim 1: design a semantic enhancement module (SEM), which performs a pixel-level subtraction operation on the basic features extracted by the backbone network and the multi-scale features extracted by the SPMM, and then obtains a weight map of lost detail information after dimensionality reduction and activation function, and then multiplies the weight map with the corresponding multi-scale features to obtain enhanced features.

[0042] According to step 4 of claim 1: using the texture features extracted at the shallow layer by the backbone network in step 1 to compensate for the detail information of the enhanced features obtained in step 3, so as to enrich the detail information of the feature map. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] Figure 1 It is an overall framework diagram of the method of the preferred embodiment provided by the present invention. DETAILED DESCRIPTION

[0044] The following will describe the technical solutions in the embodiments of the present invention in detail in conjunction with the accompanying drawings in the embodiments of the present invention. The described embodiments are only part of the embodiments of the present invention.

[0045] The technical solution of the present invention to solve the above technical problems is:

[0046] As attached Figure 1 As shown in FIG. 1 , a spatial pyramid crowd counting method based on semantic refinement includes the following steps:

[0047] 1. As attached Figure 1 As shown, a crowd image dataset is obtained and divided into a training set and a test set. The training set is cropped to obtain the input image, and the input image enters the backbone network based on VGG-16 to extract basic features:

[0048] A1: Crop the crowd image from the training set in the dataset into an input image I of size 576×768;

[0049] A2: Input image I into the backbone network consisting of the first 13 layers of VGG-16 to extract features. The features extracted from the 7th layer are F7, and the features extracted from the 13th layer are called basic features, and F v If F v It can be defined as:

[0050] F v =f vgg (I) (7)

[0051] where f vgg Backbone network, F v It is the basic feature extracted by the backbone network.

[0052] 2. As attached Figure 1 As shown in the figure, a Spatial Pyramid Multi-scale Module (SPMM) is designed. SPMM has multiple parallel branches with different receptive fields. These parallel branches with different receptive fields form a spatial pyramid structure, which captures multi-scale features in crowd images based on the basic features in step 1:

[0053] B1: According to step A2, the basic feature F v Input to the SPMM module with four parallel branches. Specifically, the first branch of SPMM is a dilated convolution with a kernel size of 3×3 and a dilation rate of 6, the second branch is a dilated convolution with a kernel size of 3×3 and a dilation rate of 12, the third branch is a dilated convolution with a kernel size of 3×3 and a dilation rate of 18, and the fourth branch is a global adaptive average pooling layer with an output feature map size of 1×1.

[0054] B2: The SPMM with four branches can capture multi-scale features by utilizing the receptive fields of different sizes in different branches, with F s i Indicates that s represents the scale, and the value range of i is 1, 2, 3, and 4, which correspond to the four different branches of SPMM. s1 、F s 2 、F s 3 、F s 4 They represent the features extracted by SPMM from the first branch to the fourth branch respectively.

[0055] 3. As attached Figure 1 As shown in the figure, a semantic enhancement module (SEM) is designed. SEM performs pixel-level subtraction operation on the basic features extracted by the backbone network and the multi-scale features extracted by SPMM. After dimensionality reduction and activation function, a weight map with lost detail information is obtained. The weight map is then multiplied with the corresponding multi-scale features to obtain enhanced features:

[0056] C1: Extract the basic features F in step A2 v Input to the 1×1 convolutional layer for dimensionality reduction, the purpose is to make F v The F extracted in step B2 s 1 、F s 2 、F s 3 、F s 4 The dimensions are the same;

[0057] C2: Next, let the basic feature F obtained after dimensionality reduction in step C1 v And the multi-scale feature F extracted in step B2 s 1 、F s 2 、F s 3 、F s 4 Perform a subtraction operation. Our method considers the features obtained by the subtraction operation to be the lost detail features, which are called contrast features.

[0058] C3: Then, a 1×1 convolutional layer is used to reduce the dimension of the contrast features extracted in step C2;

[0059] C4: Next, the reduced-dimensional contrast features extracted in step C3 are input into the Sigmoid activation function to obtain a weight map M that loses detail information. i , defined as follows:

[0060] M i =Sigmoid(C 1×1 (C 1×1 (F si )-F v )),i∈{1,2,3,4} (8)

[0061] Among them, F s i are the features of four different scales extracted in step B2, F v is the basic feature extracted in step A2, C 1×1 It is a 1×1 convolutional layer and Sigmoid is the activation function.

[0062] C5: Finally, the weight map M obtained by C4 i The four features F of different scales extracted from step B2 s i Multiply pixel by pixel to optimize the multi-scale features using the lost detail information weight map. The features obtained after optimization are consistent with the basic features F extracted in step A2. v Fusion is performed in the channel direction to ensure the completeness of feature extraction and obtain enhanced features F sem The definition is as follows:

[0063] F sem =[M i *F s i |F v ],i∈{1,2,3,4} (9)

[0064] Among them, * represents pixel-by-pixel multiplication, and [.|.] represents the pixel-wise fusion operation.

[0065] 4. As attached Figure 1 As shown, the texture features extracted by the backbone network in step 1 at the shallow layer are used to compensate for the detail information of the enhanced features obtained in step 3, so as to enrich the detail information of the feature map:

[0066] D1: Enhanced feature F extracted from step C5 sem Upsample by 4 times to make its size consistent with feature F7 extracted from layer 7 of the backbone network;

[0067] D2: Enhanced feature F after upsampling in D1 sem It is spliced ​​with F7 in the channel direction, and then a 3×3 convolutional layer is used to fuse the features. The shallow texture information is used to make up for the lack of head edge information in the feature map, preparing for the subsequent generation of high-quality density maps.

[0068] 5. As attached Figure 1As shown, the feature map obtained in step 4 is input into the decoding structure composed of a series of dilated convolutions to generate the final density map. The density map is integrated to obtain the number of individuals predicted by the network:

[0069] E1: The features of the shallow and deep layers fused in step D2 are input into a series of decoders composed of dilated convolutions to obtain the final density map.

[0070] E2: Specifically, the decoder consists of six layers of dilated convolutions and one layer of 1×1 convolutions. The dilated convolution structures all have a convolution kernel of 3×3 and a dilation rate of 2. The difference is that the number of channels keeps decreasing, namely 512, 512, 512, 256, 128, and 64. The feature map with 64 channels is reduced to 1 by a 1×1 convolution layer to obtain the final density map.

[0071] E3: In order to obtain the number of people predicted by the network for a dense crowd image, we only need to perform an integral operation on the density map.

[0072] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0073] The above embodiments should be understood to be only used to illustrate the present invention and not to limit the protection scope of the present invention. After reading the contents of the present invention, technicians can make various changes or modifications to the present invention, and these equivalent changes and modifications also fall within the scope defined by the claims of the present invention.

Claims

1. A spatial pyramid crowd counting method based on semantic refinement, characterized in that: The following steps are involved: Step 1: Obtain a crowd image dataset and divide it into a training set and a test set. Crop the training set to obtain the input image, and then enter the VGG-16-based backbone network to extract basic features. Step 2: Design a spatial pyramid multi-scale module SPMM. SPMM has multiple parallel branches with different receptive fields. These parallel branches with different receptive fields form a spatial pyramid structure, which captures multi-scale features in crowd images based on the basic features in step 1. Step 3: Design a semantic enhancement module (SEM). SEM performs pixel-level subtraction operations on the basic features extracted by the backbone network and the multi-scale features extracted by SPMM. After dimensionality reduction and activation function, a weight map with lost detail information is obtained. The weight map is then multiplied with the corresponding multi-scale features to obtain enhanced features. Step 4: Use the texture features extracted at the shallow layer by the backbone network in step 1 to compensate for the detail information of the enhanced features obtained in step 3, so as to enrich the detail information of the feature map; Step 5: Input the feature map obtained in step 4 into the decoding structure composed of a series of dilated convolutions to generate the final density map. The density map is integrated to obtain the number of individuals predicted by the network. The step 1: obtaining a crowd image dataset and dividing it into a training set and a test set, cropping the training set to obtain an input image, and inputting the input image into a convolutional neural layer to extract features, specifically includes the following steps: A1: Crop the crowd image from the training set in the dataset into an input image I of size 576×768; A2: Input image I into the backbone network consisting of the first 13 layers of VGG-16 to extract features. The features extracted from the 7th layer are F7, and the features extracted from the 13th layer are called basic features, and F v If F v It can be defined as: F v =f vgg (I) (1) where f vgg Backbone network, F v It is the basic features extracted by the backbone network; The step 2 designs an SPMM, which has multiple parallel branches with different receptive fields. These parallel branches with different receptive fields form a spatial pyramid structure, which captures multi-scale features in crowd images based on the basic features of step A2, and specifically includes the following steps: B1: According to step A2, the basic feature F v Input to the SPMM module with four parallel branches. Specifically, the first branch of SPMM is a dilated convolution with a kernel size of 3×3 and a dilation rate of 6, the second branch is a dilated convolution with a kernel size of 3×3 and a dilation rate of 12, the third branch is a dilated convolution with a kernel size of 3×3 and a dilation rate of 18, and the fourth branch is a global adaptive average pooling layer with an output feature map size of 1×1. B2: The SPMM with four branches can capture multi-scale features by utilizing the receptive fields of different sizes in different branches, with F s i Indicates that s represents the scale, and the value range of i is 1, 2, 3, and 4, which correspond to the four different branches of SPMM. They represent the features extracted by SPMM from the first branch to the fourth branch respectively.

2. The spatial pyramid crowd counting method based on semantic refinement according to claim 1, characterized in that: The step 3 designs SEM, which performs pixel-level subtraction operation on the basic features extracted by the backbone network and the multi-scale features extracted by SPMM, and then obtains a weight map with lost detail information after dimension reduction and activation function, and then multiplies the weight map with the corresponding multi-scale features to obtain enhanced features, which specifically includes the following steps: C1: Extract the basic features F in step A2 v Input to the 1×1 convolutional layer for dimensionality reduction, the purpose is to make F v The same as that extracted in step B2 The dimensions are the same; C2: Next, let the basic feature F obtained after dimensionality reduction in step C1 v The multi-scale features extracted from step B2 Perform a subtraction operation. Our method considers the features obtained by the subtraction operation to be the lost detail features, which are called contrast features. C3: Then, a 1×1 convolutional layer is used to reduce the dimension of the contrast features extracted in step C2; C4: Next, the reduced-dimensional contrast features extracted in step C3 are input into the Sigmoid activation function to obtain a weight map M that loses detail information. i , defined as follows: in are the features of four different scales extracted in step B2, F v is the basic feature extracted in step A2, C 1×1 It is a 1×1 convolutional layer, and Sigmoid is the activation function; C5 : Finally, the weight map M obtained by C4 i Features of four different scales extracted in step B2 Multiply pixel by pixel to optimize the multi-scale features using the lost detail information weight map. The features obtained after optimization are consistent with the basic features F extracted in step A2. v Fusion is performed in the channel direction to ensure the completeness of feature extraction and obtain enhanced features F sem The definition is as follows: Among them, * represents pixel-by-pixel multiplication, and [.|.] represents the pixel-wise fusion operation.

3. The spatial pyramid crowd counting method based on semantic refinement according to claim 2 is characterized in that: Step 4: Use the texture features extracted by the backbone network at the shallow layer to enhance the feature F sem The detailed information of the feature map is used to compensate for the details of the feature map: D1: Enhanced feature F extracted from step C5 sem Upsample by 4 times to make its size consistent with feature F7 extracted from layer 7 of the backbone network; D2: Enhanced feature F after upsampling in D1 sem It is spliced ​​with F7 in the channel direction, and then a 3×3 convolutional layer is used to fuse the features. The shallow texture information is used to make up for the lack of head edge information in the feature map, preparing for the subsequent generation of high-quality density maps.

4. The spatial pyramid crowd counting method based on semantic refinement according to claim 3 is characterized in that: In step 5, the feature map obtained by D2 is input into a decoding structure composed of a series of dilated convolutions to generate a final density map. The density map is integrated to obtain the number of individuals predicted by the network, which specifically includes: E1: Input the shallow and deep features fused in step D2 into a series of decoders composed of dilated convolutions to obtain the final density map; E2: Specifically, the decoder consists of six layers of dilated convolution and one layer of 1×1 convolution. The dilated convolution structure has a convolution kernel of 3×3 and a dilation rate of 2. The difference is that the number of channels keeps decreasing, namely 512, 512, 512, 256, 128, and 64. The feature map with 64 channels is reduced to 1 by a 1×1 convolution layer to obtain the final density map. E3: In order to obtain the number of people predicted by the network for a dense crowd image, we only need to perform an integral operation on the density map.

Citation Information

Patent Citations

  • Crowd counting method based on coding-decoding structure multi-scale convolutional neural network

    CN111242036A

  • Dense crowd counting method based on multi-scale feature pyramid network

    CN113011329A

  • Method for detecting crowd abnormal behaviors by using fused convolutional neural network

    CN112329685A

  • Dense crowd counting method, apparatus and device, and storage medium

    WO2020169043A1