Crowd positioning method and device, electronic device and storage medium

By performing feature extraction and fusion on images in crowd video clips, a feature map reflecting spatiotemporal relationships is generated, which solves the problem of low crowd positioning accuracy in the existing technology and achieves higher positioning accuracy and support for crowd analysis tasks.

CN113283343BActive Publication Date: 2024-10-29SHANGHAI SENSETIME INTELLIGENT TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202110579974.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-05-26
Publication Date
2024-10-29
Estimated Expiration
2041-05-26

AI Technical Summary

Technical Problem

The existing technology has low accuracy in crowd positioning and cannot effectively utilize the spatiotemporal relationship in crowd video clips, affecting the accuracy of crowd counting and group behavior analysis.

Method used

By extracting features from at least two frames of images in the crowd video clip, the feature neighborhoods of the target pixels are determined, and feature fusion is performed based on these neighborhoods to generate a second feature map to reflect the spatiotemporal relationship between different frames of crowd images. , thereby achieving accurate crowd positioning.

Benefits of technology

It improves the accuracy of crowd positioning, can more effectively capture the spatiotemporal information in crowd video clips, and provides more accurate crowd counting and behavior analysis data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113283343B_ABST
    Figure CN113283343B_ABST
Patent Text Reader

Abstract

The present disclosure relates to a crowd positioning method and device, an electronic device and a storage medium, the method comprising: extracting features from at least two frames of crowd images obtained from a crowd video clip, respectively, to obtain at least two first feature maps; determining the feature neighborhood corresponding to each target pixel point in the target first feature map in the at least two first feature maps, wherein the target first feature map is a first feature map corresponding to the target crowd image in the at least two frames of crowd images; based on the feature neighborhood corresponding to each target pixel point, fusing the at least two first feature maps to obtain a second feature map corresponding to the target crowd image; positioning the crowd according to the second feature map, to obtain a target positioning map corresponding to the target crowd image, wherein the target positioning map is used to indicate the position of the human body included in the target crowd image. The embodiments of the present disclosure can improve the accuracy of crowd positioning.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to a crowd positioning method and device, an electronic device, and a storage medium. Background Art

[0002] With the growth of population and the acceleration of urbanization, the number of large crowd gatherings is increasing and the scale is getting larger. Crowd analysis is of great significance to public safety and urban planning. Common crowd analysis tasks include crowd counting, group behavior analysis, crowd positioning, etc. Among them, crowd positioning is the basis of other crowd analysis tasks. Crowd positioning refers to estimating the position of the human body included in the image or video through computer vision algorithms, determining the coordinates of the human body included in the image or video, and providing data basis for subsequent crowd analysis tasks such as crowd counting and group behavior analysis. The accuracy of crowd positioning directly affects the accuracy of crowd counting and the results of crowd behavior analysis. Therefore, a crowd positioning method with high accuracy is urgently needed. Summary of the invention

[0003] The present disclosure proposes a crowd positioning method and device, an electronic device, and a storage medium technical solution.

[0004] According to one aspect of the present disclosure, a crowd positioning method is provided, comprising: performing feature extraction on at least two frames of crowd images obtained from a crowd video clip, respectively, to obtain at least two first feature maps; determining a feature neighborhood corresponding to each target pixel point in the target first feature map in the at least two first feature maps, wherein the target first feature map is a first feature map corresponding to a target crowd image in the at least two frames of crowd images; based on the feature neighborhood corresponding to each target pixel point, fusing the at least two first feature maps to obtain a second feature map corresponding to the target crowd image; performing crowd positioning according to the second feature map to obtain a target positioning map corresponding to the target crowd image, wherein the target positioning map is used to indicate the position of a human body included in the target crowd image.

[0005] In a possible implementation, determining the feature neighborhood corresponding to each target pixel point in the at least two first feature maps of the target first feature map includes: determining the two-dimensional Gaussian distribution corresponding to each target pixel point according to the coordinates of each target pixel point in the target first feature map and a preset standard deviation; and determining the corresponding feature neighborhood in the at least two first feature maps respectively according to the two-dimensional Gaussian distribution corresponding to each target pixel point.

[0006] In a possible implementation, the at least two first feature maps are fused based on the feature neighborhood corresponding to each target pixel point to obtain a second feature map corresponding to the target population image, including: based on the feature neighborhood corresponding to each target pixel point in the at least two first feature maps, respectively determining the sampling pixel points corresponding to each target pixel point in the at least two first feature maps; according to each target pixel point and the sampling pixel points corresponding to each target pixel point, the at least two first feature maps are fused to obtain the second feature map, wherein the second feature map and the target first feature map have the same size.

[0007] In a possible implementation, the at least two first feature maps are fused according to each target pixel and the sampling pixel corresponding to each target pixel to obtain the second feature map, including: normalizing the dot product between each target pixel and the sampling pixel corresponding to each target pixel to obtain the weight of the sampling pixel corresponding to each target pixel; and performing weighted summation of the sampling pixel corresponding to each target pixel according to the weight of the sampling pixel corresponding to each target pixel to obtain the second feature map.

[0008] In a possible implementation, the method of performing crowd positioning according to the second feature map to obtain a target positioning map corresponding to the target crowd image includes: performing crowd positioning according to the second feature map to obtain a first positioning probability map, wherein the first positioning probability map is used to indicate the probability that each target pixel in the target crowd image is a human body; and performing image processing on the first positioning probability map according to a probability threshold to obtain the target positioning map.

[0009] In a possible implementation, the crowd positioning according to the second feature map to obtain the first positioning probability map includes: performing convolution processing on the second feature map to obtain a third feature map; performing transposed convolution processing on the third feature map to obtain a fourth feature map, wherein the fourth feature map and the target crowd image have the same size; and performing convolution processing on the fourth feature map to obtain the first positioning probability map.

[0010] In a possible implementation, the first positioning probability map is subjected to image processing according to a probability threshold to obtain the target positioning map, including: performing an average pooling operation on the first positioning probability map to obtain a mean pooling map; performing a maximum pooling operation on the mean pooling map to obtain a maximum pooling map; obtaining a second positioning probability map according to the mean pooling map and the maximum pooling map; and performing threshold segmentation on the second positioning probability map according to the probability threshold to obtain the target positioning map.

[0011] In a possible implementation, the crowd positioning method is implemented by a crowd positioning neural network, and the training samples of the crowd positioning neural network include a crowd sample video clip and a real positioning map corresponding to a target crowd sample image in the crowd sample video clip; the training method of the crowd positioning neural network is as follows: according to the crowd sample video clip, the predicted positioning probability map corresponding to the target crowd sample image is determined by the crowd positioning neural network, wherein the predicted positioning probability map is used to indicate the probability that each pixel point in the target crowd sample image is a human body; based on the predicted positioning probability map and the real positioning map, the positioning loss is determined; based on the positioning loss, the crowd positioning neural network is optimized.

[0012] In a possible implementation, the method of determining a predicted positioning probability map corresponding to the target crowd sample image through the crowd positioning neural network based on the crowd sample video clip includes: performing feature extraction on at least two frames of crowd sample images obtained from the crowd sample video clip respectively to obtain at least two fifth feature maps; determining a feature neighborhood corresponding to each pixel point in the target fifth feature map in the at least two fifth feature maps, wherein the target fifth feature map is the fifth feature map corresponding to the target crowd sample image; fusing the at least two fifth feature maps based on the feature neighborhood corresponding to each pixel point in the at least two fifth feature maps to obtain a sixth feature map corresponding to the target crowd sample image; and positioning the crowd based on the sixth feature map to obtain the predicted positioning probability map.

[0013] In a possible implementation, determining the positioning loss based on the predicted positioning probability map and the true positioning map includes: determining the positioning loss using a cross entropy loss function according to the predicted positioning probability map, the true positioning map, and the positive sample weight, wherein the positive sample weight is the weight corresponding to the pixel point in the true positioning map used to indicate the position of the human body.

[0014] In a possible implementation, the method further includes: acquiring an original crowd sample video; and performing frame rate downsampling on the original crowd sample video to obtain the crowd sample video segment, wherein the frame rate of the crowd sample video segment is less than a threshold.

[0015] In a possible implementation, the method further includes: determining a labeling result corresponding to the target population sample image, wherein the labeling result includes coordinates of a human body in the target population sample image; and determining the real positioning map based on the labeling result.

[0016] According to one aspect of the present disclosure, a crowd positioning device is provided, comprising: a feature extraction module, used to perform feature extraction on at least two frames of crowd images obtained from a crowd video clip, respectively, to obtain at least two first feature maps; a feature neighborhood determination module, used to determine the feature neighborhood corresponding to each target pixel point in the target first feature map in the at least two first feature maps, wherein the target first feature map is a first feature map corresponding to a target crowd image in the at least two frames of crowd images; a feature fusion module, used to fuse the at least two first feature maps based on the feature neighborhood corresponding to each target pixel point, to obtain a second feature map corresponding to the target crowd image; a crowd positioning module, used to perform crowd positioning according to the second feature map, to obtain a target positioning map corresponding to the target crowd image, wherein the target positioning map is used to indicate the position of a human body included in the target crowd image.

[0017] According to one aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing processor-executable instructions; wherein the processor is configured to call the instructions stored in the memory to execute the above method.

