Multi-view optimal transmission crowd detection method, system and terminal based on point supervision

Through a multi-view optimal transmission crowd detection method based on point supervision, multi-view image features and distance selection strategies are used to fuse the cost matrix, and the convolutional neural network is trained with real crowd coordinates, which solves the problem of low detection accuracy in densely populated areas in the existing technology. problem, achieving higher detection accuracy.

CN118429781BActive Publication Date: 2024-10-29SHENZHEN UNIV
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202410891360.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-04
Publication Date
2024-10-29
Estimated Expiration
2044-07-04

AI Technical Summary

Technical Problem

Existing multi-view crowd detection methods use Gaussian blur kernels when supervising network training, which leads to the problem of false detection and missed detection in densely populated areas.

Method used

A multi-view optimal transmission crowd detection method based on point supervision is adopted. By obtaining multi-view image features, the occupancy probability map is determined, and the cost matrix of different views is fused based on the distance selection strategy. The real crowd coordinates are used to calculate the loss function to supervise the convolutional neural network. For network training, the Mahalanobis distance cost matrix is ​​used to overcome the impact of projection distortion.

Benefits of technology

It effectively improves the accuracy of crowd location detection, overcomes the performance bottleneck of the model in large scenes and crowded areas, and improves the accuracy of detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118429781B_ABST
    Figure CN118429781B_ABST
Patent Text Reader

Abstract

The present invention discloses a multi-perspective optimal transmission crowd detection method, system and terminal based on point supervision, the method comprising: obtaining multi-perspective images, extracting multi-perspective image features based on a convolutional neural network, and determining an occupancy probability map based on the multi-perspective image features, the occupancy probability map being used to reflect the probability of a person existing at each position; obtaining cost matrices of different perspectives, and fusing the cost matrices of different perspectives based on a distance selection strategy to obtain an optimal transmission cost matrix; obtaining real crowd coordinates, and calculating the loss value of the occupancy probability map and the real crowd coordinates using the loss function corresponding to the optimal transmission cost matrix to supervise the training of the convolutional neural network. The present invention uses the coordinate points of the real crowd as supervision information, effectively overcoming the performance bottleneck of the model in large scenes and densely populated areas, and the optimal transmission matrix based on multiple perspectives can effectively improve the accuracy of crowd position detection in the scene.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of crowd detection, and in particular to a multi-view optimal transmission crowd detection method, system and terminal based on point supervision. Background Art

[0002] Research on crowd detection usually performs detection on the ground plane of the scene, which can serve a variety of practical applications, such as public safety, autonomous driving, and crowd analysis. Some early methods are based on single-view methods, which try to extract some artificially defined features in the image to detect the location of each person, and then train a classifier based on these features.

[0003] However, it is difficult for single-view methods to solve the occlusion problem. With the development of multi-view deep learning methods, methods based on multi-view detection have made great progress recently. Multi-view crowd detection uses convolutional neural networks to extract features from each view image, and predicts the probability occupancy map of the ground plane by connecting and stacking multi-view features as a way to fuse multi-view feature information. The occupancy probability map describes the probability of a person existing at the corresponding position. However, when supervising network training, existing methods use Gaussian blur kernels to smooth the coordinate points of the crowd on the ground plane, making it easier for the network to converge. However, this supervision method is often prone to false detection and missed detection when facing densely populated areas due to the repeated stacking of Gaussian kernels.

[0004] Therefore, there are technical defects in the prior art that need to be improved. Summary of the invention

[0005] The technical problem to be solved by the present invention is to provide a multi-view optimal transmission crowd detection method, system and terminal based on point supervision in view of the above-mentioned defects of the prior art. The technical solution adopted by the present invention is as follows:

[0006] In a first aspect, the present invention provides a multi-view optimal transmission crowd detection method based on point supervision, wherein the method comprises:

[0007] Acquire a multi-view image, extract multi-view image features based on a convolutional neural network, and determine an occupancy probability map based on the multi-view image features, wherein the occupancy probability map is used to reflect the probability of a person existing at each position;

[0008] Obtain the cost matrices of different perspectives, and fuse the cost matrices of different perspectives based on the distance selection strategy to obtain the optimal transmission cost matrix;

