Object detection device, object detection method, and object detection program
The object detection device integrates position and size estimation models with a distribution generation model to enhance accuracy in detecting objects like human heads by maintaining consistency in position, size, and abundance distribution, addressing inconsistent outputs in conventional techniques.
Patent Information
- Application Number
- JP2020050054
- 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 techniques for crowd density estimation suffer from inconsistent outputs between position and density maps, leading to erroneous detections, particularly in crowded environments.
An object detection device that integrates position and size estimation models using a distribution generation model trained with an abundance function to maintain consistency between position, size, and abundance distribution, employing a convolutional neural network (CNN) to enhance detection accuracy.
The device achieves high-precision detection of objects, such as human heads, by maintaining consistency in position, size, and abundance distribution, effectively reducing false positives and improving accuracy in crowded conditions.
Smart Images

Figure 0007554569000002 
Figure 0007554569000009 
Figure 0007554569000013
Abstract
Description
[Technical field]
[0001] The present invention relates to a technique for detecting a detection target 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 of frequent erroneous outputs, such as an output indicating the head position for pixels that do not output a density greater than 0 (i.e., pixels with a head density of 0).
[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] Similar problems can also occur with models that output the size of a person's head along with its position.
[0009] The present invention has been made in consideration of the above problems, and has an object to provide a technique capable of detecting a detection target from an image with high accuracy. [Means for solving the problem]
[0010] (1) An object detection device according to the present invention is a device for detecting a predetermined object appearing in an image, comprising: a storage means for storing a position estimation model for estimating, for each pixel of the image, a likelihood that that pixel is the position of the object, and a size estimation model for estimating the size of the object at each pixel; a position estimation means for determining a candidate position of the object in the image using the position estimation model; a size estimation means for determining an estimated size of the object at the candidate position using the size estimation model; and a size estimation means for determining a collection of the candidate positions to be integrated using the estimated sizes, and integrating the candidate positions within the collection to obtain the size of the object. and an integration means for outputting the position of the detected object, wherein the position estimation model and the size estimation model are trained models trained using a predetermined presence function which is a function for calculating the presence of the detected object in the image and which can set the position and size of the area where the presence is concentrated using parameters, and a training image and ground truth data of a presence distribution given in advance for the training image, wherein in this learning, the parameter values of the presence function are set for the training image based on the candidate position and the estimated size determined by the position estimation means and the size estimation means, and the presence distribution for the training image is determined.
[0011] (2) In the object detection device described in (1) above, the integration means can be configured to set an integration target range around the candidate position, the size of which is based on the estimated size at the candidate position, and perform non-maximum value suppression processing on the candidate positions that exist within the integration target range, thereby outputting the candidate position with the maximum likelihood as the position of the detection object.
[0012] (3) In the object detection device described in (1) above, the integration means can be configured to set values of the parameters of the presence function based on the candidate positions and the estimated sizes obtained by the position estimation means and the size estimation means to generate an presence distribution of the detection target in the image, move the candidate positions by a steepest ascent method according to a gradient of the presence distribution to obtain corrected candidate positions, set an integration target range of a predetermined size around the corrected candidate positions, and perform non-maximum value suppression processing on the corrected candidate positions that exist within the integration target range to output the corrected candidate position with the maximum likelihood as the position of the detection target.
[0013] (4) In the object detection device described in (1) to (3) above, the presence function may be a normal distribution, a uniform distribution, or a rectangular function.
[0014] (5) The object detection device described in (1) to (4) above may further include a binary image acquisition means for acquiring a binary image that distinguishes between an area of interest in the image corresponding to the object to be detected and an area of non-interest other than the area of interest, and a masking means for performing a masking process on the candidate positions estimated by the position estimation means using the binary image to delete the candidate positions that belong to the area of non-interest, and the candidate positions after deletion by the masking means may be used as the positions to be set as the parameters of the presence function in generating the presence distribution and as the candidate positions to be processed by the integration means.
[0015] (6) A target detection method according to the present invention is a method for detecting a predetermined target appearing in an image, the method comprising the steps of: preparing a position estimation model for estimating, for each pixel of the image, a likelihood that the pixel is the position of the target; and a size estimation model for estimating the size of the target at each pixel; a position estimation step for determining a candidate position of the target in the image using the position estimation model; a size estimation step for determining an estimated size of the target at the candidate position using the size estimation model; and an integration step for determining a collection of the candidate positions to be integrated using the estimated sizes, and integrating the candidate positions within the collection to output the position of the target, wherein the position estimation model and the size estimation model are trained models trained using a predetermined presence function that calculates the presence of the target in the image and can set the position and size of an area where the presence is concentrated using parameters, and a training image and ground truth data of a presence distribution given in advance for the training image, and in the training, the parameter values of the presence function are set according to the candidate position and the estimated size obtained for the training image, and the presence distribution for the training image is obtained.
[0016] (7) An object detection program according to the present invention is a program for causing a computer to perform a process of detecting a predetermined object appearing in an image, the computer being provided with a storage means for storing, for each pixel of the image, a position estimation model for estimating the likelihood that the pixel is the position of the object, and a size estimation model for estimating the size of the object at each pixel, a position estimation means for determining a candidate position of the object in the image using the position estimation model, a size estimation means for determining an estimated size of the object at the candidate position using the size estimation model, and a method for determining a set of the candidate positions to be integrated using the estimated size, and The position estimation model and the size estimation model are trained models trained using a predetermined presence function which is a function for calculating the presence of the detection target in the image and which can set the position and size of the area where the presence is concentrated using parameters, and a training image and ground truth data of a presence distribution given in advance for the training image, and in this training, the parameter values of the presence function are set for the candidate position and the estimated size determined by the position estimation means and the size estimation means for the training image, and the presence distribution for the training image is determined. Effect of the Invention
[0017] According to the present invention, a distribution generation model that has been trained while maintaining consistency between the position, size, and abundance distribution of the target is used to detect the target, thereby making it possible to detect the target from an image with high accuracy. [Brief description of the drawings]
[0018] [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 according to an embodiment of the present invention as an object detection device. [Figure 8] 2 is a schematic block diagram illustrating the functional configuration of an estimation unit and an integration processing unit of the object detection device according to the embodiment of the present invention. FIG. [Figure 9] 1 is a schematic flow diagram of the operation of an image monitoring device according to an embodiment of the present invention as an object detection device. [Figure 10] 5A to 5C are schematic diagrams illustrating an example of processing by an integrated processing unit of the object detection device according to the embodiment of the present invention. [Figure 11] 13A and 13B are schematic diagrams illustrating an example of processing by an integrated processing unit of an object detection device according to a modified example of an embodiment of the present invention. [Figure 12] FIG. 13 is a schematic block diagram illustrating the functional configuration of an estimation unit and an integration processing unit according to a modified example of the embodiment of the present invention. [Figure 13] FIG. 13 is a schematic block diagram illustrating the functional configuration of an estimation unit and an integration processing unit according to another modified example of the embodiment of the present invention. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0019] 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 includes a learning device 20 and an object detection device 30 according to the present invention, and reports a detection result. Here, the learning device 20 constructs a position estimation model and a size estimation model for estimating the position and size of the detection object from an image, and the object detection device 30 uses the position estimation model and the size estimation model created by the learning device 20 to obtain a candidate position and an estimated size of the detection object from a captured image, and detects the detection object based on them. In this embodiment, the position estimation model and the size estimation model form a part of a model 10 for estimating the presence distribution of the detection object from an image. Here, the presence distribution is a distribution that expresses the presence of the detection object with a function having the position and size of the detection object as parameters (input parameters). The presence expressed as a function for one detection object is summed up for all detection objects 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 objects per pixel. The detection result is given as information about the circumscribing circle on the image that represents the area of each detected object. This information is expressed as the center coordinates of the circumscribing circle and the radius of the circumscribing circle.
[0020] In this embodiment, the detection target is described as a human head. That is, the image monitoring device 1 detects the human head, which is the detection target, captured in an image by analyzing the captured image of a space where a crowd may exist.
[0021] 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.
[0022] [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.
[0023] 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.
[0024] 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 photographed images from the photographing unit 2 and inputs them to the image processing unit 5, and outputs the detection results input from the image processing unit 5 to the display unit 6.
[0025] The storage unit 4 is a storage device composed 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 object detection 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.
[0026] 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 photographing unit 2 and the display unit 6 via the communication unit 3, and detects a detection target by analyzing the photographed image acquired from the photographing unit 2 via the communication unit 3, and causes the display unit 6 to display the detection result via the communication unit 3.
[0027] 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 detection results by the image processing unit 5. For example, a monitor visually checks the displayed detection results, judges the situation, and dispatches a response officer if necessary.
[0028] Regarding the configuration of the image monitoring device 1, first, the structure of the distribution generation model 10 including a model that takes an image as input and estimates the position and size of a detection target will be explained, followed by an explanation of the configuration and operation of a learning device 20 that learns the model, and then an explanation of the configuration and operation of an object detection device 30 that detects an object from an image.
[0029] [Structure of distribution generation model] FIG. 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 target in the image. The distribution generation model 10 includes a position estimation model that estimates the position of the detection target in the image and determines a candidate position, a size estimation model 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 model and the estimated size of the detection target at the estimated position by the size estimation model, and calculates the presence. The distribution generation model 10 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 to which a common feature extraction means 11, a position map generation means 12, a size map generation means 13, and an presence distribution generation means 14 are connected. Among these, the common feature extraction means 11 and the position map generation means 12 correspond to a position estimation model, and the common feature extraction means 11 and the size map generation means 13 correspond to a size estimation model. Also, the presence distribution generation means 14 corresponds to a presence calculation unit.
[0030] 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).
[0031] 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.
[0032] The position map generating means 12 generates a position map representing an 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 data of M pixels x N pixels x 1 channel. Hereinafter, the value of each element of the position map is also referred to as the value of the position map. The value range of the position map is [0, 1], and it means that the position of a pixel corresponding to an element with a larger value is estimated to be more likely to be the position of the head. In addition, a position where the value (likelihood) of the position map is equal to or greater than a predetermined threshold value is also referred to as a candidate position.
[0033] 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.
[0034] 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.
[0035] 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 distribution is a function that is uniquely determined once the position and size are determined, so there are no learning parameters.
[0036] [Learning device configuration] The learning device 20 is a device that learns the distribution generation model 10 using training data prepared in advance.
[0037] 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.
[0038] 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).
[0039] 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.
[0040] 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.
[0041] 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.
[0042] 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.
[0043] 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.
[0044] 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.
[0045] 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.
[0046] 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.
[0047] 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.
[0048] 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.
[0049] [Learning device operation] Prior to operating as an object detection device 30, the image monitoring device 1 operates as a learning device 20 and learns a distribution generation model 10.
[0050] FIG. 6 is a schematic flow diagram regarding the operation of the learning device 20.
[0051] 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).
[0052] 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.
[0053] Thereafter, the learning means 23 starts a learning operation (steps S12 to S16) for the model. The operation will be described below.
[0054] 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).
[0055] 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).
[0056] 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.
[0057] [Configuration of target detection device] 7 is a schematic functional block diagram of the image monitoring device 1 as an object detection device 30. The object detection device 30 includes an image input means 31, an estimation means 32, an integration processing means 33, a result output means 34, and a learning model storage means 24, with the storage unit 4 functioning as the learning model storage means 24 and the image processing unit 5 functioning as the estimation means 32 and the integration processing means 33. In addition, the communication unit 3 cooperates with the image processing unit 5 and functions as the image input means 31 and the result output means 34.
[0058] FIG. 8 is a schematic block diagram illustrating the functional configuration of the estimation means 32 and the integration processing means 33. As shown in FIG.
[0059] The learning model storage means 24 stores the learned distribution generation model 10.
[0060] The image input means 31 sequentially acquires photographed images from the photographing unit 2 and inputs them to the estimation means 32 .
[0061] The estimation means 32 reads the distribution generation model 10 stored in the learning model storage means 24. In Fig. 8, the portion consisting of the common feature extraction means 11, the position map generation means 12, the size map generation means 13 and the presence distribution generation means 14 is the distribution generation model 10, which has the same structure as in Fig. 2. The estimation means 32 inputs the photographed image acquired from the image input means 31 to the distribution generation model 10, and the distribution generation model 10 generates a position map and a size map by the position map generation means 12 and the size map generation means 13, and generates an presence distribution by the presence distribution generation means 14. The estimation means 32 extracts the position map from the position map generation means 12 and the size map from the size map generation means 13, and outputs them to the integration processing means 33 together with the presence distribution and the photographed image.
[0062] The integration processing means 33 receives the position map, size map, and presence distribution from the estimation means 32, and performs integration processing on the position map so that one detection output is obtained for one head. Ideally, for one head, the position map value is 1 for one pixel near the head center, and the position map values other than that pixel are zero. However, in an actual position map, multiple pixels near the head center have values greater than zero, and a presence distribution for one head is generated by superimposing the distributions corresponding to the values of these multiple pixels. Therefore, in order to obtain one detection output for one head, a process is required to integrate the values of multiple pixels near the head center into the value of one pixel. The integration processing means 33 outputs the detection result obtained by performing the integration processing to the result output means 34 together with the captured image.
[0063] The result output means 34 outputs the captured image and the detection result input from the integrated processing means 33 to the display unit 6 .
[0064] [Operation of target detection device] FIG. 9 is a schematic flow diagram regarding the operation of the object detection device 30.
[0065] When an instruction to start monitoring is given, the image monitoring device 1 starts operating as the target detection device 30. The image processing unit 5 functions as the estimation means 32, which reads the trained distribution generation model 10 from the learning model storage means 24 (step S20). In addition, the photographing unit 2 starts operating to sequentially output images of the monitored space photographed at predetermined time intervals.
[0066] 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).
[0067] The estimation means 32 estimates a position map and a size map by inputting the input photographed image into the distribution generation model 10, and calculates the presence distribution (step S22). The position map, the size map, the presence distribution, and the photographed image obtained by the estimation means 32 are passed to the integration processing means 33.
[0068] FIG. 10 is a schematic diagram for explaining an example of processing in the integration processing means 33. In FIG.
[0069] The integration processing means 33 performs threshold processing on the acquired position map to leave only values (likelihoods) equal to or greater than a predetermined threshold as candidates for the true head position (step S23). FIG. 10(a) is an example of the position map after threshold processing. In FIG. 10, the marks x indicate candidate positions in the position map that have a likelihood equal to or greater than the threshold, and (x k ,y k )(k=0,1,2) are its coordinates, and w k is the candidate position (x k ,y kAt this point, there are multiple candidate positions for the right head, specifically (x1, y1) and (x2, y2).
[0070] Next, the integration processing means 33 performs a shift process to modify the coordinates of all the candidate positions (step S24). In this shift process, the estimated presence distribution is used to move candidate positions that may correspond to the same head so that they are gathered at the center of the head. Specifically, when the steepest ascent method according to the gradient of the presence distribution is applied to the candidate positions, the candidate positions are shifted to the vicinity of the center of the head. FIG. 10(b) shows this process, and the candidate positions (x k ,y k ) is the candidate position (x k ',y k ').
[0071] Then, the integration processing means 33 creates a position list in descending order of the likelihood before the shift (step S25). That is, in the position list, the likelihood w k and the candidate position after shift (x k ',y k ') are associated with each other.
[0072] The integration processing means 33 then determines whether there is a candidate position in the position list (step S26). If there is a candidate position in the position list (YES in step S26), the candidate position with the highest likelihood (x p ',y p ') to each other candidate position (x q ',y q Distance d in coordinates to pq (Step S27). This is shown in FIG. 10(c), where the distance d from the maximum likelihood position (x2', y2') to the position (x0', y0') is calculated. 20 Similarly, the distance d 21 is also required.
[0073] The integration processing means 33 detects the maximum likelihood position (x p ',y pCandidate positions (x ') that are less than the distance threshold q ',y q 10(d) shows this state, and in the position map on the left, a solid-line circle centered on the maximum likelihood position (x2', y2') is the distance threshold, and a candidate position (x1', y1') within this circle is integrated into the maximum likelihood position (x2', y2'). That is, in this embodiment, integration is performed by representing the candidate positions within the circle with the maximum likelihood position. The integration processing means 33 saves the maximum likelihood position as a detection result, and deletes the candidate position integrated with the maximum likelihood position from the position list (step S29). For example, in the example of FIG. 10, as shown in the position map on the right side of FIG. 10(d), the coordinates (x2', y2') of the maximum likelihood position, the size s (x2', y2') at the coordinates, and the likelihood w (x2, y2) are extracted by integration, and the detection result is obtained from these. For example, the center and radius of the circumscribing circle of the head (the solid circle on the right side of FIG. 10(d)) may be defined as the detection result from the coordinates and size of the maximum likelihood position. Specifically, the center coordinates of the circumscribing circle of the head are the coordinates (x p ',y p '), and the radius is the value of the size map s(x p ',y p ')×0.5 is used. By the way, the value of the size map is the width of the head area, which is equivalent to the diameter, so multiplying it by 0.5 gives the radius.
[0074] If there is a candidate position in the position list, the integration processing means 33 repeats the processes of steps S27 to S29. On the other hand, if it is determined that there is no candidate position, that is, if the position list is empty ("NO" in step S26), the integration processing means 33 ends the integration process and outputs the detection result to the result output means .
[0075] The image processing unit 5 cooperates with the communication unit 3 to function as result output means 34, and outputs the captured image and the detection result to the display unit 6 (step S30). As a result, the detection result and the like are displayed on the display unit 6.
[0076] Basically, the object detection device 30 repeats the processes of steps S21 to S30 in conjunction with the image capture by the image capture unit 2. This repetitive operation continues, for example, until an instruction to stop it is received.
[0077] The integration process of the present invention is more advantageous in a crowded state than the integration process used in normal object detection. The integration process used in normal object detection is performed based on the overlap of the circumscribed rectangular areas of the detection objects, so that in a crowded state, multiple detection objects that are close to each other are easily integrated, and the tendency to miss a report increases. On the other hand, the integration process of the present invention is an integration process on a position map in which values are localized near the center of the head. Even in a crowded state, multiple detection objects that are close to each other are separated on the position map, so they are difficult to integrate. Furthermore, since the process of shifting the candidate position to the center of the head is performed using the estimated presence distribution, there is an effect of making it even easier to separate nearby objects on the position map. Therefore, the integration process can be performed without miss-reporting even in a crowded state.
[0078] [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.
[0079] (2) 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.
[0080] (3) 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 .
[0081] (4) In the object detection device 30 of the above embodiment and its modified example, the integration processing means 33 performs integration processing by deleting candidate positions that are less than a distance threshold from the maximum likelihood position, but for candidate positions that are less than a distance threshold from the maximum likelihood position, an integration process may be performed to generate a detection result by weighting the size of the maximum likelihood position and the size of the candidate positions, with the likelihood as a weight. In addition, the likelihood of the detection result may be obtained by performing integration processing by addition. Note that the position of the detection result may be the maximum likelihood position.
[0082] (5) In the object detection device 30 of the above embodiment, the estimation means 32 outputs the presence distribution from the presence distribution generation means 14 to the integration processing means 33 in addition to the position map from the position map generation means 12 and the size map from the size map generation means 13, and the integration processing means 33 performs integration processing using these, but the integration processing may be performed by inputting only the position map and the size map from the estimation means 32 to the integration processing means 33. In this case, the presence distribution generation means 14 of the distribution generation model 10 is not necessary when operating as the object detection device 30.
[0083] The procedure of the integration process in this case will be described below. FIG. 11 is a schematic diagram for explaining an example of the process in the integration process means 33 in this case. First, the integration process means 33 performs threshold processing on the position map to leave only values (likelihoods) equal to or greater than a predetermined threshold. Incidentally, this threshold processing corresponds to step S23 in the flow of FIG. 9 shown in the above embodiment. As a result, a position map after threshold processing is obtained. In addition, in the integration process here, the value of the size map corresponding to the coordinates remaining after threshold processing is also used. FIG. 11(a) is an example of the position map and size map after threshold processing. The left side of FIG. 11(a) is the position map, and shows the same example as the position map in FIG. 10(a). At this point, there are multiple candidate positions for the right side of the head. In the size map on the right side of FIG. 11(a), the size corresponding to each candidate position in the position map on the left side is shown by a solid-line circle centered on that position.
[0084] Next, the integration processing means 33 calculates the likelihood w(x k ,y k) in descending order. This corresponds to the processing in step S25 in FIG. 9. In other words, in this modified example, the position list is created without shifting the candidate positions using the presence distribution (processing in step S24 in FIG. 9), which is performed in the above embodiment. In this position list, the coordinates (x k ,y k ) and the likelihood at that position w k are associated with each other.
[0085] Then, the integration processing means 33 calculates the maximum likelihood position (x p ,y p ) to each other candidate position (x q ,y q ) distance d pq This corresponds to the process in step S27 in FIG. 9. Next, the integration process means 33 calculates the coordinates (x p ,y p ) the size map value s(x p ,y p ) is used as a reference to calculate the distance threshold using a predetermined formula. For example, the value of the size map s(x p ,y p ) × a constant multiple (the constant is a value less than 1). In the above embodiment, the distance threshold in step S28 is a constant, but in this modified example, the distance threshold changes depending on the value of the size map, which is different from the above embodiment.
[0086] The integration processing means 33 uses this distance threshold to perform the processes corresponding to steps S28 and S29 in FIG. 9 in the same manner as in the above embodiment. That is, the integration processing means 33 integrates candidate positions that are equal to or less than the distance threshold into the maximum likelihood position, and stores the maximum likelihood position as a detection result, while deleting the candidate positions integrated with the maximum likelihood position from the position list. FIG. 11(b) shows this state, and in the position map on the left, a solid-line circle centered on the maximum likelihood position (x2, y2) is the distance threshold, and candidate positions (x1, y1) within this circle are integrated into the maximum likelihood position (x2, y2). As shown in the position map on the right side of FIG. 11(b), the integration deletes candidate positions (x1, y1) that are equal to or less than the distance threshold, and also extracts the coordinates (x2, y2) of the maximum likelihood position, the size s (x2, y2) at the coordinates, and the likelihood w (x2, y2), from which a detection result is obtained. For example, as in the above embodiment, a circumscribing circle of the head is given as a detection result. Specifically, the center coordinate of the circumscribed circle of the head is the coordinate of the maximum likelihood position (x p ,y p ), and the radius is the value of the size map s(x p ,y p ) × 0.5 is used.
[0087] The integration process performed after creating the position list in this modified example is repeated until the position list becomes empty, similar to the processes in steps S26 to S29 in FIG. 9. When the position list becomes empty, the integration process means 33 terminates the integration process and outputs the detection result to the result output means 34.
[0088] In addition, as in variant example (4) of the above embodiment, in this variant example, for candidate positions that are within a distance threshold from the maximum likelihood position, an integration process is performed to generate a detection result by weighting the size of the maximum likelihood position and the size of the candidate position, using the likelihood as a weight, and averaging the size of the maximum likelihood position and the size of the candidate position, and the likelihood of the detection result may be obtained by performing an integration process by addition.
[0089] As with the above embodiment, this modification is also advantageous in crowded conditions compared to the integration process used in normal object detection. Furthermore, in this modification, the estimated size map can be used to dynamically adjust the distance threshold for the integration process, which has the effect of preventing erroneous integration of nearby detection objects. Therefore, integration can be performed without failure to report even in crowded conditions.
[0090] (6) 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.
[0091] 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 each 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 of the head as the average value and the size multiplied by α as the standard deviation, respectively. 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 distribution.
[0092] 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.
[0093] 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.
[0094] 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.
[0095] 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.
[0096] 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.
[0097] The estimation means 32 of the object detection device 30 creates an abundance distribution using an abundance function based on a normal distribution in the distribution generation model 10 , and supplies the abundance distribution to integration processing in the integration processing means 33 .
[0098] (7) Furthermore, the presence distribution generated using the rectangular function described in the modified example (6) can be used for the false alarm removal process in the object detection device 30. 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. Fig. 12 is a schematic block diagram for explaining the functional configuration of the estimation means 32 and the integration processing means 33 according to this modified example. In Fig. 12, the common feature extraction means 11, the position map generation means 12, the size map generation means 13, the binary image acquisition means 15, the mask processing means 16, and the presence distribution generation means 14 correspond to the estimation means 32.
[0099] 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 (7). 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.
[0100] 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.
[0101] Then, the masked presence distribution output from the presence distribution generating means 14, the masked position map output from the mask processing means 16, and the size map output from the size map generating means 13 are input to an integration processing means 33, which performs integration processing and outputs a post-mask detection result.
[0102] In the distribution generation model in the estimation means 32 of this modified example, the binary image acquisition means 15 acquires a binary image using the outputs 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 outputs 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.
[0103] (8) 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 calculates an abundance distribution with a number of pixels fewer than the input image may be used. This allows the learning device 20 and the estimation device 30 to have a small processing load.
[0104] 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.
[0105] (9) In the modified example (8), 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").
[0106] 13 is a schematic block diagram explaining the functional configuration of the estimation means 32 and the integration processing means 33 according to this modified example. The estimation means 32 is composed of a front stage 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 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.
[0107] 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.
[0108] The latter part creates an abundance distribution of the original scale based on the input from the former part. Specifically, the feature quantity created by the first common feature quantity 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 quantity extraction means 11b, and the second common feature quantity extraction means 11b creates a common feature quantity from the feature quantity that combines these. From this point on, the configuration is the same as that of Fig. 8, and the second position map generation means 12b and the second size map generation means 13b create a position map and size map of the original scale from the feature quantity, respectively, and the abundance distribution of the original scale is output from the second abundance distribution generation means 14b.
[0109] The error function used in the learning of the configuration shown in FIG. 13 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.
[0110] 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.
[0111] (10) 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 and y directions. 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. [Explanation of symbols]
[0112] 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 Object detection device, 31 Image input means, 32 Estimation means, 33 Integration processing means, 34 Result output means.
Claims
1. An object detection device that detects a predetermined object appearing in an image, a storage means for storing a position estimation model that estimates, for each pixel of the image, a likelihood that the pixel is a position of the detection target based on the image, and a size estimation model that estimates a size of the detection target at each pixel based on the image; a position estimation means for estimating the likelihood for each pixel of the image using the position estimation model, and determining a candidate position of the detection target from the position of the pixel where the estimated likelihood is equal to or greater than a predetermined threshold; a size estimation means for determining an estimated size of the object at the candidate position using the size estimation model; an integration means for setting an integration target range having a size according to the estimated size or a predetermined size from a maximum likelihood position, which is the candidate position having the maximum likelihood, and integrating other candidate positions present within the integration target range with the maximum likelihood position, and outputting the obtained position as the position of the detection target; the position estimation model and the size estimation model are trained models in which learning parameters of the position estimation model and the size estimation model are updated by training using a training image and ground truth data of an presence distribution given in advance to the training image, and in the training, an presence function of the pixel is calculated by setting the position of the pixel of the training image and the size of the detection object at the position calculated by the size estimation model for the training image as parameter values of the presence function of the pixel, the presence function being a predetermined probability distribution, and the presence distribution is calculated by adding up, for all pixels, the presence function of the pixel weighted by the likelihood of the pixel estimated by the position estimation model for the training image; An object detection device comprising:
2. 2. The object detection device according to claim 1, The object detection device is characterized in that the integration means creates a position list in which the candidate positions are associated with the likelihood at the candidate positions, sets the integration target range around the maximum likelihood position, and repeatedly executes a non-maximum value suppression process in which other candidate positions that exist within the integration target range are deleted from the position list and the maximum likelihood position is saved as a detection result until the position list is empty, and when the position list becomes empty, outputs the maximum likelihood position saved as the detection result as the position of the detected object.
3. 3. The object detection device according to claim 1, The object detection 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 object detection device according to claim 3, the abundance function is a rectangle function based abundance function; an abundance distribution generating means for calculating the abundance function of each pixel by setting parameter values of the abundance function of the pixel based on the position of the pixel determined by the position estimating means and the size of the detection target at the position estimated by the size estimating means, and for calculating the abundance distribution by adding up, for all pixels, the abundance functions of the pixels weighted by the likelihood of each pixel estimated by the position estimating means; a binary image acquisition means for calculating an abundance function of each pixel by setting the position of the pixel and the size of the detection target at the position determined by the size estimation model as the parameter value, calculating the abundance distribution for generating a binary image by adding up, for all pixels, the abundance functions of the pixels weighted by the likelihood of the pixel estimated by the position estimation model, and acquiring a binary image that distinguishes between a region of interest corresponding to the detection target in the image and a non-interest other than the region of interest, based on the abundance distribution for generating a binary image; 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; said presence distribution generating means using the positions remaining after the deletion by said masking means as the value of said parameter; An object detection device comprising:
5. 1. A method for detecting a predetermined object appearing in an image, comprising: preparing a position estimation model that estimates, for each pixel of the image, a likelihood that the pixel is a position of the detection target based on the image, and a size estimation model that estimates, for each pixel of the image, a size of the detection target at the pixel based on the image; a position estimation step of estimating the likelihood for each pixel of the image using the position estimation model, and determining a candidate position of the detection target from the position of the pixel where the estimated likelihood is equal to or greater than a predetermined threshold; a size estimation step of determining an estimated size of the object at the candidate location using the size estimation model; an integration step of setting an integration target range having a size according to the estimated size or a predetermined size from a maximum likelihood position, which is the candidate position having the maximum likelihood, and integrating other candidate positions present within the integration target range with the maximum likelihood position to output the obtained position as the position of the detection target; the position estimation model and the size estimation model are trained models in which learning parameters of the position estimation model and the size estimation model are updated by training using a training image and ground truth data of an presence distribution given in advance to the training image, and in the training, an presence function of the pixel is calculated by setting the position of the pixel of the training image and the size of the detection object at the position calculated by the size estimation model for the training image as parameter values of the presence function of the pixel, the presence function being a predetermined probability distribution, and the presence distribution is calculated by adding up, for all pixels, the presence function of the pixel weighted by the likelihood of the pixel estimated by the position estimation model for the training image; An object detection method comprising:
6. An object detection program that causes a computer to perform a process of detecting a predetermined object appearing in an image, The computer, a storage means for storing a position estimation model for estimating, for each pixel of the image, a likelihood that the pixel is a position of the detection target based on the image, and a size estimation model for estimating a size of the detection target at each pixel based on the image; a position estimation means for estimating the likelihood for each pixel of the image using the position estimation model, and determining a candidate position of the detection target from the position of the pixel where the estimated likelihood is equal to or greater than a predetermined threshold; a size estimation means for determining an estimated size of the object at the candidate location using the size estimation model; and an integration means for setting an integration target range of a size according to the estimated size or a predetermined size from a maximum likelihood position, which is the candidate position having the maximum likelihood, and integrating other candidate positions present within the integration target range with the maximum likelihood position, and outputting the obtained position as the position of the detection target; the position estimation model and the size estimation model are trained models in which learning parameters of the position estimation model and the size estimation model are updated by training using a training image and ground truth data of an presence distribution given in advance to the training image, and in the training, an presence function of the pixel is calculated by setting the position of the pixel of the training image and the size of the detection object at the position calculated by the size estimation model for the training image as parameter values of the presence function of the pixel, the presence function being a predetermined probability distribution, and the presence distribution is calculated by adding up, for all pixels, the presence function of the pixel weighted by the likelihood of the pixel estimated by the position estimation model for the training image; An object detection program comprising:
Citation Information
Patent Citations
Information processing device, information processing method, and program
JP2020140295A