[0018] According to one aspect of the present disclosure, a computer-readable storage medium is provided, on which computer program instructions are stored, and when the computer program instructions are executed by a processor, the above method is implemented.

[0019] In the disclosed embodiment, feature extraction is performed on at least two frames of crowd images obtained from a crowd video clip, respectively, to obtain at least two first feature maps; the feature neighborhood corresponding to each pixel point in the target first feature map in the at least two first feature maps is determined, wherein the target first feature map is the first feature map corresponding to the target crowd image in the at least two frames of crowd images; based on the feature neighborhood corresponding to each target pixel point, the at least two first feature maps are fused to obtain a second feature map corresponding to the target crowd image; the crowd is located according to the second feature map, to obtain a target location map corresponding to the target crowd image, wherein the target location map is used to indicate the position of the human body included in the target crowd image. In the crowd location process, based on the feature neighborhood of each target pixel point in the first feature map corresponding to the target crowd image in the crowd video clip, the at least two first feature maps corresponding to the at least two frames of crowd images obtained in the crowd video clip are fused, and the fused second feature map can reflect the spatiotemporal relationship between different frames of crowd images, so that after the crowd is located using the second feature map, a target location map with a higher accuracy corresponding to the target crowd image can be obtained, thereby effectively improving the accuracy of crowd location.

[0020] It should be understood that the above general description and the following detailed description are exemplary and explanatory only and do not limit the present disclosure. Other features and aspects of the present disclosure will become clear from the following detailed description of exemplary embodiments with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] The drawings herein are incorporated into the specification and constitute a part of the specification. These drawings illustrate embodiments consistent with the present disclosure and are used to illustrate the technical solutions of the present disclosure together with the specification.

[0022] Figure 1 A flow chart showing a crowd positioning method according to an embodiment of the present disclosure is shown;

[0023] Figure 2 A schematic diagram showing feature fusion according to an embodiment of the present disclosure;

[0024] Figure 3 A schematic diagram showing a crowd positioning neural network according to an embodiment of the present disclosure;

[0025] Figure 4 A block diagram of a crowd positioning device according to an embodiment of the present disclosure is shown;

[0026] Figure 5 A block diagram of an electronic device according to an embodiment of the present disclosure is shown;

[0027] Figure 6 A block diagram of an electronic device according to an embodiment of the present disclosure is shown. DETAILED DESCRIPTION

[0028] Various exemplary embodiments, features and aspects of the present disclosure will be described in detail below with reference to the accompanying drawings. The same reference numerals in the accompanying drawings represent elements with the same or similar functions. Although various aspects of the embodiments are shown in the accompanying drawings, the drawings are not necessarily drawn to scale unless otherwise specified.

[0029] The word “exemplary” is used exclusively herein to mean “serving as an example, example, or illustration.” Any embodiment described herein as “exemplary” is not necessarily to be construed as preferred or advantageous over other embodiments.

[0030] The term "and / or" herein is only a description of the association relationship of the associated objects, indicating that there may be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the term "at least one" herein represents any combination of at least two of any one or more of a plurality of. For example, including at least one of A, B, and C can represent including any one or more elements selected from the set consisting of A, B, and C.

[0031] In addition, in order to better illustrate the present disclosure, numerous specific details are given in the following specific embodiments. It should be understood by those skilled in the art that the present disclosure can also be implemented without certain specific details. In some examples, methods, means, components and circuits well known to those skilled in the art are not described in detail in order to highlight the subject matter of the present disclosure.

[0032] Figure 1 A flow chart of a crowd positioning method according to an embodiment of the present disclosure is shown. The crowd positioning method can be executed by an electronic device such as a terminal device or a server. The terminal device can be a user equipment (UE), a mobile device, a user terminal, a cellular phone, a cordless phone, a personal digital assistant (PDA), a handheld device, a computing device, a vehicle-mounted device, a wearable device, etc. The crowd positioning method can be implemented by a processor calling a computer-readable instruction stored in a memory. Alternatively, the crowd positioning method can be executed by a server. Figure 1 As shown, the crowd positioning method may include:

[0033] In step S11, feature extraction is performed on at least two frames of crowd images obtained from the crowd video clip to obtain at least two first feature maps.

[0034] The crowd video clip here is a video clip including multiple frames of crowd images, which can be obtained after an image acquisition device captures a dense crowd in a certain spatial range (for example, squares, shopping malls, subway stations, tourist attractions and other places with large traffic flow), or it can be obtained by other means, and the present disclosure does not make specific limitations on this.

[0035] In one example, after an image acquisition device acquires a video of a dense crowd and obtains an original crowd video, when the frame rate of the original crowd video is high, the difference between the crowd images of adjacent frames in the original crowd video is small. In order to better utilize the spatiotemporal relationship between crowd images of different frames, the original crowd video with a high frame rate can be downsampled to obtain a crowd video segment with a frame rate less than a threshold, so that the difference between the crowd images of adjacent frames in the crowd video segment is large, so that the spatiotemporal relationship between the crowd images of different frames in the crowd video segment can be better utilized, and better crowd positioning can be achieved. For example, the frame rate of the crowd video segment is 5 frames per second.

[0036] In one example, after the original crowd video is frame-rate downsampled to obtain a crowd video clip, since each frame of the crowd image of the crowd video clip may include other background parts in addition to the dense crowd, in order to better locate the crowd, each frame of the crowd image can be cropped to retain the dense crowd part included in each frame of the crowd image. However, the cropped frames of the crowd image need to have the same scale to ensure that subsequent image processing operations such as feature extraction and feature fusion can be performed on each frame of the crowd image.

[0037] The crowd video clip includes multiple frames of crowd images, and at least two frames of crowd images are obtained from the crowd video clip for feature extraction, wherein the number of frames of crowd images for feature extraction obtained from the crowd video clip can be determined according to actual conditions, for example, 2 frames, 3 frames, 5 frames, 7 frames, etc., and the present disclosure does not make specific limitations on this.

[0038] Feature extraction is performed on at least two frames of crowd images, specifically, feature extraction is performed on at least two frames of crowd images through a feature extraction module in a convolutional neural network to obtain at least two first feature maps. The feature extraction process will be described in detail later in conjunction with possible implementations of the present disclosure, and will not be repeated here.

[0039] In step S12, the feature neighborhood corresponding to each target pixel point in the target first feature map in at least two first feature maps is determined, wherein the target first feature map is a first feature map corresponding to the target crowd image in at least two frames of crowd images.

[0040] The target crowd image here is a certain frame of at least two frames of crowd images obtained from the crowd video clip. For example, it can be the first frame of the at least two frames of crowd images; it can be the last frame of the at least two frames of crowd images; in the case where the crowd images obtained from the crowd video clip are odd-numbered frames greater than or equal to 3 frames, the target crowd image can be the middle frame of the odd-numbered frames greater than or equal to 3 frames; it can also be any one of the at least two frames of crowd images, and the present disclosure does not make specific limitations on this.

[0041] The first feature map corresponding to the target crowd image is determined as the target first feature map. The feature neighborhood corresponding to each target pixel point in the target first feature map in at least two first feature maps is determined. For example, three frames of crowd images I1, I2 and I3 are obtained from a crowd video clip, and feature extraction is performed on the three frames of crowd images respectively to obtain three first feature maps: the first feature map X1 corresponding to the crowd image I1, the first feature map X2 corresponding to the crowd image I2, and the first feature map X3 corresponding to the crowd image I3. Among them, in the case where the crowd image I2 is the target crowd image, the first feature map X2 is the target first feature map. At this time, for each target pixel point in the target first feature map X2, the feature neighborhood corresponding to each target pixel point is determined in the first feature map X1, the first feature map X2 and the first feature map X3 respectively. The specific process of determining the feature neighborhood corresponding to each target pixel point will be described in detail later in combination with the possible implementation methods of the present disclosure, which will not be repeated here.

[0042] In step S13, based on the feature neighborhood corresponding to each target pixel point, at least two first feature maps are fused to obtain a second feature map corresponding to the target population image.

[0043] In the related art, when crowd positioning is performed using crowd video clips, at least two first feature maps obtained after feature extraction of at least two frames of crowd images obtained from the crowd video clips are only simply fused in the channel dimension, which fails to fully utilize the temporal information between different frames of crowd images in the crowd video clips.

[0044] In the embodiment of the present disclosure, based on the feature neighborhoods of each target pixel in the target first feature map, at least two first feature maps are fused, so that in the feature fusion process, both the spatial information in the target crowd image and the temporal information between crowd images of different frames can be used to obtain a second feature map with more robust semantic features corresponding to the target crowd image. The feature fusion process will be described in detail later in conjunction with possible implementation methods of the present disclosure, and will not be repeated here.

[0045] In step S14, crowd positioning is performed according to the second feature map to obtain a target positioning map corresponding to the target crowd image, wherein the target positioning map is used to indicate the positions of human bodies included in the target crowd image.

[0046] Since the second feature map obtained after feature fusion can reflect the spatiotemporal relationship between crowd images of different frames, after using the second feature map to locate the crowd, a target location map with a high accuracy corresponding to the target crowd image can be obtained. The crowd location process will be described in detail later in conjunction with possible implementation methods of the present disclosure, which will not be repeated here.

