The present invention relates to a feature representation device, a feature representation method, and a program and, more particularly, to a feature representation device, a feature representation method, and a program that, with respect to an input image, outputs information representing features captured by a specific layer of a CNN.
In recent years, proliferation of digital cameras and smartphones has allowed for easy image acquisition, and as such images circulate through the Internet, access to images in which diversifying objects are shot in diversifying environments has become easier. In such circumstances, there are many cases where it is unknown what is an object appearing in an image. Such a problem can be solved if it is possible to identify every object from image information and to acquire new information when information about an unknown object is unable to be acquired easily.
As described above, demand has been growing for image identification technology that enables provision of new information from image information.
With respect to the image identification technology, various techniques have been invented and disclosed conventionally. For example, Non-Patent Literature 1 discloses a method based on SIFT (Scale Invariant Feature Transform). In the method, a computer is caused to learn relations between features in images including objects with known names and the names, whereby a newly input image (a query image) is categorized. A very small region called a keypoint is detected from each image, and a SIFT feature amount is calculated for each keypoint. The feature amounts are quantized into codes called Visual Words, and each image is represented by a histogram of frequencies of occurrence of the Visual Words. By causing a computer to learn the obtained histogram as the feature amounts of the image, an unknown query image can be identified.
Similarly, in a technique disclosed in Patent Literature 1, partial images including specific patterns included an image are cut out, and feature amounts of the partial images are calculated. By causing a computer to learn a correspondence between a histogram created from the calculated feature amounts and the image as in Non-Patent Literature 1, an unknown query image can be identified.
According to Non-Patent Literature 1, distinctive points are detected from an input image, and a SIFT feature amount is calculated for each of such keypoints. Similarly, also in the Patent Literature, partial images including specific patterns are cut out from an input image, and a feature amount is calculated for each of the partial images. Accordingly, in these techniques, it is obvious which portion in an image is captured, and a feature amount to be described for an input is predetermined.
Accordingly, when an identification result for an image is obtained, a feature captured from the image can be used to analyze a factor leading to the identification result.
On the other hand, methods based on a Convolutional Neural Network (CNN), as disclosed in Non-Patent Literature 2, are disclosed in large numbers.
In a CNN, convolution processing for outputting a feature map, which is created by applying a feature detection filter to an input image while the filter is slid, and pooling processing for combining extracted features in each local region are iterated. It is known that high identification performance is demonstrated by learning a feature detection filter to suit data and enhancing, by the pooling processing, robustness in terms of positions of the detected features.
Since each filter is automatically learned such that an image will be more accurately discriminated ultimately, it depends on learning data what feature representation an image results in.
Accordingly, a problem arises that when an identification result for an image is obtained, it is difficult to directly use features captured by a CNN to analyze a factor leading to the identification result.
For example, when an error occurs in the identification result, it is difficult to analyze a cause of the error, and such a fact is a major obstacle to commercialization of CNN-based image identification technology.
To overcome the above-described problems, several inventions have been made and disclosed that explain a factor leading to an identification result obtained by a CNN.
For example, a technique is disclosed that aims at clearly visualizing a portion to which a CNN ultimately gives attention in an image (Non-Patent Literature 3).
In Non-Patent Literature 3, gradients indicating degrees of influence on an identification result are obtained for feature maps of a final layer, and a portion to be given attention on the final layer is obtained by using values of the gradients as weights and calculating a linear combination of the weights and the feature maps of the final layer. A user can perceive the portion ultimately given attention when an identification result for an image is obtained.
In Non-Patent Literature 3, a position to which a CNN ultimately gives attention can be presented.
However, since the method is to obtain regions highly relevant to a final output and information about features captured in an image by a CNN cannot be obtained, such features captured in the image by the CNN cannot be used to analyze a factor for an identification result.
Accordingly, with the CNN-based image identification technology, there has been a problem that it cannot be efficiently represented what features in which portion in an image are captured by a CNN.
The present invention is made in view of the foregoing, and an object thereof is to provide a feature representation device, a feature representation method, and a program that make it possible to efficiently represent features in an image used by a CNN to identify the input image.
A feature representation device according to the present invention is a feature representation device that, for an input image, outputs information representing features captured by a specific layer of a CNN (Convolutional Neural Network), including: an agreement rate calculation unit that, with respect to each of a plurality of filters used on the specific layer of the CNN, calculates, for each of a plurality of concepts defined in advance, an agreement rate indicating a degree of relevance of a feature map output from the filter of interest when each of a plurality of images in which a region representing each of the plurality of concepts is already obtained is used as an input, with a region representing the concept of interest; a feature map calculation unit that calculates a feature map to be output from each of the plurality of filters when the input image is input into the CNN; a clustering processing unit that classifies the feature map calculated with respect to each of the plurality of filters by the feature map calculation unit into any of a plurality of clusters, based on values in the feature map; an integration map calculation unit that, based on a result of classification of the feature maps by the clustering processing unit and the agreement rates, calculates, for each of the plurality of concepts and for each of the plurality of clusters, an integration map in which a plurality of feature maps classified into the cluster of interest are integrated by using the agreement rates with the concept of the filter outputting the feature maps; a threshold value calculation unit that, with respect to each of the plurality of clusters, calculates, for each of the plurality of concepts, a threshold value based on values in the integration maps calculated by the integration map calculation unit; and a threshold value processing unit that, with respect to each of the integration maps, outputs, in a pair, a feature representation visualization image visualized by using the threshold value and information on the concept corresponding to the integration map of interest.
A feature representation method according to the present invention is a feature representation method of, for an input image, outputting information representing features captured by a specific layer of a CNN (Convolutional Neural Network), including: by an agreement rate calculation unit, with respect to each of a plurality of filters used on the specific layer of the CNN, calculating, for each of a plurality of concepts defined in advance, an agreement rate indicating a degree of relevance of a feature map output from the filter of interest when each of a plurality of images in which a region representing each of the plurality of concepts is already obtained is used as an input, with a region representing the concept of interest; by a feature map calculation unit, calculating a feature map to be output from each of the plurality of filters when the input image is input into the CNN; by a clustering processing unit, classifying the feature map calculated with respect to each of the plurality of filters by the feature map calculation unit into any of a plurality of clusters, based on values in the feature map; by an integration map calculation unit, based on a result of classification of the feature maps by the clustering processing unit and the agreement rates, calculating, for each of the plurality of concepts and for each of the plurality of clusters, an integration map in which a plurality of feature maps classified into the cluster of interest are integrated by using the agreement rates with the concept of the filter outputting the feature maps; by a threshold value calculation unit, with respect to each of the plurality of clusters, calculating, for each of the plurality of concepts, a threshold value based on values in the integration maps calculated by the integration map calculation unit; and by a threshold value processing unit, with respect to each of the integration maps, outputting, in a pair, a feature representation visualization image visualized by using the threshold value and information on the concept corresponding to the integration map of interest.
According to the feature representation device and the feature representation method of the present invention, with respect to each of the plurality of filters used on the specific layer of the CNN, the agreement rate calculation unit calculates, for each of the plurality of concepts defined in advance, an agreement rate indicating a degree of relevance of a feature map output from the filter of interest when each of a plurality of images in which a region representing each of the plurality of concepts is already obtained is used as an input, with a region representing the concept of interest; the feature map calculation unit calculates a feature map to be output from each of the plurality of filters when an input image is input into the CNN; and the clustering processing unit classifies the feature map calculated with respect to each of the plurality of filters by the feature map calculation unit into any of a plurality of clusters, based on values in the feature map.
Then, based on a result of the classification of the feature maps by the clustering processing unit and the agreement rates, the integration map calculation unit calculates, for each of the plurality of concepts and for each of the plurality of clusters, an integration map in which a plurality of feature maps classified into the cluster of interest are integrated by using the agreement rates with the concept of the filter outputting the feature maps; with respect to each of the plurality of clusters, the threshold value calculation unit calculates, for each of the plurality of concepts, a threshold value based on values in the integration maps calculated by the integration map calculation unit; and with respect to each of the integration maps, the threshold value processing unit outputs, in a pair, a feature representation visualization image visualized by using the threshold value and information on the concept corresponding to the integration map of interest.
As described above, with respect to each of a plurality of filters used on a specific layer of a CNN, an agreement rate indicating a degree of relevance of a feature map output from the filter of interest when a plurality of images in which regions representing a plurality of concepts defined in advance are already obtained are used as inputs, with a region representing a concept of interest is calculated for each concept; an integration map in which feature maps are integrated by using the agreement rates with the concept of the filter outputting the feature maps is calculated for each concept and for each of a plurality of clusters, based on the agreement rates and a result of classification of feature maps output from the plurality of filters when an input image is input into the CNN, into each cluster based on values in the feature maps; and feature representation visualization images visualized by using threshold values that are based on values in the integration maps and information on the respective concepts corresponding to the integration maps are output in pairs, whereby features in the image used by the CNN to identify the input image can be efficiently represented.
The integration map calculation unit of the feature representation device according to the present invention can integrate, for each of the plurality of concepts and for each of the plurality of clusters, the plurality of feature maps classified into the cluster of interest, by calculating a linear sum using the agreement rates with the concept of the filter outputting the feature maps.
The integration map calculation unit in the feature representation method according to the present invention can integrate, for each of the plurality of concepts and for each of the plurality of clusters, the plurality of feature maps classified into the cluster of interest, by calculating a linear sum using the agreement rates with the concept of the filter outputting the feature maps.
The feature representation device according to the present invention further includes a resizing processing unit that, for each of the plurality of integration maps, converts a size of the integration map of interest, and the threshold value processing unit can output, in a pair, the feature representation visualization image visualized by using the threshold value and the information on the concept corresponding to the integration map, for each of the integration maps with the sizes converted by the resizing processing unit.
Another feature representation device according to the present invention is a feature representation device that, for an input image, outputs information representing features captured on a specific layer of a CNN (Convolutional Neural Network), including a feature representation unit that, based on each of a plurality of images in which a region representing each of a plurality of concepts defined in advance is obtained beforehand, outputs, with respect to each of the plurality of concepts, information on the concept of interest and a feature representation visualization image in which a region given attention with respect to the concept of interest on the specific layer of the CNN is visualized, in a pair.
Another feature representation method according to the present invention is a feature representation method of, for an input image, outputting information representing features captured on a specific layer of a CNN (Convolutional Neural Network), including, by a feature representation unit, based on each of a plurality of images in which a region representing each of a plurality of concepts defined in advance is obtained beforehand, outputting, with respect to each of the plurality of concepts, information on the concept of interest and a feature representation visualization image in which a region given attention with respect to the concept of interest on the specific layer of the CNN is visualized, in a pair.
According to the feature representation device and the feature representation method of the present invention, based on each of the plurality of images in which a region representing each of the plurality of concepts defined in advance is obtained beforehand, the feature representation unit outputs, with respect to each of the plurality of concepts, information on the concept of interest and a feature representation visualization image in which a region given attention with respect to the concept of interest on the specific layer of the CNN is visualized, in a pair.
As described above, based on each of a plurality of images in which a region representing each of a plurality of concepts defined in advance is obtained beforehand, information on a concept of interest and a feature representation visualization image in which a region given attention with respect to the concept of interest on the specific layer of the CNN is visualized are output in a pair with respect to each of the plurality of concepts, whereby features in an image used by the CNN to identify the input image can be efficiently represented.
A program according to the present invention is a program for causing a computer to function as each unit of any one of the above-described feature representation devices.
According to the feature representation device, the feature representation method, and the program of the present invention, it is possible to efficiently represent features in an image used by a CNN to identify the input image.
Hereinafter, an embodiment of the present invention will be described with reference to drawings.
<Outline of Feature Representation Device According to Embodiment of the Invention>
First, an outline of the embodiment of the present invention will be described.
A technique aiming at representing a feature captured by each filter in accordance with a predefined concept has been provided (Reference Literature 1).
First, content of the invention according to Reference Literature 1 will be described. An image data set in which labels of concepts existing in each image are associated with binary images indicating regions of the individual concepts, respectively, is prepared. Concepts are broadly divided into six categories including object, part, scene, texture, material, and color, and each category includes a large number of labels. When an image is chosen from the prepared data set and input into a CNN, only a region producing a greater reaction is extracted from a feature map obtained through each filter. For the region, a degree of region overlap (an agreement rate) with each concept-assigned region is calculated. Such agreement rates of regions are calculated for all images in the data set. An agreement rate is a score indicating how easy it is for each filter to capture each concept.
By using the agreement rates, for example, a concept obtaining a largest agreement rate is made to correspond to a filter, and visualization is rendered based on a feature map representing reactions in an image resulting from the filter, whereby a position and a nature of a feature the CNN (Convolutional Neural Network) captures in the image can be visualized. The visualization image can be used to analyze a factor leading to an identification result.
By replacing a feature with a concept by utilizing Reference Literature 1 that makes it possible to represent features captured by a CNN in terms of concepts, a concept captured in an image can be used to analyze a factor leading to an identification result.
However, filters automatically learned within a CNN do not always make one-to-one correspondences with human-defined concepts, and one filter may react on many concepts.
In other words, all concepts existing in an image cannot necessarily be captured by only considering a concept obtaining a high agreement rate. Accordingly, it is necessary to consider a plurality of concepts for one filter.
In addition, there may be a plurality of filters that react on a concept. In other words, a plurality of filters may strongly react on a concept in an image. Accordingly, when all of the regions are simply visualized, as many visualizations as the number of filters x the number of concepts are needed at maximum.
For example, in a case of 4-layer res5c of Residual Network-152 in Reference Literature 1, since 2,453,504 visualizations are needed at maximum on an assumption that the number of filters is 2,048 and the number of concepts is 1,198, such visualizations are redundant and require much human work for visual confirmation.
For the above-described reasons, the foregoing method is insufficient as a method for representing a position and a nature of a feature existing in an image because only one concept can be considered at a time for one filter, and because visualizations become redundant when an attempt is made to consider a plurality of filters and a plurality of concepts for each filter in order to represent concepts existing in an image.
In the present embodiment, with respect to a plurality of filters used on a specific layer of a CNN, a feature representation device can calculate, for each concept, an agreement rate indicating a degree of relevance of each feature map output from the filters when a plurality of images in which regions representing a plurality of concepts defined in advance are obtained are used as inputs, with a region representing the concept of interest. Moreover, based on the agreement rates and a result of classification of feature maps output from the plurality of filters when an input image is input into the CNN, into each cluster based on values in the feature maps, the feature representation device can calculate, for each concept and for each of the plurality of clusters, an integration map in which feature maps are integrated by using the agreement rates with the concept of the filter outputting the feature maps. Further, with respect to integration maps obtained after sizes of the plurality of integration maps are converted, the feature representation device outputs, in pairs, feature representation visualization images visualized by using threshold values that are based on values in the integration maps and information on the respective concepts corresponding to the integration maps of interest, and thus can efficiently represent features in the image used by the CNN to identify the input image.
In other words, an effect can be achieved that positions and natures of features captured by a CNN can be efficiently visualized while a plurality of filters and a plurality of concepts for each of the filters are considered at the same time.
By using the present embodiment in analysis of a cause of erroneous recognition in an image recognition service using a CNN, a user can recognize positions and natures of features captured by the CNN and can easily perform analysis of a factor leading to an identification result, so that a contribution can be made to acceleration of the commercialization of the image identification technology using CNNs.
<Configuration of Feature Representation Device According to Embodiment of the Invention>
A configuration of the feature representation device according to the embodiment of the present invention will be described with reference to
The feature representation device 100 is configured by using a computer including a CPU, a RAM, and a ROM storing a program for executing a feature representation processing routine, which will be described later, and is functionally configured as described below.
As shown in
The image DB 2 stores an image set 21 that is a set of images.
Each image in the image set 21 is assigned a correct-answer label used in CNN learning. A correct-answer label is, for example, a sequence of letters expressing an object appearing in an image.
It is assumed that a file of each image in the image set 21 is assigned an identifier that can identify each image file, so that an arbitrary file can be referred to. For example, when the number of stored image files is D, a natural number that is not smaller than 1 and not larger than D is assigned to each image.
The storage unit 3 stores an image set 31 that is a set of images. The storage unit 3 may also store an agreement rate calculated by an agreement rate calculation section 12 as an agreement rate 32.
Each of the images in the image set 31 is associated with labels of concepts existing in the image and with binary images indicating regions of the individual concepts. A concept is an attribute of an object appearing in an image, and a label of the concept is a sequence of letters expressing the attribute. Preferably, labels of concepts are broadly divided into the six categories defined in Reference Literature 1, including object, part, scene, texture, material, and color, and an image set including many labels in each category is used.
For a binary image indicating a region of each concept, for example, it is determined through human work which concept each pixel in an image corresponds to, and a map in which is are arranged at positions of pixels corresponding to a concept and 0s are arranged at positions of the other pixels is created for each concept and used.
Each image file in the image set 31 may be an image set that is identical to the image set 21 stored in image DB 2, or may be a different image set.
It is assumed that each image file in the image set 31 is assigned an identifier that can identify the image file, so that an arbitrary file can be referred to. For example, when the number of image files in the image set 31 stored in the storage unit 3 is X, a natural number that is not smaller than 1 and not larger than X is assigned to each image.
The CNN learning unit 4 receives the image set 21 from the image DB 2, learns a CNN that has an arbitrary network structure for identifying an object appearing in an image, for example, Deep Residual Network proposed in Non-Patent Literature 2, and outputs a CNN model.
Here, the CNN model has a network structure of a neural network that iterates a combination of convolution processing and pooling processing, and retains learned parameter information.
Based on each of a plurality of images in which a region representing each of a plurality of concepts defined in advance is obtained beforehand, the feature representation unit 1 outputs, with respect to each of the plurality of concepts, information on the concept of interest and a feature representation visualization image in which a region given attention with respect to the concept of interest on a specific layer of the CNN is visualized, in a pair.
Specifically, with respect to an input image 5 or an image registered in the image DB 2, the feature representation unit 1 generates feature representation visualization information 6 representing where and how features captured by the CNN exist.
The feature representation visualization information 6 includes feature representation visualization images and concept information in pairs. A feature representation visualization image has one channel, and is represented in binary by using numerical values that are either 0 or 1 in some cases, or is represented by using integers that are not smaller than 0 in some cases. A feature representation visualization image is an image represented by using two colors in the case of the binary numerical values, and is a heat-map image in which values are represented by variations in gray levels in the case of the integers that are not smaller than 0.
Information in which each feature representation visualization image is given a corresponding concept is the feature representation visualization information 6. An image diagram of the feature representation visualization information 6 when feature representation visualization images are represented in binary is shown in
The feature representation unit 1 functionally includes a feature map calculation section 11, the agreement rate calculation section 12, a clustering processing section 13, an integration map calculation section 14, a threshold value calculation section 15, a resizing processing section 16, and a threshold value processing section 17.
With respect to each of the plurality of filters used on the specific layer of the CNN, the agreement rate calculation section 12 calculates, for each of the plurality of concepts, an agreement rate Rn, c indicating a degree of relevance of a feature map An(x) output from the filter n of interest when each of a plurality of images in which a region representing each of the plurality of concepts defined in advance is already obtained is used as an input, with a region representing the concept c of interest.
Specifically, after the image set 31 and the CNN model are received, the agreement rate calculation section 12, with respect to each filter of the CNN model and for each concept, outputs an agreement rate of a large-value region in a feature map An(x) of an image x belonging to the image set 31 obtained through the filter n of interest, with a binary image indicating a region of the concept c of interest associated with the image x.
When the images x in the image set 31 stored in the storage unit 3 are input into the CNN model received from the CNN learning unit 4, the agreement rate calculation section 12 collects feature maps An(x) with respect to the filters n on an arbitrary layer, for example, the same layer that is used by the feature map calculation section 11. x is a natural number that is not smaller than 1 and not larger than X, and n is a natural number that is not smaller than 1 and not larger than N. That is, N×X feature maps are obtained.
Here, it is assumed that a feature map An(x) is a matrix with a size of h×w. For example, when 4-layer res5c of Residual Network-152 in Reference Literature 1 and a Broden dataset are used, the number X of images is 63,305, the number N of filters is 2,048, and therefore 129,648,640 feature maps An(x) are obtained. The size of each feature map An(x) is 7×7.
Next, for each filter, such a threshold value that divides X×h×w values included in X feature maps at predetermined ratios is calculated.
For example, when the above-described example is used, with respect to a certain filter n, a total number of values included in 63,305 feature maps An(x) each with a size of 7×7 is 3,101,945, and a 15,509-th value in a top 0.5% of the values is set as a threshold value.
Ultimately, as many threshold values as the number N of the filters are calculated.
The agreement rate calculation section 12 then performs thresholding on the N×X feature maps An(x) by using the N threshold values calculated for the filters, respectively, as boundaries, and obtains N×X maps Mn(x).
With respect to an arbitrary image x in the image set 31 stored in the storage unit 3, a binary image indicating a region of a concept c associated with the image is assumed to be Lc(x). Assuming that an agreement rate with a concept c in case of a filter n is Rn, c, the agreement rate Rn, c can be obtained based on following expression (1).
Here, in the expression (1), ∩ is a subset, ∪, is a union, and |⋅| is a cardinality of a set.
Since a total sum of the agreement rates Rn, c for each filter is not equal to the others, normalization may be performed such that a total sum of the agreement rates for each filter becomes 1 (expressing (2) below).
Examples of a normalization method that results as in the expression (2) include, for example, a method as in expression (3) below.
The agreement rates Rn, c may be calculated beforehand, and in such a case, the agreement rates Rn, c may be stored as agreement rates 32 in the storage unit 3. When the agreement rates 32 are stored in the storage unit 3, efficiency is achieved because the agreement rate calculation section 12 only needs to acquire the agreement rates 32 from the storage unit 3.
The agreement rate calculation section 12 then outputs the agreement rates Rn, c to the integration map calculation section 14.
When an input image x is input into the CNN, the feature map calculation section 11 calculates a feature map An(x) to be output from each of the plurality of filters n.
Specifically, the feature map calculation section 11 receives input of an input image 5 and also receives the CNN model from the CNN learning unit 4, and then calculates a feature map An(x) with respect to each filter n on an arbitrary layer, for example, a fifth layer when the input image 5 is input into the CNN model.
The feature map calculation section 11 then outputs the calculated feature maps An(x) to the clustering processing section 13.
The clustering processing section 13 classifies each feature map calculated with respect to each of the plurality of filters by the feature map calculation section 11, into any of a plurality of clusters, based on a value of the feature map An(x).
Specifically, the clustering processing section 13 acquires N feature maps An(x) each with a size of h×w from the feature map calculation section 11, and performs clustering to classify the N feature maps An(x) into K clusters.
h, w are vertical and horizontal sizes of each feature map An(x), respectively, and N is the number of filters on the layer of interest, and h, w, N are defined depending on a CNN model and a layer to be used. For example, in the case of 4-layer res5c of Residual Network-152 in Reference Literature 1, h, w, N are 7, 7, 2,048, respectively.
K is the number of clusters, and it is determined depending on a clustering scheme to be used whether or not there is necessity to preset K.
Here, clustering is processing for combining feature maps with large-value regions that are similar in range, among the feature maps An(x).
For the clustering scheme, an example using the k-means method will be illustrated. The number of clusters is a parameter and is set to an arbitrary value. Here, for example, it is assumed that K=5. With respect to each feature map An(x), a largest element in the feature map An(x) is extracted, and clustering is performed based on coordinates of a position of the largest element, which are calculated assuming that coordinates of a top-left end of the feature map are (0,0).
The clustering scheme does not need to be the k-means method, and various clustering schemes can be adopted, for example, the minimum distance method, hierarchical clustering, and the like.
For a method of representing a large-value region in each feature map An(x), coordinates do not need to be those of the largest value, and for example, coordinates of top three points may be used.
Besides, a method may be used in which each feature map An(x) is divided into four regions beforehand, and the feature maps An(x) are classified depending on which one of the four regions a largest value in each feature map An(x) belongs to.
The clustering processing section 13 then outputs the feature maps An(x) obtained through the individual filters and classified into the K clusters, to the integration map calculation section 14.
Based on a result of the classification of the feature maps An(x) by the clustering processing section 13 and the agreement rates Rn, c, the integration map calculation section 14 calculates, for each of the plurality of concepts c and for each of the plurality of clusters k, an integration map
I
c
k [Formula 5]
in which a plurality of feature maps classified into the cluster k of interest are integrated by using the agreement rates Rn, c with the concept c of the filter n that outputs the feature maps An(x) of interest.
Specifically, based on feature maps An(x) acquired from the clustering processing section 13 that are classified into a cluster k, and based on the agreement rates Rn, c acquired from the agreement rate calculation section 12, the integration map calculation section 14 calculates an integration map
I
c
k [Formula 6]
in which the feature maps An(x) are integrated.
An integration map
I
c
k [Formula 7]
is a map representing a degree of presence of each concept c in each cluster k, and can be calculated by integrating feature maps An(x), for each cluster k, based on the agreement rates with each concept c. Here, for a method of calculating an integration map
I
c
k, [Formula 8]
a method can be used in which a linear sum of the feature maps An(x) and the agreement rates Rn, c is calculated for each cluster k and for each concept c. In such a case, the integration map calculation section 14 calculates, for each cluster k, an integration map
I
c
k [Formula 9]
based on following expression (4).
Here, a cluster to which feature maps An(x) belong is represented by γn,k, and it is assumed that γn,k=1 when feature maps An(x) belong to a cluster k and otherwise γn,k=0.
A linear sum does not necessarily need to be calculated, and an integration map
I
c
k [Formula 10]
for each cluster k and for each concept c may be calculated by taking a largest value of each element in maps obtained by multiplying the feature maps An(x) by the agreement rates Rn, c. Further, a mean value or a median value may be taken instead of the largest value.
The integration map calculation section 14 then outputs the calculated K×C integration maps
I
c
k [Formula 11]
to the threshold value calculation section 15 and the resizing processing section 16.
The threshold value calculation section 15 calculates a threshold value, based on values in integration maps of interest
I
c
k, [Formula 12]
each of which is calculated for each of the plurality of concepts c and for each of the plurality of clusters k by the integration map calculation section 14.
Specifically, the threshold value calculation section 15 receives the integration maps
I
c
k [Formula 13]
from the integration map calculation section 14 and outputs threshold values each of which divides values in integration maps
I
c
k [Formula 14]
in each cluster k at predetermined ratios.
For example, in the case of 4-layer res5c of Residual Network-152 in Reference Literature 1, a size of each integration map is 7×7, the number of concepts is 1,198, the total number of values in integration maps
I
c
k [Formula 15]
in each cluster k is 58,702, and a 2,935-th value in top 5% of the values is set as a threshold value. Ultimately, K threshold values are calculated.
The threshold value calculation section 15 then outputs the calculated K threshold values to the resizing processing section 16 and the threshold value processing section 17.
With respect to each of the plurality of integration maps, the resizing processing section 16 converts a size of the integration map
I
c
k. [Formula 16]
For example, when it is desired to check alignment of positions in a feature representation visualization image and the input image 5, the resizing processing section 16 converts sizes of (resizes) the K x C integration maps
I
c
k [Formula 17]
acquired from the integration map calculation section 14, each into a size of the input image 5 received by the feature map calculation section 11, and outputs the integration maps each with the image size. When it is not necessary to check alignment of positions in a feature representation visualization image and the input image 5, the resizing processing section 16 may output the received integration maps without converting the sizes, for efficiency.
For a method of resizing an image, a known method may be used, and for example, the nearest-neighbor interpolation method or the bilinear interpolation method may be used.
For efficiency, the integration maps
I
c
k [Formula 18]
may be narrowed down before size conversion is performed. Narrowing-down methods include, for example, a method in which the threshold value for each cluster k is acquired from the threshold value calculation section 15, and an integration map
I
c
k [Formula 19]
that does not include values equal to or larger than the threshold value is deleted, and a method in which largest values in the individual integration maps are compared to each other, and only a predetermined number of top integration maps
I
c
k [Formula 20]
in each cluster are retained.
The resizing processing section 16 then outputs the resized integration maps to the threshold value processing section 17.
With respect to each of the integration maps with the sizes converted by the resizing processing section 16, the threshold value processing section 17 outputs, in a pair, a feature representation visualization image visualized by using one of the threshold values calculated by the threshold value calculation section 15 and information on the concept c corresponding to the integration map
I
c
k. [Formula 21]
Specifically, the threshold value processing section 17 receives a resized integration map for each concept c and for each cluster k, which is acquired from the resizing processing section 16, and the threshold value for a cluster k of interest, which is acquired from the threshold value calculation section 15, and makes a feature representation visualization image of the integration map in which regions smaller than the threshold value are set to 0.
Next, pairs of such feature representation visualization images and corresponding concept information are output as feature representation visualization information 6.
A feature representation visualization image may be a binary image in which regions satisfying the threshold value are colored in a single color, or may be a heat-map image in which variations in gray levels are represented based on values of regions satisfying the threshold value.
The threshold value processing section 17 then outputs the feature representation visualization information 6.
<Operation of Feature Representation Device According to Embodiment of the Invention>
First, the CNN learning unit 4 receives the image set 21 from the image DB 2 and learns a CNN for identifying objects existing in images. When an input image 5 is input into the feature map calculation section 11, the feature representation processing routine shown in
First in step S201, with respect to each of a plurality of filters used on a specific layer of the CNN, the agreement rate calculation section 12 calculates, for each of a plurality of concepts defined in advance, an agreement rate Rn, c indicating a degree of relevance of a feature map An(x) output from the filter n of interest when each of a plurality of images in which a region representing each of the plurality of concepts is already obtained is used as an input, with a region representing the concept c of interest. A size of the output agreement rates Rn, c is as shown in 0301.
Next in step S202, the feature map calculation section 11 calculates a feature map An(x) to be output from each of the plurality of filters when the input image 5 is input into the CNN. A size of the output feature maps An(x) is as shown in 0302.
In step S203, the clustering processing section 13 classifies each feature map obtained in the step S202 that is calculated with respect to each of the plurality of filters, into any of a plurality of clusters, based on values in the feature map An(x) of interest. A size of an output result of the classification is as shown in 0303.
In step S204, based on the result of the classification of the feature maps An(x) obtained in the step S203 and the agreement rates Rn, c, the integration map calculation section 14 calculates, for each of the plurality of concepts c and for each of the plurality of clusters k, an integration map
I
c
k [Formula 22]
in which a plurality of feature maps classified into the cluster k of interest are integrated by using the agreement rates Rn, c with the concept c of the filter n outputting the feature maps An(x). A size of the output integration maps
I
c
k [Formula 23]
is as shown in 0304.
In step S205, with respect to each of the plurality of clusters k, the threshold value calculation section 15 calculates, for each of the plurality of concepts c, a threshold value based on values in the integration maps
I
c
k [Formula 24]
obtained in the step S204. A size of the output threshold values is as shown in 0305.
In step S206, for each of the plurality of integration maps obtained in the step S204, the resizing processing section 16 converts a size of the integration map of interest
I
c
k. [Formula 25]
A size of the output integration maps after the conversion is as shown in 0306.
In step S207, for each of the integration maps with the converted sizes obtained in the step S206, the threshold value processing section 17 outputs feature representation visualization information 6 that is a pair of a feature representation visualization image visualized by using one of the threshold values obtained in the step 205 and information on the concept c corresponding to the integration map of interest
I
c
k. [Formula 26]
A size of the output feature representation visualization information 6 is as shown in 0307.
As described above, with respect to a plurality of filters used on a specific layer of a CNN, the feature representation device according to the present embodiment can calculate, for each concept, an agreement rate indicating a degree of relevance of a feature map output from the filter of interest when a plurality of images in which regions representing a plurality of concepts defined in advance are already obtained are used as inputs, with a region representing the concept of interest. Moreover, based on the agreement rates and a result of classification of feature maps output from the plurality of filters when an input image is input into the CNN, into each cluster based on values in the feature maps, the feature representation device can calculate, for each concept and for each of the plurality of clusters, an integration map in which feature maps are integrated by using the agreement rates with the concept of the filter outputting the feature maps. Further, the feature representation device can efficiently represent features in the image used by the CNN to identify the input image, by outputting, in pairs, feature representation visualization images visualized by using threshold values that are based on values in the integration maps, and information on the respective concepts corresponding to the integration maps of interest.
Note that the present invention is not limited to the above-described embodiment, and various changes and applications can be made without departing from the scope of the invention.
In the description of the present application, although the embodiment in which a program is preinstalled is described, it is also possible to provide the program by storing the program in a computer-readable recording medium.
Number | Date | Country | Kind |
---|---|---|---|
2018-031292 | Feb 2018 | JP | national |
Filing Document | Filing Date | Country | Kind |
---|---|---|---|
PCT/JP2019/007026 | 2/25/2019 | WO | 00 |