[0009] The real crowd coordinates are obtained, and the occupancy probability map and the real crowd coordinates are compared with each other using the loss function corresponding to the optimal transmission cost matrix to calculate the loss value, so as to supervise the training of the convolutional neural network.

[0010] In one implementation, acquiring a multi-view image, extracting multi-view image features based on a convolutional neural network, and determining an occupancy probability map based on the multi-view image features includes:

[0011] Capturing images based on different cameras to obtain the multi-view images, wherein each camera corresponds to one view;

[0012] Inputting the multi-view image into the convolutional neural network, and performing feature extraction on each view image based on a feature extraction module in the convolutional neural network to obtain the multi-view image features, wherein the multi-view image features include crowd features extracted from each view image;

[0013] The multi-view image features are processed and decoded to obtain the occupancy probability map.

[0014] In one implementation, the weights of the feature extraction module are shared for all viewing angles.

[0015] In one implementation, the processing of the multi-view image features and decoding to obtain the occupancy probability map includes:

[0016] Projecting the multi-view image features onto a ground plane to obtain a projection feature map of each view;

[0017] All the projection feature maps are fused, and the fused projection feature maps are input into the ground plane decoder for decoding to obtain the occupancy probability map, which is the prediction result of the crowd coordinates.

[0018] In one implementation, the acquiring cost matrices of different perspectives and fusing the cost matrices of different perspectives based on a distance selection strategy to obtain an optimal transmission cost matrix includes:

[0019] Get the cost matrix corresponding to the viewing angle of each camera;

[0020] Calculate the distance between each real crowd coordinate and each camera;

[0021] Based on the distance selection strategy, determine the cost matrix corresponding to the camera closest to each real crowd coordinate;

[0022] The cost matrices corresponding to all cameras that are closest to each real crowd coordinate are fused to obtain the optimal transmission cost matrix.

[0023] In one implementation, the optimal transmission cost matrix is ​​a transmission cost matrix based on Mahalanobis distance.

[0024] In one implementation, the loss function corresponding to the optimal transmission cost matrix is:

[0025] The loss function is as follows:

[0026] ,

[0027] in, Represents the density of all pixels in the multi-view image, is the pixel in the image The density of Indicated in Is there anyone at this position? , m is the total number of people predicted in the scene, n is the actual total number of people in the scene, C is the optimal transmission cost matrix, and are the row index and column index of the P matrix respectively, P is the transmission plan matrix to be solved, is the entropy regularization term used to ensure the stability of convergence, It is used to ensure that each value on the predicted occupancy probability map has a corresponding true value. It is used to ensure that all real values ​​participate in the operation. T is the matrix transpose symbol. , Both are adjustment factors used to adjust the weights of corresponding items.

[0028] In a second aspect, an embodiment of the present invention further provides a multi-view optimal transmission crowd detection system based on point supervision, wherein the system comprises:

[0029] A crowd prediction module is used to obtain multi-view images, extract multi-view image features based on a convolutional neural network, and determine an occupancy probability map based on the multi-view image features, wherein the occupancy probability map is used to reflect the probability of a person existing at each position;

[0030] The cost matrix determination module is used to obtain the cost matrices of different perspectives and fuse the cost matrices of different perspectives based on the distance selection strategy to obtain the optimal transmission cost matrix;

[0031] A training supervision module is used to obtain real crowd coordinates and calculate a loss value between the occupancy probability map and the real crowd coordinates using a loss function corresponding to the optimal transmission cost matrix to supervise the training of the convolutional neural network.

[0032] In the third aspect, an embodiment of the present invention further provides a terminal, wherein the terminal includes a memory, a processor, and a multi-perspective optimal transmission crowd detection program based on point supervision stored in the memory and executable on the processor, and when the processor executes the multi-perspective optimal transmission crowd detection program based on point supervision, the steps of the multi-perspective optimal transmission crowd detection method based on point supervision of any one of the above-mentioned schemes are implemented.

[0033] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, wherein a multi-perspective optimal transmission crowd detection program based on point supervision is stored on the computer-readable storage medium, and when the multi-perspective optimal transmission crowd detection program based on point supervision is executed by a processor, the steps of the multi-perspective optimal transmission crowd detection method based on point supervision described in any one of the above-mentioned schemes are implemented.