[0047] In an embodiment of the present disclosure, feature extraction is performed on at least two frames of crowd images obtained from a crowd video clip, respectively, to obtain at least two first feature maps; a feature neighborhood corresponding to each target pixel point in the target first feature map in the at least two first feature maps is determined, wherein the target first feature map is a first feature map corresponding to the target crowd image in the at least two frames of crowd images; based on the feature neighborhood corresponding to each target pixel point, the at least two first feature maps are fused to obtain a second feature map corresponding to the target crowd image; crowd positioning is performed according to the second feature map to obtain a target positioning map corresponding to the target crowd image, wherein the target positioning map is used to indicate the position of the human body included in the target crowd image.

[0048] Compared with the method of performing crowd positioning based on a single crowd image in the related art, using crowd video clips to perform crowd positioning of target crowd images can mine the temporal information in the crowd video clips, so as to improve the crowd positioning accuracy.

[0049] In addition, compared with the method of simply fusing at least two first feature maps at the channel level in the related art, in the crowd positioning process, based on the corresponding feature neighborhood in the first feature map of adjacent frame images of each target pixel point of the target image, the long-distance correlation relationship between pixels in different frame crowd images of the crowd video clip can be captured, so that the fusion of at least two first feature maps can mine more sufficient and robust feature information, so that the fused second feature map can reflect the spatiotemporal relationship between crowd images of different frames, and then after using the second feature map to locate the crowd, a target positioning map with higher accuracy corresponding to the target crowd image can be obtained, thereby effectively improving the accuracy of crowd positioning.

[0050] In a possible implementation, a feature extraction module in a convolutional neural network may be used to perform feature extraction on at least two frames of crowd images obtained from a crowd video clip to obtain at least two first feature maps.

[0051] In one example, the feature extraction module in the convolutional neural network can be composed of convolutional layers (e.g., the first 13 convolutional layers of the VGG-16 network) in a deep convolutional neural network trained on a public image dataset (e.g., ImageNet) in the field of computer vision.

[0052] For example, three crowd images I1, I2 and I3 are obtained from a crowd video clip. The three crowd images I1, I2 and I3 are input into the feature extraction module in the convolutional neural network for feature extraction, and three first feature maps can be obtained: the first feature map X1 corresponding to the crowd image I1, the first feature map X2 corresponding to the crowd image I2 and the first feature map X3 corresponding to the crowd image I3. The size of each first feature map is reduced to 1 / 8 of the corresponding frame crowd image, and the number of channels is 512.

[0053] In addition to being composed of the first 13 convolutional layers of the VGG-16 network, the structure of the feature extraction module can also be set to other network structures according to actual conditions, and the present disclosure does not make specific restrictions on this. For feature extraction modules with different network structures, the size and number of channels of at least two first feature maps obtained after feature extraction of at least two frames of crowd images obtained from the crowd video clip can be different, and the present disclosure does not make specific restrictions on this.

[0054] In a possible implementation, determining a feature neighborhood corresponding to each target pixel point in the target first feature map in at least two first feature maps includes: determining a two-dimensional Gaussian distribution corresponding to each target pixel point based on the coordinates of each target pixel point in the target first feature map and a preset standard deviation; and determining a corresponding feature neighborhood in at least two first feature maps based on the two-dimensional Gaussian distribution corresponding to each target pixel point.

[0055] Based on the distribution characteristics of the two-dimensional Gaussian distribution, according to the two-dimensional Gaussian distribution corresponding to each target pixel point, the corresponding feature neighborhood is determined in at least two first feature maps, so that the feature neighborhood can capture the local and long-distance correlation relationship of the pixel points in different first feature maps, and effectively reflect the spatiotemporal relationship between crowd images in different frames.

[0056] Still taking the above three first feature maps X1, X2 and X3, where the first feature map X2 is the target first feature map as an example, for any target pixel point (x, y) in the target first feature map X2, according to the coordinates of the target pixel point (x, y) and the preset standard deviation γ 2 , generate the two-dimensional Gaussian distribution N((x,y),γ 2 ,I 2 ), where I 2 is a second-order unit matrix. The default standard deviation γ 2 The specific value of can be determined according to actual conditions, and this disclosure does not make any specific limitation on this.

[0057] After determining the two-dimensional Gaussian distribution N((x,y),γ 2 ,I 2) and then, by applying the Gaussian two-dimensional distribution N((x,y),γ 2 ,I 2 ) to perform sampling, and determine a set of integer sampling coordinates for each first feature map X1, X2 and X3 respectively. Wherein, P is the number of sampling coordinates included in each set of sampling coordinates. The specific value of P can be determined according to actual conditions, and the present disclosure does not make specific restrictions on this. The method of sampling the two-dimensional Gaussian distribution can be random sampling, or other sampling methods can be used, and the present disclosure does not make specific restrictions on this.

[0058] The sampling coordinates determined for each first feature map X1, X2 and X3 are as follows: The feature neighborhoods of the target pixel point (x, y) in the target first feature map X2 in each of the first feature maps X1, X2 and X3 are respectively constituted.

[0059] By traversing each target pixel point in the target first feature map X2 in the above manner, the feature neighborhood of each target pixel point in the target first feature map X2 in each of the first feature maps X1, X2 and X3 can be obtained.

[0060] In a possible implementation, based on the feature neighborhood corresponding to each target pixel point, at least two first feature maps are fused to obtain a second feature map corresponding to the target population image, including: based on the feature neighborhood corresponding to each target pixel point in the at least two first feature maps, respectively determining the sampling pixel points corresponding to each target pixel point in the at least two first feature maps; based on each target pixel point and the sampling pixel points corresponding to each target pixel point, the at least two first feature maps are fused to obtain a second feature map, wherein the second feature map and the target first feature map have the same size.

[0061] After determining the feature neighborhood corresponding to each target pixel point in at least two first feature maps, the sampling pixel points corresponding to each target pixel point in at least two first feature maps can be quickly determined based on the feature neighborhood corresponding to each target pixel point, and then the fusion of at least two first feature maps is achieved based on each target pixel point and the sampling pixel points corresponding to each target pixel point, so as to effectively obtain the second feature map corresponding to the target population image.

[0062] In one example, a Gaussian neighborhood attention module in a convolutional neural network can be utilized to implement a Gaussian neighborhood attention mechanism. According to the feature neighborhoods corresponding to each target pixel point in at least two first feature maps, at least two first feature maps are fused to obtain a second feature map corresponding to the target population image. The Gaussian neighborhood attention module includes three inputs: a query map, a key map, and a value map. Among them, the query map can be the target first feature map corresponding to the target population image, and the key map and the value map are multiple pairs of key map - value map pairs formed according to each first feature map. Among them, the key map and the value map in the same key map - value map pair are the same first feature map. The query map can be expressed as Q ∈ R h×w×c , and the key map - value map pair can be expressed as where K represents the key map, V represents the value map, and n is the number of key map - value map pairs. The value of n is the same as the number of at least two first feature maps.

[0063] Since the feature neighborhoods corresponding to each target pixel point in the target first feature map in each first feature map are determined based on the two - dimensional Gaussian distribution of each target pixel point, therefore, in the subsequent feature fusion process, the attention mechanism can be limited only within the Gaussian neighborhood of the target first feature map, so that the redundant components in the global attention mechanism can be removed, thereby improving the feature fusion efficiency and reducing the computational consumption.

[0064] Still taking the above three first feature maps X1, X2, and X3 as an example, where the first feature map X2 is the target first feature map. The target first feature map X2 is determined as the query map Q. Three key map - value map pairs are determined according to the three first feature maps X1, X2, and X3: (K 1 , V 1 ) = (X1, X1), (K 2 , V 2 ) = (X2, X2), and (K 3 , V 3 ) = (X3, X3).

[0065] Since the sampled pixel point coordinates determined for each of the first feature maps X1, X2, and X3 above respectively form the feature neighborhoods of the target pixel point (x, y) in the target first feature map X2 in each of the first feature maps X1, X2, and X3. Therefore, for any target pixel point (x, y) in the query map Q, is the feature neighborhood corresponding to the target pixel point (x, y) in the key map - value pair (K 1 , V 1 ), is the feature neighborhood corresponding to the target pixel point (x, y) in the key map - value pair (K 2 , V2 ) in the corresponding feature neighborhood, is the target pixel (x, y) in the key-value pair (K 3 ,V 3 ) in the corresponding feature neighborhood.

[0066] In a possible implementation, at least two first feature map pairs are fused according to each target pixel and the sampling pixel corresponding to each target pixel to obtain a second feature map, including: normalizing the dot product between each target pixel and the sampling pixel corresponding to each target pixel to obtain the weight of the sampling pixel corresponding to each target pixel; and performing weighted summation of the sampling pixel corresponding to each target pixel according to the weight of the sampling pixel corresponding to each target pixel to obtain the second feature map.

[0067] For the target pixel (x, y) in the query graph Q (target first feature graph), in any key-value graph pair {(K i ,V i )}, according to the key-graph-value graph pair {(K i ,V i )} corresponds to a set of sampling coordinate points Determine the target pixel (x, y) in the key graph K i The corresponding sampling pixel point And determine the target pixel (x, y) in the value map V i The corresponding sampling pixel point Based on the following formula (1), the Gaussian attention ATTENTION(x,y) corresponding to the pixel point (x,y) in the second feature map is determined:

