Image recognition device using neural network and program used in the image recognition device
By integrating human knowledge to correct attention maps, the image recognition device ensures accurate alignment with user intent, enhancing recognition performance without modifying the neural network's parameters.
Patent Information
- Application Number
- JP2020104577
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Priority Date
- 2019-07-25
- Filing Date
- 2020-06-17
- Publication Date
- 2024-09-02
- Estimated Expiration
- 2040-06-17
AI Technical Summary
Neural networks in image recognition often generate mismatched recognition results and attention maps, leading to errors without a way to correct this discrepancy.
An image recognition device incorporates human knowledge to correct attention maps using a map correction unit, allowing the neural network to focus on intended areas without altering its parameters.
This approach enables accurate image recognition aligned with human intent by correcting attention maps, improving recognition results without retraining the neural network.
Smart Images

Figure 0007542802000005 
Figure 0007542802000010 
Figure 0007542802000004
Abstract
Description
[Technical field]
[0001] The present invention relates to an image recognition device and a training device using a neural network. [Background technology]
[0002] Conventionally, in image recognition technology using neural networks such as CNN (Convolutional Neural Network), a technology is known that generates an attention map that represents a gaze area during inference by the neural network (see, for example, Non-Patent Documents 1 and 2). [Prior art documents] [Non-patent literature]
[0003] [Non-Patent Document 1] Ramprasaath, R., S., Michael, C., Abhishek, D., Ramakrishna, V., Devi, P. and Dhruv, B.: Grad-CAM: Visual Explanations from Deep Networks via Gradient-Based Localization, International Conference on Computer Vision, pp. 618-626 (2017). [Non-Patent Document 2] Zhou, B., Khosla, A., Lapedriza, A., Oliva, A. and Torralba, A.: Learning Deep Features for Discriminative Localization, Computer Vision and Pattern Recognition, pp. 2921-2929 (2016). Summary of the Invention [Problem to be solved by the invention]
[0004] However, according to the inventor's study, when a neural network generates a recognition result and an attention map for a certain image, the recognition result may not match the gaze area in the attention map. For example, if the recognition result is a "smile" but the gaze area is hair, the recognition result does not match the gaze area in the attention map. If there is a mismatch between the recognition result and the gaze area in the attention map, it is a problem that can lead to errors in the image recognition itself. And, currently, there is no way to correct this mismatch.
[0005] In view of the above, the present disclosure aims to incorporate human knowledge into the recognition function or learning of a neural network in an image recognition technology using a neural network that outputs an attention map. [Means for solving the problem]
[0006] According to one aspect of the present disclosure, an image recognition device includes an input unit (120) that inputs an image (51) to a neural network (10); A feature map (52) containing features of the input image and an attention map (53) representing the areas of attention of the input image; And, When the neural network is generated, a map correction unit (140) corrects the generated attention map in response to a correction operation by a person; A composite map (54) in which the feature map and the feature map are combined. and an output unit (160) that outputs the generated recognition result when the neural network (10) generates a recognition result for the image based on the image. According to another aspect, a program causes the image recognition device to function.
[0007] In this way, by using human knowledge to correct the attention map 53, the recognition unit 14 places emphasis on the area intended by the human. As a result, image recognition can be performed in line with the human's intention. Furthermore, at this time, the parameters of the neural network 10 are not changed. In other words, re-learning of the neural network 10 is not required, and the recognition result intended by the human can be obtained.
[0010] The reference symbols in parentheses attached to each component indicate an example of the correspondence between the component and specific components described in the embodiments described below. [Brief description of the drawings]
[0011] [Figure 1] FIG. 1 is a configuration diagram of an image recognition device. [Diagram 2] FIG. 1 is a diagram illustrating a configuration of a neural network. [Diagram 3] FIG. 2 is a diagram illustrating a configuration of an attention unit. [Figure 4] 11 is a flowchart of a process executed by a processing unit. [Diagram 5] FIG. 13 is a diagram showing a display in which an input image and an unmodified attention map are superimposed. [Figure 6] FIG. 13 is a diagram showing a display in which an input image and an attention map from which a gaze area has been deleted are superimposed. [Figure 7] FIG. 13 is a diagram showing a display in which an input image and an attention map with an added gaze area are superimposed. [Figure 8] FIG. 13 illustrates the relationship between the modified attention map and the neural network. [Figure 9] 13 is a flowchart of a process executed by a processing unit in the second embodiment. [Figure 10] FIG. 1 is a diagram showing an outline of relearning. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0012] (First embodiment) Hereinafter, a description will be given of the first embodiment. An image recognition device 1 according to this embodiment includes an operation device 2, a display device 3, a memory 4, and a processing unit 5, as shown in FIG.
[0013] The operation device 2 is a device that receives an operation by a person and outputs a signal corresponding to the received operation to the processing unit 5. The operation device 2 may be, for example, a mouse, a keyboard, a touch panel, etc. The display device 3 is a device that displays an image to a person.
[0014] The memory 4 includes a RAM, which is a rewritable volatile storage medium, a ROM, which is a non-rewritable non-volatile storage medium, and a flash memory, which is a rewritable non-volatile storage medium. The RAM, ROM, and flash memory are non-transient tangible storage media. The flash memory stores data of the trained neural network 10 in advance.
[0015] The processing unit 5 executes a program (not shown) stored in a ROM or a flash memory, and uses the RAM as a working area during the execution to realize various processes, which will be described later.
[0016] Here, we will explain the neural network 10. The neural network 10 is a deep neural network including a feature extraction unit 11, an attention unit 12, a synthesis unit 13, and a recognition unit 14, as shown in FIG.
[0017] When an input image 51 is input, the neural network 10 generates an attention map 53. The attention map 53 is data expressing a fixation area during inference by the neural network 10. In other words, the attention map 53 is visual explanatory data explaining which area of the input image 51 is emphasized during inference by the neural network 10.
[0018] The neural network 10 also outputs a classification result for the input image 51 based on the input image 51 and the attention map 53. The classification result for the input image 51 is a plurality of likelihoods corresponding to a plurality of classes (e.g., Dalmatian, crayfish, finch, frog, etc.) corresponding to the recognition target of the image. Here, the number of classes is K.
[0019] The feature extraction unit 11 is a neural network having multiple layers. These multiple layers include at least multiple convolution layers. Furthermore, these multiple layers may be components of multiple residual blocks, or may have multiple pooling layers, etc. The feature extraction unit 11 generates a feature map 52 by propagating information of the input image 51 to these multiple layers.
[0020] The feature map 52 is a map with K resolutions of h×w, each of which corresponds to K classes. h and w are any integers. Therefore, the number of channels of the feature map 52 is K. The resolution of the feature map 52 may be the same as the resolution of the input image 51, or may be lower than the resolution of the input image 51.
[0021] The feature extraction unit 11 may be configured by a portion of the baseline model starting from the input layer and preceding the first fully connected layer. As the baseline model, one having multiple convolutional layers and generating the same types of multiple class likelihoods as the neural network 10 is selected. For example, as the baseline model, VGGNet shown in Non-Patent Document 3, ResNet shown in Non-Patent Document 4, or other CNNs (Convolutional Neural Networks) may be used.
[0022] The attention unit 12 generates an attention map 53 from the feature map 52 generated by the feature extraction unit 11. The attention unit 12 is a neural network having multiple layers. As shown in FIG. 3, these multiple layers include a first part 12a having one or more convolution layers or one or more residual blocks, and a K×1×1 convolution layer 12b at the rear of the first part. Here, if L, a, and b are any natural numbers, the L×a×b convolution layer means a convolution layer using an a×b kernel in each of the L channels.
[0023] The attention unit 12 has two K×1×1 convolutional layers 12c and 1×1×1 convolutional layers 12e branched out after the convolutional layer 12b, and a GAP (Global Average Pooling) layer 12d after the convolutional layer 12c.
[0024] The information of the feature map 52 input to the attention unit 12 propagates through the first part 12a, the convolution layer 12b, the convolution layer 12c, and the GAP layer 12d, and the output of the GAP layer 12d is input to a Softmax function, whereby likelihoods of multiple classes of the same type as those of the neural network 10 are generated as classification results. The classification results are a type of recognition results.
[0025] In addition, the information of the feature map 52 input to the attention unit 12 is propagated to the first part 12a, the convolution layer 12b, and the convolution layer 12e to generate an attention map 53. By generating the attention map 53 via the convolution layer 12b instead of the fully connected layer, the information of the attention area is propagated to the attention map 53 while remaining localized. In addition, by passing through the 1×1×1 convolution layer 12e, a one-channel attention map 53 is generated as a weighted sum of the attention areas corresponding to all classes. Each value of the kernel of the convolution layer 12e may be all 1 or may be other than that.
[0026] The resolution of each map in the feature map 52 is the same as that of the attention map 53. The attention unit 12 is configured so that this is the case. In the attention map 53, pixels that correspond to the attention area are given relatively high pixel values, and pixels that do not correspond to the attention area are given lower pixel values than those of the attention area. Each pixel value in the attention map 53 may have a binary value or a value of 256 levels. The higher the pixel value of a pixel, the higher the attention level at the position of that pixel.
[0027] The synthesis unit 13 synthesizes the feature map 52 and the attention map 53. Specifically, the attention map 53 is multiplied by a map of resolution h×w in each of the K channels in the feature map 52. The attention map 53 is multiplied by the map of resolution h×w between pixels at the same position coordinates. The synthesis may be multiplication as described above, addition, or a calculation consisting of a combination of addition and multiplication. A synthesis map 54 is obtained by this synthesis. The number of channels and resolution of the synthesis map 54 are the same as those of the feature map 52.
[0028] The perception unit 14 outputs the likelihood of each class based on the composite map 54. The perception unit 14 is a neural network having multiple layers. The multiple layers include at least multiple convolution layers. The multiple layers also include one or both of a fully connected layer and a GAP layer. The multiple layers may further be components of multiple residual blocks or may have multiple pooling layers. The perception unit 14 outputs the likelihood of each class as a classification result by propagating the information of the input composite map 54 to the multiple layers. The classification result is also a recognition result. The perception unit 14 may be configured by a portion of the above-mentioned baseline model from the stage immediately following the portion used in the attention unit 12 to the output layer.
[0029] In addition, the functions described above as being performed by the neural network 10, the feature extraction unit 11, the attention unit 12, the synthesis unit 13, and the recognition unit 14 are actually realized by the processing unit 5 performing processing in accordance with the structure and parameters of the neural network 10.
[0030] The feature extraction unit 11, the attention unit 12, and the synthesis unit 13 are trained in advance by the error backpropagation method in supervised learning so as to realize the above-mentioned functions. In the learning, L=Latt+Lper is used as the learning error (also called a loss function) L. Here, Latt is the learning error regarding the classification result output by the attention unit 12, and Lper is the learning error regarding the classification result output by the recognition unit 14. Latt and Lper may be calculated by applying a combination of a Softmax function and cross entropy to each classification result. The feature extraction unit 11 is trained by passing through the gradients of the attention unit 12 and the recognition unit 14 in the error backpropagation method.
[0031] The image classification process of the processing unit 5 using the trained neural network 10 configured in this way will be described below.
[0032] When a predetermined condition, such as a human operation to start execution on the operation device 2, is satisfied, the processing unit 5 starts the processing shown in Fig. 4 which is defined in a predetermined program recorded in the memory 4. In this processing, the processing unit 5 first reads out the neural network 10 from the memory 4 in step 110.
[0033] Next, in step 120, an input image 51 is acquired and input to the neural network 10. The input image 51 may be an image selected from a plurality of images previously recorded in the memory 4 by a human operating the operation device 2, or may be an image received from another device via a communication network (not shown).
[0034] When an input image 51 is input to the neural network 10, as described above, the feature extraction unit 11 of the neural network 10 generates a feature map 52 and a classification result from the input image 51, and the attention unit 12 generates an attention map 53 from the feature map 52.
[0035] In step 130 following step 120, the processing unit 5 obtains the attention map 53 thus generated. That is, the processing unit 5 copies or moves the attention map 53 generated in the memory 4 by the neural network 10 to another area in the memory 4.
[0036] Next, in step 140, the processing unit 5 corrects the acquired (i.e., copy destination or move destination) attention map 53 based on a correction operation by a person on the operation device 2. In this way, the attention map 53 is corrected based on human knowledge.
[0037] Specifically, the processing unit 5 displays the attention map 53 and the pointer before correction on the display device 3. The pointer is an image that moves within the display range of the attention map 53 displayed on the display device 3 in response to a person's operation on the operation device 2. The person corrects the value of the position range overlapping with the pointer in the displayed attention map 53 by performing a predetermined correction operation (e.g., a delete operation, an add operation, etc.) on the operation device 2.
[0038] 5, the processing unit 5 may transparently align and overlay the input image 51 on the attention map 53 and display the same on the display device 3, and then reflect the correction corresponding to the correction operation on the attention map 53. In this case, if the input image 51 and the attention map 53 have different resolutions, the processing unit 5 lowers the resolution of the input image 51 to match that of the attention map 53, and then transparently overlays the input image 51 on the attention map 53.
[0039] In FIG. 5, an input image 51 of a Dalmatian holding a soccer ball is transparently overlaid on an attention map 53 .
[0040] In this attention map 53, the gaze area is in the soccer ball area. If attention map 53 is input as is to synthesis unit 13, and synthesis map 54, which is the result of synthesizing attention map 53 and feature map 52, is input to the first layer of recognition unit 14, the classification result generated by recognition unit 14 will have the highest likelihood of being a soccer ball. In other words, neural network 10 recognizes input image 51 as an image of a soccer ball.
[0041] However, if a person using the image recognition device 1 wants the input image 51 to be recognized as an image of a Dalmatian, the fixation area in this attention map 53 should be the area where the Dalmatian is located.
[0042] In such a case, a person uses the operation device 2 to correct the gaze area in the attention map 53. Specifically, first, the person uses the operation device 2 to erase the gaze area in the attention map 53. For example, the person moves the pointer while pressing a predetermined erase button on the operation device 2 to scan the entire gaze area in the attention map 53. As a result, the processing unit 5 lowers the pixel values of the attention map 53 in the area scanned by the pointer while pressing the erase button, to make the pixel values not part of the gaze area as shown in FIG. 6.
[0043] Then, the person uses the operation device 2 to set a new area in the attention map 53 that is to be set as the gaze area. For example, the person moves the pointer while pressing a predetermined add button on the operation device 2 to scan the entire area in the attention map 53 that is to be set as the gaze area. As a result, the processing unit 5 increases the pixel value of the attention map 53 in the area scanned by the pointer while pressing the add button, and sets the pixel value as the gaze area as shown in Fig. 7. In the example of Fig. 7, the new gaze area specified by the person is the face part of the Dalmatian.
[0044] In this way, by displaying the input image 51 on the display device 3 while being superimposed on the attention map 53, if a person can determine which part of the input image 51 should be set as the gaze area, that person can efficiently use that knowledge to easily specify the gaze area in the attention map 53. By the processing of step 140, the attention map 53 obtained in step 130 is corrected in the memory 4.
[0045] Next, in step 150, the processing unit 5 inputs the attention map 53 corrected in the previous step 140 to the synthesis unit 13. Then, the synthesis unit 13 generates a synthesis map 54 by synthesizing the feature map 52 and the attention map 53 as described above, and inputs the synthesis map 54 to the first layer of the recognition unit 14. The recognition unit 14 to which the synthesis map 54 has been input generates a classification result based on the synthesis map 54 as described above. In this classification result, the likelihood of a Dalmatian is the highest. In other words, the neural network 10 recognizes the input image 51 as an image of a Dalmatian.
[0046] In step 160 following step 150, the processing unit 5 acquires and outputs the classification result thus generated by the recognition unit 14. The output destination may be another device via a communication network (not shown), the memory 4, or the display device 3.
[0047] In this way, by correcting the attention map 53 using human knowledge, the recognition unit 14 assigns a higher weight to the area intended by the human. As a result, image recognition can be performed in accordance with the human's intention. In other words, the recognition result can be adjusted by using the attention map manually corrected based on human knowledge.
[0048] At this time, the parameters of the neural network 10 are not changed. In other words, there is no need to re-learn the neural network 10, and the recognition result intended by the person can be obtained.
[0049] For example, when a fundus image is input to the neural network 10 as the input image 51, a doctor can use his / her own experience-based knowledge to correct the gaze area of the attention map 53, thereby making it possible to more accurately classify the grade of eye disease as a class. In this way, the function of this embodiment is useful, for example, in medical image diagnosis.
[0050] As described above, the processing unit 5 of the image recognition device 1 corrects the attention map 53 generated by the neural network 10 to which the input image 51 is input in response to a human correction operation (step 140), as shown in Fig. 8. Then, the processing unit 5 outputs the recognition result of the input image 51 generated by the neural network 10 based on the corrected attention map 53 and the input image 51 (step 160).
[0051] In this way, by using human knowledge to correct the attention map 53, the recognition unit 14 places emphasis on the area intended by the human. As a result, image recognition can be performed in line with the human's intention. Furthermore, at this time, the parameters of the neural network 10 are not changed. In other words, re-learning of the neural network 10 is not required, and the recognition result intended by the human can be obtained.
[0052] In addition, the path along which image information propagates to generate attention map 53 and the path along which image information propagates to generate a recognition result are shared in one part (i.e., feature extraction unit 11) and are separated in other parts (i.e., attention unit 12 and recognition unit 14). Then, synthesis unit 13 inputs composite map 54 reflecting the corrected attention map 53 to the recognition unit 14 side of the separated part. In this way, the input point of composite map 54 based on corrected attention map 53 is suited to the structure of neural network 10, and the degree of improvement in recognition results by corrected attention map 53 is improved.
[0053] Furthermore, the processing unit 5 reflects the correction according to the correction operation by the person in the attention map 53 while the input image 51 is transparently superimposed on the attention map 53 and displayed on the display device 3. A person can relatively easily determine which part of the input image 51 should be set as the gaze area by looking at the input image 51. Therefore, by displaying the input image 51 on the display device 3 superimposed on the attention map 53, a person can easily specify the gaze area in the attention map 53 by visually efficiently using his or her own knowledge.
[0054] In this embodiment, the processing unit 5 functions as an input unit by executing step 120, functions as a map correction unit by executing step 140, and functions as an output unit by executing step 160.
[0055] Second embodiment Next, a second embodiment will be described. In this embodiment, learning parameters such as weights and biases of the neural network 10 are corrected based on the attention map corrected according to the human correction operation. That is, the neural network 10 is re-learned based on the corrected attention map.
[0056] The hardware configuration of this embodiment is the same as that shown in Fig. 1 in the first embodiment. The configuration of the trained neural network 10 stored in the memory 4 is also the same as that in the first embodiment. The image recognition device 1 of this embodiment corresponds to a training device.
[0057] One difference between this embodiment and the first embodiment is that the processing unit 5 does not perform the processing of FIG. 4, but instead causes the neural network 10 to generate a classification result corresponding to the input image 51 without modifying the attention map 53.
[0058] That is, the processing unit 5 first reads out the neural network 10 from the memory 4, and then acquires the input image 51 and inputs this input image 51 to the neural network 10, in the same manner as in the first embodiment.
[0059] Then, in the neural network 10, the feature extraction unit 11 and the attention unit 12 function in the same manner as in the first embodiment, and the attention unit 12 generates an attention map 53 and a classification result. This attention map 53 is input to the synthesis unit 13 without being modified by a human, i.e., without being modified. The synthesis unit 13 generates a composite map 54 by synthesizing the feature map 52 and the attention map 53 that has not been modified by a human. The recognition unit 14 generates a classification result based on this composite map 54 in the same manner as in the first embodiment. The processing unit 5 acquires and outputs this classification result in the same manner as in the first embodiment.
[0060] Then, in addition to the process of acquiring the classification result of the input image 51 from the input image 51 using the neural network 10 as described above, the processing unit 5 executes the process shown in Fig. 9 to re-learn the neural network 10. By this re-learning, the neural network 10 is fine-tuned.
[0061] The processing unit 5 starts the process of Fig. 9 based on a predetermined relearning start operation being performed by a human on the operation device 2. In this process, the processing unit 5 uses a data set for relearning. The data set for relearning has multiple groups (10, 100, or 100,000) each consisting of learning images and teacher labels.
[0062] The learning image is data input to the feature extraction unit 11, such as the input image 51. The teacher label is data that is regarded as the correct answer value of the classification result output from the attention unit 12 and the recognition unit 14 when learning images of the same group are input to the feature extraction unit 11.
[0063] The re-learning dataset may be generated in advance and recorded in a non-volatile storage medium of the memory 4, or may be acquired from a data server via a communication network (not shown). In addition, the training images and teacher labels of the re-learning dataset may be the same as those of the training dataset used during initial training of the neural network 10, or may be different from the training dataset.
[0064] 9, the processing unit 5 first executes the loop process of steps 210 and 220 for each group included in the re-learning data set. In each loop process, the processing unit 5 first inputs the learning images in the target group to the feature extraction unit 11 in step 210. Then, in step 220, the processing unit 5 acquires the attention map 53 and the classification result generated by the attention unit 12 based on the input learning images, and the classification result generated by the recognition unit 14 based on the learning images, and records them in the memory 4.
[0065] The method in which the neural network 10 outputs the attention map 53 and the two types of classification results based on the input learning images is the same as the above-mentioned method in which the learning images are replaced with the input images 51. After step 220, one loop process ends.
[0066] When the loop processing is completed for the number of groups, the processing unit 5 proceeds to step 230. At this point, for each group in all re-learning data sets, the attention map 53 and the classification result generated by the attention unit 12 and the classification result generated by the recognition unit 14 are associated with each other and recorded in the memory 4.
[0067] In step 230, the processing unit 5 extracts a group in which erroneous recognition has occurred from among the multiple groups. A group in which the class with the highest likelihood in the classification result output by the recognition unit 14 does not match the class indicated by the teacher label (i.e., the class with the highest likelihood in the teacher label) is extracted as a group in which erroneous recognition has occurred. Alternatively, a group in which the class with the highest likelihood in the classification result output by the attention unit 12 does not match the class indicated by the teacher label may be extracted as a group in which erroneous recognition has occurred. Alternatively, both of these may be extracted. In most cases, multiple groups are extracted.
[0068] Next, in step 240, the attention map 53 recorded in the memory 4 corresponding to each of the groups extracted in the previous step 230 is corrected based on human knowledge. Specifically, the attention map 53 is corrected based on a human correction operation on the operation device 2 by the same process as in step 140 in Fig. 4. Then, the processing unit 5 stores the corrected attention map 53 in the memory 4 as a teacher attention map belonging to the group.
[0069] The teacher attention map created in this way is data that is regarded as the correct answer value of the attention map 53 output from the attention unit 12 when learning images of the same group are input to the feature extraction unit 11. Through this process, the teacher attention map is added to the re-learning dataset.
[0070] Next, in step 250, the processing unit 5 re-trains the neural network 10 based on the two types of classification results, the attention map 53, and the re-learning dataset acquired in the current process of Fig. 9. As described above, the re-learning dataset includes the teacher attention map and the teacher label.
[0071] Specifically, as shown in Fig. 10, the learning parameters such as weights and biases of the attention unit 12 and the recognition unit 14 are updated by the error backpropagation method, with the amount L=Latt+Lper+Lmap consisting of the sum of three learning errors Latt, Lper, and Lmap being the learning error. In Fig. 10, the output layer 14b of the recognition unit 14 and the part 14a preceding the output layer 14b of the recognition unit 14 are shown. In this embodiment, the learning parameters such as weights and biases of the feature extraction unit 11 are not updated.
[0072] Here, Latt is an amount indicating the error between the classification result output by the attention unit 12 when a training image 61 is input to the neural network 10 and the teacher label 60 that belongs to the same group as the training image 61.
[0073] Furthermore, Lper is an amount indicating the error between the classification result output by the feature extraction unit 11 when a training image 61 is input to the neural network 10 and the teacher label 60 that belongs to the same group as the training image 61.
[0074] Furthermore, Lmap is an amount indicating the error between the attention map 53 output by the attention unit 12 when a training image 61 is input to the neural network 10 and the teacher label 60 that belongs to the same group as the training image 61.
[0075] As the learning error Lmap, an L2 norm error may be adopted as shown in the following formula, or another form of error may be adopted. Lmap = γ × ||M'-M||2 Here, M indicates the value of the attention map 53 output by the attention unit 12 when the learning image 61 is input to the neural network 10. M' indicates the value of the corrected attention map corresponding to the same group as the learning image 61. By calculating the error for each element of these two attention maps, the attention unit 12 is trained to output an attention map that is close to human knowledge.
[0076] Here, γ is a coefficient for adjusting the learning error Lmap. Lmap has a larger error value than Latt and Lper. Therefore, by multiplying Lmap by γ, the magnitudes of the three learning errors Lmap, Latt, and Lper can be adjusted. After step 250, the process of FIG. 9 ends, and the re-trained neural network 10 is recorded in the memory 4.
[0077] In this way, fine-tuning of the neural network 10 based on the attention map corrected based on human knowledge improves the image recognition function of the neural network 10. In other words, the accuracy rate of the recognition results generated by the recognition unit 14 when the processing unit 5 inputs various input images 51 to the fine-tuned neural network 10 improves.
[0078] As described above, the processing unit 5 uses the re-learning data set to re-learn the neural network 10 (step 250). The re-learning data set includes a plurality of teacher attention maps.
[0079] In this way, when re-learning the neural network 10 that generates the attention map, the teacher attention map that is regarded as the correct answer value of the attention map is used. Since the teacher attention map is created based on human knowledge, this makes it possible to incorporate human knowledge into the learning of the neural network 10.
[0080] Moreover, the processing unit 5 obtains a plurality of attention maps corresponding to the plurality of learning images by inputting the plurality of learning images to the neural network 10 (steps 210, 220). Then, the processing unit 5 modifies the plurality of attention maps in response to a manual modification operation to obtain a teacher attention map (step 240).
[0081] In this way, a teacher attention map can be generated based on a human correction operation on the attention map generated by the neural network 10. Therefore, it is possible to more directly incorporate human knowledge into the learning of the neural network 10. Moreover, the correction operation is simpler than when a teacher attention map is created from scratch.
[0082] In addition, the multiple teacher attention maps included in the re-learning dataset are only the training images that were erroneously recognized by the neural network 10 before re-learning. In this way, by using many teacher attention maps corresponding to the erroneously recognized training images for re-learning, re-learning can be performed more efficiently. This is because the attention map generated by inputting the erroneously recognized training images is likely to have many errors itself.
[0083] Moreover, the neural network 10 generates a recognition result for the input image 51 based on the input image 51 and the attention map 53. In this way, in the neural network 10 in which not only the input image 51 but also the attention map 53 is fed back as information for image recognition, there is a strong correlation between the recognition result for the input image 51 and the attention map 53. Therefore, in such a neural network 10, the effect of re-learning using the teacher attention map highly contributes to improving the recognition result for the input image 51.
[0084] Moreover, the processing unit 5 re-learns the attention unit 12 without re-learning the feature extraction unit 11. In this way, the part of the neural network 10 that is strongly related to the generation of the attention map 53 is re-learned, thereby achieving highly efficient fine-tuning of the neural network 10.
[0085] In this embodiment, the processing unit 5 functions as a reading unit by executing step 205, functions as a training unit by executing step 250, functions as an acquisition unit by executing steps 210 and 220, and functions as a map correction unit by executing step 240.
[0086] (Other embodiments) The present invention is not limited to the above-mentioned embodiment, and can be modified as appropriate. The above-mentioned embodiments are not unrelated to each other, and can be combined as appropriate, except when the combination is clearly impossible. In the above-mentioned embodiments, the elements constituting the embodiment are not necessarily essential, except when it is specifically stated that they are essential or when it is clearly considered essential in principle. In the above-mentioned embodiments, when the numbers, values, amounts, ranges, etc. of the components of the embodiment are mentioned, they are not limited to the specific numbers, except when it is specifically stated that they are essential or when it is clearly limited to a specific number in principle. In addition, when multiple values are exemplified for a certain amount, it is also possible to adopt a value between those multiple values, except when it is specifically stated otherwise or when it is clearly impossible in principle.
[0087] The present invention also allows the following modifications and modifications within an equivalent scope to the above-described embodiments. Note that the following modifications can be independently applied or not applied to the above-described embodiments. In other words, any combination of the following modifications can be applied to the above-described embodiments.
[0088] (Variation 1) The image recognition device 1 may have both the functions of the first embodiment (i.e., image recognition using an attention map modified based on human knowledge) and the functions of the second embodiment (i.e., re-learning using an attention map modified based on human knowledge).
[0089] (Variation 2) In the above embodiment, a classification result is given as an example of the recognition result output by the attention unit 12 and the recognition unit 14. However, the recognition result output by the attention unit 12 and the recognition unit 14 is not limited to a classification result, and may be a result by regression. In other words, the image recognition performed by the neural network 10 may be classification or regression.
[0090] (Variation 3) In the first embodiment, the neural network 10 has a feature extraction unit 11, an attention unit 12, a synthesis unit 13, and a recognition unit 14. However, the neural network for realizing image recognition using an attention map corrected based on human knowledge is not limited to such a configuration. In other words, if the neural network generates an attention map based on an input image and generates an image recognition result based on the input image and the attention map, the image recognition function can be improved by correcting the attention map.
[0091] (Variation 4) In the second embodiment, the neural network 10 has a feature extraction unit 11, an attention unit 12, a synthesis unit 13, and a recognition unit 14. However, it may be modified based on human knowledge. However, the neural network for realizing re-learning using the attention map modified based on human knowledge is not limited to such a configuration. That is, if it is a neural network that generates an attention map and an image recognition result based on an input image, the image recognition function can be improved by re-learning using the modified attention map. For example, a neural network such as CAM (Class Activation Mapping) described in Non-Patent Document 2 may be re-learned using an attention map modified based on human knowledge.
[0092] (Variation 5) In the first embodiment, the processing unit 5 reflects the correction corresponding to the correction operation by the person in the attention map in a state where the input image 51 is transparently superimposed on the attention map 53 and displayed on the display device 3. However, this is not necessarily required. For example, the processing unit 5 may reflect the correction corresponding to the correction operation by the person in the attention map in a state where the input image 51 and the attention map 53 are displayed side by side without overlapping on the display device 3. Also, for example, the processing unit 5 may reflect the correction corresponding to the correction operation by the person in the attention map in a state where the attention map 53 is displayed on the display device 3 and the input image 51 is not displayed on the display device 3.
[0093] (Variation 6) In the above first and second embodiments, as a method for correcting an attention map, a method is shown in which only the values of some pixels in the attention map generated by the attention unit 12 are changed and the values of the remaining pixels are not changed. In other words, a method is shown in which a change is made to the attention map generated by the attention unit 12.
[0094] However, the method of correcting the attention map is not necessarily limited to this method. For example, a new attention map may be created from scratch in addition to the attention map output by the attention unit 12 when an image is input to the neural network 10. In this case, in the first embodiment, this new attention map is input to the synthesis unit 13, and in the second embodiment, this new attention map becomes the teacher attention map.
[0095] A method for creating a new attention map may be, for example, as follows. First, a person looks at the image input to the neural network 10 and determines the position range of the gaze area. Then, the person may operate a computer to create a new attention map that reflects the determined position range of the gaze area. This computer may be the image recognition device 1 or another device.
[0096] (Variation 7) In the above second embodiment, the teacher attention map used for re-learning is only the teacher attention map corresponding to the learning images erroneously recognized by the neural network 10 before re-learning. However, the teacher attention map used for re-learning may include the teacher attention map corresponding to the learning images correctly recognized by the neural network 10 before re-learning.
[0097] Even in this case, if the number of teacher attention maps corresponding to erroneously recognized learning images is greater than the number of teacher attention maps corresponding to correctly recognized learning images, re-learning can be performed with high efficiency.
[0098] Alternatively, the number of teacher attention maps corresponding to erroneously recognized training images may be smaller than the number of teacher attention maps corresponding to correctly recognized training images.
[0099] (Variation 8) In the above embodiment, in the re-learning of the neural network 10, the feature extraction unit 11 is not re-learned, and only the attention unit 12 and the recognition unit 14 are re-learned. The re-learning of the neural network 10 is not limited to this form. For example, the feature extraction unit 11 and the recognition unit 14 may not be re-learned, and only the attention unit 12 may be re-learned. Alternatively, for example, only the feature extraction unit 11 may be re-learned, and the attention unit 12 and the recognition unit 14 may not be re-learned. Alternatively, for example, the feature extraction unit 11 and the recognition unit 14 may be re-learned, and the attention unit 12 may not be re-learned.
[0100] It is also permissible to retrain the feature extraction unit 11, attention unit 12, and recognition unit 14. In this case, the retraining of the neural network 10 is not fine tuning.
[0101] (Variation 9) In the above embodiment, the re-learning is performed using the error backpropagation method with three learning errors, Lmap, Latt, and Lper. However, it is not necessary to use all of Lmap, Latt, and Lper. For example, only Lmap may be used. [Explanation of symbols]
[0102] Reference Signs List 1: image recognition device, 2: operation device, 3: display device, 4: memory, 5: processing unit, 10: neural network, 11: feature extraction unit, 12: attention unit, 13: synthesis unit, 14: recognition unit, 51: input image, 52: feature map, 53: attention map, 54: synthesis map, 60: teacher label, 61: learning image
Claims
1. an input unit (120) for inputting an image (51) to the neural network (10); a map correction unit (140) that corrects, when the neural network generates a feature map (52) including features of the input image and an attention map (53) expressing a gaze area of the input image, the generated attention map in response to a correction operation by a person; An image recognition device comprising: a composite map (54) in which the corrected attention map and the feature map are combined; and an output unit (160) that outputs the generated recognition result when the neural network (10) generates a recognition result for the image based on the image.
2. The neural network includes a feature extraction unit (11), an attention unit (12), a synthesis unit (13), and a recognition unit (14), The feature extraction unit includes a plurality of convolution layers, and generates the feature map (52) by propagating information of the image through the plurality of convolution layers; The attention unit generates the attention map based on the feature map; The synthesis unit synthesizes the feature map and the modified attention map to generate the synthesis map; The image recognition device according to claim 1 , wherein the recognition unit generates the recognition result based on the composite map.
3. The image recognition device of claim 1 or 2, characterized in that the map correction unit reflects corrections corresponding to the correction operation in the attention map while the image is transparently overlaid on the attention map and displayed on a display device (3).
4. A program used in an image recognition device that outputs a recognition result of an input image (51), An input unit (120) for inputting the image into the neural network (10); a map correction unit (140) that corrects, when the neural network generates a feature map (52) including features of the input image and an attention map (53) expressing a gaze area of the input image, the generated attention map in response to a correction operation by a person; A program that causes the image recognition device to function as an output unit (160) that outputs a recognition result generated when the neural network (10) generates a recognition result for the image based on a composite map (54) in which the modified attention map and the feature map are combined and the image.