[0034] Beneficial effect: Compared with the prior art, the present invention provides a multi-perspective optimal transmission crowd detection method based on point supervision. The present invention first obtains a multi-perspective image, extracts multi-perspective image features based on a convolutional neural network, and determines an occupancy probability map based on the multi-perspective image features. The occupancy probability map is used to reflect the probability of the existence of a person at each position. Then, the cost matrix of different perspectives is obtained, and the cost matrices of different perspectives are fused based on a distance selection strategy to obtain an optimal transmission cost matrix. Finally, the coordinates of the real crowd are obtained, and the loss value of the occupancy probability map and the real crowd coordinates is calculated using the loss function corresponding to the optimal transmission cost matrix to supervise the training of the convolutional neural network. The present invention uses the coordinate points of the real crowd as supervision information, which effectively overcomes the performance bottleneck of the model in large scenes and densely populated areas. The optimal transmission matrix based on multiple perspectives can effectively improve the accuracy of crowd position detection in the scene. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] Figure 1 A flowchart of a preferred embodiment of a multi-view optimal transmission crowd detection method based on point supervision provided in an embodiment of the present invention.

[0036] Figure 2 Schematic diagram of the multi-view optimal transmission crowd detection method based on point supervision provided in an embodiment of the present invention.

[0037] Figure 3 A flowchart of a specific implementation method of the multi-view optimal transmission crowd detection method based on point supervision provided in an embodiment of the present invention.

[0038] Figure 4 A schematic diagram of the architecture of a multi-view optimal transmission crowd detection device based on point supervision provided in an embodiment of the present invention.

[0039] Figure 5A functional block diagram of a terminal provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0040] In order to make the purpose, technical solution and effect of the present invention clearer and more specific, the present invention is further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0041] In the prior art, crowd detection is supervised and trained based on probability occupancy maps, and cannot be trained directly in a point-supervised manner; and good results are achieved on data sets containing only a limited number of frames and a fixed number of camera angles, but poor results are achieved on data sets with angle changes and scene changes, especially in densely populated areas. To this end, this embodiment provides a multi-view optimal transmission crowd detection method based on point supervision. In specific implementation, this embodiment first obtains multi-view images, extracts multi-view image features based on a convolutional neural network, and determines an occupancy probability map based on the multi-view image features. The occupancy probability map is used to reflect the probability of a person existing at each position. Then, the cost matrix of different perspectives is obtained, and the cost matrix of different perspectives is fused based on a distance selection strategy to obtain an optimal transmission cost matrix. Finally, the real crowd coordinates are obtained, and the loss value corresponding to the optimal transmission cost matrix is ​​used to calculate the loss value of the occupancy probability map and the real crowd coordinates to supervise the training of the convolutional neural network. The present invention uses the coordinate points of the real crowd as supervision information, effectively overcoming the performance bottleneck of the model in large scenes and densely populated areas. The optimal transmission matrix based on multiple perspectives can effectively improve the accuracy of crowd position detection in the scene.

[0042] The multi-view optimal transmission crowd detection method based on point supervision in this embodiment can be applied to a terminal, which can be a computer, a smart TV, a mobile phone or other smart terminal products. Figure 1 As shown in , the multi-view optimal transmission crowd detection method based on point supervision includes the steps of:

[0043] Step S100: acquiring a multi-view image, extracting multi-view image features based on a convolutional neural network, and determining an occupancy probability map based on the multi-view image features, wherein the occupancy probability map is used to reflect the probability of a person existing at each position;

[0044] Step S200, obtaining cost matrices of different perspectives, and fusing the cost matrices of different perspectives based on a distance selection strategy to obtain an optimal transmission cost matrix;

[0045] Step S300, obtaining real crowd coordinates, and calculating loss values ​​of the occupancy probability map and the real crowd coordinates using the loss function corresponding to the optimal transmission cost matrix to supervise the training of the convolutional neural network.