[0068]

[0069] in, and They are the target pixel (x, y) in the query graph Q and the target pixel (x, y) in the key graph K. i The corresponding sampling pixel point And the target pixel (x, y) in the value map V i The corresponding sampling pixel point Softmax(·) is a normalization function. Using softmax(·) normalization function, Q x,y and The dot product between them is normalized to determine the target pixel (x, y) in the key graph K i The corresponding sampling pixels in The weight of K. i Each sampling pixel in The weight of the value graph V i Each sampling pixel in Perform weighted summation to obtain the Gaussian attention ATTENTION(x,y) corresponding to the pixel point (x,y) in the second feature map.

[0070] Figure 2 FIG. 2 is a schematic diagram showing feature fusion according to an embodiment of the present disclosure. Figure 2 As shown in the figure, for the target pixel in the query graph Q (target first feature graph), according to the two-dimensional Gaussian distribution of the target pixel, the key-value graph pair {(K i ,V i )} i Sum value graph V i The sampling pixel points corresponding to the target pixel points are determined in (both are first feature maps), and then based on the above formula (1), the dot product between the target pixel point and the corresponding sampling pixel points in the key map is normalized using the softmax(·) normalization function to obtain the weights of the corresponding sampling pixel points in the key map. Then, according to the weights of the corresponding sampling pixel points in the key map, the weighted summation of the corresponding sampling pixel points in the value map is performed to obtain the Gaussian attention of the target pixel point in the second feature map.

[0071] Based on the above formula (1), each target pixel in the query graph Q is traversed, so that the Gaussian attention corresponding to each pixel in the second feature graph Z corresponding to the target population image I2 can be obtained. Based on the Gaussian attention corresponding to each pixel in the second feature graph Z, a second feature graph Z having the same size as the target first feature graph X2 corresponding to the target population image I2 can be obtained. The second feature graph Z is a feature graph obtained after feature enhancement based on the Gaussian neighborhood attention mechanism. The second feature graph Z and the target first feature graph X2 corresponding to the target population image I2 have the same size. The second feature graph Z can reflect the spatiotemporal relationship between the target population image I2 and other non-target population images I1 and I3.

[0072] In a possible implementation, crowd positioning is performed according to the second feature map to obtain a target positioning map corresponding to the target crowd image, including: performing crowd positioning according to the second feature map to obtain a first positioning probability map, wherein the first positioning probability map is used to indicate the probability that each target pixel point in the target crowd image is a human body; performing image processing on the first positioning probability map according to a probability threshold to obtain a target positioning map.

[0073] Since the second feature map can reflect the spatiotemporal relationship between the target crowd image and other non-target crowd images, the second feature map is used to locate the crowd, and a first positioning probability map with a higher accuracy corresponding to the target crowd image can be obtained. However, since the first positioning probability map is only used to indicate the probability that each pixel in the target crowd image is a human body, the first positioning probability map is processed by a pre-set probability threshold, so that a target positioning map for indicating the position of the human body included in the target crowd image can be effectively obtained.

[0074] The process of locating a crowd based on the second feature map is described in detail below in conjunction with possible implementations of the present disclosure.

[0075] In a possible implementation, crowd positioning is performed according to the second feature map to obtain a first positioning probability map, including: performing convolution processing on the second feature map to obtain a third feature map; performing transposed convolution processing on the third feature map to obtain a fourth feature map, wherein the fourth feature map and the target crowd image have the same size; and performing convolution processing on the fourth feature map to obtain a first positioning probability map.

[0076] By performing convolution processing on the second feature map to achieve further feature extraction, a third feature map is obtained. In order to determine the probability that each target pixel in the target population image is a human body, a transposed convolution processing is performed on the third feature map so that a fourth feature map having the same size as the target population image can be obtained. Then, the fourth feature map is convolved to effectively obtain a first positioning probability map indicating the probability that each target pixel in the target population image is a human body.

[0077] The first positioning probability map has the same size as the target crowd image. Taking the target crowd image I2 as an example, in the target crowd image I2∈R H×W×3 In the case of , H and W are the height and width of the target population image, respectively, and the number of channels of the target population image is 3 (for example, RGB three channels). At this time, the first positioning probability map can be recorded as in, Used to indicate the probability that I2(x) is a human body, x is the target population image I2 and the first positioning probability map The coordinates of the target pixel points with the same relative position in .

[0078] In a possible implementation, a positioning prediction module in a convolutional neural network can be used to locate the crowd on the second feature map to obtain a first positioning probability map.

[0079] In one example, the positioning prediction module in the convolutional neural network may include a convolution layer for performing convolution processing and a transposed convolution layer for performing transposed convolution processing. The specific structure of the positioning prediction module can be set according to actual conditions (for example, the number of convolution layers, and the arrangement of each layer, etc.), and this disclosure does not specifically limit this.

[0080] In one example, still taking the above-mentioned second feature map Z as an example, the second feature map Z is input into the positioning prediction module in the convolutional neural network. The process of the positioning prediction module for crowd positioning the second feature map Z can be specifically described as follows: using three convolutional layers (the convolution kernel size is 3, the hole rate is 2, and the number of channels is 512), the second feature map Z is convolved to achieve further feature extraction and obtain a third feature map; then using three transposed convolutional layers (the convolution kernel size is 4, the step size is 2, and the number of channels is 256, 128, and 64, respectively), and a convolutional layer connected after each transposed convolutional layer (the convolution kernel size is 3, the hole rate is 2, and the number of channels is 256, 128, and 64, respectively), the third feature map is transposed and convolved to achieve the transformation of the feature into the size of the target crowd image, and a fourth feature map with the same size as the target crowd image is obtained. Finally, a 1×1 convolutional layer is used to convolve the fourth feature map to transform the number of channels of the feature to 1, and finally output the first positioning probability map.

[0081] Since the first positioning probability map is only used to indicate the probability that each target pixel in the target population image is a human body, the first positioning probability map is processed by a pre-set probability threshold, so that a target positioning map for indicating the position of the human body included in the target population image can be effectively obtained. The specific value of the probability threshold can be determined according to actual conditions, and the present disclosure does not make specific restrictions on this.

[0082] In a possible implementation, the first positioning probability map is subjected to image processing according to a probability threshold to obtain a target positioning map, including: performing an average pooling operation on the first positioning probability map to obtain a mean pooling map; performing a maximum pooling operation on the mean pooling map to obtain a maximum pooling map; obtaining a second positioning probability map according to the mean pooling map and the maximum pooling map; and performing threshold segmentation on the second positioning probability map according to the probability threshold to obtain a target positioning map.

[0083] An average pooling operation is performed on the first positioning probability map to obtain a mean pooling map, and a maximum pooling operation is performed on the mean pooling map to obtain a maximum pooling map, thereby effectively suppressing image noise.

[0084] In one example, first, the first positioning probability map is averaged by using a first pooling kernel with a size of 3 and a step size of 1 to obtain a mean pooling map; then, the mean pooling map is max-pooled by using a second pooling kernel with a size of 3 and a step size of 1 to obtain a maximum pooling map. The specific values ​​of the size and step size of the first pooling kernel and the second pooling kernel can be set according to actual conditions, and the present disclosure does not specifically limit this.

[0085] Peak screening is performed on the mean pooling map and the maximum pooling map, so as to obtain a second positioning probability map with higher accuracy.

[0086] In one example, the pixel values ​​of the pixels in the mean pooling map and the maximum pooling map are used to indicate the probability that the corresponding target pixel in the target population image is a human body. The mean pooling map and the maximum pooling map are compared pixel by pixel. For the pixels at the same relative position in the mean pooling map and the maximum pooling map, if the pixel values ​​are the same probability values, the pixel values ​​of the pixels at the same relative position in the second positioning probability map are determined as the probability value; for the pixels at the same relative position in the mean pooling map and the maximum pooling map, if the pixel values ​​are different probability values, the pixel values ​​of the pixels at the same relative position in the second positioning probability map are determined as 0.

[0087] For example, when the pixel value of the pixel point (i, j) (the pixel point at the i-th row and the j-th column) in the mean pooling map is 0.7 and the pixel value of the pixel point (i, j) in the maximum pooling map is 0.7, the pixel value of the pixel point (i, j) in the second positioning probability map is determined to be 0.7.

[0088] For another example, when the pixel value of the pixel point (i, j) in the mean pooling map is 0.7 and the pixel value of the pixel point (i, j) in the maximum pooling map is 0.5, the pixel value of the pixel point (i, j) in the second positioning probability map is determined to be 0.

[0089] Finally, the second positioning probability map is threshold segmented by using a preset probability threshold, so that the final required target positioning map can be obtained, thereby effectively determining the position of the human body included in the target crowd image.

[0090] In one example, the probability value corresponding to each pixel in the second positioning probability map is compared with the probability threshold. When the pixel value of a certain pixel is greater than or equal to the probability threshold, the pixel value of the pixel with the same relative position in the target positioning map is determined to be 1; when the pixel value of a certain pixel is less than the probability threshold, the pixel value of the pixel with the same relative position in the target positioning map is determined to be 0.

