Information processing apparatus and information processing program
By training a classification model with a specific number of samples and an XAI model with fewer samples, the method improves model interpretability by visually highlighting the model's focus and supporting user-driven selection of optimal learning states.
Patent Information
- Application Number
- JP2023035278
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2023-03-08
- Publication Date
- 2024-09-20
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing anomaly detection models, such as image recognition models, suffer from poor interpretability due to saliency maps showing reactions at the same location regardless of the inference result, leading to difficulties in understanding the model's decision-making process.
The method involves training a classification model with a predetermined number of data samples and an XAI model with fewer samples, allowing the generation of a saliency map that highlights the model's focus during inference, supported by a user interface showing learning curves and feature distributions to select an appropriate learning state.
This approach enhances the interpretability of the trained model by visually indicating the model's focus, enabling users to understand the inference process and improve model selection based on learning states.
Smart Images

Figure 2024126705000001
Abstract
Description
[Technical field]
[0001] The present invention relates to an information processing device and an information processing program. [Background technology]
[0002] Functions such as anomaly detection using trained models are being put to practical use in production sites. There is a technology that visualizes how such trained models make decisions. This type of technology is sometimes called Explainable AI (XAI).
[0003] For example, in an image recognition model, a technique is known that uses a saliency map to visualize which part of the input is the basis for an inference between an input and a corresponding inference (for example, Non-Patent Document 1, etc.). [Prior art documents] [Non-patent literature]
[0004] [Non-Patent Document 1] "Grad-CAM: Visual Explanations from Deep Networks via Gradient-based Localization", Ramprasaath R. Selvaraju, Michael Cogswell, Abhishek Das, Ramakrishna Vedantam, Devi Parikh, Dhruv Batra, 2017 IEEE International Conference on Computer Vision (ICCV), 22-29 October 2017,<URL:https: / / arxiv.org / abs / 1610.02391> Summary of the Invention [Problem to be solved by the invention]
[0005] For example, in the case of a task that involves classification based on images of a workpiece, a response may occur in the same location on the visualized saliency map regardless of the inference result, resulting in low interpretability.
[0006] One object of the present invention is to provide a method for improving the interpretability of a trained model. [Means for solving the problem]
[0007] An information processing device according to one example of the present invention includes a learning unit that sequentially learns a model using a plurality of learning data and sequentially stores data indicating a state of the model during learning, a determination unit that determines a model in a state trained using a first number of the plurality of learning data as a first model, and in accordance with a user operation, determines a model in a state trained using a second number of the plurality of learning data that is less than the first number as a second model, and a generation unit that generates a saliency map based on the output of the second model.
[0008] According to this configuration, the first model can be used to perform the original inference, and the second model can be used to visually grasp the part that the first model focused on when performing the inference.
[0009] The determination unit may generate a user interface screen including a learning curve indicating a change in at least one of the error and the accuracy of the model with respect to the number of learning data used for learning, and output a model in a selected state as the second model in response to a user operation on the user interface screen. According to this configuration, by providing a user interface screen including the learning curve, it is possible to assist the user in selecting an appropriate learning state for the second model.
[0010] The determination unit may generate a user interface screen including the evaluation result of the accuracy of the model in the specified learning state. With this configuration, by providing the user interface screen including the evaluation result of the accuracy of the model, it is possible to assist the user in selecting an appropriate learning state for the second model.
[0011] The determination unit may generate a user interface screen including a distribution of features output by the model in a specified learning state. With this configuration, by providing a user interface screen including the distribution of features, it is possible to assist a user in selecting an appropriate learning state for the second model.
[0012] The determination unit may generate a user interface screen including a saliency map generated based on the output of the model in the specified learning state. According to this configuration, by providing the user interface screen including the saliency map, it is possible to assist the user in selecting an appropriate learning state for the second model.
[0013] An information processing program according to another example of the present invention causes a computer to execute the steps of: sequentially learning a model using a plurality of learning data and sequentially storing data indicating a state of the model during learning; determining a model in a state trained using a first number of the plurality of learning data as a first model; and determining, in accordance with a user operation, a model in a state trained using a second number of the plurality of learning data that is less than the first number as a second model. The second model is associated with a generation unit for generating a saliency map based on an output of the second model.
[0014] An information processing device according to yet another example of the present invention includes a calculation unit that inputs input data to a first model and calculates an inference result, and a generation unit that generates a saliency map based on an output obtained by inputting the input data to a second model. The first model is a model trained using a first number of training data, and the second model is a model trained using a second number of training data that is smaller than the first number.
[0015] According to this configuration, the first model can be used to perform the original inference, and the second model can be used to visually grasp the portion that the first model focused on when performing the inference.
[0016] The information processing device may display and output the input data and the saliency map side by side. With this configuration, when an inference result is incorrect, it is possible to assist in identifying the cause based on the input data and the saliency map that suggests the reason why the inference result was output.
[0017] The first model and the second model may receive an input image as input data and output a classification result for the input image as an inference result. With this configuration, a classification task for the input image can be realized using the first model. Effect of the Invention
[0018] According to the present invention, it is possible to improve the interpretability of a trained model. [Brief description of the drawings]
[0019] [Figure 1] FIG. 2 is a diagram showing an example of a saliency map generated by the XAI technique according to the related art. [Diagram 2] 13 is a diagram showing an example of a saliency map generated by the XAI method according to the present embodiment. FIG. [Diagram 3] 1 is a schematic diagram showing an example of a hardware configuration of an information processing device according to an embodiment of the present invention; [Figure 4]It is a schematic diagram showing a software configuration example of an information processing apparatus according to the present embodiment. [Diagram 5] It is a diagram showing an example of a learning curve of a classification model and a model used for an XAI model according to the present embodiment. [Figure 6] It is a diagram for explaining an example of an XAI method according to the present embodiment. [Figure 7] It is a diagram showing an example of accuracy calculated during model learning according to the present embodiment. [Figure 8] It is a diagram showing an example of the distribution of XAI images and image feature amounts calculated during model learning according to the present embodiment. [Figure 9] It is a diagram showing an example of a user interface screen provided by the information processing apparatus according to the present embodiment. [Figure 10] It is a schematic diagram showing an example of data sequentially stored in a database by the information processing apparatus during the learning process according to the present embodiment. [Figure 11] It is a diagram showing a configuration example of a model generated by the information processing apparatus during the learning process according to the present embodiment. [Figure 12] It is a flowchart showing a processing procedure of the learning process of the information processing apparatus according to the present embodiment. [Figure 13] It is a flowchart showing a processing procedure of the operation process of the information processing apparatus according to the present embodiment.
Embodiments for Carrying Out the Invention
[0020] Embodiments of the present invention will be described in detail with reference to the drawings. Note that the same or corresponding parts in the drawings are denoted by the same reference numerals and their descriptions will not be repeated.
[0021] In this specification, the term "or" includes the meaning of "and" in addition to the meaning of "or".
[0022] <A. Application Examples> An example of a situation in which the present invention is applied will be described below. In the following, a task of classifying a workpiece (e.g., whether or not there is an abnormality) based on an image of the workpiece will be described, but the present invention can be applied to various tasks.
[0023] In the following description, a saliency map generated by the XAI method from an arbitrary trained model will be described. The saliency map generated by the XAI method visualizes the part focused on by the trained model to output the inference result, and is also called a heat map. Hereinafter, the image of the saliency map will also be called an "XAI image." In other words, the image generated by the XAI method is an XAI image.
[0024] Fig. 1 is a diagram showing an example of a saliency map generated by an XAI technique according to the related art. Fig. 1 shows an example of the result of a task to evaluate the state of a top seal 22 based on an input image 20 captured by a pillow packaging machine.
[0025] The task shown in Fig. 1 is to classify an input image 20 into three classes: "OK" (normal), "NG Lv.1" (abnormality 1), and "NG Lv.2" (abnormality 2). A trained model that performs three-class classification (hereinafter also referred to as a "classification model") outputs a value indicating the possibility (probability) for each class. Note that abnormality 1 and abnormality 2 refer to different abnormality modes.
[0026] An input image 20 is input as input data to the model according to this embodiment. The model outputs a classification result for the input image 20 as an inference result 30.
[0027] Fig. 1 shows input images 20 for each class and a saliency map 12 generated by the XAI method according to the related art side by side. As shown in Fig. 1, in the saliency map 12 generated by the XAI method according to the related art, the entire top seal 22 responds for each class, making it difficult to know from which part of the top seal 22 the feature amount was calculated. In other words, the saliency map 12 generated by the XAI method according to the related art has low interpretability of the classification model.
[0028] Fig. 2 is a diagram showing an example of a saliency map generated by the XAI method according to the present embodiment. Like Fig. 1, Fig. 2 shows an example of the result of a task to evaluate the state of a top seal 22 based on an input image 20 captured by an image capturing device for a workpiece packaged by a pillow packaging machine.
[0029] 2 shows an input image 20 for each class, an XAI image 24 output by an XAI model with insufficient learning, and an XAI image 26 output by an XAI model with sufficient learning. The XAI model is a trained model for outputting a saliency map. The XAI model with insufficient learning has a relatively small number of samples input in learning, and the XAI model with sufficient learning has a relatively large number of samples input in learning.
[0030] Referring to Figure 2, the XAI image 26 output by a fully trained XAI model shows responses across the entire top seal 22 for all classes, similar to the saliency map 12 output by an XAI model according to the related technology shown in Figure 1, resulting in low interpretability of the classification model.
[0031] In contrast, the XAI image 24 output by the XAI model with insufficient learning shows that attention is focused on the characteristic parts of each class. In other words, the XAI image 24 output by the XAI model with insufficient learning has high interpretability for the classification model.
[0032] In the present embodiment, it is based on a new finding that the interpretability of the classification model can be enhanced by using the XAI image output by the XAI model lacking such learning.
[0033] In the present embodiment, the classification model 162 (first model) is a model learned using a predetermined number (first number) of learning data. On the other hand, the XAI model 164 (second model) is a model learned using a number (second number) of learning data less than the predetermined number.
[0034] <B. Hardware Configuration Example> Next, a hardware configuration example of the information processing apparatus 100 will be described.
[0035] FIG. 3 is a schematic diagram showing a hardware configuration example of the information processing apparatus 100 according to the present embodiment. Referring to FIG. 3, the information processing apparatus 100 is an example of a computer and includes one or more processors 102, a memory 104, a storage 106, a display output unit 114, an input unit 116, and an interface circuit 118.
[0036] One or more processors 102 provide the following processes and functions by executing computer-readable instructions included in the programs stored in the storage 106. When one or more processors 102 execute the computer-readable instructions included in the program, part or all of the program may be expanded in the memory 104.
[0037] The storage 106 is a non-transitory computer-readable medium. For example, an OS (Operating System) 108, a model generation program 110, and a model operation program 112 are stored in the storage 106. The OS 108 includes computer-readable instructions for providing functions necessary for the computer and computer-readable instructions for generating an environment for executing the model generation program 110.
[0038] The model generation program 110 corresponds to the information processing program according to the present invention and includes computer-readable instructions for generating a learned model as described later.
[0039] The model operation program 112 corresponds to the information processing program according to the present invention and includes computer-readable instructions for operating a learned model as described later.
[0040] The display output unit 114 displays and outputs the processing result by the processor 102, etc. Here, "display output" means outputting data or a signal for displaying a display screen to a display possessed by the information processing apparatus 100 or a display existing outside the information processing apparatus 100.
[0041] The input unit 116 receives user operations. The input unit 116 may include, for example, a keyboard or a mouse, or may include an interface for connecting to a keyboard or a mouse. Further, the input unit 116 may include a device capable of touch operations such as a touch panel integrated with a display.
[0042] The interface circuit 118 acquires image data from the camera 50 arranged on a manufacturing line or the like.
[0043] In this specification, the term "processor" includes not only an arithmetic circuit that performs processing by executing computer-readable instructions such as a CPU (Central Processing Unit), but also a hardwired circuit. Examples of the hardwired circuit include an ASIC (Application Specific Integrated Circuit) or an FPGA (Field Programmable Gate Array).
[0044] <C. Software Configuration Example> Next, a software configuration example of the information processing apparatus 100 according to the present embodiment will be described.
[0045] 4 is a schematic diagram showing an example of a software configuration of information processing device 100 according to the present embodiment. With reference to FIG. 4, information processing device 100 includes database 150, operation unit 160, learning unit 166, model determination unit 168, and XAI visualization unit 170.
[0046] The database 150 corresponds to a storage unit, and may be realized using the storage 106 (FIG. 3), or may be realized using a storage device external to the information processing device 100, or a storage device connected via a network. The learning unit 166, the model determination unit 168, and the XAI visualization unit 170 may be realized by one or more processors 102 of the information processing device 100 executing the model generation program 110. The operation unit 160 may be realized by one or more processors 102 of the information processing device 100 executing the model operation program 112.
[0047] The database 150 stores an input image 20 acquired from a camera 50 arranged on the production line 10 or the like, an XAI image 24 generated by the XAI method during the learning process, model parameters 165, and image features 180.
[0048] The operation unit 160 corresponds to a calculation unit, and operates a classification model 162 that performs classification on the input image 20, and an XAI model 164 that outputs an XAI image 24 for the input image 20. More specifically, the operation unit 160 inputs the input image 20 (input data) to the classification model 162 to calculate the inference result 30. The operation unit 160 also inputs the input image 20 (input data) to the XAI model 164. The inference result output from the XAI model 164 is used for processing in the XAI visualization unit 170, as described below.
[0049] In this way, in the course of operation, the input image 20 is input to the classification model 162, and the inference result 30 is output. The inference result 30 indicates, for example, a classification result. The inference result 30 is output to a control device or the like disposed on the production line 10 or the like.
[0050] The learning unit 166 learns models used for the classification model 162 and the XAI model 164. The learning unit 166 sequentially learns the models using a plurality of learning data (e.g., a data set consisting of the input images 20 to which correct labels are assigned) and sequentially stores data (e.g., model parameters 165) indicating the state of the model during learning in the database 150 (storage unit). The learning unit 166 may sequentially store the input images 20, the XAI images 24, and the image features 180 in the database 150 in addition to the model parameters 165.
[0051] The model determination unit 168 corresponds to a determination unit, and generates a user interface screen as shown in Fig. 9 described later, and accepts user operations. The model determination unit 168 determines a model trained using a predetermined number of pieces of training data as the classification model 162, and determines a model trained using a number of pieces of training data less than the predetermined number as the XAI model 164 in accordance with user operations.
[0052] The XAI visualization unit 170 corresponds to a generation unit, and generates the XAI image 24 (saliency map) based on the output of the XAI model 164. More specifically, the XAI visualization unit 170 generates the XAI image 24 based on the inference result of the XAI model 164, a feature map, and the like.
[0053] Even during operation, the XAI visualization unit 170 generates an XAI image 24 (saliency map) based on the inference result (output) obtained by inputting the input image 20 into the XAI model 164.
[0054] Note that FIG. 4 shows an example of a software configuration realized in a single information processing apparatus 100, but it may be realized by a plurality of apparatuses, or some functions may be realized using computing resources such as a cloud. Further, the apparatus for learning the learned models (classification model 162 and XAI model 164) and the apparatus for operating the learned models (classification model 162 and XAI model 164) may be separate entities.
[0055] For example, the information processing apparatus 100 that operates the learned model may be a control apparatus such as a PLC (Programmable Logic Controller).
[0056] <D. Classification Model and XAI Model> Next, the learning and generation of the classification model 162 and the XAI model 164 will be described.
[0057] In the present embodiment, the model structures of the classification model 162 and the XAI model 164 are substantially the same. However, the learning states are different between the classification model 162 and the XAI model 164.
[0058] Any type of model may be used for the classification model 162 and the XAI model 164. For example, assuming a classification task for the input image 20, as the model (classification model 162 and XAI model 164), for example, VGG, ResNet, MobileNet, or EfficientNet can be used. Note that it is not limited to the classification task, and any task may be used. Further, a model corresponding to the task may be selected.
[0059] FIG. 5 is a diagram showing an example of a learning curve of a model used in the classification model 162 and the XAI model 164 according to the present embodiment. FIG. 5 shows a change in model error with respect to the number of samples (per epoch). FIG. 5 shows an error for the learning data used to learn the model and an error for validation data different from the learning data. Note that the learning data and validation data can be prepared by dividing a set of acquired input images 20 by a cross-validation method (e.g., K-cross-validation, etc.).
[0060] As shown in Figure 5, we can see that the error of the model for the training data decreases as the number of training samples increases. On the other hand, we can see that the error of the model for the validation data increases halfway through as the number of training samples increases. In other words, this shows that an excessive increase in the number of training samples can cause the model to become overfitted.
[0061] Therefore, a model in an appropriate learning state, neither underlearned nor overlearned, is used as the classification model 162. By using a model in an appropriate learning state, high versatility and high accuracy can be expected.
[0062] In contrast, an under-learned model is used as the XAI model 164. As described above, by using a model in an under-learned state, the interpretability of the classification model can be improved.
[0063] The information processing device 100 according to the present embodiment provides a user interface screen, as described below, in the model learning process so that an appropriate learning state can be grasped as the XAI model 164. Furthermore, the information processing device 100 sequentially stores the model (model parameters 165) in the database 150 in the learning process.
[0064] It should be noted that the vertical axis of the learning curve shown in Fig. 5 may use precision instead of or in addition to the error. The lower the error, the better the model, and the higher the precision, the better the model.
[0065] <XAI method> Next, an XAI method for generating the XAI image 24 will be described. For example, as an XAI method for visualization using a saliency map, any algorithm such as Grad-CAM, XGrad-CAM, ScoreCAM, or Eigen-CAM can be used.
[0066] FIG. 6 is a diagram for explaining an example of the XAI method according to the present embodiment. FIG. 6 shows an example of using the Grad-CAM algorithm as the XAI method.
[0067] Referring to FIG. 6, the models (classification model 162 and XAI model 164) include, for example, a CNN (Convolutional Neural Network) 1620 and a fully-connected layer (FC: Fully-Connected layer) 1622.
[0068] In the learning of the models (classification model 162 and XAI model 164) shown in FIG. 6, the information processing apparatus 100 inputs learning data (input image 20 with a correct label) to the CNN 1620 to calculate a feature map 190, inputs the feature map 190 to the fully-connected layer 1622, and outputs an inference result 30. When performing 3-class classification as described above, the number of output classes is "3". Subsequently, the information processing apparatus 100 updates the model parameters 165 of the CNN 1620 based on the error between the inference result 30 and the correct label by the error backpropagation method.
[0069] The XAI image 24 is generated from the feature map 190 output from the CNN 1620. More specifically, the information processing apparatus 100 inputs the input image 20 to the CNN 1620 to calculate a feature map 190, inputs the feature map 190 to the fully-connected layer 1622, and outputs an inference result 30 (step S1).
[0070] Subsequently, the information processing apparatus 100 calculates the gradient 192 from the inference result 30 to the feature map 190 output from the final layer of the CNN 1620 (step S2).
[0071] The information processing apparatus 100 executes GAP (Global Average Pooling) processing on the gradient 192 up to the feature map 190 (step S3). By the GAP processing, a pooling result 194 with the dimensionality of the gradient 192 up to the feature map 190 reduced is generated.
[0072] Subsequently, the information processing apparatus 100 calculates a weighted sum of the feature map 190 and the pooling result 194, and inputs the weighted sum to an activation function 1640 (for example, ReLU (Rectified Linear Unit), etc.) to generate the XAI image 24 (step S4).
[0073] In addition to or instead of generating the XAI image 24, the information processing apparatus 100 may calculate features with the dimensionality of the feature map 190 compressed. Specifically, the information processing apparatus 100 executes GAP processing on the sequentially output feature maps 190 in accordance with the learning of the classification model 162 (step S5). By the GAP processing, a pooling result 196 with the dimensionality of the feature map 190 reduced is generated.
[0074] Subsequently, the information processing apparatus 100 further compresses the dimensionality of the pooling result 196 to calculate two-dimensional image features 180 (step S6). As a dimensionality compression method, an algorithm such as PCA (Principal Component Analysis) or UMAP (Uniform Manifold Approximation and Projection) can be used.
[0075] <Generation of XAI Model 164> Next, the process of generating the XAI model 164 will be described.
[0076] As described above, a model in an under-learned state is used for the XAI model 164. The user may confirm that the model is in an under-learned state, and the information processing device 100 may determine the model in an under-learned state as the XAI model 164 in accordance with a user operation. Also, the information processing device 100 may present the model in an under-learned state as a candidate for the XAI model 164.
[0077] The accuracy of the model or image features may be used to determine whether the model is in an undertrained state.
[0078] For example, the information processing device 100 may receive a specification of the required accuracy of the classification model 162, and present as a candidate for the XAI model 164 a model with as few epochs (number of samples) as possible for the specified required accuracy.
[0079] FIG. 7 is a diagram showing an example of accuracy calculated during model learning according to the present embodiment. For example, if a required accuracy is specified as a macro average (F1-Score) of 0.95 or higher, the learning state with the smallest number of epochs (number of samples) that meets the specified required accuracy is presented as a candidate for XAI model 164.
[0080] Fig. 7(A) shows an example of the accuracy of classification model 162 when the number of epochs is 10, and Fig. 7(B) shows an example of the accuracy of classification model 162 when the number of epochs is 40. For both accuracies, the macroavg is equal to or greater than "0.95," and classification model 162 in the state shown in Fig. 7(A) with a small number of epochs is presented as a candidate for XAI model 164.
[0081] Furthermore, the information processing device 100 may visualize a state during model learning. The state during model learning may be, for example, the XAI image 24 itself, or the distribution 182 of the image feature amount 180 calculated from the feature amount map 190.
[0082] FIG. 8 is a diagram showing an example of the XAI image 24 and a distribution 182 of image features 180 calculated during model learning according to the present embodiment.
[0083] Figure 8 (A) shows an example of a distribution 182 of XAI images 24 and image features 180 output from classification model 162 when the number of epochs is 10, and Figure 7 (B) shows an example of a distribution 182 of XAI images 24 and image features 180 output from classification model 162 when the number of epochs is 40.
[0084] The user can also check the distribution 182 of the XAI image 24 or the image feature amount 180 to determine an appropriate learning state for the XAI model 164. The information processing device 100 may determine the model of the selected learning state as the XAI model 164 in accordance with a user operation.
[0085] In this manner, the user may qualitatively determine the XAI model 164 by checking the XAI image 24 or the distribution 182 of the image features 180.
[0086] Fig. 9 is a diagram showing an example of a user interface screen 200 provided by information processing device 100 according to the present embodiment. Referring to Fig. 9, user interface screen 200 includes a learning curve 210, an accuracy evaluation result 220, and a distribution 230 of image features.
[0087] The learning curve 210 indicates a change in the error or accuracy of the model generated during the learning process. The information processing device 100 generates a user interface screen 200 including a learning curve 210 indicating a change in at least one of the error and accuracy of the model with respect to the number of learning data used in learning.
[0088] The information processing device 100 displays a classification model position 214 at the position of the learning state determined as the classification model 162 in association with the learning curve 210, and displays a recommended position 216 at the position of the learning state calculated to be suitable for the XAI model 164.
[0089] The information processing device 100 changes the position display 213 in response to a user's operation of the slider 212. In response to a user's selection of the selection button 218, the information processing device 100 determines the model corresponding to the learning state in which the position display 213 is displayed as the XAI model 164. In this way, the information processing device 100 determines the model in the selected state as the XAI model 164 in response to a user operation on the user interface screen 200.
[0090] The information processing device 100 updates the display contents of the accuracy evaluation result 220 in response to a user's operation of the slider 212. A required accuracy 222 designated in advance may be displayed together with the accuracy evaluation result 220. In this manner, the information processing device 100 generates a user interface screen 200 including the evaluation result of the accuracy of the model (accuracy evaluation result 220) in a designated learning state.
[0091] The information processing device 100 updates the distribution 182 of the image features 180 in response to the user's operation of the slider 212. In this manner, the information processing device 100 generates a user interface screen 200 including the distribution 182 of the image features 180 (distribution of features) output by the model in a specified learning state.
[0092] When any of the samples (image features) of the distribution 182 of the image features 180 is selected by the pointer 234, the information processing device 100 may display the input image 20 and the XAI image 24 corresponding to the selected sample. In this manner, the information processing device 100 generates a user interface screen 200 including a saliency map (XAI image 24) generated based on the output of the model. By displaying the input image 20 and the XAI image 24, the user can visually confirm the state of learning.
[0093] The information processing device 100 may appropriately change the calculation algorithm of the image feature amount used for the distribution 182 of the image feature amount 180 in response to a selection made by the user on the pull-down menu 232.
[0094] In this way, the information processing apparatus 100 provides a user interface screen so that the user can determine the XAI model 164.
[0095] FIG. 10 is a schematic diagram showing an example of data sequentially stored in the database 150 by the information processing apparatus 100 in the learning process. Referring to FIG. 10, the information processing apparatus 100 sequentially stores the model parameters 165, the XAI image 24, and the image feature amount 180 in the database 150 in association with the number of epochs.
[0096] When any number of epochs is specified, the information processing apparatus 100 generates the classification model 162 and the XAI model 164 by reflecting the model parameters 165 corresponding to the specified number of epochs in the model.
[0097] FIG. 11 is a diagram showing a configuration example of a model generated by the information processing apparatus 100 according to the present embodiment in the learning process.
[0098] Referring to FIG. 11, the information processing apparatus 100 generates a classification model 162 including the appropriately learned CNN 1620A and the fully connected layer 1622A, and an XAI model 164 including the under-learned CNN 1620B and the fully connected layer 1622B. The XAI model 164 is associated with an XAI visualization unit 170 for generating the XAI image 24 by an XAI method. The XAI visualization unit 170 includes, for example, an activation function 1640.
[0099] <G. Example of processing procedure> Next, an example of a processing procedure executed by the information processing apparatus 100 according to the present embodiment will be described.
[0100] (g1: Learning process) FIG. 12 is a flowchart showing the processing procedure of the learning process of the information processing apparatus 100 according to the present embodiment. Each step shown in FIG. 12 may be realized by one or a plurality of processors 102 of the information processing apparatus 100 executing the model generation program 110.
[0101] 12, the information processing device 100 selects one epoch from among the learning data (the input image 20 to which the correct answer label is assigned) divided into a plurality of epochs (step S100). Then, the information processing device 100 selects one piece of learning data included in the selected epoch (step S102).
[0102] The information processing device 100 inputs the selected input image 20 of the learning data to a model for generating a classification model 162 and an XAI model 164 (step S104). The information processing device 100 updates the model parameters 165 based on the error between the inference result of the model and the correct label assigned to the input learning data (step S106).
[0103] The information processing device 100 also acquires a feature map 190 calculated by inputting the input image 20 of the selected learning data into the model, and calculates a gradient 192 from the inference result 30 to the feature map 190 (step S108). Then, the information processing device 100 generates an XAI image 24 based on the feature map 190 and the gradient 192 from the inference result 30 to the feature map 190 (step S110).
[0104] Moreover, the information processing device 100 calculates the image feature amount 180 from the feature amount map 190 calculated by inputting the input image 20 into the model (step S112).
[0105] The order of steps S104 and S106 and steps S108 to S112 may be arbitrary. The process of steps S104 and S106 and the process of steps S108 to S112 may be executed in parallel. The generation of the XAI image 24 (step S110) may be executed only for the last input image 20 of each epoch.
[0106] The information processing device 100 determines whether or not all of the learning data included in the selected epoch has been selected (step S114). If there is any learning data that has not been selected (NO in step S114), the processing from step S102 onwards is repeated.
[0107] If all the learning data have been selected (YES in step S114), the information processing device 100 stores the model parameters 165, the XAI image 24, and the image feature amount 180 in the database 150 in association with the number of epochs (step S116).
[0108] The information processing device 100 determines whether or not all the prepared epochs have been selected (step S118). If an epoch remains that has not been selected (NO in step S118), the processes from step S100 onwards are repeated.
[0109] In this manner, the information processing device 100 sequentially learns a model using a plurality of epochs (learning data), and sequentially stores data indicating the state of the model during learning in the database 150 (steps S100 to S118).
[0110] If all of the prepared epochs have been selected (YES in step S118), the information processing device 100 generates information necessary to determine the XAI model 164 based on the stored model parameters 165, the XAI image 24, and the image features 180 (step S120), and displays and outputs a user interface screen including the generated information (step S122).
[0111] The information processing device 100 determines a model in a predetermined learning state as the classification model 162 in accordance with a user operation, and determines a model in a specified learning state as the XAI model 164 (step S124). Then, the process ends.
[0112] In this way, the information processing device 100 determines a model in a state trained using a predetermined number of epochs among the multiple epochs (learning data) as the classification model 162. Also, the information processing device 100 determines a model in a state trained using a number of epochs among the multiple epochs (learning data) that is less than the predetermined number as the XAI model 164.
[0113] In addition, in step S124, an XAI visualization unit 170 associated with the XAI model 164 may also be generated.
[0114] (g2: Operation process) 13 is a flowchart showing a processing procedure of the operation process of the information processing device 100 according to this embodiment. Each step shown in FIG. 13 may be realized by one or more processors 102 of the information processing device 100 executing the model operation program 112.
[0115] 13, when a new input image 20 is input (YES in step S200), information processing device 100 inputs input image 20 to classification model 162 (step S202), and outputs inference result 30 (step S204).
[0116] Moreover, the information processing device 100 inputs the input image 20 to the XAI model 164 (step S206), and calculates the feature map 190 and the gradient 192 from the inference result 30 to the feature map 190 (step S208). Then, the information processing device 100 generates the XAI image 24 based on the feature map 190 and the gradient 192 from the inference result 30 to the feature map 190 (step S210).
[0117] The order of execution of steps S202 and S204 and steps S206 to S210 does not matter. Also, the processing of steps S202 and S204 and the processing of steps S206 to S210 may be executed in parallel.
[0118] The processes of steps S200 to S210 are repeated every time the input image 20 is input.
[0119] During operation, the information processing apparatus 100 may also display and output the input image 20 and the XAI image 24 side by side in addition to the inference result 30 for the input image 20.
[0120] <H. Supplementary Note> The present embodiment as described above includes the following technical ideas.
[0121] [Configuration 1] A learning unit (166) that sequentially learns a model using a plurality of learning data and sequentially stores data (165) indicating a state during the learning of the model; A determination unit (168) that determines a model in a state learned using a first number of learning data among the plurality of learning data as a first model (162), and according to a user operation, determines a model in a state learned using a second number of learning data less than the first number among the plurality of learning data as a second model (164); An information processing apparatus comprising a generation unit (170) that generates a saliency map based on the output of the second model.
[0122] [Configuration 2] The determination unit generates a user interface screen (200) including a learning curve (210) indicating at least one of a change in error and accuracy of the model with respect to the number of learning data used for learning, and determines a model in a selected state as the second model according to a user operation on the user interface screen, the information processing apparatus according to Configuration 1.
[0123] [Configuration 3] The determination unit generates a user interface screen (200) including an evaluation result (220) of the accuracy of the model in a specified learning state, the information processing apparatus according to Configuration 1 or 2.
[0124] [Configuration 4] 4. The information processing device according to any one of configurations 1 to 3, wherein the determination unit generates a user interface screen (200) including a distribution (182) of features output by the model in a specified learning state.
[0125] [Configuration 5] The information processing device according to any one of configurations 1 to 4, wherein the determination unit generates a user interface screen (200) including a saliency map (24) generated based on the output of the model in a specified learning state.
[0126] [Configuration 6] An information processing program (110) comprising: A step of sequentially learning a model using a plurality of learning data and sequentially storing data indicating a state of the model during learning; determining a model trained using a first number of training data among the plurality of training data as a first model (S100 to S118); and determining, in accordance with a user operation, as a second model, a model trained using a second number of training data among the plurality of training data, the second number being smaller than the first number (S124). The second model is associated with a generator (170) for generating a saliency map based on an output of the second model.
[0127] [Configuration 7] a calculation unit (160) that inputs input data (20) into a first model (162) and calculates an inference result (30); a generation unit (170) that generates a saliency map (24) based on an output obtained by inputting the input data into a second model (164); the first model is a model trained using a first number of training data; The information processing apparatus, wherein the second model is a model trained using a second number of training data that is less than the first number.
[0128] [Configuration 8] The information processing apparatus according to Configuration 7, wherein the information processing apparatus displays and outputs the input data and the saliency map side by side.
[0129] [Configuration 9] The information processing apparatus according to Configuration 7 or 8, wherein an input image is input as the input data to the first model and the second model, and a classification result for the input image is output as the inference result.
[0130] [Configuration 10] An information processing program (112) that causes a computer (100) to perform steps (S202, S204) of inputting input data (20) to a first model (162) and calculating an inference result (30), and perform steps (S206, S208, S210) of generating a saliency map based on an output obtained by inputting the input data to a second model, wherein the first model is a model trained using a first number of training data, and the second model is a model trained using a second number of training data that is less than the first number.
[0131] [Configuration 11] A non-transitory computer-readable medium (106) storing the information processing program according to Configuration 6 or 10.
[0132] <I. Advantages> When a classification model that performs a classification task on an input image is visualized using the XAI method, a reaction occurs in the same place in the visualized saliency map regardless of the inference result, which may cause a problem of low interpretability. In contrast, according to this embodiment, a model in an adequate learning state is used as the classification model, and a model in an insufficient learning state is used as the XAI model, so that the part that the classification model focuses on can be visualized.
[0133] In this way, according to this embodiment, the interpretability of the trained model can be improved. The embodiments disclosed herein should be considered to be illustrative and not restrictive in all respects. The scope of the present invention is defined by the claims, not the above description, and is intended to include all modifications within the meaning and scope of the claims. [Explanation of symbols]
[0134] 10 manufacturing line, 12 saliency map, 20 input image, 22 top seal, 24, 26 XAI image, 30 inference result, 50 camera, 100 information processing device, 102 processor, 104 memory, 106 storage, 108 OS, 110 model generation program, 112 model operation program, 114 display output unit, 116 input unit, 118 interface circuit, 150 database, 160 operation unit, 162 classification model, 164 XAI model, 165 model parameters, 166 learning unit, 168 model determination unit, 170 XAI visualization unit, 180 image feature, 182, 230 distribution, 190 feature map, 192 gradient, 194, 196 pooling result, 200 user interface screen, 210 learning curve, 212 slider, 213 position display, 214 Classification model position, 216 Recommended position, 218 Selection button, 220 Accuracy evaluation result, 222 Required accuracy, 232 Pull-down menu, 234 Pointer.
Claims
1. a learning unit that sequentially learns a model using a plurality of learning data and sequentially stores data indicating a state of the model during learning; a determination unit that determines, as a first model, a model trained using a first number of pieces of training data among the plurality of pieces of training data, and determines, in accordance with a user operation, as a second model, a model trained using a second number of pieces of training data that is less than the first number among the plurality of pieces of training data; A generation unit that generates a saliency map based on an output of the second model.
2. The determination unit is generating a user interface screen including a learning curve showing a change in at least one of an error and an accuracy of the model with respect to the number of training data used for training; The information processing apparatus according to claim 1 , wherein a model in a selected state is determined as the second model in response to a user operation on the user interface screen.
3. The information processing device according to claim 1 , wherein the determining unit generates a user interface screen including an evaluation result of the accuracy of the model in a specified learning state.
4. The information processing apparatus according to claim 1 , wherein the determination unit generates a user interface screen including a distribution of features output by the model in a specified learning state.
5. The information processing device according to claim 1 , wherein the determination unit generates a user interface screen including a saliency map generated based on an output of the model in a specified learning state.
6. An information processing program, comprising: A step of sequentially learning a model using a plurality of learning data and sequentially storing data indicating a state of the model during learning; determining a model trained using a first number of training data among the plurality of training data as a first model; determining, in accordance with a user operation, a model trained using a second number of training data among the plurality of training data, the second number being smaller than the first number, as a second model; The second model is associated with a generator for generating a saliency map based on an output of the second model.
7. A calculation unit that inputs input data into a first model and calculates an inference result; a generator for generating a saliency map based on an output obtained by inputting the input data into a second model; the first model is a model trained using a first number of training data; The information processing device, wherein the second model is a model trained using a second number of training data that is smaller than the first number.
8. The information processing device according to claim 7 , wherein the information processing device displays the input data and the saliency map side by side.
9. The information processing apparatus according to claim 7 , wherein an input image is input to the first model and the second model as the input data, and a classification result for the input image is output as the inference result.