[0046] When applying it in specific Figure 2 and Figure 3 As shown, in this embodiment, a plurality of cameras with different viewing angles are used to collect images for a certain scene, and each camera corresponds to a viewing angle, so as to collect multi-view images, such as Figure 2 As shown in , images of view 1, view 2, view 3, ... view K are obtained. Next, this embodiment uses a convolutional neural network to extract image features from multi-view images to obtain multi-view image features. These multi-view image features all reflect the characteristics of the crowd in the scene, and crowd detection can be performed based on these multi-view image features.

[0047] For multi-view crowd detection, usually we first use mature image feature extraction networks, such as VGG network, ResNet, etc., to obtain better image features. This embodiment selects a convolutional neural network as the backbone network for feature extraction. In order to cope with the problem of different numbers of cameras in training scenes and test scenes, the weights of the feature extraction module in the convolutional neural network in this embodiment are shared for all viewpoints. When the multi-view image is input into the convolutional neural network, and feature extraction is performed on each viewpoint image based on the feature extraction module in the convolutional neural network, after the multi-view image passes through the feature extraction module, each viewpoint outputs a feature map of a certain resolution, thereby obtaining multi-view image features, which include crowd features extracted from each viewpoint image. Next, this embodiment processes the multi-view image features and obtains the occupancy probability map after decoding, that is, Figure 2 The predicted value in .

[0048] Specifically, this embodiment can project the multi-view image features to the ground plane to obtain projection feature maps of each view. Then all the projection feature maps are fused. During the specific implementation, the camera calibration parameters can be used to convert the view, project the multi-view image features to the ground plane of the scene, and use a simple splicing of the projection feature maps of multiple viewpoints as a feature fusion method to achieve feature fusion. The fused projection feature map is input into the ground plane decoder in the convolutional neural network for decoding to obtain the occupancy probability map, which is the prediction result of the crowd coordinates.

[0049] Furthermore, in order to improve the accuracy of crowd detection by the convolutional neural network in this embodiment, this embodiment directly uses the coordinate points of the crowd on the ground plane as supervision information, effectively overcoming the performance bottleneck of the model in large scenes and densely populated areas. Specifically, this embodiment obtains the cost matrices of different perspectives, and fuses the cost matrices of different perspectives based on the distance selection strategy to obtain the optimal transmission cost matrix. Then, the real crowd coordinates are obtained, that is, Figure 2 The true value in , and the occupancy probability map and the true crowd coordinates are calculated using the loss function corresponding to the optimal transmission cost matrix to supervise the training of the convolutional neural network.

[0050] In the multi-view crowd detection problem, the ground plane prediction is usually susceptible to projection errors and is prone to elliptical distortion along the ray direction, which seriously affects the detection accuracy. Therefore, this embodiment designs an optimal transmission cost matrix that can model this distortion. The logic of this embodiment is to give a greater penalty along the camera ray direction to the crowd prediction coordinates of each ground plane (i.e., the crowd coordinates predicted in the occupancy probability map) to reduce the distortion along the ray direction. At the same time, considering that it is not easy to obtain accurate predictions when the coordinate point is far away from the camera, this embodiment takes into account the distance between the crowd coordinate point and the camera. The farther the coordinate point is from the camera, the greater the penalty imposed. Based on the above two considerations, this embodiment designs a corresponding Mahalanobis distance cost matrix to replace the traditional Euclidean distance cost matrix. The major axis direction of the ellipse represented by the Mahalanobis distance is along the camera direction, and the data variance along the camera direction and perpendicular to the camera direction is determined by the distance from the coordinate point to the camera. During multi-view fusion, for each person's coordinate point, this embodiment selects the camera closest to it to calculate the corresponding Mahalanobis distance cost matrix, and then fuses it to obtain the optimal transmission cost matrix. By using the loss function corresponding to the optimal transmission cost matrix to calculate the loss value by comparing the predicted results of the crowd coordinates reflected in the occupancy probability map with the actual crowd coordinates, the training of the convolutional neural network is supervised, which helps to improve the prediction accuracy of the convolutional neural network.

[0051] Specifically, when designing the optimal transmission cost matrix, this embodiment first directly extends the single-view Euclidean distance optimal transmission to multiple viewpoints. Specifically, the optimal transmission loss between the predicted crowd coordinates on the ground plane and the real crowd coordinates is first directly calculated. The cost matrix used is the exponential Euclidean distance between the predicted crowd coordinate points and the real crowd coordinate points, where i and j are the row index and column index of the C matrix respectively, and T is the matrix transpose symbol.