[0091] The target positioning map and the target population image have the same size, and the position of the pixel point with a pixel value of 1 in the target positioning map is used to indicate the position of the human body included in the target population image. For example, when the pixel value of the pixel point (i, j) in the target positioning map is 1, the position of the target pixel point (i, j) in the target population image corresponds to the human body; when the pixel value of the pixel point (i, j) in the target positioning map is 0, the position of the target pixel point (i, j) in the target population image corresponds to the part other than the head of the human body.

[0092] According to the target positioning map, the positions of the human bodies included in the target crowd image can be determined to achieve crowd positioning and provide data basis for other crowd analysis tasks (e.g., crowd counting, group behavior analysis, etc.). For example, by counting the number of pixels with a pixel value of 1 in the target positioning map, the number of human bodies included in the target crowd image can be obtained to achieve crowd counting of the target crowd image. For another example, by counting the distribution of pixel points with a pixel value of 1 in the target positioning map, the behavior trajectory of the human bodies included in the target crowd image can be obtained to achieve crowd behavior analysis of the target crowd image.

[0093] In a possible implementation, the crowd positioning method is implemented by a crowd positioning neural network, and the training samples of the crowd positioning neural network include crowd sample video clips and real positioning maps corresponding to target crowd sample images in the crowd sample video clips; the training method of the crowd positioning neural network is as follows: according to the crowd sample video clips, the predicted positioning probability map corresponding to the target crowd sample image is determined by the crowd positioning neural network, wherein the predicted positioning probability map is used to indicate the probability that each pixel point in the target crowd sample image is a human body; based on the predicted positioning probability map and the real positioning map, the positioning loss is determined; based on the positioning loss, the crowd positioning neural network is optimized.

[0094] In order to quickly realize crowd positioning, a crowd positioning neural network can be pre-trained based on the above crowd positioning method, and then in practical applications, the crowd positioning neural network can be used to quickly and effectively realize the recognition and positioning of crowd images.

[0095] A training sample for network training of a crowd positioning neural network is pre-constructed, wherein the training sample includes a crowd sample video clip and a real positioning map corresponding to a target crowd sample image in the crowd sample video clip.

[0096] The crowd sample video clip here is a video clip including multiple frames of crowd sample images, which can be obtained after the image acquisition device performs video acquisition on dense crowds in a certain spatial range (for example, squares, shopping malls, subway stations, tourist attractions and other places with large traffic flow), or it can be obtained by other means, and the present disclosure does not make specific limitations on this.

[0097] In a possible implementation, the crowd positioning method further includes: acquiring an original crowd sample video; downsampling the original crowd sample video to obtain a crowd sample video segment, wherein the frame rate of the crowd sample video segment is less than a threshold.

[0098] After the image acquisition device acquires the video of the dense crowd and obtains the original crowd sample video, when the frame rate of the original crowd sample video is high, the difference between the crowd sample images of adjacent frames in the original crowd sample video is small. In order to better utilize the spatiotemporal relationship between the crowd sample images of different frames, the original crowd sample video with a high frame rate can be frame-rate downsampled to obtain a crowd sample video segment with a frame rate less than a threshold, so that the difference between the crowd sample images of adjacent frames in the crowd sample video segment is large, so that the spatiotemporal relationship between the crowd sample images of different frames in the crowd sample video segment can be better utilized to train the crowd positioning neural network. For example, the frame rate of the crowd sample video segment is 5 frames per second.

[0099] After the original crowd sample video is frame-rate downsampled to obtain the crowd sample video clip, since each frame of the crowd sample image of the crowd sample video clip may include other background parts in addition to the dense crowd, in order to better train the crowd positioning neural network, each frame of the crowd sample image can be cropped to retain the dense crowd part included in each frame of the crowd sample image. However, the cropped crowd sample images need to have the same scale to ensure that subsequent image processing operations such as feature extraction and feature fusion can be performed on each frame of the crowd sample image.

[0100] The crowd sample video clip includes multiple frames of crowd sample images, and at least two frames of crowd sample images are obtained from the crowd sample video clip for feature extraction, wherein the specific number of at least two frames of crowd sample images for feature extraction can be determined according to actual conditions, for example, 2 frames, 3 frames, 5 frames, 7 frames, etc., and the present disclosure does not make specific limitations on this.

[0101] Among at least two frames of crowd sample images obtained from the crowd sample video clip, one frame of crowd sample image is randomly selected to be determined as the target crowd sample image. For example, the target crowd sample image may be the first frame of the at least two frames of crowd sample images; it may be the last frame of the at least two frames of crowd sample images; in the case where the crowd sample images obtained from the crowd sample video clip are odd-numbered frames greater than or equal to 3 frames, the target crowd sample image may be the middle frame of the odd-numbered frames greater than or equal to 3 frames; it may also be any one frame of the at least two frames of crowd sample images, and the present disclosure does not make any specific limitation on this.

[0102] The real positioning map and the target population sample image have the same size. The pixel values ​​of the pixels in the real positioning map are 0 or 1. The positions of the pixels with a pixel value of 1 are used to indicate the positions of the human body included in the target population sample image; the positions of the pixels with a pixel value of 0 are used to indicate other positions other than the human body included in the target population sample image. The relationship between the real positioning map and the target population sample image is similar to the relationship between the target positioning map and the target population image, and will not be repeated here.

[0103] In a possible implementation, the crowd positioning method further includes: determining a labeling result corresponding to a sample image of a target crowd, wherein the labeling result includes coordinates of a human body in the sample image of the target crowd; and determining a true positioning map according to the labeling result.

[0104] By annotating the human body coordinates of the sample images of the target population, the real positioning map corresponding to the sample images of the target population can be effectively determined according to the annotation results, and then the training samples for network training of the population positioning neural network can be effectively constructed according to the sample images of the target population and the real positioning map.

[0105] In one example, the target population sample image is I2'∈R H×W×3 , H and W are the height and width of the target population sample image I2' respectively, and the number of channels of the target population sample image is 3. Label the human body included in the target population sample image I2' to obtain the labeling result corresponding to the target population sample image I2' Among them, a i is the coordinate of the i-th human body in the target population sample image I2', and m is the number of human bodies included in the target population sample image I2'.

[0106] In one example, the labeling result corresponding to the target population sample image I2' can be Using the following formula (2), determine the real positioning map Y∈R corresponding to the target population sample image I2' H×W :

[0107]

[0108] in, y is the coordinate of the pixel points with the same relative position in the target population sample image I2' and the true positioning map Y, K = [0, 1, 0; 1, 1, 1; 0, 1, 0] is the convolution kernel, ψ(·) is the convolution result map, δ(·) is the multivariate delta function, and its specific form can be shown in the following formula (3):

[0109]

[0110] According to the annotation results corresponding to the sample images of the target population, in addition to using the above formula (2) to determine the true positioning map, other methods can also be used to determine it, and the present disclosure does not make specific limitations on this.

[0111] After determining the above-mentioned training samples, the crowd localization neural network is trained using the above-mentioned training samples. First, the crowd localization neural network is used to determine the predicted localization probability map corresponding to the target crowd sample image included in the training samples, which is used to indicate the probability that each pixel point in the target crowd sample image is a human body.

[0112] In a possible implementation, based on a crowd sample video clip, a predicted positioning probability map corresponding to a target crowd sample image is determined through a crowd positioning neural network, including: performing feature extraction on at least two frames of crowd sample images obtained from the crowd sample video clip respectively to obtain at least two fifth feature maps; determining the feature neighborhood corresponding to each pixel point in the target fifth feature map in at least two fifth feature maps, wherein the target fifth feature map is the fifth feature map corresponding to the target crowd sample image; based on the feature neighborhood corresponding to each pixel point, fusing at least two fifth feature maps to obtain a sixth feature map corresponding to the target crowd sample image; and positioning the crowd according to the sixth feature map to obtain a predicted positioning probability map.

[0113] The crowd localization neural network includes a feature extraction module. After at least two crowd sample images obtained from the crowd sample video clip are subjected to feature extraction by the feature extraction module, at least two fifth feature maps can be obtained. For example, three frames of crowd sample images are obtained from the crowd sample video clip: I1', I'2 and I'3, wherein the crowd sample image I'2 is the target crowd sample image. Using the feature extraction module in the crowd localization neural network, feature extraction is performed on the crowd sample images I1', I'2 and I'3 to obtain three fifth feature maps: the fifth feature map X1' corresponding to the crowd sample image I1', the fifth feature map X'2 corresponding to the crowd sample image I'2 and the fifth feature map X'3 corresponding to the crowd sample image I'3.

[0114] The network structure of the feature extraction module in the crowd positioning neural network is similar to the network structure of the feature extraction module in the above-mentioned convolutional neural network. The feature extraction process of the feature extraction module in the crowd positioning neural network for at least two frames of crowd sample images is similar to the feature extraction process of the feature extraction module in the above-mentioned convolutional neural network for at least two frames of crowd sample images, and will not be repeated here.

[0115] The crowd positioning neural network includes a Gaussian neighborhood attention module. Based on the Gaussian neighborhood attention module, the feature neighborhood corresponding to each pixel point in the target fifth feature map in at least two fifth feature maps can be determined, and based on the feature neighborhood corresponding to each pixel point in at least two fifth feature maps, at least two fifth feature maps are fused to obtain the sixth feature map Z' corresponding to the target crowd sample image I'2.

