Estimation device, estimation method, estimation program, and learning device
The distribution generation model using CNNs for image analysis addresses inconsistent outputs in conventional methods by maintaining consistency between position, size, and presence, enhancing the accuracy of density map estimation.
Patent Information
- Application Number
- JP2020050053
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2020-03-19
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2040-03-19
AI Technical Summary
Conventional image analysis methods for estimating the presence of detection targets, such as crowd density, often produce inconsistent outputs for position and density, leading to erroneous results due to weak constraints between these parameters.
A distribution generation model that estimates the presence distribution of detection targets using a CNN-based framework, incorporating a position estimation unit, size estimation unit, and abundance calculation unit, with a normal distribution function to maintain consistency between position, size, and presence distribution.
This approach allows for highly accurate estimation of detection target presence distributions by ensuring consistency between position, size, and presence, thereby improving the accuracy of density map generation.
Smart Images

Figure 0007554568000007 
Figure 0007554568000002 
Figure 0007554568000006
Abstract
Description
[Technical field]
[0001] The present invention relates to a technique for estimating a distribution within an image relating to the presence of a detection target, etc., from the image, and a technique for training a distribution generation model that generates the distribution from an image. [Background technology]
[0002] There is active research being conducted on the analysis of images taken of crowds or event venues to automatically determine the level of congestion and the number of people in a crowd, and it is hoped that the information recognized in this way will be useful for smoothly operating event security.
[0003] Non-Patent Document 1 below describes a technology for performing image analysis of crowds by training a convolutional neural network (CNN) that takes an image as input and outputs the positions of people's heads and a density map of people's heads. The data used for the training consists of training images of a crowd, data showing the positions of the centers of gravity of each area of people's heads in the training images, and a density map obtained by adding up two-dimensional normal distributions with a sum of 1 and a variance according to the size of each area of the human head, with the positions of the centers of gravity as the average.
[0004] The CNN described in Non-Patent Document 1 was trained to minimize the error between the position output and the position training data, and was also trained to minimize the error between the density map output and the density map training data. [Prior art documents] [Non-patent literature]
[0005] [Non-Patent Document 1] H. Idrees, M. Tayyab, K. Athrey, D. Zhang, S. Maadeed, N. Rajpoot, and M. Shah, “Composition Loss for Counting, Density Map Estimation and Localization in Dense Crowds”, European Conference on Computer Vision(ECCV), Munich, Germany, 2018. Summary of the Invention [Problem to be solved by the invention]
[0006] However, the conventional technology had a problem in that there were many erroneous outputs, such as a certain density or higher being output for a pixel that is not the position of the head.
[0007] This is thought to be related to the fact that in the conventional technology, the position output and the density output are independent, and learning is performed to reduce the errors in position and density. In other words, while the output indicating the head position and the output regarding density should both be high values and be consistent, in the conventional technology, the constraint between the two outputs is weak, and it is thought that a model is learned that may output a low density at a pixel that is supposed to be the head position, or that may output an output indicating that the pixel is not the head position at a pixel that outputs a density above a certain level.
[0008] This problem can also occur with models that output one or more of three additional parameters (position, density, size) including the size of a human head.
[0009] The present invention has been made in consideration of the above problems, and aims to provide a technology that can estimate with high accuracy a distribution within an image related to a target quantity of a detection target, for example, an abundance distribution such as a density map, from an image, and a technology for learning a distribution generation model that can generate with high accuracy the said distribution of detection targets from an image. [Means for solving the problem]
[0010] (1) An estimation device according to the present invention is a distribution generation model that calculates a target quantity for a detection target appearing in an image using a predetermined target quantity function having a first parameter and a second parameter, and generates a target quantity distribution of the detection target in the image, the distribution generation model including a first parameter estimation unit that estimates the first parameter at a corresponding position corresponding to each pixel of the image, a second parameter estimation unit that estimates the second parameter at the corresponding position, and a target quantity calculation unit that sets values of the first parameter and the second parameter of the objective quantity function using estimates by the first parameter estimation unit and the second parameter estimation unit to calculate the target quantity, and further including a storage means that stores a trained model that has been trained using a training image and ground-truth data of the target quantity distribution that has been given in advance to the training image, and an estimation means that inputs an image to be processed into the distribution generation model and estimates the target quantity distribution.
[0011] (2) Another estimation device according to the present invention is a distribution generation model that calculates the presence of a detection target appearing in an image using a predetermined presence function whose parameters can set the position and size of an area in which the presence is concentrated, and generates a presence distribution of the detection targets in the image, and includes a position estimation unit that estimates the position of the detection target in the image, a size estimation unit that estimates the size of the detection target at a corresponding position corresponding to each pixel of the image, and a presence calculation unit that sets the value of the parameter of the presence function based on the estimated position of the detection target by the position estimation unit and the estimated size of the detection target at the estimated position by the size estimation unit, and calculates the presence, and is equipped with a memory means that stores a trained model that has been trained using a learning image and correct answer data of the presence distribution that has been given in advance to the learning image, and an estimation means that inputs an image to be processed into the distribution generation model and estimates the presence distribution.
[0012] (3) In the estimation device described in (2) above, the distribution generation model may include a plurality of the presence calculation units, the presence functions of which are different from one another.
[0013] (4) In the estimation device described in (2) or (3) above, the abundance function may be a normal distribution function, a uniform distribution function, or a rectangular function.
[0014] (5) The estimation device described in (2) to (4) above may include a binary image acquisition means for acquiring a binary image that distinguishes between an area of interest in the image corresponding to the detection target and an area of non-interest other than the area of interest, and a masking means for performing a masking process on the estimated position by the position estimation unit using the binary image and deleting the estimated position belonging to the area of non-interest, and the presence calculation unit may be configured to use the estimated position after deletion by the masking means as the value of the parameter.
[0015] (6) In the estimation device described in (2) to (5) above, the estimation device may further include a means for storing a second presence function, which is a predetermined function different from the presence function of the distribution generation model as a function for calculating the presence, and which allows a position and a size of an area where the presence is concentrated to be set by parameters, and the estimation means may be configured to input an image to be processed to the distribution generation model, set values of the parameters of the second presence function based on the position estimated by the position estimation unit and the size estimated by the size estimation unit at the estimated position, and estimate the presence distribution based on the second presence function.
[0016] (7) A learning device according to the present invention is a learning device that trains a distribution generation model that generates a presence distribution of detection targets in an image, and the learning model of the distribution generation model is a model that calculates the presence of the detection targets appearing in the image using a predetermined presence function that can set the position and size of an area where the presence is concentrated using parameters, and generates a presence distribution of the detection targets in the image, the model including a position estimation unit that estimates the position of the detection target in the image, a size estimation unit that estimates the size of the detection target at a corresponding position corresponding to each pixel of the image, and a presence calculation unit that sets the parameters of the presence function based on the estimated position of the detection target by the position estimation unit and the estimated size of the detection target at the estimated position by the size estimation unit, and calculates the presence; learning data storage means that stores a learning image and ground truth data of the presence distribution that is given in advance for the learning image; and learning means that inputs the learning image to the learning model and performs learning to update the learning model based on an error of the presence distribution based on the output of the presence calculation unit with respect to the ground truth data.
[0017] (8) An estimation method according to the present invention is a distribution generation model that calculates a target quantity for a detection target appearing in an image using a predetermined target quantity function having a first parameter and a second parameter, and generates a target quantity distribution of the detection target in the image, the distribution generation model including a first parameter estimation unit that estimates the first parameter at a corresponding position corresponding to each pixel of the image, a second parameter estimation unit that estimates the second parameter at the corresponding position, and a target quantity calculation unit that sets values of the first parameter and the second parameter of the objective quantity function using estimates by the first parameter estimation unit and the second parameter estimation unit to calculate the target quantity, and the estimation method includes the steps of: preparing a training image and a trained model that has been trained using ground-truth data of the target quantity distribution that is given in advance to the training image; and an estimation step of inputting an image to be processed into the distribution generation model and estimating the target quantity distribution.
[0018] (9) An estimation program according to the present invention is a program for causing a computer to perform a process of estimating a target quantity distribution of a detection target in an image, the program causing the computer to function as: a distribution generation model that calculates a target quantity for the detection target appearing in the image using a predetermined target quantity function having a first parameter and a second parameter, and generates the target quantity distribution, the distribution generation model including a first parameter estimation unit that estimates the first parameter at a corresponding position corresponding to each pixel of the image, a second parameter estimation unit that estimates the second parameter at the corresponding position, and a target quantity calculation unit that sets values of the first parameter and the second parameter of the objective quantity function using estimates by the first parameter estimation unit and the second parameter estimation unit and calculates the target quantity, the storage unit that stores a trained model that has been trained using a training image and ground-truth data of the target quantity distribution that has been given in advance to the training image, and an estimation unit that inputs an image to be processed into the distribution generation model and estimates the target quantity distribution. Effect of the Invention
[0019] According to the present invention, for example, since consistency can be maintained between the position, size, and abundance distribution of detection targets in a distribution generation model, it becomes possible to estimate the abundance distribution of detection targets from an image with high accuracy.
[0020] Furthermore, according to the present invention, for example, since consistency can be maintained between the position, size, and presence distribution of the detection target in the distribution generation model, it is possible to train a distribution generation model that can generate the presence distribution of the detection target from an image with high accuracy. [Brief description of the drawings]
[0021] [Figure 1] 1 is a block diagram showing a schematic configuration of an image monitoring device according to an embodiment of the present invention; [Diagram 2] FIG. 2 is a block diagram showing a schematic structure of a distribution generation model according to an embodiment of the present invention. [Diagram 3] FIG. 13 is a schematic diagram for explaining the process of generating the presence distribution. [Figure 4] 1 is a schematic functional block diagram of an image monitoring device according to an embodiment of the present invention as a learning device. [Diagram 5] FIG. 13 is a schematic diagram showing how to create training presence distributions based on functions of different shapes. [Figure 6] 1 is a schematic flow diagram of the operation of an image monitoring device according to an embodiment of the present invention as a learning device. [Figure 7] 1 is a schematic functional block diagram of an image monitoring device as an estimation device according to an embodiment of the present invention. [Figure 8] 1 is a schematic flow diagram of an operation of an image monitoring device according to an embodiment of the present invention as an estimation device. [Figure 9] FIG. 13 is a block diagram showing a schematic structure of a distribution generation model according to a modified example of an embodiment of the present invention. [Figure 10] FIG. 13 is a block diagram showing a schematic structure of a distribution generation model according to another modified example of the embodiment of the present invention. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0022] An image monitoring device 1 according to an embodiment of the present invention (hereinafter referred to as an embodiment) will be described below with reference to the drawings. The image monitoring device 1 is configured to include a learning device 20 and an estimation device 30 according to the present invention, and reports an estimation result. Here, the learning device 20 constructs a model 10 for estimating the presence distribution of detection targets from an image, and the estimation device 30 estimates the presence distribution of detection targets from a captured image using the distribution generation model 10 created by the learning device 20. The presence distribution of this embodiment is a distribution that expresses the presence of detection targets with a function having the position and size of the detection targets as parameters (input parameters). The presence expressed as a function for one detection target is summed up for all detection targets in an image to form the presence distribution in that image. The value of each pixel in the presence distribution represents the number of detection targets per pixel.
[0023] In this embodiment, the detection target is described as a human head. That is, the image monitoring device 1 estimates the head presence distribution by analyzing an image captured of a space where a crowd may exist, for example.
[0024] In this embodiment, the position of the head is defined as the coordinates of the center of gravity of the head region on the image, and the size of the head is defined as the size determined by the width of the head region on the image.
[0025] [Configuration of image monitoring device] 1 is a block diagram showing a schematic configuration of an image monitoring device 1 according to an embodiment of the present invention. The image monitoring device 1 includes an image capturing section 2, a communication section 3, a storage section 4, an image processing section 5, and a display section 6.
[0026] The photographing unit 2 is a surveillance camera that is connected to the image processing unit 5 via the communication unit 3, photographs the monitored space at a predetermined time interval to generate photographed images, and sequentially inputs the photographed images to the image processing unit 5. For example, the photographing unit 2 is installed at an event venue, photographs the venue, which is the monitored space, at a predetermined frame period (for example, 1 second) to generate color or monochrome images.
[0027] The communication unit 3 is a communication circuit, one end of which is connected to the image processing unit 5 and the other end of which is connected to the photographing unit 2 and the display unit 6 via a communication network such as a coaxial cable, a LAN (Local Area Network), or the Internet. The communication unit 3 acquires the photographed image from the photographing unit 2 and inputs it to the image processing unit 5, and outputs the estimation result input from the image processing unit 5 to the display unit 6.
[0028] The storage unit 4 is a storage device formed of an HDD (Hard Disk Drive), a semiconductor memory, etc., and stores various programs and various data. The storage unit 4 is connected to the image processing unit 5, and inputs and outputs such information between the image processing unit 5. For example, the storage unit 4 stores a program for causing the image processing unit 5 to function as each of the means of a distribution generation model 10, a learning device 20, and an estimation device 30, which will be described later. The storage unit 4 also functions as a learning data storage means 21 and a learning model storage means 24 in the learning device 20, and functions as a distribution generation model storage means 34 in the estimation device 30.
[0029] The image processing unit 5 is composed of arithmetic devices such as a CPU (Central Processing Unit), a DSP (Digital Signal Processor), an MCU (Micro Control Unit), a GPU (Graphics Processing Unit), and an FPGA (Field-programmable gate array). The image processing unit 5 is connected to the storage unit 4, and operates as various processing means and control means by reading and executing programs from the storage unit 4, and also inputs and outputs various data between the storage unit 4. The image processing unit 5 is also connected to the imaging unit 2 and the display unit 6 via the communication unit 3, and estimates the distribution of the detection target by analyzing the captured image acquired from the imaging unit 2 via the communication unit 3, and causes the display unit 6 to display the estimation result via the communication unit 3.
[0030] The display unit 6 is a display device, which is connected to the image processing unit 5 via the communication unit 3, and displays the estimation results by the image processing unit 5. For example, a monitor visually checks the displayed estimation results, judges the situation, and dispatches response personnel as necessary.
[0031] Regarding the configuration of the image monitoring device 1, first, the structure of the distribution generation model 10 that inputs an image and outputs an abundance distribution will be described below, followed by a description of the configuration and operation of a learning device 20 that learns the model, and then a description of the configuration and operation of an estimation device 30 that estimates an abundance distribution from an image.
[0032] [Structure of distribution generation model] 2 is a block diagram showing a schematic structure of the distribution generation model 10 in this embodiment. The distribution generation model 10 is a model that calculates the presence of a detection target appearing in an image using a predetermined presence function that can set the position and size of an area where the presence is concentrated using input parameters, and generates an presence distribution of the detection targets in the image. The distribution generation model 10 includes a position estimation unit that estimates the position of the detection target in the image, a size estimation unit that estimates the size of the detection target at a corresponding position corresponding to each pixel of the image, and an presence calculation unit that sets the value of the input parameter of the presence function based on the estimated position of the detection target by the position estimation unit and the estimated size of the detection target at the estimated position by the size estimation unit, and calculates the presence, and is a trained model that has been trained using a learning image and correct answer data of the presence distribution given in advance to the learning image. In this embodiment, the distribution generation model 10 is modeled using CNN. The CNN is configured as a network in which a common feature extraction means 11, a position map generation means 12, a size map generation means 13, and a presence distribution generation means 14 are connected, and among these, the position map generation means 12, the size map generation means 13, and the presence distribution generation means 14 correspond to the above-mentioned position estimation unit, size estimation unit, and presence calculation unit, respectively.
[0033] In this embodiment, the common feature extraction means 11, the position map generation means 12, and the size map generation means 13 are all modeled using CNN. That is, each of the common feature extraction means 11, the position map generation means 12, and the size map generation means 13 has a multi-layer network structure in which a convolution layer, a pooling layer, a layer of a ReLU function (activation function), etc. are connected, and the parameters of the filters and functions used in these layers are the objects of learning (learning parameters).
[0034] The common feature extraction means 11 receives an image as input, extracts features from the image, and outputs the extracted features to the position map generation means 12 and the size map generation means 13. Since the extracted features are input in common to the two means, these features are referred to as common features. Note that when the image monitoring device 1 operates as the learning device 20, the images input are learning images, and when the image monitoring device 1 operates as the estimation device 30, the images input are captured images.
[0035] The position map generating means 12 generates a position map representing the estimated position of the head from the common features input from the common feature extracting means 11, and outputs the generated position map to the presence distribution generating means 14. In this embodiment, the position map is data in which the likelihood that the position of each pixel of the image input to the common feature extracting means 11 is the position of the head is arranged in the same arrangement as the pixels of the image. In other words, the position map is a one-channel feature map, and if the width and height of the input image are M pixels and N pixels, respectively, the position map is M pixels x N pixels x 1 channel data. Hereinafter, the value of each element of the position map is also referred to as the value of the position map. The range of the value of the position map is [0, 1], and it means that the position of the pixel corresponding to the element with a larger value is estimated to be more likely to be the position of the head.
[0036] The size map generating means 13 generates a size map representing the estimated size of the head from the common feature input from the common feature extracting means 11, and outputs the generated size map to the presence distribution generating means 14. In this embodiment, the size map is data in which the size of the head, the presence of which is estimated, is arranged at the position of each pixel of the image input to the common feature extracting means 11 in the same arrangement as the pixels of the image. In other words, the size map is also a one-channel feature map, and the size map is data of M pixels×N pixels×1 channel. Hereinafter, the value of each element of the position map is referred to as the value of the size map. Note that, preferably, the final layer of the size map generating means 13 includes a process of converting the value of the size map to 0 or more by the ReLU function and then replacing it with a predetermined lower limit value if the value is less than the lower limit value, thereby preventing division by 0 in the presence distribution generating means 14.
[0037] The position map calculated by the position map generating means 12 and the size map calculated by the size map generating means 13 are input to the abundance distribution generating means 14. In this embodiment, the abundance distribution generating means 14 uses a normal distribution as an abundance function with position and size as input parameters to generate an abundance distribution. The abundance distribution to be generated has the same size as the input image.
[0038] FIG. 3 is a schematic diagram for explaining the process of generating an abundance distribution. As described above, the position map and size map have the same number of pixels as the input image, and they have corresponding pixels. The distribution generation model 10 generates a two-dimensional normal distribution for each pixel using the values of the position map and the size map. Then, the abundance distribution for one image is created by adding up all of these normal distributions for each pixel. Specifically, the abundance distribution generation means 14 assigns an index ξ defined as ξ=i+M(j-1) to the pixel at coordinates (i,j) in an image whose width and height are M pixels and N pixels, respectively, sets the coordinates (i,j) of pixel ξ as the average value (center of distribution) in the range of ξ=1 to MN, and calculates the size map value s at pixel ξ. ξ h multiplied by a constant α ξDerive a normal distribution with standard deviation, and apply the position map value w at pixel ξ to the normal distribution for each pixel ξ. ξ The abundance distribution is generated by multiplying the weight by α and summing it up for all pixels. Here, α is a constant for adjusting the distribution, and is set in advance in the range of 0<α<1. When the abundance distribution is created based on the normal distribution in this way, the sum of the abundance distribution is the number of heads. Note that the abundance function is a function that is uniquely determined once the position and size are determined, so there are no learning parameters.
[0039] [Learning device configuration] The learning device 20 is a device that learns the distribution generation model 10 using training data prepared in advance.
[0040] 4 is a schematic functional block diagram of the image monitoring device 1 as a learning device 20. The learning device 20 includes a learning data storage means 21, a learning presence distribution generating means 22, a learning means 23, and a learning model storage means 24. The storage unit 4 functions as the learning data storage means 21 and the learning model storage means 24, and the image processing unit 5 functions as the learning presence distribution generating means 22 and the learning means 23.
[0041] The learning data storage means 21 stores in advance a learning image and data on the position and size of a head shown in the learning image in association with each other. The learning data storage means 21 also stores a learning presence distribution (learning presence distribution).
[0042] The training presence distribution generating means 22 generates a training presence distribution. The training presence distribution is used as correct answer data of the presence distribution corresponding to the training image in the training by the training means 23. Specifically, the training presence distribution is a map having the same width and height as the corresponding training image, and the presence is stored corresponding to each pixel.
[0043] The training presence distribution generating means 22 reads data on the position and size of the head from the training data storage means 21, and creates a training presence distribution. The method of creating a training presence distribution is shown in FIG. 5(a). First, a distribution expressing the presence is created using an presence function with the position (x, y) and size s of one head as input parameters. The presence function creates a normal distribution using the position (marked with an x in FIG. 5) as the average value and the value of size×α as the standard deviation. The weight of the normal distribution (corresponding to w in FIG. 3) is set to 1. α is the distribution adjustment constant mentioned above. Then, since the coordinates become discrete when assigning the presence to each pixel, normalization is performed so that the sum of the presences assigned to the pixels becomes 1. A distribution for one head like this is created for all heads in the image in the same way, and these are added together to create the training presence distribution for the training image. The training presence distributions created in this way are added together to become the number of heads in the image. The created training presence distribution is output to the training data storage means 21 and stored in association with the corresponding training image.
[0044] The learning means 23 reads the learning image and the corresponding learning presence distribution from the learning data storage means 21, inputs the learning image to the learning model of the distribution generation model 10, calculates the error with respect to the learning presence distribution for the presence distribution based on the output of the presence distribution generation means 14, and performs learning to update the learning model based on the error. Therefore, the learning image and the learning presence distribution are given in pairs. When reading the learning data, instead of reading all the learning data at once, a predetermined number of pairs are read and learning is performed sequentially.
[0045] This model is trained by minimizing an error function calculated from the presence distribution output from the distribution generation model 10 when a training image is input and the training presence distribution corresponding to the input training image. The error function to be minimized is calculated as follows.
[0046] The error function consists of a weighted sum of an error function related to the estimation of the head presence distribution and an error function related to the estimation of the sum of the presence distribution corresponding to the number of heads. The former is a microscopic perspective error that calculates the error of the presence distribution for each pixel, while the latter is a global perspective error that calculates the error of the sum of the presence distribution for the entire image. Using these two types of error functions has the effect of improving the estimation accuracy for objects that appear differently, such as a large head in the foreground and a small head in the background.
[0047] For the error function related to the estimation of the presence distribution, the square of the difference between the learning presence distribution, which is the correct answer data, and the presence distribution output by the distribution generation model 10 is calculated for each pixel, and the average of all pixels (hereinafter referred to as the mean square error) is used. In this case, the presence distribution may have a large pixel ratio between the part where the head is present (part where the presence distribution value is greater than zero) and the part where the head is not present (part where the presence distribution value is zero). In such a situation, if the mean square error is used as the error function, it becomes easy to estimate a state with a large number of pixels. Therefore, the mean square error is calculated separately for the part where the head is present and the part where the head is not present in the correct answer data, and the respective mean square errors are weighted based on the inverse ratio of the number of pixels between the part where the object is present and the part where the object is not present in the correct answer data, and then added.
[0048] On the other hand, the error function for the number of heads uses the squared difference between the sum of the learning presence distribution of heads and the sum of the presence distribution output by the distribution generation model 10. Like the error function for the presence distribution, this error function also calculates the squared difference for the sum of the presence distribution separately for the part in the correct answer data where a head is present and the part in which a head is not present, and adds up after weighting each squared difference based on the inverse ratio of the number of pixels between the part in the correct answer data where a head is present and the part in which a head is not present.
[0049] Incidentally, error calculation is performed only for the abundance distribution output by the distribution generation model 10, and error calculation using the correct answer data is not performed for the position map and the size map. This is because, since the abundance function does not have learning parameters and the input parameters are defined as the position and size, if correct answer data of the abundance distribution is provided, learning is sufficiently performed so that the outputs of the position map generation means 12 and the size map generation means 13 approach the position map and size map that match the correct answer data.
[0050] The stochastic gradient method is used to minimize the error function. In learning using the stochastic gradient method, the gradient of each process is calculated using the error backpropagation method, and each learning parameter is updated based on the gradient. After learning, the obtained model is stored in the learning model storage means 24.
[0051] The learning model storage means 24 stores the structure of the distribution generation model 10 and its initial values when the distribution generation model 10 is trained, and is read out as necessary by the training means 23. After training, the learning model storage means 24 stores the trained model calculated by the training means 23.
[0052] [Learning device operation] The image monitoring device 1 operates as a learning device 20 and learns a distribution generation model 10 prior to operating as an estimation device 30 that estimates the presence distribution of objects appearing in a captured image.
[0053] FIG. 6 is a schematic flow diagram regarding the operation of the learning device 20.
[0054] When a learning operation start is instructed, image processing section 5 first functions as learning presence distribution generating means 22, reads the head position and head size from learning data storage means 21, and creates a learning presence distribution (step S10).
[0055] Next, the image processing unit 5 functions as the learning means 23, which reads out the learning model from the learning model storage means 24 in order to learn the distribution generation model 10 (step S11). The learning parameters of the learning model at this point in time are the initial values.
[0056] Thereafter, the learning means 23 starts a learning operation (steps S12 to S16) for the model. The operation will be described below.
[0057] The learning means 23 reads the learning image and the learning presence distribution of the image from the learning data storage means 21 (step S12).
[0058] The learning means 23 inputs the learning image to the learning model and performs an estimation process (step S13).Then, the learning means 23 calculates the degree of deviation between the estimated presence distribution and the learning presence distribution using a predetermined error function (step S14), and updates the learning parameters of the learning model using the error (step S15).
[0059] Next, the learning means 23 judges whether a predetermined iteration end condition is satisfied (step S16). The learning means 23 repeats the processes of steps S12 to S15 while changing the learning data until the iteration end condition is satisfied (if "NO" in step S16), and when the iteration end condition is satisfied (if "YES" in step S16), the learning means 23 stores the learning parameters of the trained model in the learning model storage means 24 (step S17) and ends the learning operation. As the iteration end condition, for example, the variation amount of the error function becomes smaller than a predetermined threshold value, the number of iterations is reached, or the like can be used.
[0060] [Configuration of the estimation device] 7 is a schematic functional block diagram of the image monitoring device 1 as an estimation device 30. The estimation device 30 includes image input means 31, estimation means 32, result output means 33, and distribution generation model storage means 34, with the storage unit 4 functioning as the distribution generation model storage means 34 and the image processing unit 5 functioning as the estimation means 32. In addition, the communication unit 3 cooperates with the image processing unit 5 and functions as the image input means 31 and result output means 33.
[0061] The distribution generative model storage means 34 stores the trained distribution generative model 10. In this embodiment, the distribution generative model storage means 34 is the same as the trained model storage means 24 of the learning device 20 described above.
[0062] The image input means 31 sequentially acquires photographed images from the photographing unit 2 and inputs them to the estimation means 32 .
[0063] The estimation means 32 reads the distribution generation model 10 stored in the distribution generation model storage means 34. Then, the captured image input from the image input means 31 is input to the distribution generation model 10 to calculate the presence distribution. The estimation means 32 also outputs the calculated presence distribution to the result output means 33 together with the captured image.
[0064] The result output means 33 outputs the photographed image and the presence distribution input from the estimation means 32 to the display unit 6 .
[0065] [Operation of the estimation device] FIG. 8 is a schematic flow diagram regarding the operation of the estimating device 30. As shown in FIG.
[0066] When an instruction to start monitoring is given, the image monitoring device 1 starts operating as the estimation device 30. The image processing unit 5 functions as the estimation means 32, which reads the trained distribution generation model 10 from the distribution generation model storage means 34 (step S20). In addition, the photographing unit 2 starts operating to sequentially output images of the monitored space photographed at predetermined time intervals.
[0067] The image processing unit 5 cooperates with the communication unit 3 to function as the image input means 31, acquires the captured image output by the imaging unit 2, and inputs it to the estimation means 32 (step S21).
[0068] The estimation means 32 estimates the presence distribution by inputting the input photographed image into the distribution generation model 10 (step S22).
[0069] The image processing unit 5 cooperates with the communication unit 3 to function as result output means 33, and outputs the estimated presence distribution and the captured image to the display unit 6 (step S23). As a result, the presence distribution and the like are displayed on the display unit 6.
[0070] The estimation device 30 basically repeats the processes of steps S21 to S23 in conjunction with the imaging by the imaging unit 2. This repetitive operation continues, for example, until an instruction to stop it is received.
[0071] [Variations] (1) In the above embodiment, an example was described in which the detection target was a head. However, other objects that may appear multiple times in an image, such as chairs, vehicles, fish, sheep, horses, or goods, may also be detected.
[0072] (2) The learning data may include class classification information according to the number of detection targets appearing in each learning image. The class classification information is information in which, for example, an image with less than 5 heads is classified as "Class 1," an image with 5 to 10 heads is classified as "Class 2," and an image with 10 or more heads is classified as "Class 3." The learning data storage means 21 stores this class classification information in advance in association with the learning images. In the description of the above embodiment, it has been described that the learning means 23 sequentially performs learning using a predetermined number of pairs of learning data. In the modified example, the learning means 23 refers to the class classification information and adjusts the ratio of each class in the above-mentioned predetermined number of pairs of learning data to a predetermined ratio. In this way, the number of detection targets in the learning images used in one learning is adjusted so as not to be biased, and a highly accurate distribution generation model 10 can be learned.
[0073] (3) In the above embodiment and its modified examples, the common feature extraction means 11 is modeled using CNN. However, the common feature extraction means 11 may be a means for extracting, from an image, Histograms of Oriented Gradients (HOG), Gray-Level Co-Occurrence Matrix (GLCM), other well-known image features, or one or more of these image features.
[0074] (4) Alternatively, the common feature extraction means 11 may be omitted, and the distribution generation model 10 may be configured such that the images are directly input to the position map generation means 12 and the size map generation means 13 .
[0075] (5) In the distribution generation model 10 of the above embodiment and its modified examples, one abundance distribution is generated by one abundance distribution generation means 14, but the distribution generation model may be provided with multiple abundance distribution generation means having different abundance functions to generate multiple abundance distributions that are different from each other. In this case, the distribution generation model is one in which the outputs of the position map generation means 12 and the size map generation means 13 are input to each of the multiple abundance distribution generation means. In other words, each of the multiple abundance distribution generation means inputs a common position map and size map to a different abundance function to generate an abundance distribution that is different from each other.
[0076] Examples of abundance functions based on a distribution other than the normal distribution include the uniform distribution, the rectangular function, the first derivative of the normal distribution, and the second derivative of the normal distribution. Fig. 5(a) to (e) are schematic diagrams of how a learning abundance distribution is generated using the abundance functions based on the normal distribution, the uniform distribution, the rectangular function, the first derivative of the normal distribution, and the second derivative of the normal distribution, respectively. The abundance function based on the uniform distribution calculates a uniform value with a total sum of 1 in the head region with the position of each head as the center of gravity and the size of the head as the diameter. In other words, the value of each pixel in the head region is 1 / (head region area). The abundance function based on the rectangular function calculates 1 inside the head region with the position of the head as the center of gravity and the size of the head as the diameter, and 0 outside the head region. The abundance functions based on the first derivative and the second derivative of the normal distribution calculate the first derivative and the second derivative of the normal distribution with the position as the average value and the size multiplied by α as the standard deviation, respectively, for each head. Here, α is the distribution adjustment constant described above. There are two types of first derivatives of normal distribution: x-direction derivative and y-direction derivative. Figure 5(d) shows the x-direction derivative. There are three types of second derivatives of normal distribution: x-direction second derivative, y-direction second derivative, and xy-direction (x-direction and y-direction) second derivative. Figure 5(e) shows the x-direction second derivative.
[0077] As in the case of normal distribution, each presence distribution generating means synthesizes the distributions calculated for all heads in the image to obtain the learning presence distribution for one image. Note that, after synthesis, the presence function based on the rectangular function performs upper limit setting processing to correct the presences of each pixel that are greater than 1 to 1 to obtain the learning presence distribution.
[0078] In the abundance distribution generating means 14 for each abundance function, the normal distribution function used in the abundance distribution generating process described with reference to FIG. 3 is replaced with a function corresponding to each distribution to generate the abundance distribution.
[0079] In the uniform distribution and rectangular function, the head area is calculated using the value of the size map as the diameter. However, since the value of the abundance distribution created using the rectangular function may exceed 1, after the abundance distribution is created, post-processing is added to keep the value within the range of 0 to 1. Specifically, a calculation is performed: (abundance distribution created using the rectangular function - 0.5) x constant, and the result of this calculation is input to a sigmoid function to keep the value within the range of 0 to 1. The constant here is a predetermined value greater than 1. The value converted in this way becomes the output of the abundance distribution created using the rectangular function.
[0080] In the learning of the distribution generation model 10, a corresponding learning presence distribution is created for each of the plurality of presence distribution generation means 14, and an error calculation is performed with respect to the estimated presence distribution. The error function used in the learning is a weighted sum of the error functions set for each of the plurality of types of presence distribution. For the presence distributions created using a uniform distribution, a first derivative distribution of a normal distribution, and a second derivative distribution of a normal distribution as error functions related to the estimation of the head presence distribution, a mean square error is calculated between the learning presence distribution, which is the correct data, and the presence distribution output by the distribution generation model. For the presence distribution created using a rectangular function, a cross entropy error for distinguishing the head region from other regions is calculated for each pixel, and the average of all pixels is used. For the uniform distribution, the square of the difference between the sum of the learning presence distribution and the sum of the presence distribution output by the distribution generation model is used as an error function related to the estimation of the number of heads.
[0081] Learning using multiple types of abundance distributions has the effect of improving accuracy because the abundance distribution is learned from various perspectives. In particular, the uniform distribution is effective in the accuracy of size, and the rectangular function is effective in the accuracy of distinguishing between the head region and the non-head region. In addition, the first and second derivatives of the normal distribution are functions related to the gradient that reflect the shape of the normal distribution, so they are effective in the accuracy of both position and size. Furthermore, when creating each abundance distribution, the input parameters of the abundance function are set from a common position map and size map, so that the abundance distributions can be consistent. Therefore, from the viewpoint of learning with multiple consistent abundance distributions, there is a greater effect of improving accuracy than with conventional methods. Even with conventional methods, learning using multiple abundance distributions is possible. However, when creating multiple abundance distributions with conventional methods, the consistency between the abundance distributions depends on the learning, so each abundance distribution becomes independent, and the effect of improving accuracy tends to be small.
[0082] The distribution generation model 10 for the estimation operation can be configured as a network having a plurality of presence distribution generation means 14 corresponding to the presence distribution to be output from among the plurality of types of presence distributions used in learning. A common position map and size map are input to each presence distribution generation means 14, and the presence distribution creation process is performed using the corresponding functions in the same manner as in Fig. 3, and each presence distribution is output.
[0083] (6) In addition, the presence distribution generated using the rectangular function described in the modified example (5) can be used for the false alarm removal process during estimation. This false alarm removal process can be performed by masking, but in this modified example, the masking process is performed on the position map using the estimated presence distribution. Figure 9 is a schematic block diagram of the network structure of the distribution generation model 10B according to this modified example.
[0084] First, an image is input to the common feature extraction means 11, which outputs a common feature. The common feature is input to each of the position map generation means 12 and the size map generation means 13, which output a position map and a size map, respectively. Then, the position map and the size map are input to the binary image acquisition means 15. The binary image acquisition means 15 creates an abundance distribution in the same manner as the abundance distribution generation means 14 using the rectangular function described in the above modification (5). Then, the binary image acquisition means 15 binarizes the value of the abundance distribution by a predetermined threshold process and creates a mask. In the binarization, for example, 1 is set to a position equal to or greater than the threshold, and 0 is set to a position less than the threshold. In other words, the binary image acquisition means 15 acquires a binary image as a mask that distinguishes between an area of interest (an area where 1 is set) corresponding to the detection target in the image input to the common feature extraction means 11 and an area of non-interest other than the area of interest.
[0085] The mask created by the binary image acquisition means 15 is input to the mask processing means 16 (mask means of the present invention). The mask processing means 16 multiplies the position map input from the position map generation means 12 by the mask input from the binary image acquisition means 15, and outputs a position map after mask processing. That is, the mask processing means 16 performs mask processing on the positions estimated by the position map generation means 12 using a binary image, and deletes the estimated positions that belong to the non-interest area. Thereafter, the masked position map and the size map output from the size map generation means 13 are input to the abundance distribution generation means 14. The abundance distribution generation means 14 creates an abundance distribution using a normal distribution, as in the abundance distribution creation process of FIG. 3, and outputs the abundance distribution after mask processing. That is, the abundance distribution generation means 14 estimates the abundance distribution using the estimated positions remaining after deletion by the mask processing means 16 as one of the input parameters of the abundance function.
[0086] In this way, by performing mask processing on the position map, it is possible to obtain the effect of removing false alarms with high accuracy. In other words, since the value of the presence distribution is the sum of the values of multiple heads and cannot be separated, there is a possibility that the true head will also be removed when mask processing is performed on the presence distribution to remove false alarm factors. In contrast, since the values of the position map are localized near the center of the head, it is possible to remove only the false alarm factors by performing mask processing on the position map to remove false alarm factors. Therefore, by performing mask processing on the position map, it is possible to remove only the false alarms and leave the presence distribution of the head.
[0087] In the distribution generation model 10B of this modified example shown in Fig. 9, the binary image acquisition means 15 acquires a binary image using the output of the position map generation means 12 and the size map generation means 13. In contrast, the binary image acquisition means 15 may be configured to acquire a binary image without using the output of the position map generation means 12 and the size map generation means 13 of the distribution generation model 10. For example, the binary image acquisition means 15 may be configured to receive an image as input and acquire a binary image using a separate model, or to receive an image as input and acquire a binary image using background difference processing, etc.
[0088] (7) In the above embodiment and its modified example, a distribution generation model that generates an abundance distribution with the same number of pixels as the input image has been shown, but a distribution generation model that generates an abundance distribution with fewer pixels than the input image may be used. This allows the learning device 20 and the estimation device 30 to have a small processing load.
[0089] For example, when the presence distribution output by the distribution generation model is set to 1 / 2 scale (1 / 4 times the number of pixels), the training presence distribution generation means creates a training presence distribution by multiplying the X and Y coordinates of the head position and the size of the head by 1 / 2. Then, the learning means 23 trains the distribution generation model using the training image at the original scale and the training presence distribution at 1 / 2 scale. The presence distribution generation means also performs bilinear interpolation processing on the presence distribution obtained by inputting the captured image into the distribution generation model to generate an presence distribution with the same number of pixels as the captured image. However, the presence distribution generation means based on normal distribution and the presence distribution generation means based on uniform distribution further multiply each value of the presence distribution after the bilinear interpolation processing by 1 / 4 so that the integral value of the entire presence distribution becomes the number of heads in the captured image.
[0090] (8) In the modified example (7), the abundance distribution is expanded outside the distribution generation model, but it can also be expanded within the distribution generation model. In that case, it is more preferable that the distribution generation model is configured such that the front-stage unit obtains an abundance distribution, a position map, and a size map with fewer pixels than the input image (hereinafter referred to as "reduced scale"), and the rear-stage unit uses these as feature quantities to output an abundance distribution with the same number of pixels as the input image (hereinafter referred to as "original scale").
[0091] 10 is a schematic block diagram of a distribution generation model 10C according to this modified example. The distribution generation model 10C is composed of a front-stage part consisting of a first common feature extraction means 11a, a first position map generation means 12a, a first size map generation means 13a, and a first presence distribution generation means 14a, and a rear-stage part consisting of a second common feature extraction means 11b, a second position map generation means 12b, a second size map generation means 13b, and a second presence distribution generation means 14b. Here, the functions of the first common feature extraction means 11a and the second common feature extraction means 11b basically correspond to the functions of the common feature extraction means 11 in the above embodiment, and similarly, the first position map generation means 12a and the second position map generation means 12b correspond to the position map generation means 12, the first size map generation means 13a and the second size map generation means 13b correspond to the size map generation means 13, and further, the first presence distribution generation means 14a and the second presence distribution generation means 14b correspond to the presence distribution generation means 14, but there may be differences between the front and rear parts and between them and the above embodiment in the number of pixels of the images and feature maps that they handle.
[0092] The front-stage section receives an image as input and creates a reduced-scale presence distribution. Specifically, a first common feature extraction means 11a extracts features from the input image, a first position map generation means 12a and a first size map generation means 13a create a reduced-scale position map and a size map from the features, respectively, and a first presence distribution generation means 14a creates a reduced-scale presence distribution based on the outputs of the first position map generation means 12a and the first size map generation means 13a.
[0093] The latter part creates an abundance distribution of the original scale based on the input from the former part. Specifically, the feature created by the first common feature extraction means 11a and the reduced-scale position map, size map and abundance distribution created by the first position map generation means 12a, the first size map generation means 13a and the first abundance distribution generation means 14a, respectively, are input to the second common feature extraction means 11b, and the second common feature extraction means 11b creates a common feature from the feature linked between them. From this point on, the network structure is the same as that of Fig. 2, and the abundance distribution of the original scale is output from the second abundance distribution generation means 14b.
[0094] The error function used in the learning of the distribution generation model 10C is a weighted sum of an error function relating to the reduced-scale abundance distribution and an error function relating to the original-scale abundance distribution.
[0095] In this way, by using a distribution generation model that includes an early part and a late part that handle different scales, a wide range is convolved at a reduced scale for rough analysis, and a narrow range is convolved at the original scale for detailed analysis, thereby having the effect of generating a highly accurate distribution.
[0096] (9) In the distribution generation model of the above embodiment and its modified examples, a distribution function based on a normal distribution is used. However, a distribution function based on a distribution other than the normal distribution may also be used.
[0097] (10) In the above embodiment and its modified examples, the presence distribution generating means of the estimation device 30 uses the distribution generation model trained by the learning device 20 as is, but the presence distribution generating means of the estimation device 30 can also use a distribution generation model in which the presence function in the distribution generation model trained by the learning device 20 is replaced. However, the conditions for the replacement are that nothing other than the presence function is changed, and that the input parameters for setting the presence (e.g., the position and size of the head) are common between the presence functions before and after the replacement.
[0098] For example, when it is desired to estimate the presence distribution using a normal distribution with a smaller standard deviation than the normal distribution used at the time of learning, the presence distribution generating means 14 of the estimation device 30 generates the presence distribution using a distribution generation model 10 in which the value of the standard deviation used in the normal distribution is changed to size map × β (0 < β < α, α is a distribution adjustment constant used at the time of learning). Also, for example, the presence distribution generating means 14 of the estimation device 30 generates the presence distribution using a distribution generation model 10 in which the normal distribution is changed to a uniform distribution, a rectangular function, the first derivative of the normal distribution, or the second derivative of the normal distribution, as described in modification example (5).
[0099] In other words, since the presence function included in the distribution generation model of the present invention is a function that is not updated by learning, it can be replaced as long as the input parameters for setting the presence are common. Also, replacement is possible using a highly accurate position map and size map that are consistent. In other words, it is possible to provide an estimation device that can change the type of presence distribution while maintaining high accuracy without performing new learning, and can flexibly respond to changes in user specifications, etc.
[0100] (11) In the above embodiment and each modified example, the distribution generation model 10 generates a distribution of the presence of a detection target appearing in an image, but the present invention can also be applied to a distribution generation model that generates a distribution of a target quantity other than the presence. In other words, the distribution generation model can calculate a target quantity of a detection target appearing in an image using a predetermined target quantity function having multiple input parameters (a first parameter and a second parameter) and generate a target quantity distribution of the detection target in the image. Then, an estimation device can be configured that includes an estimation means that inputs an image to be processed into this distribution generation model and estimates the target quantity distribution.
[0101] In the distribution generation model 10 of the above embodiment, the position map value calculated by the position map generation means 12 and the size map value calculated by the size map generation means 13 are input parameters, and the presence distribution generation means 14 creates and outputs the presence distribution using an presence function. In contrast, in this modification, a distribution generation model is described in which the presence distribution value and the size map value are input parameters (first parameter and second parameter), and a position map is output by a predetermined function process. That is, in this modification, the position of the head, which is the detection target, is the target quantity, and a position map is estimated as the target quantity distribution. In the above embodiment, error calculation in learning is performed on the presence distribution, but in this modification, it is performed on the position map. Note that the size map value in this modification is a size appropriate for creating a position map, and is a value obtained by learning.
[0102] The distribution generation model of this modified example that inputs an image and outputs a position map is represented as a distribution generation model 50. First, the structure of the distribution generation model 50 will be described below, and then the learning of the distribution generation model 50 will be described.
[0103] The distribution generation model 50 is composed of a common feature extraction means 51, an abundance distribution generation means 52, a size map generation means 53, and a position map generation means 54. Here, the abundance distribution generation means 52 and the size map generation means 53 are a first parameter estimation unit and a second parameter estimation unit, and the position map generation means 54 is a target quantity calculation unit. Although the network structure is not shown, it has a structure in which the position map generation means 12 and the abundance distribution generation means 14 in Fig. 2 are interchanged. In this modified example, the common feature extraction means 51, the abundance distribution generation means 52, and the size map generation means 53 are updated by learning, and the position map generation means 54 is not updated by learning.
[0104] 2, the common feature extraction means 51 can be modeled by CNN, receives an image, and outputs a common feature. The common feature is input to the abundance distribution generation means 52 and the size map generation means 53.
[0105] The abundance distribution generating means 52 and the size map generating means 53 are modeled with CNN, and generate and output an abundance distribution and a size map as a one-channel feature map from the common feature. The final layer of the abundance distribution generating means 52 sets the abundance distribution value to be in the range from 0 to 1. After converting the value of the size map to 0 or more, the size map generating means 53 replaces the value with the predetermined lower limit value if the value is less than the predetermined lower limit value.
[0106] The position map generating means 54 performs filtering processing on the presence distribution using a filter determined from the size map to generate a position map. The generated position map has the same size as the input image. A filter is generated for each pixel on the size map. Specifically, as a filter at a certain point of interest, a Laplacian filter of normal distribution is generated with the coordinates of the point of interest as the mean value and the value of the size map at the point of interest × α (0<α<1) as the standard deviation. The position map generating means 54 calculates the inner product of this filter and the presence distribution, and the calculation result is set as the value of the position map at the point of interest. Note that if the value of the size map is smaller than a predetermined value, the inner product calculation is not performed, and the value of the position map at the point of interest is set to zero. Filters are generated and inner products are calculated with all pixels as points of interest, and the position map is generated. Note that the filter used in the inner product calculation with the position map is uniquely determined by the value of the size map, and is not updated by learning.
[0107] The distribution generation model 50 is trained using the training image and the training position map as training data. Correspondingly, the training device according to this modification is configured with a training position map generation means instead of the training presence distribution generation means 22 in the functional block diagram of Fig. 4 according to the above embodiment, and the training data storage means 21 stores the training position map generated by the training position map generation means and provides it to the training means 23. Incidentally, the training position map is a map in which a value of 1 is entered for each head position.
[0108] The distribution generation model 50 is trained by minimizing an error function calculated from the position map output from the position map generation means 54 when a training image is input to the common feature extraction means 51, and the training position map corresponding to the input training image. The error function to be minimized uses the mean square error calculated from the training position map, which is the correct data, and the position map output by the distribution generation model 50. Since the error calculation is performed only on the position map, the values of the size map and the abundance distribution are adjusted by training so that this error is reduced. Therefore, the value entered in the size map is a size that makes it easy for the distribution generation model 50 to create a position map.
[0109] The network structure of the distribution generation model 50 allows the model to be trained in a state where the presence distribution for the head position is consistent with a size suitable for creating a position map, thereby improving the accuracy of estimating the head position.
[0110] (12) In the above embodiment, calculations were performed only for the abundance distribution output from the abundance distribution generating means 14 as the error function used in training the distribution generation model 10, but the abundance distribution generating means 14 may also calculate an error function for the size map output from the size map generating means 13 as an input parameter for the abundance function to perform training to evaluate the error of the entire model. Below, a method for creating correct data for the size map, an error function for the size map, and an overall error function will be described in that order.
[0111] The size map of the correct answer data is created by performing the operation of inputting the head size into the coordinates of the head position (center of the head) for each head in the same manner for all heads in the image, using the head position and size stored in the learning data storage means 21. For example, this process is performed by the learning presence distribution generating means 22 reading the data of the head position and size from the learning data storage means 21, and the created size map of the correct answer data is output to the learning data storage means 21 and stored in association with the corresponding learning image.
[0112] The error function for the size map uses the mean square error between the size map of the correct answer data and the size map output by the size map generating means 13. The area in which the error calculation is performed for the size map is only the area in which values are substituted in the size map of the correct answer data (the central coordinates of each head), and calculation is not performed in other areas.
[0113] The overall error function consists of a weighted sum of the error function for the abundance distribution and the error function for the size map, where the error function for the size map is weighted to be smaller than the error function for the abundance distribution, so that the error function for the abundance distribution dominates.
[0114] Such a method of evaluating the error of the distribution generation model by combining the error function for the objective quantity distribution and the error function for the input parameters of the objective quantity function can also be applied to the training of the distribution generation model 50 of the above modification (10). Specifically, not only the error function for the position map but also the error function for the size map is calculated, and the overall error function is the weighted sum of the error function for the position map and the error function for the size map. Note that the creation of the correct answer data for the size map and the calculation of the error function for the size map are the same as in the case of training the distribution generation model 10 of this modification described above. Incidentally, this network structure has the effect of improving the estimation accuracy of the head position and head size, since the model can be trained in a state where the presence distribution is consistent with respect to the head position and head size.
[0115] (13) In the above embodiment and each of its modified examples, the size, which is one of the input parameters of the presence function, is set to a size defined by the width of the human head region, and is set as an input parameter corresponding to the standard deviation of the normal distribution. In another embodiment, the size may be set to a size defined by the width and height of the detection target, and two input parameters corresponding to the standard deviation of the normal distribution may be set in the x direction and the y direction. For example, the width size x α (0<α<1) is set to the standard deviation in the x direction, and the height size x α (0<α<1) is set to the standard deviation in the y direction. By setting the size to the width and height of the detection target, it becomes possible to appropriately define the detection result according to the shape of the detection target, such as a rectangle or an ellipse.
[0116] (14) In the above embodiment and each of its modified examples, the detection target is a human head, the target amount is the presence of the head, the first parameter is the position of the head, and the second parameter is the size of the head, but the present invention can be applied to other applications. For example, the detection target can be a rigid body of a convex polygon, the target amount can be the structural amount of the rigid body, the first parameter can be the center of gravity of the rigid body, and the second parameter can be the vertex positions. An example will be described in which the rigid body is a quadrilateral rigid body such as the top surface of a desk or the back of a chair. The value of the feature map of the first parameter is the likelihood of being the center of gravity of the rigid body. The second parameter is a relative vector from the center of gravity to the four vertices, and the element corresponding to the center of gravity of the rigid body in the feature map of the second parameter is an eight-dimensional vector in which the relative vectors are arranged. The structural amount of the rigid body, which is the target amount, is the inclination of the rigid body, the length from the center of gravity to the four vertices, the angle of the four vertices, whether it is front or back, and the area, and the element corresponding to the center of gravity of the rigid body in the target amount distribution is a vector in which the inclination, length, angle, whether it is front or back, and area are listed. The inclination of the rigid body is the inclination of the relative vector of the first vertex based on the positive direction of the x-axis of the image, and is a two-dimensional vector that lists the x and y coordinates of the unit vector obtained by normalizing the relative vector of the first vertex to a length of 1. The length from the center of gravity to the four vertices is a four-dimensional vector that lists four lengths. The angle of the four vertices is a four-dimensional vector that lists the angle of the relative vector of the nth vertex to the relative vector of the n+1th vertex. The front / back is a flag that indicates whether the front or back is front or back (whether the inclination is calculated clockwise or counterclockwise). The area is a scalar that indicates the area of a quadrangle. Therefore, the structural quantity is a 12-dimensional vector. The objective function is a function that derives the inclination, length, angle, front / back, and area from the coordinates of the four vertices. Then, the feature map of the center of gravity position of the rigid body, which is the first parameter, is referenced, and the inclination, length, angle, front / back, and area are calculated from the element of the objective quantity map corresponding to the position with the maximum likelihood. In learning, the feature map of the center of gravity of the rigid body (the first parameter) and correct answer data of the structural quantities of inclination, length, angle, front / back, and area are given, and the error for each is calculated. Note that it is also possible to create a distribution generation model in which the relative vectors to the four vertices (the second parameter) and the target structural quantity of the rigid body are swapped. In other words, the second parameter can be the structural quantity of the rigid body, and the target quantity can be the relative vector from the center of gravity to the four vertices. [Explanation of symbols]
[0117] 1 image monitoring device, 2 shooting unit, 3 communication unit, 4 memory unit, 5 image processing unit, 6 display unit, 10 distribution generation model, 11 common feature extraction means, 12 position map generation means, 13 size map generation means, 14 presence distribution generation means, 15 binary image acquisition means, 16 mask processing means, 20 learning device, 21 learning data storage means, 22 learning presence distribution generation means, 23 learning means, 24 learning model storage means, 30 estimation device, 31 image input means, 32 estimation means, 33 result output means, 34 distribution generation model storage means.
Claims
1. A distribution generation model that generates an presence distribution of the detection target in the image by calculating, for each pixel, the presence function which is a predetermined probability distribution having parameters of the position of each pixel of the image and the size of the detection target estimated at that position, and adding up the presence function for each pixel for all pixels, the distribution generation model comprising: a position estimation unit that estimates the likelihood that the position of each pixel in the image is the position of the detection target, based on the image; a size estimation unit that estimates the size of the detection target at each pixel of the image, based on the image; a presence calculation unit that calculates the presence function of the pixel by setting parameter values of the presence function of the pixel based on the position of the pixel and the size of the detection target estimated by the size estimation unit at the position, and calculates the presence distribution by adding up, for all pixels, the presence functions of the pixels weighted by the likelihood of each pixel estimated by the position estimation unit, and stores a trained distribution generation model in which learning parameters of the position estimation unit and the size estimation unit are updated by training using a learning image and ground-truth data of the presence distribution given in advance to the learning image; an estimation means for inputting a processing target image to the distribution generation model and estimating the abundance distribution; An estimation device comprising:
2. 2. The estimation device according to claim 1, the distribution generation model includes a plurality of the presence degree calculation units, the presence degree calculation units having different presence degree functions, and the presence degree calculation units each receiving an output of the position estimation unit and an output of the size estimation unit; the estimation means inputs the image to be processed into the distribution generation model, and estimates a plurality of the presence distributions corresponding to each of the presence calculation units; The distribution generation model further comprises: learning parameters of the position estimation unit and the size estimation unit are updated so that an error between each of a plurality of learning presence distributions corresponding to each of the plurality of presence functions, which are a learning image and correct answer data given in advance to the learning image, and each of the estimated plurality of presence distributions is reduced. An estimation device comprising:
3. 3. The estimation device according to claim 1, The estimation device, wherein the abundance function is an abundance function based on a normal distribution, an abundance function based on a uniform distribution, or an abundance function based on a rectangular function.
4. 4. The estimation device according to claim 3, the abundance function is a rectangle function based abundance function; a binary image acquisition means for acquiring a binary image that distinguishes a region of interest corresponding to the detection target in the image from a non-interest region other than the region of interest based on the presence distribution; a masking means for performing a masking process of multiplying a pixel value of each pixel by a pixel value of a pixel corresponding to the pixel in the binary image, thereby deleting the positions of the pixels that belong to the region of non-interest; the presence degree calculation unit uses the position remaining after the deletion by the mask means as the value of the parameter; An estimation device comprising:
5. A learning device that learns a learning model that generates a presence distribution of a detection target in an image, comprising: a learning model storage means for storing the learning model, the learning model being an abundance function that represents an abundance of a detection target appearing in the image, the abundance function being a predetermined probability distribution having parameters, the position of each pixel of the image and the size of the detection target estimated at the position, for each pixel, and generating an abundance distribution of the detection target in the image by adding up the abundance function for each pixel for all pixels, the learning model including: a position estimation unit that estimates a likelihood that the position of each pixel in the image is the position of the detection target, based on the image; a size estimation unit that estimates the size of the detection target at each pixel of the image, based on the image; and an abundance calculation unit that calculates the abundance function of each pixel by setting a value of the parameter of the abundance function of the pixel according to the position of each pixel and the size of the detection target estimated by the size estimation unit at the position, and calculates the abundance distribution by adding up the abundance function of the pixel weighted by the likelihood of each pixel estimated by the position estimation unit for all pixels; a learning data storage means for storing learning images and correct answer data of the presence distribution given in advance for the learning images; a learning means for performing learning by inputting the learning image into the learning model and updating learning parameters of the position estimation unit and the size estimation unit of the learning model so that an error of the presence distribution based on an output of the presence calculation unit with respect to the ground truth data becomes small; A learning device comprising:
6. A distribution generation model that generates an presence distribution of the detection target in the image by calculating, for each pixel, the presence function which is a predetermined probability distribution having parameters of the position of each pixel of the image and the size of the detection target estimated at that position, and adding up the presence function for each pixel for all pixels, the distribution generation model comprising: a position estimation unit that estimates the likelihood that the position of each pixel in the image is the position of the detection target, based on the image; a size estimation unit that estimates the size of the detection target at each pixel of the image, based on the image; a presence calculation unit that calculates the presence function of the pixel by setting values of the parameters of the presence function of the pixel based on the position of the pixel and the size of the detection target estimated by the size estimation unit at the position, and calculates the presence distribution by adding up, for all pixels, the presence functions of the pixels weighted by the likelihood of each pixel estimated by the position estimation unit, and prepares a trained distribution generation model in which learning parameters of the position estimation unit and the size estimation unit are updated by training using a training image and ground-truth data of the presence distribution given in advance to the training image; an estimation step of inputting a processing target image into the distribution generation model and estimating the abundance distribution; The estimation method according to claim 1,
7. An estimation program that causes a computer to perform a process of estimating a presence distribution of a detection target in an image, The computer, A distribution generation model that generates an presence distribution of the detection target in the image by calculating, for each pixel, the presence function which is a predetermined probability distribution having parameters of the position of each pixel of the image and the size of the detection target estimated at the position, and adding up the presence function for each pixel for all pixels, the distribution generation model comprising: a position estimation unit that estimates the likelihood that the position of each pixel in the image is the position of the detection target, based on the image; a size estimation unit that estimates the size of the detection target at each pixel of the image, based on the image; a presence calculation unit that calculates the presence function of the pixel by setting parameter values of the presence function of the pixel based on the position of the pixel and the size of the detection target estimated by the size estimation unit at the position, and calculates the presence distribution by adding up, for all pixels, the presence functions of the pixels weighted by the likelihood of each pixel estimated by the position estimation unit, and stores a trained distribution generation model in which learning parameters of the position estimation unit and the size estimation unit are updated by training using a learning image and ground-truth data of the presence distribution given in advance to the learning image; and an estimation means for inputting an image to be processed into the distribution generation model and estimating the abundance distribution; The present invention relates to a method for estimating a function of a computer-implemented ...
8. A distribution generation model that estimates the likelihood that the position of each pixel in an image is the position of a detection target appearing in the image, comprising: a presence distribution estimation unit that estimates the presence distribution of the detection targets in the image based on the image; a size estimation unit that estimates the size of the detection targets at the position of each pixel based on the image; and a position estimation unit that calculates for each pixel a Laplacian filter of normal distribution, the mean value being the position of each pixel and the standard deviation being the estimated size of the detection target at that position by the size estimation unit, and calculates the inner product of the Laplacian filter of normal distribution for each pixel and the presence distribution for each pixel as the likelihood at that pixel; and a storage means that stores a trained distribution generation model in which the learning parameters of the presence distribution estimation unit and the size estimation unit have been updated by training using a training image and correct answer data of the likelihood previously given for the training image; an estimation means for inputting an image to be processed into the distribution generation model and estimating the likelihood of each pixel of the image to be processed; An estimation device comprising:
Citation Information
Patent Citations
Information processing device, information processing method, and program
JP2020140295A