[0052] ,

[0053] However, directly applying the Euclidean distance does not achieve good results in multi-view tasks. There are two factors unique to multi-view tasks that the Euclidean distance cannot model: the direction of the ray from the camera to the crowd and the distance from the crowd to the camera.

[0054] When the multi-view feature is projected onto the ground plane, the projection will cause the feature to be distorted in shape, that is, the feature will produce an elliptical tail along the projection direction, which will cause the predicted crowd coordinates to be offset along the projection direction. Therefore, a greater penalty should be given to the position deviation along the projection direction. This embodiment uses a transmission cost matrix based on the Mahalanobis distance, taking into account the influence of the camera ray direction on the prediction, and achieves better results than the Euclidean distance cost matrix.

[0055] The minor axis of the ellipse represented by the Mahalanobis distance is consistent with the direction from the camera to the crowd coordinate point, and the major axis is perpendicular to this direction. With this design, more penalties will be given for the deviation of the predicted crowd coordinate point along the ray direction. Specifically, for each true value of the crowd coordinate on the ground plane, its covariance matrix is ​​first calculated:

[0056] ,

[0057] ,

[0058] Where R represents the counterclockwise rotation matrix from the original coordinate system to the camera ray direction coordinate system, is the rotation angle. is a diagonal matrix with values ​​on the diagonal and are the variances along the ray direction and perpendicular to the ray direction, respectively, and are fixed constants. < , so (1 / )>(1 / ), indicating that the prediction deviation along the ray direction will result in a greater penalty. The complete cost matrix formula is as follows:

[0059] ,

[0060] The above matrix is ​​called the ray-based Mahalanobis distance cost matrix. and are the row and column indices of the C matrix respectively, and T is the matrix transpose symbol.

[0061] For the distance from the crowd to the camera, it is more difficult to predict the coordinate points of the crowd far away from the camera, so a larger penalty should be imposed. and The specific expression is:

[0062] ,

[0063] in is the distance from the crowd to the camera. and Equal, this can also be regarded as a weighted Euclidean distance. Used to normalize the distance from the coordinate point to the camera to [0, 1]. It is an adjustment factor used to adjust the influence of the distance from the crowd to the camera. Based on this, the optimal transmission cost matrix of the Mahalanobis distance based on the distance from the crowd to the camera is constructed.

[0064] In order to consider the above two multi-view influencing factors at the same time, this embodiment proposes a distance-ray based Mahalanobis distance optimal transmission cost matrix. and Expressed as:

[0065] , ,

[0066] That is, the distance from the crowd to the camera is used to adjust the major and minor axes of the ellipse represented by the Mahalanobis distance. Specifically, for the crowd coordinate points that are gradually moving away from the camera, a larger variance is allocated in the direction perpendicular to the ray, that is, a smaller penalty is given, and the corresponding penalty along the ray direction is larger.

[0067] The above derivation is for each individual camera. When multiple cameras are fused, this embodiment uses a distance-based selection strategy to fuse the optimal transmission cost matrix of the Mahalanobis distance of each camera perspective. Specifically, for each ground plane coordinate point, only the camera perspective closest to it is selected to calculate the corresponding Mahalanobis distance optimal transmission cost matrix. In this way, we extend the proposed method to multiple perspectives. The optimal transmission cost matrix expression obtained in the end is as follows:

[0068] ;

[0069] in, ,

[0070] in is a binary function used to select the value corresponding to the C matrix of the nearest viewing angle, K is the number of cameras, Represents the distance from the real crowd coordinate point to the kth camera.

[0071] Finally, the loss function of the optimal transmission cost matrix is ​​as follows:

[0072] ,

[0073] in, Represents the density of all pixels in the multi-view image, is the pixel in the image The density of Indicated in Is there anyone at this position? , m is the total number of people predicted in the scene, n is the actual total number of people in the scene, C is the optimal transmission cost matrix, and are the row index and column index of the P matrix respectively, P is the transmission plan matrix to be solved, is the entropy regularization term used to ensure the stability of convergence, It is used to ensure that each value on the predicted occupancy probability map has a corresponding true value. It is used to ensure that all real values ​​participate in the operation. T is the matrix transpose symbol. , Both are adjustment factors used to adjust the weights of the corresponding items. Among them, the inner product of C and P describes the difference between the predicted population distribution and the actual population distribution. By minimizing the loss function, the predicted population distribution is expected to be close to the actual population distribution, thereby improving the crowd prediction accuracy of the convolutional neural network.

