Computer system and inference uncertainty determination method
The computer system addresses the challenge of determining unreliable regions in semantic segmentation by using Monte Carlo dropout and uncertainty indicators to classify factors, resulting in improved inference accuracy and reliability through targeted corrections in machine learning models.
Patent Information
- Application Number
- PCT/JP2024/013788
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-06-14
- Filing Date
- 2024-04-03
- Publication Date
- 2024-12-19
AI Technical Summary
Existing methods for semantic segmentation inferences fail to accurately determine the factors contributing to unreliable regions, despite providing uncertainty indices, as these indices are continuous and do not clearly distinguish between reliable and unreliable areas.
A computer system that processes image data by generating modified machine learning models using Monte Carlo dropout, calculates probability distributions for each pixel, and assigns uncertainty levels based on multiple indicators to classify unreliable regions by factor, generating an uncertainty map for each pixel.
Enables the classification of unreliable regions in semantic segmentation by factor, improving the reliability of inference results and allowing for targeted corrections in machine learning models, thereby enhancing the accuracy of image classification.
Smart Images

Figure JP2024013788_19122024_PF_FP_ABST
Abstract
Description
Computer system and method for determining uncertainty of inference Incorporation by Reference
[0001] This application claims priority from Japanese Patent Application No. 2023-97501, filed on June 14, 2023, the contents of which are incorporated herein by reference.
[0002] The present disclosure relates to a technology for quantitatively evaluating the uncertainty of inference results in semantic segmentation and assigning a level of uncertainty.
[0003] Artificial intelligence (AI) is increasingly being used in a variety of fields to classify images into multiple regions. For example, in the field of materials science, AI is used to extract features from tissue images and model their relationship with physical properties, which is expected to improve the efficiency of new material development. Semantic segmentation (SS) is a widely used AI machine learning model for analyzing tissue features.
[0004] It is important to evaluate the uncertainty of the inference results, which are the output of a machine learning model, along with the accuracy of the inference. A method for quantifying uncertainty is known, as described in Patent Literature 1. Patent Literature 1 describes the repeated application of Monte Carlo dropout to evaluate uncertainty.
[0005] Japanese Patent Application Laid-Open No. 2018-200677
[0006] The uncertainty index in Patent Document 1 is a continuous value, which can be used to identify reliable and unreliable regions.
[0007] There are various possible causes of uncertainty in semantic segmentation inference, but even if the index described in Patent Literature 1 is used, it is difficult to determine what factors cause unreliable regions.
[0008] The present disclosure provides a technique for classifying unreliable regions in semantic segmentation inference by factor.
[0009] A representative example of the invention disclosed in the present application is as follows: That is, a computer system includes a computer having a processor and a storage device connected to the processor, and stores definition information of a model used for inference to classify pixels included in an image into a plurality of classes, the model calculating a probability that the pixel belongs to each of the plurality of classes, the processor accepts an input of an image, generates a model by modifying the model defined by the definition information, executes a process of inferring the image using the model a plurality of times, calculates a probability distribution for each pixel of the image for each of the plurality of classes based on the results of the plurality of inferences, calculates a plurality of uncertainty indices representing the uncertainty of the inference for the pixel by statistically processing the probability distribution for each of the plurality of classes for each pixel of the image, assigns an uncertainty level, which is a classification of uncertainty, to each pixel of the image based on the plurality of uncertainty indices, and generates and outputs an uncertainty map to present the uncertainty level for each pixel of the image.
[0010] According to one aspect of the present disclosure, regions that are unreliable in semantic segmentation inference can be classified by factor. Problems, configurations, and effects other than those described above will become apparent from the following description of the embodiments.
[0011] 1 is a diagram illustrating an example of a functional configuration of a computer system according to a first embodiment. FIG. 2 is a diagram illustrating an example of a hardware configuration of a computer constituting the computer system according to the first embodiment. FIG. 3 is a diagram illustrating an example of the cooperation of functions of the computer system according to the first embodiment. FIG. 4 is a diagram illustrating an example of the data structure of a teacher data DB according to the first embodiment. FIG. 5 is a diagram illustrating an example of the data structure of a model DB according to the first embodiment. FIG. 6 is a diagram illustrating an example of the data structure of an inference result DB according to the first embodiment. FIG. 7 is a diagram illustrating an example of the data structure of an inference result DB according to the first embodiment. FIG. 8 is a diagram illustrating an example of the data structure of an inference result DB according to the first embodiment. FIG. 9 is a diagram illustrating the characteristics of inference of semantic segmentation. FIG. 10 is a diagram illustrating the characteristics of inference of semantic segmentation. FIG. 11 is a diagram illustrating the characteristics of inference of semantic segmentation. FIG. 12 is a flowchart illustrating an example of an inference process executed by the computer system according to the first embodiment. FIG. 13 is a diagram illustrating an example of a probability distribution of classes calculated by the computer system according to the first embodiment. FIG. 14 is a flowchart illustrating an example of an uncertainty level determination process executed by the computer system according to the first embodiment. 1 is a diagram showing an example of the correlation between the uncertainty index and the accuracy rate in Example 1. FIG. 2 is a diagram showing an example of the correlation between the uncertainty index and the accuracy rate in Example 1. FIG. 3 is a diagram showing an example of a method for calculating an evaluation index in Example 1. FIG. 4 is a flowchart explaining an example of an uncertainty map generation process executed by the computer system of Example 1. FIG. 5 is a diagram showing an example of a GUI presented by the computer system of Example 1. FIG. 6 is a diagram showing an example of an uncertainty map of Example 2. FIG. 7 is a diagram showing an example of the functional configuration of the computer system of Example 3. FIG. 8 is a diagram showing cooperation of the functions of the computer system of Example 3. FIG. 9 is a flowchart explaining an example of an inference process executed by the computer system of Example 3. FIG. 10 is a flowchart explaining an example of an inference result output process executed by the computer system of Example 3. FIG. 11 is a diagram showing an example of a GUI presented by the computer system of Example 3.
[0012] Hereinafter, embodiments of the present invention will be described with reference to the drawings. However, the present invention should not be construed as being limited to the description of the embodiments shown below. Those skilled in the art will readily understand that the specific configuration can be changed without departing from the spirit or intent of the present invention.
[0013] In the configuration of the invention described below, the same or similar configurations or functions are denoted by the same reference numerals, and redundant explanations will be omitted.
[0014] In this specification, the terms "first," "second," "third," etc. are used to identify components and do not necessarily limit the number or order.
[0015] In Example 1, evaluation of uncertainty in the learning phase will be described. To generate a machine learning model, training data must be prepared in advance. Ground truth data to be included in the training data is often prepared manually. If the inference result contains a part with high uncertainty, the ground truth data must be corrected.
[0016] Fig. 1 is a diagram illustrating an example of the functional configuration of a computer system according to Example 1. Fig. 2 is a diagram illustrating an example of the hardware configuration of a computer that constitutes the computer system according to Example 1.
[0017] The computer system 100 is configured from a computer 200 as shown in Fig. 2. The computer 200 includes a processor 201, a main memory device 202, a secondary memory device 203, and a network interface 204. The computer 200 may also include input devices such as a mouse and a keyboard, and an output device such as a display.
[0018] The processor 201 executes a program stored in the main memory device 202. The processor 201 executes processing in accordance with the program, thereby operating as a functional unit (module) that realizes a specific function. In the following description, when a processing is described using a functional unit as the subject, this indicates that the processor 201 is executing a program that realizes the functional unit.
[0019] The main storage device 202 is a memory or the like, and stores programs executed by the processor 201 and data used by the programs. The main storage device 202 is also used as a work area. The secondary storage device 203 is a hard disk drive (HDD) or the like, and permanently stores programs and data. The network interface 204 communicates with external devices.
[0020] The computer system 100 includes a learning unit 101, an inference unit 102, an accuracy rate calculation unit 103, an uncertainty index calculation unit 104, an uncertainty level determination unit 105, and an input / output unit 106. The computer system 100 also stores a teacher data DB 110, a model DB 111, and an inference result DB 112.
[0021] The training data DB 110 is a database that stores training data consisting of input data to be input to the machine learning model and inference correct data. In this embodiment, the input data is an image, and the correct data is an array of classes to which the pixels belong. The model DB 111 is a database that stores information that defines the machine learning model. The inference result DB 112 is a database that stores the results of inference using the machine learning model.
[0022] It should be noted that with regard to each functional unit of the computer system 100, multiple functional units may be combined into one functional unit, or one functional unit may be divided into multiple functional units for each function.
[0023] FIG. 3 is a diagram illustrating the cooperation of functions of the computer system 100 according to the first embodiment.
[0024] The learning unit 101 acquires the training data stored in the training data DB 110 as training data, and executes a learning process for a machine learning model to realize semantic segmentation.
[0025] The machine learning model is a model that calculates the probability that a pixel belongs to each class, and is, for example, a convolutional neural network (CNN), SegNet, U-Net, or PSPNet. The machine learning method is, for example, deep learning. The present invention is not limited to the type of machine learning model. The present invention is not limited to the learning method of the machine learning model. The learning unit 101 stores the learning results in the model DB 111.
[0026] The inference unit 102 acquires training data stored in the training data DB 110 as verification data and performs inference using a machine learning model defined by information stored in the model DB 111. In this embodiment, an array of probabilities that each pixel of the image corresponds to each class is output as the inference result. The inference unit 102 stores the inference result in the inference result DB 112.
[0027] In this embodiment, the inference unit 102 generates a machine learning model (hereinafter referred to as an MCD model) in which some of the nodes constituting the machine learning model are dropped out using a Monte Carlo dropout method, and performs inference on verification data using the MCD model. Inference is performed multiple times for one verification data set using different MCD models.
[0028] The accuracy rate calculation unit 103 uses the inference result and the correct answer data included in the verification data to calculate the accuracy rate for the input data, the accuracy rate for each class, etc. The accuracy rate calculation unit 103 stores the processing results in the inference result DB 112.
[0029] The uncertainty index calculation unit 104 calculates a plurality of uncertainty indexes using the inference results. The uncertainty index calculation unit 104 stores the processing results in the inference result DB 112. The calculated uncertainty indexes will be described later.
[0030] The uncertainty level determination unit 105 assigns an uncertainty level to the inference result of one piece of verification data using a plurality of uncertainty indices. The uncertainty level determination unit 105 stores the processing result in the inference result DB 112.
[0031] The input / output unit 106 receives input to the computer system 100 and outputs various data from the computer system 100 .
[0032] FIG. 4 is a diagram illustrating an example of a data structure of the teacher data DB 110 according to the first embodiment.
[0033] The teacher data DB 110 stores a table 400 for managing teacher data. The table 400 stores entries including a data ID 401, input data 402, and correct answer data 403. One entry corresponds to one piece of teacher data.
[0034] Data ID 401 is a field that stores the ID of the training data. Input data 402 is a field that stores input data to be input to the machine learning model. In this embodiment, an array of pixel values of pixels that make up an image is stored as input data. Supervised answer data 403 is a field that stores supervised answer data that indicates the correct answer of the inference. In this embodiment, an array of values that indicates the class to which the pixel belongs is stored as supervised answer data. Figure 4 shows a two-dimensional array that indicates whether the pixel belongs to the first class or the second class.
[0035] The data format of the teacher data DB 110 is not limited to the table format.
[0036] FIG. 5 is a diagram illustrating an example of a data structure of the model DB 111 according to the first embodiment.
[0037] The model DB 111 stores a table 500 that stores information that defines a machine learning model. One table 500 exists for one machine learning model. The table 500 stores entries including a layer ID 501, a layer type 502, and parameters 503. One entry exists for one layer.
[0038] The layer ID 501 is a field that stores the ID of a layer of a machine learning model. The layer type 502 is a field that stores the type of layer. Layer types include an input layer, a convolutional layer, a pooling layer, a fully connected layer, and an output layer. The parameter 503 is a field that stores the parameter of the layer corresponding to the layer ID 501. The layer parameter is, for example, a weight.
[0039] The data format of the model DB 111 is not limited to the table format.
[0040] 6A, 6B, 6C, and 6D are diagrams illustrating an example of the data structure of the inference result DB 112 according to the first embodiment.
[0041] The inference result DB 112 stores a table 600 , a table 610 , a table 620 , and a table 630 .
[0042] The table 600 is a table for managing inference results. The table 600 stores entries including an inference result ID 601, a data ID 602, and an inference result 603. One entry exists for one inference result.
[0043] The inference result ID 601 is a field that stores the ID of the inference result. The data ID 602 is a field that stores the ID of the verification data (teacher data) used for inference. The inference result 603 is a field that stores the inference result. In this embodiment, an array of the probability that a pixel belongs to each class is stored as the inference result. In FIG. 6A, an array of the probability that a pixel belongs to each of the first and second classes is stored. The sum of the probabilities of each class of a pixel is 1.
[0044] The table 610 is a table for managing the accuracy rate of the inference results. The table 610 stores entries including an inference result ID 611 and an accuracy rate 612. One entry exists for one inference result.
[0045] The inference result ID 611 is the same field as the inference result ID 601. The accuracy rate 612 is a field that stores the accuracy rate. In this embodiment, the accuracy rate of each pixel, the accuracy rate of the entire input data, the accuracy rate of each class, etc. are stored. The accuracy rate of the entire input data can be calculated, for example, as the average of the accuracy rates of each pixel. The accuracy rate of a class can be calculated, for example, as the average of the accuracy rates of pixels assigned the same class in the correct data.
[0046] Table 620 is a table for managing uncertainty indices for evaluating the uncertainty of inferences for validation data. Table 620 stores entries including a data ID 621, a first uncertainty index 622, and a second uncertainty index 623. One entry exists for one validation data.
[0047] The data ID 621 is the same field as the data ID 602. The first uncertainty index 622 and the second uncertainty index 623 are fields for storing the uncertainty indexes.
[0048] The table 630 is a table for managing the uncertainty levels assigned to the verification data. The table 630 stores entries each including a data ID 631 and an uncertainty level 632. One entry exists for one piece of verification data.
[0049] The data ID 631 is the same field as the data ID 602. The uncertainty level 632 is a field that stores the uncertainty level. In this embodiment, an array of the uncertainty levels of the pixels is stored.
[0050] The information managed in the tables 600, 610, 620, and 630 may be managed in a data format other than the table format.
[0051] Here, the characteristics of inference in semantic segmentation will be described. Figures 7A, 7B, 7C, and 7D are diagrams illustrating the characteristics of inference in semantic segmentation.
[0052] 7A, 7B, 7C, and 7D show the distribution of the probability that a pixel belongs to a class. Here, semantic segmentation for classification into three classes will be explained as an example.
[0053] As shown in FIG. 7A, if the variance of the probability distribution of a certain class is small and the most frequent is close to 1, and the variance of the probability distribution of another class is small and the most frequent is close to 0, the inference result is sufficiently reliable.
[0054] As shown in FIG. 7B, if the probability distributions of each class overlap and the most frequent probability of each class is small (for example, less than 0.5), the inference results are unreliable.
[0055] As shown in Figure 7C, if the probability distributions of two classes overlap, the mode of the probability distributions of the two classes is large (e.g., greater than 0.5), and the mode of the probability distribution of the other class is approximately 0, then there is a high possibility that this is the boundary between the two classes.
[0056] As shown in Figure 7D, if there are two probability distributions with non-zero modes, the overlap between the two probability distributions is small, and the mode of the probability distribution of another class is almost 0, then the area to which a certain class belongs within the image may be small.
[0057] In this embodiment, the inference results for pixels are classified into the above four levels using two uncertainty indices calculated from the probability distribution.
[0058] Fig. 8 is a flowchart illustrating an example of an inference process executed by the computer system 100 according to the first embodiment. Fig. 9 is a diagram illustrating an example of a probability distribution of classes calculated by the computer system 100 according to the first embodiment.
[0059] The inference unit 102 acquires definition information of the machine learning model from the model DB 111 (step S101).
[0060] The inference unit 102 starts a loop process of the verification data (step S102). Specifically, the inference unit 102 acquires one piece of verification data from the training data DB 110.
[0061] The inference unit 102 starts an inference loop process (step S103). Specifically, the inference unit 102 generates an MCD model using the Monte Carlo dropout method. In this loop process, inference is executed a predetermined number of times. Note that, since it is only necessary to obtain the probability distribution of the classes, the model may be modified using a method other than the Monte Carlo dropout method.
[0062] The inference unit 102 performs inference on the verification data using the MCD model (step S104). The inference unit 102 stores the inference result in the table 600 of the inference result DB 112.
[0063] The inference unit 102 instructs the accuracy rate calculation unit 103 to calculate the accuracy rate. The instruction includes the ID of the inference result.
[0064] The accuracy rate calculation unit 103 compares the inference result with the correct answer data included in the verification data and calculates the accuracy rate (step S105). The accuracy rate calculation unit 103 stores the calculation result in table 610 of the inference result DB 112. Thereafter, the accuracy rate calculation unit 103 notifies the inference unit 102 of the completion of the processing.
[0065] The inference unit 102 determines whether the number of times the inference has been executed is less than a predetermined number (step S106). If the number of times the inference has been executed is greater than the predetermined number, the inference unit 102 returns to step S103.
[0066] If the number of executions of the inference is equal to or greater than the predetermined number, the inference unit 102 instructs the uncertainty index calculation unit 104 to calculate an uncertainty index. The instruction includes the ID of the verification data.
[0067] The uncertainty index calculation unit 104 calculates the probability distribution of each class for each pixel (step S107). Specifically, the uncertainty index calculation unit 104 obtains the inference result of the verification data from the table 600, and calculates the probability distribution of each class for each pixel as shown in FIG.
[0068] The uncertainty index calculation unit 104 calculates a first uncertainty index for each pixel based on the probability distribution of each class (step S108). Specifically, the following process is executed.
[0069] (S108-1) The uncertainty index calculation unit 104 selects a pixel.
[0070] (S108-2) The uncertainty index calculation unit 104 calculates the mode of the probability distribution of each class for the selected pixel.
[0071] (S108-3) The uncertainty index calculation unit 104 calculates the variance of the probability distribution of the class with the largest mode as a first uncertainty index.
[0072] (S108-4) The uncertainty index calculation unit 104 determines whether or not processing has been completed for all pixels. If processing has not been completed for all pixels, the uncertainty index calculation unit 104 returns to S108-1. If processing has been completed for all pixels, the uncertainty index calculation unit 104 stores the calculation results in table 620 of the inference result DB 112.
[0073] The uncertainty index calculation unit 104 calculates a second uncertainty index for each pixel based on the probability distribution of each class (step S109). Specifically, the following process is executed.
[0074] (S109-1) The uncertainty index calculation unit 104 selects a pixel.
[0075] (S109-2) The uncertainty index calculation unit 104 calculates the mode of the probability distribution of each class for the selected pixel.
[0076] (S109-3) The uncertainty index calculation unit 104 ranks the classes in descending order of the mode.
[0077] (S109-4) The uncertainty index calculation unit 104 calculates the sum of the most frequent values of the classes ranked third and below as a second uncertainty index.
[0078] (S109-5) The uncertainty index calculation unit 104 determines whether or not processing has been completed for all pixels. If processing has not been completed for all pixels, the uncertainty index calculation unit 104 returns to S109-1. If processing has been completed for all pixels, the uncertainty index calculation unit 104 stores the calculation results in table 620 of the inference result DB 112.
[0079] After calculating the second uncertainty index, the uncertainty index calculation unit 104 notifies the inference unit 102 of the completion of the processing. The inference unit 102 determines whether the processing has been completed for all of the verification data (step S110).
[0080] If the processing has not been completed for all the verification data, the inference unit 102 returns to step S102. If the processing has been completed for all the verification data, the inference unit 102 ends the inference processing.
[0081] 10A and 10B are flowcharts illustrating an example of uncertainty level determination processing executed by the computer system 100 of Example 1. Figures 11A and 11B are diagrams illustrating an example of the correlation between the uncertainty index and the accuracy rate in Example 1. Figure 12 is a diagram illustrating an example of a method for calculating an evaluation index in Example 1.
[0082] The uncertainty level determination unit 105 executes the following process for one piece of verification data.
[0083] The uncertainty level determination unit 105 analyzes the correlation between the first uncertainty index and the accuracy rate for the verification data (step S201). Specifically, the following process is executed.
[0084] (S201-1) The uncertainty level determination unit 105 acquires the accuracy rate of each pixel from the table 610, and also acquires the first uncertainty index of each pixel from the table 620.
[0085] (S201-2) The uncertainty level determination unit 105 analyzes the correlation between the accuracy rate and the first uncertainty index. For example, the analysis result shown in FIG. 11A is obtained. Graph 1101 shows the correlation between the accuracy rate and the first uncertainty index. The dotted bar graph shows the number of correct pixels for the first uncertainty index. The white bar graph shows the number of incorrect pixels for the first uncertainty index.
[0086] The uncertainty level determination unit 105 calculates a threshold value Th1 based on the correlation between the first uncertainty index and the accuracy rate (step S202).
[0087] Specifically, the uncertainty level determination unit 105 uses correlation to calculate an uncertainty index at which the accuracy rate becomes a value designated by the user, as a threshold Th1. In Fig. 11A, the threshold Th1 is 0.15.
[0088] The uncertainty level determination unit 105 analyzes the correlation between the second uncertainty index and the accuracy rate for the verification data (step S203). Specifically, the following process is executed.
[0089] (S203-1) The uncertainty level determination unit 105 obtains the accuracy rate of each pixel from the table 610, and also obtains the second uncertainty index of each pixel from the table 620.
[0090] (S203-2) The uncertainty level determination unit 105 analyzes the correlation between the accuracy rate and the second uncertainty index. For example, the analysis result shown in FIG. 11B is obtained. Graph 1102 shows the correlation between the accuracy rate and the second uncertainty index. The dotted bar graph shows the number of correct pixels for the second uncertainty index. The white bar graph shows the number of incorrect pixels for the second uncertainty index.
[0091] The uncertainty level determination unit 105 calculates the threshold value Th2 based on the correlation between the second uncertainty index and the accuracy rate (step S204). Specifically, the following process is executed.
[0092] (S204-1) The uncertainty level determination unit 105 calculates the change in the accuracy rate relative to the change in the second uncertainty index (the decreasing gradient of the accuracy rate).
[0093] (S204-2) The uncertainty level determination unit 105 calculates the maximum value of the second uncertainty index in the range where the gradient of decline of the accuracy rate is greatest as the threshold value Th2. In FIG. 11B, the gradient of decline of the second uncertainty index is greatest in the range between 0.1 and 0.2, so the threshold value Th2 is 0.2.
[0094] The uncertainty level determination unit 105 starts a loop process of pixels (step S205). Specifically, the uncertainty level determination unit 105 selects one pixel of the verification data.
[0095] The uncertainty level determining unit 105 determines whether the first uncertainty index of the pixel is smaller than a threshold value Th1 (step S206).
[0096] If the first uncertainty index of the pixel is smaller than the threshold Th1, the uncertainty level determination unit 105 assigns an uncertainty level of "0" (step S207). Specifically, the uncertainty level determination unit 105 sets the uncertainty level in the table 630. Then, the uncertainty level determination unit 105 proceeds to step S213. The uncertainty level of "0" indicates that the inference result is sufficiently reliable.
[0097] If the first uncertainty index of the pixel is equal to or greater than the threshold Th1, the uncertainty level determining unit 105 determines whether the second uncertainty index of the pixel is greater than a threshold Th2 (step S208).
[0098] If the second uncertainty index of the pixel is greater than the threshold Th2, the uncertainty level determination unit 105 assigns an uncertainty level of "1" (step S209). Specifically, the uncertainty level determination unit 105 sets the uncertainty level in the table 630. Thereafter, the uncertainty level determination unit 105 proceeds to step S213. The uncertainty level of "1" indicates that the inference result is unreliable.
[0099] If the second uncertainty index of the pixel is equal to or smaller than the threshold value Th2, the uncertainty level determination unit 105 calculates an evaluation index for evaluating the degree of overlap between the probability distributions of the class with the largest mode and the second class (step S210).
[0100] 12, the uncertainty level determination unit 105 calculates the difference between the variance and the mode of the class with the largest mode (first value).The uncertainty level determination unit 105 calculates the sum of the variance and the mode of the class with the second largest mode (second value).
[0101] (S210-2) The uncertainty level determination unit 105 calculates the difference between the first value and the second value as an evaluation index.
[0102] The uncertainty level determination unit 105 determines whether the evaluation index is smaller than the first uncertainty index (step S211). The process of step S211 is a process for determining the degree of overlap between the two probability distributions. If the evaluation index is smaller than the first uncertainty index, this indicates that the degree of overlap between the two probability distributions is large, as shown in FIG. 7C .
[0103] If the evaluation index is smaller than the first uncertainty index, the uncertainty level determination unit 105 assigns an uncertainty level of "2" (step S212). Specifically, the uncertainty level determination unit 105 sets the uncertainty level in the table 630. Then, the uncertainty level determination unit 105 proceeds to step S213. The uncertainty level of "2" indicates that the pixel is located on the boundary between regions of different classes.
[0104] In step S213, the uncertainty level determination unit 105 determines whether or not the processing has been completed for all pixels (step S213). If the processing has not been completed for all pixels, the uncertainty level determination unit 105 returns to step S205.
[0105] When the process has been completed for all pixels, the uncertainty level determining unit 105 identifies pixels to which no uncertainty level has been assigned (step S214).
[0106] The uncertainty level determination unit 105 executes an uncertainty level assignment process for the identified pixel (step S215), and then ends the uncertainty level determination process. Specifically, the following process is executed.
[0107] (S215-1) The uncertainty level determination unit 105 refers to the table 610 in the inference result DB 112 and acquires the accuracy rate of the identified pixel.
[0108] (S215-2) The uncertainty level determination unit 105 identifies pixels (target pixels) whose accuracy rate is greater than the threshold value Th3.
[0109] (S215-3) The uncertainty level determination unit 105 selects a class.
[0110] (S215-4) The uncertainty level determination unit 105 groups target pixels that belong to the selected class and whose distance is smaller than the threshold value Th4 based on the positional relationship of the target pixels.
[0111] (S215-5) The uncertainty level determination unit 105 selects one group.
[0112] (S215-6) The uncertainty level determination unit 105 calculates the area ratio by dividing the number of pixels in the group by the total number of pixels.
[0113] (S215-7) The uncertainty level determination unit 105 determines whether the area ratio is smaller than the threshold value Th5. If the area ratio is equal to or larger than the threshold value Th5, the uncertainty level determination unit 105 proceeds to S215-9.
[0114] (S215-8) If the area ratio is smaller than the threshold value Th5, the uncertainty level determination unit 105 assigns an uncertainty level of "3" to the pixels included in the group. Specifically, the uncertainty level determination unit 105 sets the uncertainty level in the table 630. The uncertainty level of "3" indicates that the area to which a certain class belongs is small.
[0115] (S215-9) The uncertainty level determination unit 105 determines whether or not the processing has been completed for all groups. If the processing has not been completed for all groups, the uncertainty level determination unit 105 returns to S215-5.
[0116] (S215-10) When processing has been completed for all groups, the uncertainty level determination unit 105 determines whether processing has been completed for all classes. If processing has not been completed for all classes, the uncertainty level determination unit 105 returns to S215-3. If processing has been completed for all classes, the uncertainty level determination unit 105 ends the processing of step S215.
[0117] It should be noted that pixels to which no uncertainty level has been assigned are set to, for example, "-1."
[0118] FIG. 13 is a flowchart illustrating an example of the uncertainty map generation process executed by the computer system 100 according to the first embodiment.
[0119] The input / output unit 106 receives the verification data and the selection of the uncertainty level from the user (step S301).
[0120] The input / output unit 106 generates an uncertainty map that displays the uncertainty level of the selected verification data (step S302). Specifically, the following process is executed.
[0121] (S302-1) The input / output unit 106 refers to the table 630 of the inference result DB 112 and searches for an entry corresponding to the selected verification data.
[0122] (S302-2) The input / output unit 106 identifies pixels to which the specified uncertainty level has been assigned based on the searched entries.
[0123] (S302-3) The input / output unit 106 generates an image of the same size as the input data (image) included in the verification data, and sets RGB values corresponding to the uncertainty level to the identified pixels of the image. This image is the uncertainty map. Note that the uncertainty map may be generated by superimposing the generated image on the input data or the inference result.
[0124] The input / output unit 106 outputs the uncertainty map (step S303), and then ends the uncertainty map generation process.
[0125] FIG. 14 is a diagram illustrating an example of a GUI presented by the computer system 100 of the first embodiment.
[0126] The GUI 1400 is presented by the input / output unit 106. The GUI 1400 includes a setting area 1401 and a result display area 1402.
[0127] The setting area 1401 is an area for making various settings required for processing. The setting area 1401 includes input fields 1410, 1411, and 1412, a selection field 1413, and an operation button 1414.
[0128] Input field 1410 is a field for inputting the machine learning model to be used. For example, the name of table 500 that defines the machine learning model is input. Input field 1411 is a field for inputting the verification data to be used. For example, the name of the file that stores the verification data is input. Input field 1412 is a field for inputting various thresholds to be used in the uncertainty level determination process.
[0129] The selection column 1413 is a column for selecting the uncertainty level to be displayed on the uncertainty map. The selection column 1413 displays check boxes for selecting the uncertainty level to be displayed.
[0130] The operation button 1414 is an operation button for issuing an instruction to execute the inference process and the uncertainty level determination process.
[0131] The result display area 1402 is a field for displaying the processing results. The result display area 1402 includes a selection field 1420 and a display field 1421.
[0132] The selection field 1420 is a field for selecting verification data. The selection field 1420 displays the ID and other information of the verification data in a pull-down format. When verification data is set in the selection field 1420, an uncertainty map generation process is executed, and the process results are displayed in the display field 1421. The display field 1421 displays, for example, input data 1431 included in the verification data, an inference result 1432, and an uncertainty map 1433. The accuracy rate of the verification data and the like may also be displayed. The uncertainty map 1433 displays an image in which RGB values are set according to the uncertainty level.
[0133] The thresholds Th1 and Th2 used in determining the uncertainty level may be set by a user, in which case steps S201 to S204 of the uncertainty level determination process are not executed.
[0134] The accuracy rate used to calculate the threshold value Th1 does not have to be set when the process is executed. In this case, after executing the process of step S201, the uncertainty level determination unit 105 presents a graph as shown in Fig. 11A. The user refers to the graph and specifies the accuracy value.
[0135] The computer system of Example 1 can assign an uncertainty level to the inference results of input data included in the training data and present the uncertainty level as an image (uncertainty map). A user can correct the correct answer data by referring to the uncertainty map. By performing machine learning using the corrected training data, it is possible to improve the inference accuracy of the machine learning model and reduce the uncertainty.
[0136] In processing based on the mode of the probability distribution, the median and mean of the probability distribution may be substituted.
[0137] The method of displaying the uncertainty map is different in Example 2. Hereinafter, Example 2 will be described, focusing on the differences from Example 1.
[0138] The configuration of the computer system 100 of the second embodiment is the same as that of the first embodiment. The inference process and the uncertainty level determination process of the second embodiment are the same as those of the first embodiment. In the second embodiment, the uncertainty map generation process is partially different. Specifically, the process content of step S302 is different from that of the first embodiment.
[0139] (S302-1) The input / output unit 106 divides the input data into a plurality of partial images. The number of divisions is set in advance.
[0140] (S302-2) The input / output unit 106 selects one uncertainty level from the uncertainty levels designated by the user.
[0141] (S302-3) The input / output unit 106 selects a partial image.
[0142] (S302-4) The input / output unit 106 calculates the area ratio of the pixels to which the selected uncertainty level has been assigned. Specifically, the input / output unit 106 divides the number of pixels to which the uncertainty level has been assigned by the total number of pixels in the partial image.
[0143] (S302-5) The input / output unit 106 determines whether the area ratio is greater than a threshold value Th6. If the area ratio is equal to or less than the threshold value Th6, the input / output unit 106 proceeds to S302-7.
[0144] (S302-6) If the area ratio is greater than the threshold value Th6, the partial image and the uncertainty level are registered in the display list.
[0145] (S302-7) The input / output unit 106 determines whether or not the processing has been completed for all the partial images. If the processing has not been completed for all the partial images, the input / output unit 106 returns to S302-3.
[0146] (S302-8) When processing has been completed for all partial images, the input / output unit 106 determines whether processing has been completed for all uncertainty levels specified by the user. If processing has not been completed for all uncertainty levels specified by the user, the input / output unit 106 returns to S302-2.
[0147] (S302-9) When the processing is completed for all the uncertainty levels specified by the user, the input / output unit 106 generates an uncertainty map based on the display list.
[0148] The setting area 1401 of the GUI 1400 of the second embodiment includes fields for inputting the number of divisions and the threshold value Th6.
[0149] FIG. 15 is a diagram illustrating an example of an uncertainty map according to the second embodiment.
[0150] As shown in FIG. 15, in the second embodiment, pixels according to the uncertainty level are displayed only in the partial images registered in the display list.
[0151] According to the second embodiment, by displaying only a partial image in which a large number of pixels are assigned a specified uncertainty level, it is possible to reduce the effort required for correction.
[0152] In the third embodiment, the evaluation of uncertainty in the inference phase will be described. Fig. 16 is a diagram illustrating an example of the functional configuration of a computer system according to the third embodiment.
[0153] The computer system 100 of the third embodiment does not include the learning unit 101 and the accuracy rate calculation unit 103. Furthermore, the computer system 100 of the third embodiment does not include the teacher data DB 110.
[0154] FIG. 17 is a diagram showing the cooperation of functions of the computer system 100 according to the third embodiment.
[0155] The inference unit 102 acquires input data to be inferred, and performs inference using a machine learning model defined by information stored in the model DB 111. The inference unit 102 stores the inference result in the inference result DB 112.
[0156] The uncertainty index calculation unit 104 calculates a plurality of uncertainty indexes using the inference results, and stores the processing results in the inference result DB 112.
[0157] The uncertainty level determination unit 105 assigns an uncertainty level to the inference result of the input data of one inference target using a plurality of uncertainty indices. The uncertainty level determination unit 105 stores the processing result in the inference result DB 112.
[0158] The input / output unit 106 receives input to the computer system 100 and outputs various data from the computer system 100 .
[0159] FIG. 18 is a flowchart illustrating an example of an inference process executed by the computer system 100 according to the third embodiment.
[0160] The inference unit 102 acquires definition information of the machine learning model from the model DB 111 (step S401).
[0161] The inference unit 102 starts an inference loop process (step S402). Step S402 is the same process as step S103.
[0162] The inference unit 102 uses the MCD model to perform inference on the input data (image) to be inferred (step S403). The process of step S403 is the same as the process of step S104.
[0163] The inference unit 102 determines whether the number of executions of the inference is less than a predetermined number (step S404). The process of step S404 is the same as the process of step S106.
[0164] If the number of executions of the inference is equal to or greater than the predetermined number, the inference unit 102 instructs the uncertainty index calculation unit 104 to calculate an uncertainty index. The instruction includes the ID of the verification data.
[0165] The uncertainty index calculation unit 104 calculates the probability distribution of each class for each pixel (step S405). The process of step S405 is the same as the process of step S107.
[0166] The uncertainty index calculation unit 104 calculates a first uncertainty index for each pixel based on the probability distribution of each class (step S406). The process of step S406 is the same as the process of step S108.
[0167] The uncertainty index calculation unit 104 calculates a second uncertainty index for each pixel based on the probability distribution of each class (step S407). The process of step S407 is the same as the process of step S109.
[0168] In the uncertainty level determination process of the third embodiment, the processes from step S201 to step S204 are not executed. Also, in step S215, the processes of S215-1 and S215-2 are not executed. In this case, the process is executed for pixels to which no uncertainty level is assigned.
[0169] FIG. 19 is a flowchart illustrating an example of an inference result output process executed by the computer system 100 according to the third embodiment.
[0170] The input / output unit 106 calculates the number of pixels to which the uncertainty level designated by the user has been assigned (step S501).
[0171] The input / output unit 106 calculates the area ratio of the pixels to which the selected uncertainty level has been assigned (step S502). Specifically, the input / output unit 106 divides the number of pixels to which the uncertainty level has been assigned by the total number of pixels in the partial image.
[0172] The input / output unit 106 determines whether the area ratio is greater than a threshold value Th7 (step S503).
[0173] If the area ratio is greater than the threshold value Th7, the input / output unit 106 generates an uncertainty map (step S504) and outputs the inference result and the uncertainty map (step S505). The generation method of the uncertainty map can be the generation method described in the first or second embodiment.
[0174] If the area ratio is equal to or smaller than the threshold value Th7, the input / output unit 106 outputs the inference result (step S506).
[0175] The uncertainty map may be output regardless of the area ratio.
[0176] FIG. 20 is a diagram showing an example of a GUI presented by the computer system 100 of the third embodiment.
[0177] The GUI 2000 is presented by the input / output unit 106. The GUI 2000 includes a setting area 2001 and a result display area 2002.
[0178] The setting area 2001 is an area for making various settings required for processing. The setting area 2001 includes input fields 2010, 2011, and 2012, a selection field 2013, and an operation button 2014.
[0179] The input field 2010 is a field for inputting the machine learning model to be used. For example, the name of the table 500 that defines the machine learning model is input. The input field 2011 is a field for inputting input data to be predicted. For example, the name of the input data is input. The input field 2012 is a field for inputting various thresholds to be used in the uncertainty level determination process.
[0180] The selection field 2013 is a field for selecting the uncertainty level to be displayed on the uncertainty map. The selection field 2013 displays check boxes for selecting the uncertainty level to be displayed.
[0181] The operation button 2014 is an operation button for issuing instructions to execute the inference process, the uncertainty level determination process, and the inference result output process.
[0182] The result display area 2002 is a field for displaying the processing results. The result display area 2002 includes a display field 2020.
[0183] In the display field 2020, for example, input data 2021, inference results 2022, and an uncertainty map 2023 are displayed.
[0184] According to Example 3, the computer system can present an uncertainty map along with the inference results for the input data to be predicted. By referring to the uncertainty map, the user can confirm the degree of uncertainty of the segments included in the inference results. Furthermore, the user can correct the inference results based on the uncertainty map and register them as new training data. By performing machine learning using the training data, it is possible to generate a machine learning model that has high inference accuracy and outputs reliable inference results.
[0185] It should be noted that the present invention can also provide a machine learning model that uses data other than images, such as text and spectra, as input.
[0186] The present invention is not limited to the above-described embodiments, but includes various modifications. For example, the above-described embodiments are provided to explain the present invention in detail, and the present invention is not necessarily limited to those including all of the described configurations. Furthermore, some of the configurations of each embodiment can be added to, deleted from, or replaced with other configurations.
[0187] Furthermore, some or all of the above-described configurations, functions, processing units, processing means, etc. may be implemented in hardware, for example, by designing them as integrated circuits. The present invention can also be realized by software program code that implements the functions of the embodiments. In this case, a storage medium on which the program code is recorded is provided to a computer, and a processor included in the computer reads the program code stored in the storage medium. In this case, the program code itself read from the storage medium implements the functions of the above-described embodiments, and the program code itself and the storage medium on which it is stored constitute the present invention. Examples of storage media for providing such program code include flexible disks, CD-ROMs, DVD-ROMs, hard disks, solid-state drives (SSDs), optical disks, magneto-optical disks, CD-Rs, magnetic tape, non-volatile memory cards, and ROMs.
[0188] Furthermore, the program code that realizes the functions described in this embodiment can be implemented in a wide range of programming or scripting languages, such as assembler, C / C++, perl, Shell, PHP, Python, and Java.
[0189] Furthermore, the program code of the software that realizes the functions of the embodiments may be distributed via a network and stored in a storage means such as a computer's hard disk or memory, or in a storage medium such as a CD-RW or CD-R, and the processor of the computer may read and execute the program code stored in the storage means or the storage medium.
[0190] In the above-described embodiment, the control lines and information lines are those that are considered necessary for the explanation, and not all control lines and information lines are necessarily shown in the product. All components may be interconnected.
Claims
1. A computer system comprising: a computer having a processor and a storage device connected to the processor; and holding definition information of a model used in inference for classifying pixels included in an image into a plurality of classes, the model being a model that calculates the probability that the pixel falls into each of the plurality of classes, the processor: accepts an input of an image; performs inference on the image a plurality of times using a model that is a modification of the model defined by the definition information; calculates a probability distribution for each of the plurality of classes for each pixel of the image based on the results of the plurality of inferences; calculates a plurality of uncertainty indices that represent the uncertainty of the inference for the pixel by statistically processing the probability distribution for each of the plurality of classes for each pixel of the image; assigns an uncertainty level, which is a classification of uncertainty, to each pixel of the image based on the plurality of uncertainty indices; and generates and outputs an uncertainty map to present the uncertainty level of each pixel of the image.
2. A computer system as described in claim 1, wherein the processor calculates as a first uncertainty index the variance of the class having the largest mode, median or mean of the probability distribution, calculates as a second uncertainty index the sum of the mode, median or mean of the probability distribution of the class having a magnitude of the mode, median or mean smaller than the third largest, and uses the first uncertainty index and the second uncertainty index to assign three uncertainty levels: a first level indicating that the result of the inference is reliable, a second level indicating that the result of the inference is unreliable, and a third level indicating that the pixel is located on the boundary between areas of different classes.
3. A computer system according to claim 2, wherein the processor: determines whether the first uncertainty index of the pixel is smaller than a first threshold; and assigns the first level if the first uncertainty index of the pixel is smaller than the first threshold; when the first uncertainty index of the pixel is equal to or greater than the first threshold, determines whether the second uncertainty index of the pixel is greater than a second threshold; and assigns the second level if the second uncertainty index of the pixel is greater than the second threshold; and when the second uncertainty index of the pixel is equal to or less than the second threshold, calculates an evaluation index for evaluating the degree of overlap of the probability distributions of the first and second classes in terms of the magnitude of the mode, median, or mean of the probability distributions, and determines whether the evaluation index is smaller than the first uncertainty index; and assigns the third level if the evaluation index is smaller than the first uncertainty index.
4. A computer system as described in claim 3, wherein the processor identifies pixels to which the uncertainty level has not been assigned, determines whether the size of a judgment area formed by the identified pixels and which belong to the same class is smaller than a third threshold, and if the judgment area is smaller than the third threshold, assigns a fourth level to the pixels included in the judgment area, indicating that the judgment area is small.
5. A computer system as described in claim 3, wherein the processor receives from a user a designation of the uncertainty level to be confirmed, and generates the uncertainty map that highlights the pixels to which the designated uncertainty level has been assigned.
6. A computer system as described in claim 5, characterized in that the processor divides the image into a plurality of partial images, calculates, for each partial image, a ratio of the pixels in the partial image that have been assigned the specified uncertainty level, identifies the partial images in which the ratio is greater than a fourth threshold, and generates the uncertainty map that highlights the pixels included in the identified partial images and that have been assigned the specified uncertainty level.
7. A method of determining uncertainty of inference executed by a computer system, the computer system comprising a computer having a processor and a storage device connected to the processor, and holding definition information of a model used in inference for classifying pixels included in an image into a plurality of classes, the model being a model for calculating a probability of the pixel belonging to each of the plurality of classes, the method of determining uncertainty of inference comprising: a first step in which the computer system receives an input of an image; a second step in which the computer system executes inference on the image a plurality of times using a model obtained by modifying the model defined by the definition information; a third step in which the computer system calculates a probability distribution for each pixel of the image for each of the plurality of classes based on the results of the plurality of inferences; a fourth step in which the computer system calculates a plurality of uncertainty indices representing the uncertainty of the inference for the pixel by statistically processing the probability distribution for each of the plurality of classes for each pixel of the image; and a fifth step in which the computer system assigns an uncertainty level, which is a classification of uncertainty, to each pixel of the image based on the plurality of uncertainty indices. and a sixth step in which the computer system generates and outputs an uncertainty map to indicate the uncertainty level for each pixel of the image.
8. A method for determining uncertainty of inference as described in claim 7, wherein the fourth step includes a step by the computer system calculating the variance of the class having the largest mode, median or mean of the probability distribution as a first uncertainty index, and a step by the computer system calculating the sum of the mode, median or mean of the probability distribution of the class having a magnitude smaller than the third largest mode, median or mean of the probability distribution as a second uncertainty index, and the fifth step includes a step by the computer system using the first uncertainty index and the second uncertainty index to assign three uncertainty levels: a first level indicating that the result of the inference is reliable, a second level indicating that the result of the inference is unreliable, and a third level indicating that the pixel is located on the boundary between areas of different classes.
9. A method for determining uncertainty of inference as described in claim 8, wherein the fifth step includes the steps of: the computer system determining whether the first uncertainty index of the pixel is smaller than a first threshold; and if the first uncertainty index of the pixel is smaller than the first threshold, the computer system assigning the first level; if the first uncertainty index of the pixel is equal to or greater than the first threshold, the computer system determining whether the second uncertainty index of the pixel is greater than a second threshold; and if the second uncertainty index of the pixel is greater than the second threshold, the computer system assigning the second level; if the second uncertainty index of the pixel is equal to or less than the second threshold, the computer system calculating an evaluation index for evaluating the degree of overlap of the probability distributions of the first and second classes in terms of the magnitude of the mode, median, or mean value of the probability distributions, and determining whether the evaluation index is smaller than the first uncertainty index; and if the evaluation index is smaller than the first uncertainty index, the computer system assigning the third level.
10. A method for determining uncertainty of inference as described in claim 9, wherein the fifth step includes the steps of: the computer system identifying the pixels to which the uncertainty level has not been assigned; the computer system determining whether the size of a judgment area formed by the identified pixels and which belong to the same class is smaller than a third threshold; and, if the judgment area is smaller than the third threshold, the computer system assigning a fourth level to the pixels included in the judgment area, indicating that the judgment area is small.
11. A method for determining uncertainty in inference as described in claim 9, wherein the sixth step includes: a step in which the computer system receives, from a user, a designation of the uncertainty level to be confirmed; and a step in which the computer system generates the uncertainty map that highlights the pixels to which the designated uncertainty level has been assigned.
12. A method for determining uncertainty of inference as described in claim 11, wherein the sixth step includes the steps of: dividing the image into a plurality of partial images by the computer system; calculating a ratio of the pixels in each partial image to which the specified uncertainty level has been assigned by the computer system; identifying the partial images in which the ratio is greater than a fourth threshold value by the computer system; and generating the uncertainty map that highlights the pixels included in the identified partial images and to which the specified uncertainty level has been assigned by the computer system.
13. A computer system comprising: a computer having a processor and a storage device connected to the processor; managing definition information of a model used for inference; the processor accepts input of data to be inferred; generating a model by modifying the model defined by the definition information; and executing a process of inferring the data using the model multiple times; calculating a probability distribution for the inference based on the results of the multiple inferences; calculating multiple uncertainty indices representing the uncertainty of the inference by statistically processing the probability distribution for the inference; and determining an uncertainty level, which is a classification of uncertainty, based on the multiple uncertainty indices.
Citation Information
Patent Citations
Identifying the boundary of a lesion in image data
JP2022527525A
Determination evaluation device, method, and program
JP2024017902A
Learning device, method, and program, and medical image processing device
WO2022138277A1