[0116] The network structure of the Gaussian neighborhood attention module in the crowd localization neural network is similar to the network structure of the Gaussian neighborhood attention module in the above-mentioned convolutional neural network. The process of feature fusion performed by the Gaussian neighborhood attention module in the crowd localization neural network is similar to the process of feature fusion performed by the Gaussian neighborhood attention module in the above-mentioned convolutional neural network, and will not be repeated here.

[0117] The crowd positioning neural network also includes a positioning prediction module. The positioning prediction module is used to perform crowd positioning on the sixth feature map to obtain a predicted positioning probability map indicating the probability that each pixel in the target crowd sample image is a human body. Still taking the sixth feature map Z' as an example, the positioning prediction module in the crowd positioning neural network is used to perform crowd positioning on the sixth feature map Z' to obtain a predicted positioning probability map

[0118] The network structure of the positioning prediction module in the crowd positioning neural network is similar to the network structure of the positioning prediction module in the above-mentioned convolutional neural network. The crowd positioning process of the positioning prediction module in the crowd positioning neural network for the sixth feature map is similar to the crowd positioning process of the positioning prediction module in the above-mentioned convolutional neural network for the second feature map, which will not be repeated here.

[0119] Since the predicted positioning probability map is used to indicate the probability that each pixel in the target population sample image is a human body, and the true positioning map is used to indicate the position of the human body included in the target population sample image, the positioning loss of the crowd neural network can be determined based on the predicted positioning probability map and the true positioning map, and then based on the positioning loss, the network parameters of the crowd positioning neural network can be adjusted to optimize the crowd positioning neural network.

[0120] After the crowd localization neural network obtains the predicted localization probability map corresponding to the target crowd sample image, the localization loss of the crowd localization neural network can be determined according to the difference between the predicted localization probability map and the true localization map.

[0121] In a possible implementation, the positioning loss is determined based on the predicted positioning probability map and the true positioning map, including: determining the positioning loss using a cross entropy loss function according to the predicted positioning probability map, the true positioning map and the positive sample weight, wherein the positive sample weight is the weight corresponding to the pixel point in the true positioning map used to indicate the position of the human body.

[0122] In one example, based on the predicted positioning probability map and the true positioning map Y, the positioning loss L can be determined by the cross entropy loss function shown in the following formula (4):

[0123]

[0124] Among them, H and W are the predicted positioning probability maps and the height and width of the true positioning map Y, y is the predicted positioning probability map The coordinates of the pixel points with the same relative position as the true positioning map Y, λ is the positive sample weight.

[0125] In the sample images of the target population, the pixels where the human body is located can be considered as positive samples, and the other pixels are considered as negative samples. Since the proportion of the background in the sample images of the target population may be much larger than the proportion of the human body, that is, the number of negative samples is much larger than the number of positive samples, by setting the weight of the positive samples, the positive and negative samples can be balanced during the training process.

[0126] In addition to the cross entropy loss function shown in the above formula (4), the positioning loss can also be determined by other loss functions, which is not specifically limited in the present disclosure.

[0127] After determining the positioning loss, the network parameters corresponding to the crowd positioning neural network can be adjusted according to the positioning loss to achieve the optimization of the crowd positioning network, and iterative training can be performed using the above-mentioned network training method until the iterative training meets the preset training conditions, and finally the trained crowd positioning neural network is obtained.

[0128] In a possible implementation, the network parameters are adjusted using a gradient descent method according to the positioning loss.

[0129] For example, the network parameters for the i-th iteration training are θ i , using the network parameters θ i The positioning loss determined after network training is L, then the network parameter θ during the i+1th iteration training is i+1 It can be determined by the following formula (6):

[0130]

[0131] in, represents the gradient operator symbol, and γ is the network learning rate. The specific value of the network learning rate γ can be determined according to actual conditions, for example, γ=0.0001, which is not limited in the present disclosure.

[0132] In a possible implementation, the preset training condition may be network convergence. For example, the above network training method is used to perform iterative training until the network parameters no longer change, and the network is considered to have reached convergence, and the trained crowd positioning neural network is determined to be obtained.

[0133] In a possible implementation, the preset training condition may be an iteration threshold. For example, the above network training method is used to perform iterative training until the number of iterations reaches the iteration threshold, and the trained crowd positioning neural network is determined to be obtained.

[0134] In a possible implementation, the preset training condition may be a positioning threshold. For example, the above network training method is used to perform iterative training until the positioning accuracy rate corresponding to the network is greater than the positioning threshold, and a trained crowd positioning neural network is determined to be obtained.

[0135] In addition to the above-mentioned network convergence, iteration threshold, or positioning threshold, the preset training conditions can also be set to other training conditions according to actual conditions, and the present disclosure does not make specific limitations on this.

[0136] Figure 3 FIG. 2 is a schematic diagram of a crowd positioning neural network according to an embodiment of the present disclosure. Figure 3 As shown, the crowd positioning neural network 30 includes a feature extraction module 31, a Gaussian neighborhood attention module 32 and a positioning prediction module 33.

[0137] like Figure 3 As shown, at least two frames of crowd images obtained from crowd video clips for which crowd positioning is required are input into the crowd positioning neural network 30, and the feature extraction module 31 performs feature extraction on the at least two frames of crowd images to obtain at least two first feature maps; the Gaussian neighborhood attention 32 determines the feature neighborhoods corresponding to each target pixel point in the target first feature map corresponding to the target crowd image based on the Gaussian neighborhood attention mechanism, and fuses the at least two first feature maps based on the feature neighborhoods corresponding to each target pixel point to obtain a second feature map corresponding to the target crowd image; the positioning prediction module 33 performs crowd positioning on the second feature map to obtain a target positioning map for indicating the position of the human body included in the target crowd image. The specific processing procedures of the feature extraction module 31, the Gaussian neighborhood attention 32 and the positioning prediction module 33 are similar to the above-mentioned related descriptions and will not be repeated here.

[0138] In the disclosed embodiment, a crowd localization neural network is utilized, and during the crowd localization process, feature fusion is performed based on the Gaussian neighborhood attention mechanism, so that the fused feature map can reflect the spatiotemporal relationship between the target crowd image and other non-target frame crowd images, so that after the crowd is localized using the fused feature map, a target localization map with a higher accuracy corresponding to the target crowd image can be obtained, thereby effectively improving the accuracy of crowd localization.

[0139] It can be understood that the above-mentioned various method embodiments mentioned in the present disclosure can be combined with each other to form a combined embodiment without violating the principle logic. Due to space limitations, the present disclosure will not repeat them. It can be understood by those skilled in the art that in the above-mentioned method of the specific implementation method, the specific execution order of each step should be determined according to its function and possible internal logic.

[0140] In addition, the present disclosure also provides a crowd positioning device, an electronic device, a computer-readable storage medium, and a program, all of which can be used to implement any crowd positioning method provided by the present disclosure. The corresponding technical solutions and descriptions are referred to the corresponding records in the method part and will not be repeated here.

[0141] Figure 4 FIG. 2 is a block diagram of a crowd positioning device according to an embodiment of the present disclosure. Figure 4 As shown, the device 40 includes:

[0142] A feature extraction module 41 is used to extract features from at least two frames of crowd images obtained from the crowd video clip, respectively, to obtain at least two first feature maps;

[0143] A feature neighborhood determination module 42 is used to determine the feature neighborhood corresponding to each target pixel point in the target first feature map in at least two first feature maps, wherein the target first feature map is a first feature map corresponding to the target crowd image in at least two frames of crowd images;

[0144] A feature fusion module 43 is used to fuse at least two first feature maps based on the feature neighborhood corresponding to each target pixel point to obtain a second feature map corresponding to the target population image;

[0145] The crowd positioning module 44 is used to perform crowd positioning according to the second feature map to obtain a target positioning map corresponding to the target crowd image, wherein the target positioning map is used to indicate the positions of the human bodies included in the target crowd image.

[0146] In a possible implementation, the feature neighborhood determination module 42 is specifically configured to:

[0147] Determine the two-dimensional Gaussian distribution corresponding to each target pixel point according to the coordinates of each target pixel point in the target first feature map and a preset standard deviation;

[0148] According to the two-dimensional Gaussian distribution corresponding to each target pixel, a corresponding feature neighborhood is determined in at least two first feature maps.

[0149] In a possible implementation, the feature fusion module 43 includes:

[0150] A first determination submodule, configured to determine, based on a feature neighborhood corresponding to each target pixel in at least two first feature maps, respectively a sampling pixel corresponding to each target pixel in at least two first feature maps;

[0151] The second determination submodule is used to fuse at least two first feature maps according to each target pixel point and the sampling pixel point corresponding to each target pixel point to obtain a second feature map, wherein the second feature map and the target first feature map have the same size.

[0152] In a possible implementation, the second determining submodule is specifically configured to:

[0153] Normalizing the dot product between each target pixel and the sampling pixel corresponding to each target pixel to obtain the weight of the sampling pixel corresponding to each target pixel;

[0154] According to the weights of the sampling pixels corresponding to the target pixels, weighted summation is performed on the sampling pixels corresponding to the target pixels to obtain a second feature map.