[0074] It can be seen that this embodiment models the geometric characteristics of the projected ground plane features for the first time. The training of a complete point-supervised multi-view crowd detection neural network is realized for the first time using multi-view optimal transmission. The manual design of the Gaussian blur kernel size is eliminated, and better results are achieved than other existing technologies in large-scale urban scenes and crowded areas. The loss function corresponding to the optimal transmission cost matrix of this embodiment can effectively model the distortion caused by the projection and improve the accuracy of crowd position detection in the scene.

[0075] Based on the above embodiments, the present invention also provides a multi-view optimal transmission crowd detection system based on point supervision, such as Figure 4 As shown in , the device includes: a crowd prediction module 10, a cost matrix determination module 20 and a training supervision module 30. The crowd prediction module 10 is used to obtain multi-view images, extract multi-view image features based on a convolutional neural network, and determine an occupancy probability map based on the multi-view image features, and the occupancy probability map is used to reflect the probability of the existence of a person at each position. The cost matrix determination module 20 is used to obtain cost matrices of different viewpoints, and fuse the cost matrices of different viewpoints based on a distance selection strategy to obtain an optimal transmission cost matrix. The training supervision module 30 is used to obtain real crowd coordinates, and calculate the loss value of the occupancy probability map and the real crowd coordinates using the loss function corresponding to the optimal transmission cost matrix to supervise the training of the convolutional neural network.

[0076] In one implementation, the crowd prediction module 10 includes:

[0077] An image acquisition unit, configured to acquire images based on different cameras to obtain the multi-view images, wherein each camera corresponds to one view;

[0078] A feature extraction unit, used to input the multi-view image into the convolutional neural network, and perform feature extraction on each view image based on a feature extraction module in the convolutional neural network to obtain the multi-view image features, wherein the multi-view image features include crowd features extracted from each view image, and the weights of the feature extraction module are shared for all views;

[0079] The decoding processing unit is used to process the multi-view image features and obtain the occupancy probability map through decoding.

[0080] In one implementation, the decoding processing unit includes:

[0081] A feature projection subunit, used to project the multi-view image features onto a ground plane to obtain a projection feature map of each view;

[0082] The fusion decoding subunit is used to fuse all the projection feature maps, and input the fused projection feature maps into the ground plane decoder for decoding to obtain the occupancy probability map, which is a detection result of the crowd.

[0083] In one implementation, the cost matrix determination module 20 includes:

[0084] A matrix acquisition unit, used to obtain the cost matrix corresponding to the viewing angle of each camera;

[0085] A distance calculation unit is used to calculate the distance between each real crowd coordinate and each camera;

[0086] A matrix selection unit, used to determine the cost matrix corresponding to the camera closest to each real crowd coordinate based on the distance selection strategy;

[0087] The matrix determination unit is used to merge the cost matrices corresponding to all cameras that are closest to the coordinates of each real crowd to obtain the optimal transmission cost matrix. The optimal transmission cost matrix is ​​a transmission cost matrix based on Mahalanobis distance.

[0088] The working principles of each module in the multi-view optimal transmission crowd detection device based on point supervision in this embodiment are the same as the principles of each step in the above method embodiment, and will not be repeated here.

[0089] Based on the above embodiment, the present invention further provides a terminal, the principle block diagram of the terminal can be as follows: Figure 5 The terminal may include one or more processors 100 ( Figure 5 Only one is shown in the figure), a memory 101 and a computer program 102 stored in the memory 101 and executable on one or more processors 100, for example, a multi-view optimal transmission crowd detection program based on point supervision. When one or more processors 100 execute the computer program 102, the various steps in the embodiment of the multi-view optimal transmission crowd detection method based on point supervision can be implemented. Alternatively, when one or more processors 100 execute the computer program 102, the functions of each module / unit in the embodiment of the multi-view optimal transmission crowd detection method based on point supervision can be implemented, which is not limited here.