[0155] In a possible implementation, the crowd positioning module 44 includes:

[0156] A crowd positioning submodule, used for positioning the crowd according to the second feature map to obtain a first positioning probability map, wherein the first positioning probability map is used to indicate the probability that each target pixel point in the target crowd image is a human body;

[0157] The third determination submodule is used to perform image processing on the first positioning probability map according to the probability threshold to obtain a target positioning map.

[0158] In a possible implementation, the crowd positioning submodule is specifically used to:

[0159] Perform convolution processing on the second feature map to obtain a third feature map;

[0160] Performing a transposed convolution process on the third feature map to obtain a fourth feature map, wherein the fourth feature map and the target population image have the same size;

[0161] The fourth feature map is convolved to obtain a first positioning probability map.

[0162] In a possible implementation, the third determining submodule is specifically configured to:

[0163] Perform an average pooling operation on the first positioning probability map to obtain a mean pooling map;

[0164] Perform a maximum pooling operation on the mean pooling map to obtain a maximum pooling map;

[0165] According to the mean pooling map and the maximum pooling map, a second positioning probability map is obtained;

[0166] According to the probability threshold, the second positioning probability map is threshold segmented to obtain a target positioning map.

[0167] In a possible implementation, the device 40 implements the crowd positioning method through a crowd positioning neural network, and the training samples of the crowd positioning neural network include a crowd sample video clip and a real positioning map corresponding to a target crowd sample image in the crowd sample video clip;

[0168] The device 40 further includes: a network training module, including:

[0169] A prediction submodule is used to determine a prediction positioning probability map corresponding to a target crowd sample image through a crowd positioning neural network based on a crowd sample video clip, wherein the prediction positioning probability map is used to indicate the probability that each pixel in the target crowd sample image is a human body;

[0170] A fourth determination submodule, used to determine the positioning loss based on the predicted positioning probability map and the true positioning map;

[0171] The optimization submodule is used to optimize the crowd localization neural network based on the localization loss.

[0172] In a possible implementation, the prediction submodule is specifically used to:

[0173] Performing feature extraction on at least two frames of crowd sample images obtained from the crowd sample video clips respectively to obtain at least two fifth feature maps;

[0174] Determine a feature neighborhood corresponding to each pixel point in the target fifth feature map in at least two fifth feature maps, wherein the target fifth feature map is a fifth feature map corresponding to a sample image of a target population;

[0175] Based on the feature neighborhood corresponding to each pixel point in the at least two fifth feature maps, the at least two fifth feature maps are fused to obtain a sixth feature map corresponding to the target population sample image;

[0176] Crowd positioning is performed according to the sixth characteristic map to obtain a predicted positioning probability map.

[0177] In a possible implementation, the fourth determining submodule is specifically configured to:

[0178] The positioning loss is determined using the cross entropy loss function based on the predicted positioning probability map, the true positioning map and the positive sample weights, where the positive sample weights are the weights corresponding to the pixel points in the true positioning map that indicate the location of the human body.

[0179] In a possible implementation, the apparatus 40 further includes:

[0180] The acquisition submodule is used to obtain the original crowd sample video;

[0181] The downsampling submodule is used to downsample the frame rate of the original crowd sample video to obtain a crowd sample video clip, wherein the frame rate of the crowd sample video clip is less than a threshold.

[0182] In a possible implementation, the apparatus 40 further includes:

[0183] A fifth determination submodule is used to determine the labeling result corresponding to the target population sample image, wherein the labeling result includes the coordinates of the human body in the target population sample image;

[0184] The sixth determination submodule is used to determine the real positioning map according to the marking result.

[0185] In some embodiments, the functions or modules included in the device provided by the embodiments of the present disclosure can be used to execute the method described in the above method embodiments. The specific implementation can refer to the description of the above method embodiments, and for the sake of brevity, it will not be repeated here.

[0186] The embodiment of the present disclosure also provides a computer-readable storage medium, on which computer program instructions are stored, and when the computer program instructions are executed by a processor, the above method is implemented. The computer-readable storage medium may be a non-volatile computer-readable storage medium.

[0187] An embodiment of the present disclosure further proposes an electronic device, comprising: a processor; and a memory for storing instructions executable by the processor; wherein the processor is configured to call the instructions stored in the memory to execute the above method.

[0188] The embodiments of the present disclosure also provide a computer program product, including a computer-readable code. When the computer-readable code is run on a device, a processor in the device executes instructions for implementing the crowd positioning method provided in any of the above embodiments.

[0189] The embodiments of the present disclosure also provide another computer program product for storing computer-readable instructions, which, when executed, enable a computer to perform the operations of the crowd positioning method provided in any of the above embodiments.

[0190] The electronic device may be provided as a terminal, a server, or a device in other forms.

[0191] Figure 5 A block diagram of an electronic device according to an embodiment of the present disclosure is shown. Figure 5 As shown, the electronic device 800 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, or the like.

[0192] Reference Figure 5 , the electronic device 800 may include one or more of the following components: a processing component 802 , a memory 804 , a power component 806 , a multimedia component 808 , an audio component 810 , an input / output (I / O) interface 812 , a sensor component 814 , and a communication component 816 .

[0193] The processing component 802 generally controls the overall operation of the electronic device 800, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 802 may include one or more modules to facilitate the interaction between the processing component 802 and other components. For example, the processing component 802 may include a multimedia module to facilitate the interaction between the multimedia component 808 and the processing component 802.

[0194] The memory 804 is configured to store various types of data to support operations on the electronic device 800. Examples of such data include instructions for any application or method operating on the electronic device 800, contact data, phone book data, messages, pictures, videos, etc. The memory 804 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0195] The power supply component 806 provides power to the various components of the electronic device 800. The power supply component 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the electronic device 800.

[0196] The multimedia component 808 includes a screen that provides an output interface between the electronic device 800 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 808 includes a front camera and / or a rear camera. When the electronic device 800 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.

[0197] The audio component 810 is configured to output and / or input audio signals. For example, the audio component 810 includes a microphone (MIC), and when the electronic device 800 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 804 or sent via the communication component 816. In some embodiments, the audio component 810 also includes a speaker for outputting audio signals.

[0198] I / O interface 812 provides an interface between processing component 802 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: home button, volume button, start button, and lock button.

[0199] The sensor assembly 814 includes one or more sensors for providing various aspects of status assessment for the electronic device 800. For example, the sensor assembly 814 can detect the open / closed state of the electronic device 800, the relative positioning of the components, such as the display and keypad of the electronic device 800, and the sensor assembly 814 can also detect the position change of the electronic device 800 or a component of the electronic device 800, the presence or absence of contact between the user and the electronic device 800, the orientation or acceleration / deceleration of the electronic device 800, and the temperature change of the electronic device 800. The sensor assembly 814 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 814 may also include an optical sensor, such as a complementary metal oxide semiconductor (CMOS) or a charge coupled device (CCD) image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

[0200] The communication component 816 is configured to facilitate wired or wireless communication between the electronic device 800 and other devices. The electronic device 800 can access a wireless network based on a communication standard, such as a wireless network (WiFi), a second generation mobile communication technology (2G) or a third generation mobile communication technology (3G), or a combination thereof. In an exemplary embodiment, the communication component 816 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.

[0201] In an exemplary embodiment, the electronic device 800 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the above methods.

[0202] In an exemplary embodiment, a non-volatile computer-readable storage medium is also provided, such as a memory 804 including computer program instructions, which can be executed by a processor 820 of an electronic device 800 to perform the above method.

[0203] Figure 6 A block diagram of an electronic device according to an embodiment of the present disclosure is shown. Figure 6 As shown, the electronic device 1900 may be provided as a server. Figure 6 , the electronic device 1900 includes a processing component 1922, which further includes one or more processors, and a memory resource represented by a memory 1932 for storing instructions that can be executed by the processing component 1922, such as an application. The application stored in the memory 1932 may include one or more modules, each corresponding to a set of instructions. In addition, the processing component 1922 is configured to execute instructions to perform the above method.

[0204] The electronic device 1900 may also include a power supply component 1926 configured to perform power management of the electronic device 1900, a wired or wireless network interface 1950 configured to connect the electronic device 1900 to a network, and an input / output (I / O) interface 1958. The electronic device 1900 may operate based on an operating system stored in the memory 1932, such as a Microsoft Server operating system (Windows Server 2003).TM ), a graphical user interface operating system launched by Apple (Mac OSX TM ), a multi-user, multi-process computer operating system (Unix TM ), a free and open source Unix-like operating system (Linux TM ), an open source Unix-like operating system (FreeBSD TM ) or similar.

[0205] In an exemplary embodiment, a non-volatile computer-readable storage medium is also provided, such as a memory 1932 including computer program instructions, which can be executed by the processing component 1922 of the electronic device 1900 to perform the above method.

[0206] The present disclosure may be a system, a method and / or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for causing a processor to implement various aspects of the present disclosure.

[0207] Computer readable storage medium can be a tangible device that can hold and store instructions used by an instruction execution device. Computer readable storage medium can be, for example, (but not limited to) an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination thereof. More specific examples (non-exhaustive list) of computer readable storage medium include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disk read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, for example, a punch card or a convex structure in a groove on which instructions are stored, and any suitable combination thereof. The computer readable storage medium used here is not interpreted as a transient signal itself, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagated by a waveguide or other transmission medium (for example, a light pulse by an optical fiber cable), or an electrical signal transmitted by a wire.