[0090] In one embodiment, the processor 100 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.

[0091] In one embodiment, the memory 101 may be an internal storage unit of an electronic device, such as a hard disk or memory of the electronic device. The memory 101 may also be an external storage device of the electronic device, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the electronic device. Further, the memory 101 may also include both an internal storage unit of the electronic device and an external storage device. The memory 101 is used to store computer programs and other programs and data required by the terminal. The memory 101 may also be used to temporarily store data that has been output or is to be output.

[0092] Those skilled in the art will understand that Figure 5 The principle block diagram shown in the figure is only a block diagram of a partial structure related to the scheme of the present invention, and does not constitute a limitation on the terminal to which the scheme of the present invention is applied. The specific terminal may include more or less components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0093] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, operating database or other media used in the embodiments provided by the present invention may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double operational data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0094] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A multi-view optimal transmission crowd detection method based on point supervision, characterized in that: The method comprises: Acquire a multi-view image, extract multi-view image features based on a convolutional neural network, and determine an occupancy probability map based on the multi-view image features, wherein the occupancy probability map is used to reflect the probability of a person existing at each position; Obtain the cost matrices of different perspectives, and fuse the cost matrices of different perspectives based on the distance selection strategy to obtain the optimal transmission cost matrix; Acquire real crowd coordinates, and calculate loss values ​​of the occupancy probability map and the real crowd coordinates using the loss function corresponding to the optimal transmission cost matrix to supervise the training of the convolutional neural network; The acquiring of multi-view images, extracting multi-view image features based on a convolutional neural network, and determining an occupancy probability map based on the multi-view image features, includes: Capturing images based on different cameras to obtain the multi-view images, wherein each camera corresponds to one view; Inputting the multi-view image into the convolutional neural network, and performing feature extraction on each view image based on a feature extraction module in the convolutional neural network to obtain the multi-view image features, wherein the multi-view image features include crowd features extracted from each view image; Processing the multi-view image features and decoding them to obtain the occupancy probability map; The weights of the feature extraction module are shared for all viewing angles; The processing of the multi-view image features and decoding to obtain the occupancy probability map includes: Projecting the multi-view image features onto a ground plane to obtain a projection feature map of each view; All the projection feature maps are fused, and the fused projection feature maps are input into the ground plane decoder for decoding to obtain the occupancy probability map, which is the prediction result of the crowd coordinates; The step of obtaining the cost matrices of different perspectives and fusing the cost matrices of different perspectives based on the distance selection strategy to obtain the optimal transmission cost matrix includes: Get the cost matrix corresponding to the viewing angle of each camera; Calculate the distance between each real crowd coordinate and each camera; Based on the distance selection strategy, determine the cost matrix corresponding to the camera closest to each real crowd coordinate; The cost matrices corresponding to all cameras closest to the coordinates of each real crowd are merged to obtain the optimal transmission cost matrix; The optimal transmission cost matrix is ​​a transmission cost matrix based on Mahalanobis distance; When designing the optimal transmission cost matrix, the optimal transmission loss between the predicted crowd coordinates on the ground plane and the real crowd coordinates is first calculated. The cost matrix used is the cost matrix obtained by performing exponential operations based on the Euclidean distance between the predicted crowd coordinate points and the real crowd coordinate points. Specifically, it is: , where i and j are The row and column indices of the matrix, T is the matrix transpose symbol, is the pixel in the image, for location; Then, a larger penalty is imposed on position deviations along the projection direction, including: The transmission cost matrix based on Mahalanobis distance is used to consider the influence of the camera ray direction on the prediction. The short axis of the ellipse represented by the Mahalanobis distance is consistent with the direction from the camera to the crowd coordinate point, and the long axis is perpendicular to this direction accordingly. For each true value of the crowd coordinates on the ground plane, first calculate its covariance matrix: , , Among them, R represents the counterclockwise rotation matrix from the original coordinate system to the camera ray direction coordinate system, is the rotation angle, is a diagonal matrix with values ​​on the diagonal and are the variances along the ray direction and perpendicular to the ray direction, respectively, which are fixed constants; in, < , so (1 / )>(1 / ), indicating that the prediction deviation along the ray direction will result in a greater penalty, and the ray-based Mahalanobis distance cost matrix is ​​obtained as follows: , For the distance from the crowd to the camera, it is more difficult to predict the coordinate points of the crowd far away from the camera, so a larger penalty is imposed. and The specific expression is: , in is the distance from the crowd to the camera. At this time, and Equal, regarded as a weighted Euclidean distance, Used to normalize the distance from the coordinate point to the camera to [0, 1]. It is an adjustment factor used to adjust the influence of the distance from the crowd to the camera, that is, to construct the optimal transmission cost matrix of the Mahalanobis distance based on the distance from the crowd to the camera; In order to consider the above two multi-view influencing factors at the same time, a distance-ray based Mahalanobis distance optimal transmission cost matrix is ​​proposed. and Expressed as: , , That is, the distance from the crowd to the camera is used to adjust the major and minor axes of the ellipse represented by the Mahalanobis distance. For the coordinate points of the crowd that are gradually far away from the camera, a larger variance is allocated in the direction perpendicular to the ray, that is, a smaller penalty is given, and the corresponding penalty along the ray direction is larger; When multiple cameras are fused, a distance-based selection strategy is used to fuse the optimal transmission cost matrix of the Mahalanobis distance of each camera perspective. The optimal transmission cost matrix expression is finally obtained as follows: ; in, , in is a binary function used to select the value corresponding to the C matrix of the nearest viewing angle, K is the number of cameras, Represents the distance from the real crowd coordinate point to the kth camera.