[0208] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing / processing device.

[0209] The computer program instructions for performing the operation of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages, such as Smalltalk, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. Computer-readable program instructions may be executed completely on a user's computer, partially on a user's computer, as an independent software package, partially on a user's computer, partially on a remote computer, or completely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., using an Internet service provider to connect via the Internet). In some embodiments, an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), may be customized by utilizing the state information of the computer-readable program instructions, and the electronic circuit may execute the computer-readable program instructions, thereby realizing various aspects of the present disclosure.

[0210] Various aspects of the present disclosure are described herein with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products according to the embodiments of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer-readable program instructions.

[0211] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processor of the computer or other programmable data processing device, a device that implements the functions / actions specified in one or more boxes in the flowchart and / or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and / or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.

[0212] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operating steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.

[0213] The flow chart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to multiple embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a part of a module, program segment or instruction, and a part of the module, program segment or instruction includes one or more executable instructions for realizing the specified logical function. In some alternative implementations, the function marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous square boxes can actually be executed substantially in parallel, and they can sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or action, or can be implemented with a combination of special hardware and computer instructions.

[0214] The computer program product may be implemented in hardware, software or a combination thereof. In one optional embodiment, the computer program product is embodied as a computer storage medium, and in another optional embodiment, the computer program product is embodied as a software product, such as a software development kit (SDK) and the like.

[0215] The embodiments of the present disclosure have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and changes will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or improvements to the technology in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.

Claims

1. A crowd positioning method, characterized in that: include: Performing feature extraction on at least two frames of crowd images obtained from the crowd video clips respectively to obtain at least two first feature maps; Determine a feature neighborhood corresponding to each target pixel point in the target first feature map in the at least two first feature maps, wherein the target first feature map is a first feature map corresponding to the target crowd image in the at least two frames of crowd images, and the feature neighborhood is used to capture the local and long-range correlation relationship between the pixel points in the target first feature map and the other first feature maps; Based on the feature neighborhood corresponding to each target pixel point, the at least two first feature maps are merged to obtain a second feature map corresponding to the target crowd image, wherein the second feature map is used to reflect the spatiotemporal relationship between the target crowd image and other crowd images in the at least two frames of crowd images; Performing crowd positioning according to the second feature map to obtain a target positioning map corresponding to the target crowd image, wherein the target positioning map is used to indicate positions of human bodies included in the target crowd image; The step of determining a feature neighborhood corresponding to each target pixel point in the target first feature map in the at least two first feature maps includes: Determine the two-dimensional Gaussian distribution corresponding to each target pixel point according to the coordinates of each target pixel point in the target first feature map and a preset standard deviation; According to the two-dimensional Gaussian distribution corresponding to each target pixel point, the corresponding feature neighborhood is determined in the at least two first feature maps respectively.

2. The method according to claim 1, characterized in that The step of fusing the at least two first feature maps based on the feature neighborhood corresponding to each target pixel point to obtain a second feature map corresponding to the target population image includes: Based on the feature neighborhood corresponding to each target pixel in the at least two first feature maps, respectively determine the sampling pixel points corresponding to each target pixel in the at least two first feature maps; According to each target pixel and the sampling pixel corresponding to each target pixel, the at least two first feature maps are fused to obtain the second feature map, wherein the second feature map and the target first feature map have the same size.

3. The method according to claim 2, characterized in that The step of fusing the at least two first feature maps according to the target pixels and the sampling pixels corresponding to the target pixels to obtain the second feature map includes: Normalizing the dot product between each target pixel and the sampling pixel corresponding to each target pixel to obtain the weight of the sampling pixel corresponding to each target pixel; According to the weights of the sampling pixels corresponding to each target pixel, weighted summation is performed on the sampling pixels corresponding to each target pixel to obtain the second feature map.

4. The method according to claim 1, characterized in that: The performing crowd positioning according to the second feature map to obtain a target positioning map corresponding to the target crowd image includes: Performing crowd positioning according to the second feature map to obtain a first positioning probability map, wherein the first positioning probability map is used to indicate the probability that each target pixel point in the target crowd image is a human body; According to the probability threshold, image processing is performed on the first positioning probability map to obtain the target positioning map.

5. The method according to claim 4, characterized in that The performing crowd positioning according to the second feature map to obtain a first positioning probability map includes: Performing convolution processing on the second feature map to obtain a third feature map; Performing a transposed convolution process on the third feature map to obtain a fourth feature map, wherein the fourth feature map and the target population image have the same size; Perform convolution processing on the fourth feature map to obtain the first positioning probability map.

6. The method according to claim 4, characterized in that The step of performing image processing on the first positioning probability map according to the probability threshold to obtain the target positioning map includes: Performing an average pooling operation on the first positioning probability map to obtain a mean pooling map; Performing a maximum pooling operation on the mean pooling map to obtain a maximum pooling map; Obtaining a second positioning probability map according to the mean pooling map and the maximum pooling map; According to the probability threshold, the second positioning probability map is threshold segmented to obtain the target positioning map.

7. The method according to claim 1, characterized in that The crowd positioning method is implemented by a crowd positioning neural network, wherein the training samples of the crowd positioning neural network include a crowd sample video clip and a real positioning map corresponding to a target crowd sample image in the crowd sample video clip; The training method of the crowd positioning neural network is as follows: According to the crowd sample video clip, determining the predicted positioning probability map corresponding to the target crowd sample image through the crowd positioning neural network, wherein the predicted positioning probability map is used to indicate the probability that each pixel point in the target crowd sample image is a human body; Determining a positioning loss based on the predicted positioning probability map and the actual positioning map; Based on the positioning loss, the crowd positioning neural network is optimized.

8. The method according to claim 7, characterized in that The method of determining the predicted positioning probability map corresponding to the target crowd sample image through the crowd positioning neural network according to the crowd sample video clip includes: Performing feature extraction on at least two frames of crowd sample images obtained from the crowd sample video clips respectively to obtain at least two fifth feature maps; Determine a feature neighborhood corresponding to each pixel point in the target fifth feature map in the at least two fifth feature maps, wherein the target fifth feature map is a fifth feature map corresponding to the target population sample image; Based on the feature neighborhood corresponding to each pixel point, the at least two fifth feature maps are fused to obtain a sixth feature map corresponding to the target population sample image; Crowd positioning is performed according to the sixth characteristic map to obtain the predicted positioning probability map.

9. The method according to claim 7, characterized in that: The determining of the positioning loss based on the predicted positioning probability map and the true positioning map includes: The positioning loss is determined using a cross entropy loss function according to the predicted positioning probability map, the true positioning map and the positive sample weight, wherein the positive sample weight is a weight corresponding to a pixel point in the true positioning map used to indicate the position of a human body.

10. The method according to claim 7, characterized in that The method further comprises: Get the original crowd sample video; The original crowd sample video is frame-rate downsampled to obtain the crowd sample video segment, wherein the frame rate of the crowd sample video segment is less than a threshold.

11. The method according to claim 7, characterized in that The method further comprises: Determine the annotation result corresponding to the target population sample image, wherein the annotation result includes the coordinates of the human body in the target population sample image; The real positioning map is determined according to the labeling result.

12. A crowd positioning device, characterized in that: include: A feature extraction module, used to extract features from at least two frames of crowd images obtained from the crowd video clip, respectively, to obtain at least two first feature maps; A feature neighborhood determination module, used to determine the feature neighborhood corresponding to each target pixel point in the target first feature map in the at least two first feature maps, wherein the target first feature map is a first feature map corresponding to the target crowd image in the at least two frames of crowd images, and the feature neighborhood is used to capture the local and long-range correlation relationship between the pixel points in the target first feature map and the other first feature maps; A feature fusion module, configured to fuse the at least two first feature maps based on the feature neighborhood corresponding to each target pixel point to obtain a second feature map corresponding to the target crowd image, wherein the second feature map is used to reflect the spatiotemporal relationship between the target crowd image and other crowd images in the at least two frames of crowd images; A crowd positioning module, used for positioning a crowd according to the second feature map, and obtaining a target positioning map corresponding to the target crowd image, wherein the target positioning map is used to indicate the positions of human bodies included in the target crowd image; Wherein, the feature neighborhood determination module is specifically used for: Determine the two-dimensional Gaussian distribution corresponding to each target pixel point according to the coordinates of each target pixel point in the target first feature map and a preset standard deviation; According to the two-dimensional Gaussian distribution corresponding to each target pixel point, the corresponding feature neighborhood is determined in the at least two first feature maps respectively.

13. An electronic device, characterized in that: include: processor; a memory for storing processor-executable instructions; The processor is configured to call the instructions stored in the memory to execute the method described in any one of claims 1 to 11.

14. A computer-readable storage medium having computer program instructions stored thereon, characterized in that: When the computer program instructions are executed by a processor, the method according to any one of claims 1 to 11 is implemented.

Citation Information

Patent Citations

  • Crowd distribution prediction method and system based on double-flow convolutional neural network

    CN112767451A