2. The multi-view optimal transmission crowd detection method based on point supervision according to claim 1 is characterized in that: The loss function corresponding to the optimal transmission cost matrix is: The loss function is as follows: , in, Represents the density of all pixels in the multi-view image, is the pixel in the image The density of Indicated in Is there anyone at this position? , m is the total number of people predicted in the scene, n is the actual total number of people in the scene, C is the optimal transmission cost matrix, and are the row index and column index of the P matrix respectively, P is the transmission plan matrix to be solved, is the entropy regularization term used to ensure the stability of convergence, It is used to ensure that each value on the predicted occupancy probability map has a corresponding true value. It is used to ensure that all real values ​​participate in the operation. T is the matrix transpose symbol. , Both are adjustment factors used to adjust the weights of corresponding items.

3. A point-supervised multi-view optimal transmission crowd detection system based on the point-supervised multi-view optimal transmission crowd detection method according to claim 1 or 2, characterized in that: The system comprises: A crowd prediction module is used to obtain multi-view images, extract multi-view image features based on a convolutional neural network, and determine an occupancy probability map based on the multi-view image features, wherein the occupancy probability map is used to reflect the probability of a person existing at each position; The cost matrix determination module is used to obtain the cost matrices of different perspectives and fuse the cost matrices of different perspectives based on the distance selection strategy to obtain the optimal transmission cost matrix; A training supervision module is used to obtain real crowd coordinates and calculate a loss value between the occupancy probability map and the real crowd coordinates using a loss function corresponding to the optimal transmission cost matrix to supervise the training of the convolutional neural network.

4. A terminal, characterized in that: The terminal includes a memory, a processor, and a multi-view optimal transmission crowd detection program based on point supervision stored in the memory and executable on the processor. When the processor executes the multi-view optimal transmission crowd detection program based on point supervision, the steps of the multi-view optimal transmission crowd detection method based on point supervision as described in claim 1 or 2 are implemented.

5. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a multi-view optimal transmission crowd detection program based on point supervision. When the multi-view optimal transmission crowd detection program based on point supervision is executed by the processor, the steps of the multi-view optimal transmission crowd detection method based on point supervision as described in claim 1 or 2 are implemented.

Citation Information

Patent Citations

  • Three-dimensional reconstruction method and device based on multiple visual angles of unmanned aerial vehicle

    CN111652966A

  • Video crowd counting system and method

    CN111860162A

  • Crowd counting method and system based on background extraction and multi-scale fusion network

    CN113139489A

  • Crowd counting prediction method and system, computer equipment and storage medium

    CN114580731A

  • Crowd detection method based on view angle contribution weighting and related device

    CN116524442A