Machine learning program, machine learning method, and machine learning device
The machine learning program and device address the challenge of attribute bias by determining attribute type and weighting errors, enhancing estimation accuracy and fairness in decision-making support.
Patent Information
- Application Number
- PCT/JP2023/022294
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2023-06-15
- Publication Date
- 2024-12-19
AI Technical Summary
Existing machine learning techniques struggle to accurately identify biased attributes, especially when dealing with discrete attributes, leading to decreased estimation accuracy and fairness in decision-making support, due to limitations in handling discrete versus continuous attributes.
A machine learning program and device that determines whether an attribute is discrete or continuous by generating change data using a generative model, weighting errors based on discrete boundaries, and training the model with a loss function that prioritizes error weights for discrete attributes, thereby improving estimation accuracy and fairness.
This approach enhances the accuracy of machine learning models by effectively distinguishing between discrete and continuous attributes, reducing bias and improving fairness in decision-making support.
Smart Images

Figure JP2023022294_19122024_PF_FP_ABST
Abstract
Description
Machine learning program, machine learning method, and machine learning device
[0001] The present invention relates to a machine learning program, a machine learning method, and a machine learning device.
[0002] In recent years, attempts have been made to use machine learning models trained by deep learning to provide decision support. In such decision support, biases contained in the training data or the model itself, known as bias, can sometimes result in unfair output from the machine learning model. Attributes that are expected to affect fairness can be identified relatively easily. However, if we could identify attributes that affect fairness other than those that are easily expected to affect fairness, we believe we could more appropriately correct unfair results.
[0003] Therefore, the following techniques have been proposed to identify biased attributes. For example, a group of images with changes made along the axis of a candidate attribute is classified using a classification model, and a loss function is generated taking into account the frequency and degree of change in the classification results. Then, through optimization, attributes that have a high tendency to change the classification results, i.e., attributes with bias, can be identified.
[0004] As a machine learning technique, a technique has been proposed that calculates the posterior probability distribution of attribute classes using a least-squares probabilistic classifier, estimates attribute values as discrete quantities, and weights and integrates the continuous and discrete scores. Another technique has been proposed that converts attribute values assigned to each image in a training set into probabilities, calculates an evaluation value for each image, and determines the expression parameter value of a target phenomenon based on a threshold corresponding to the estimation model with the smallest evaluation value. Another technique has been proposed that initializes the parameters of a prior classifier by sampling from a predetermined distribution, performs training using an unbiased probability function, and initializes the parameters of a subsequent classifier using the parameters learned by the prior classifier to recognize images using the unbiased probability function. Another technique has been proposed that obtains training data for a bias-removal model based on the probability distribution of a bias-sensitive variable, divides the training data into clusters based on the variable, and adjusts the weights of the training data set to match the probability distribution of the variable.
[0005] International Publication No. 2012 / 077476 Japanese Patent Application Publication No. 2020-135568 U.S. Patent Application Publication No. 2019 / 0050689 U.S. Patent Application Publication No. 2020 / 0081865
[0006] Zhiheng Li, Chenliang Xu, Discover the Unknown Biased Attribute of an Image Classifier, In proceedings of ICCV (2021)
[0007] However, in technologies that identify biased attributes by applying changes along the axis of a candidate attribute, the accuracy of attribute discovery can be reduced when the attribute has a discrete meaning, such as whether or not the person is wearing glasses, because the technology takes into account unnecessary changes along the way. For example, there is a risk that images that are not realistic may be considered. Therefore, a method of manually labeling whether an attribute has a discrete meaning is considered, but manual labeling is a heavy burden and is not practical when there is a large amount of data. Furthermore, because binary labels are sometimes assigned to attributes that can have continuous meaning, it is difficult to distinguish whether an attribute is discrete or not simply from a given label.
[0008] Furthermore, in a technique that estimates attribute values as discrete quantities from the posterior probability distribution of attribute classes obtained using a least-squares probabilistic classifier, the attribute classes are given from the beginning, making it difficult to determine whether an attribute with an unknown number of classes is discrete. Furthermore, a technique that determines expression parameter values for a target phenomenon based on evaluation values obtained from attribute values assigned to each image in a training set does not consider whether the attribute is discrete. A technique that initializes the parameters of a subsequent classifier using parameters learned in a prior classifier and recognizes images using an unbiased probability function also does not consider whether the attribute is discrete. Furthermore, a technique that divides acquired training data based on the probability distribution of bias-sensitive variables and adjusts the weights of the training data set also does not consider whether the attribute is discrete. Therefore, regardless of the technique used, it is difficult to identify biased attributes, making it difficult to improve the estimation accuracy of machine learning models.
[0009] The disclosed technology has been made in consideration of the above, and aims to provide a machine learning program, a machine learning method, and a machine learning device that improve the estimation accuracy of a machine learning model.
[0010] In one aspect, the machine learning program, machine learning method, and machine learning device disclosed in the present application cause a computer to execute the following process: generate a plurality of change data by continuously changing a specific attribute using a generative model; determine whether the specific attribute is a discrete attribute or a continuous attribute; and, if the specific attribute is determined to be a discrete attribute, determine, for a plurality of outputs obtained by inputting each of the plurality of change data into a machine learning model, an error weight for a second output corresponding to a non-discrete boundary of the output so that the error weight for a first output corresponding to a discrete boundary of the output is smaller than the error weight for a first output; and train the machine learning model based on a loss function including the determined error weights.
[0011] According to one aspect of the machine learning program, machine learning method, and machine learning device disclosed in the present application, it is possible to improve the estimation accuracy of a machine learning model.
[0012] FIG. 1 is a block diagram of a machine learning device according to an embodiment. FIG. 2 is a diagram of an example of an output value sequence, which is a number line indicating output values. FIG. 3 is a diagram for explaining calculation of difference weights. FIG. 4 is a flowchart showing an overall hyperplane generation process that takes into account discrete values of each attribute, performed by a machine learning device according to Example 1. FIG. 5 is a flowchart of a classification model training process. FIG. 6 is a flowchart of an attribute determination process. FIG. 7 is a flowchart of an optimization process. FIG. 8 is a diagram showing a coordinate plane used in an attribute determination process by a machine learning device according to Example 2. FIG. 9 is a hardware configuration diagram of a machine learning device.
[0013] The following describes in detail embodiments of the machine learning program, the machine learning method, and the machine learning device disclosed in the present application with reference to the accompanying drawings. Note that the machine learning program, the machine learning method, and the machine learning device disclosed in the present application are not limited to the following embodiments.
[0014] 1 is a block diagram of a machine learning device according to an embodiment. The machine learning device 1 includes a control unit 10 and a storage unit 11.
[0015] The storage unit 11 stores a classification model group 110, which includes a collection of classification models 111 for each attribute for performing classification for each attribute. The classification models 111 are machine learning models. The classification model group 110 includes a target attribute classification model 112 for performing classification of a target attribute as one of the classification models 111. The target attribute is an attribute that is ultimately the subject of classification, for example, an attribute that is the subject of judgment in decision-making support. The storage unit 11 also stores an image generation model 120 that generates a change image that shows continuous changes along a hyperplane of the attribute.
[0016] The control unit 10 identifies bias attributes, which are attributes that bias the target attributes, and trains the classification model 111 of the target attributes to reduce the influence of the bias attributes. By performing classification using the classification model 111 of the target attributes trained by the control unit 10, it becomes possible to provide fair decision-making support with bias removed.
[0017] The following describes in detail the control unit 10. The control unit 10 includes a classification model training processing unit 101, an attribute determination unit 102, an optimization unit 103, and a scanned image generation unit 104.
[0018] The classification model training processing unit 101 executes the classification model training process described below to train each of the classification models 111. The classification model training processing unit 101 acquires a training dataset 21 from the dataset storage device 2. The classification model training processing unit 101 also acquires dataset attributes 22 indicating an attribute set including information on multiple attributes possessed by the training data of the training dataset 21.
[0019] Next, the classification model training processing unit 101 selects one attribute of interest from the set of attributes indicated by the dataset attributes 22. Next, the classification model training processing unit 101 identifies a classification model 111 for the attribute of interest from the classification model group 110 stored in the storage unit 11. Then, the classification model training processing unit 101 trains the classification model 111 for the attribute of interest using training data included in the training dataset 21. The classification model training processing unit 101 trains the classification model 111 for all attributes indicated by the dataset attributes 22.
[0020] The attribute determination unit 102 executes the attribute determination process described below to determine whether each attribute is discrete or continuous. Here, the number of labels assigned to each attribute is called the "number of categories." For example, an attribute having two labels, "faces wearing glasses" and "faces not wearing glasses," has two labels and the number of categories is two.
[0021] In this embodiment, the upper limit of the number of discrete categories is predetermined, and the attribute determination unit 102 has information on the upper limit of the number of discrete categories. For example, if the number of categories is determined to be discrete up to 3, attributes with a number of categories of 4 or more are considered continuous.
[0022] The attribute determination unit 102 acquires the training dataset 21 and the dataset attributes 22 from the dataset storage device 2. Then, the attribute determination unit 102 selects one attribute of interest from the set of attributes indicated by the dataset attributes 22. In this case, the attribute of interest does not need to include the target attribute. In other words, the attribute of interest is an attribute that may bias classification by the target attribute.
[0023] Next, the attribute determination unit 102 identifies a trained classification model 111 for the attribute of interest from the classification model group 110 stored in the storage unit 11. Next, the attribute determination unit 102 inputs training data into the trained classification model 111 for the attribute of interest. Then, the attribute determination unit 102 collects, as determination outputs, output values corresponding to the number of pieces of training data output from the classification model 111 for the attribute of interest.
[0024] Here, the attribute determination unit 102 can normalize the possible range of the output value to 0 to 1, convert the output value into a probability value, and use the value as a determination output in the attribute determination process. Normalizing the output value makes it possible to easily compare different attributes.
[0025] FIG. 2 is a diagram of an example of an output value sequence, which is a number line showing output values. Each circle in FIG. 2 represents an output value 130 when each training data is input. As shown in FIG. 2, the output value 130 can be expressed on a number line. FIG. 2 shows a case where the range of possible output values is 0 to 1, and the output values are shown as probability values.
[0026] Next, the attribute determination unit 102 sets the number of categories of the attribute of interest to n and executes the following determination process while increasing the value by one from n=2. The attribute determination unit 102 divides the collected determination outputs into n groups, which is the set number of categories. Here, the attribute determination unit 102 can divide the determination outputs into groups using a clustering method such as the k-nearest neighbor method, for example.
[0027] Next, the attribute determination unit 102 calculates the center of gravity of each group. The attribute determination unit 102 can use the average, median, or the like of the determination outputs included in each group as the center of gravity. The attribute determination unit 102 then determines whether the calculated center of gravity of each group falls within an interval obtained by dividing the range of values that the output value can take into n equal parts.
[0028] Here, the range of values that the output value of the classification model 111 that performs classification based on a specific attribute can take is, in the case of image classification, the difference between the output values when the change images at both ends are input, when a change image is created by changing the value within the range that can be taken on the hyperplane of the specific attribute. Also, if the output value is a probability value, the range of values that the output value can take is 0 to 1.
[0029] If the center of gravity of each group falls within n equal intervals, the attribute determination unit 102 determines that the attribute of interest is a discrete attribute that is n-valued. For example, if n is 2, the attribute determination unit 102 determines that the attribute of interest is binary.
[0030] On the other hand, if the center of gravity of each group is not within the n equal intervals, the attribute determination unit 102 increments n by 1 and repeats the same determination process. If the center of gravity of each group is not within the n equal intervals even when n reaches the upper limit of the number of categories, the attribute determination unit 102 determines that the attribute of interest is a continuous attribute having stages equal to or greater than the upper limit of the number of categories.
[0031] For example, consider the case where the level of the attribute of interest in Figure 2 is 4. In this case, the attribute determination unit 102 divides the output values 110 into four groups 131 to 134. Then, it calculates the centers of gravity of the determination outputs included in the groups 131 to 134. The attribute determination unit 102 also determines whether the centers of gravity of the groups 131 to 134 are included in each of intervals 141 to 144, which are obtained by equally dividing the range of 0.0 to 1.0 that the output values can take into. In this case, the attribute determination unit 102 determines that the centers of gravity of the groups 131 to 134 are not included in each of the intervals 141 to 134.
[0032] The attribute determination unit 102 performs the above determination process for all attributes other than the target attribute to determine whether they are discrete or continuous. The attribute determination unit 102 then outputs the determination results for each attribute to the optimization unit 103. In this case, the attribute determination unit 102 notifies the optimization unit 103 of the number of classifications as the determination result for discrete attributes. Furthermore, the attribute determination unit 102 notifies the optimization unit 103 that continuous attributes are continuous.
[0033] For example, a specific example will be described in which the set of attributes indicated by the dataset attributes 22 includes four attributes: "age," "gender," "smile," and "glasses." Here, the upper limit of the number of discrete categories is three, that is, all attributes with four or more categories are considered continuous.
[0034] For example, the attribute determination unit 102 selects "age" as the attribute of interest. Next, the attribute determination unit 102 sequentially inputs images, which are training data included in the training dataset 21, to a classification model 111 that performs classification based on "age." Then, the attribute determination unit 102 collects output values from the classification model 111 for each training data as a determination output. Next, the attribute determination unit 102 calculates a probability value corresponding to the determination output. Next, the attribute determination unit 102 sets the initial number of categories to 2. Then, the attribute determination unit 102 classifies the determination outputs into two groups. Then, the attribute determination unit 102 determines whether the centers of gravity of each group are within each of two intervals obtained by equally dividing the range of possible output values for attribute-based classification. Here, consider a case where the centers of gravity of the determination outputs belonging to the two groups are not within either of the two intervals. In this case, because the number of categories at that point has not yet reached three, the attribute determination unit 102 sets the number of categories to three as the next number of categories. Then, the attribute determination unit 102 classifies the determination outputs into three groups. Then, it is determined whether the center of gravity of each group falls within one of three intervals obtained by dividing the range of possible output values of attribute-based classification into three equal parts. Here, we consider a case where the centers of gravity of output values belonging to three groups fall within each of the three intervals. In this case, the attribute determination unit 102 determines that the number of classification values for the target attribute "age" is three, and that it is a continuous attribute.
[0035] In this way, the attribute determination unit 102 divides the determination outputs obtained by inputting a plurality of data into the classification model 111, which is a machine learning model, into a predetermined number of groups based on the specific attribute. Then, the attribute determination unit 102 determines whether the specific attribute is a discrete attribute or a continuous attribute based on whether the center of gravity of the determination outputs for each group is included in each of the divided ranges obtained by equally dividing the range of possible outputs obtained by changing the specific attribute by a predetermined number.
[0036] The optimization unit 103 receives an input of the determination result of whether each attribute other than the target attribute is discrete or continuous from the attribute determination unit 102. Then, for each attribute determined to be discrete, the optimization unit 103 calculates a loss value by performing a loss value calculation process described below, in which a weight is assigned to the difference to calculate a loss value.
[0037] The optimization unit 103 selects one attribute of interest from the attributes determined to be discrete. Next, the optimization unit 103 calculates the difference in the output value of the classification model 111 for the change data of the attribute of interest. The change data is data obtained when the attribute is changed so as to have a predetermined number of change stages with both ends as the reference within the range in which the attribute can change. In other words, the range in which the attribute can change corresponds to the sum of the differences between adjacent change data.
[0038] For example, in classification by image recognition, change data corresponds to change images in which the attributes of the target are changed. The number of change stages for the change data is predetermined. Hereinafter, the number of change data will be referred to as the "number of steps." For example, in classification by image recognition, consider the state of wearing glasses and the state of not wearing glasses. In this case, the image with glasses and the image without glasses are change images at both ends of the range in which the attributes can change. If the number of steps is 7, then there will be 7 change images, including the image with glasses and the image without glasses.
[0039] In this embodiment, the number of steps is set to be greater than 4. The optimization unit 103 may have a transition image generated in advance, or may use the image generation model 120 to acquire a transition image that is output when data whose values are changed according to a determined number of steps along the hyperplane of the attribute of interest is input.
[0040] FIG. 3 is a diagram for explaining the calculation of difference weights. Here, image classification is used as an example. The output value sequence 200 represents a sequence in which output values are arranged in order when each change image is input in the order of change. In this case, the number of steps is seven, and output values 201 to 207 exist from the classification model 111 when seven change images are input. The area in the output value sequence 200 where the output value of each change image is located is called a "step." The output values 201 to 207 correspond to the seven change images. The output value 201 is the output corresponding to the first change image, the output values 202 to 206 are the outputs corresponding to change images in which the attribute of interest gradually changes, and the output value 207 is the output corresponding to the last change image in which the change has finished.
[0041] Next, the optimization unit 103 sets n, the number of categories of the target attribute having n-value labels, to nν, the number of intervals in the range in which the attribute can change. Here, an example will be described in which the number of categories n of the target attribute is 3. That is, the optimization unit 103 sets the number of intervals nν to 3. Next, the optimization unit 103 initializes all values of elements in the weight sequence of differences between adjacent change data to 1.0, resulting in state 211 in FIG. 3 . In the case of FIG. 3 , the number of steps is 7, so there are six differences between steps, which are elements of the weight sequence. Here, the differences between adjacent change data are the differences between change images in the corresponding steps. The values written below the output value sequence 200 facing the paper correspond to the values of each element of the weight sequence. Hereinafter, the space between each step will be referred to as a "boundary point." That is, an element of the weight sequence exists at each boundary point, and the position of the element of the weight sequence in the output value sequence 200 can be considered a boundary point.
[0042] Next, the optimization unit 103 obtains the positions of both ends of the boundary point in the output value sequence 200 as segment points {x}. Here, segment points {x} correspond to the boundary when the output value sequence 200 is segmented not by the steps of continuous images but by the original number of discrete classifications. If the number of classifications is n, there are n-1 segment points {x}. For example, in the output value sequence 200 of FIG. 3, the optimization unit 103 includes the boundary points corresponding to elements 221 and 222 of the weight sequence in segment points {x}, as shown in state 212. In this case, if n is 2, i.e., the attribute of interest is binary, there is one boundary point, and therefore there is also one segment point {x}.
[0043] Next, the optimization unit 103 determines whether the level of the attribute of interest is 2, i.e., whether the number of intervals nν is 2. If the level of the attribute of interest is 2, the optimization unit 103 determines the interval point {x} to be one of the positions on both ends of the weight sequence of the differences between steps, actually, the central point of the output value sequence 200.
[0044] On the other hand, when the number of categories n of the attribute of interest is greater than 2, the optimization unit 103 extracts nv-2 equally spaced points, which is the number of sections nv minus the points on both ends of the boundary point, from the output value sequence 200. When nv=3, the optimization unit 103 extracts one equally spaced point from the output value sequence 200.
[0045] In FIG. 3 , the number of steps is 7, so the equally spaced points do not coincide with the boundary points. As such, there are cases where the equally spaced points do not coincide with the boundary points. This includes the case where n is 2 and the number of steps is odd. In this case, the optimization unit 103 selects the equally spaced boundary points as the segment point {x}. If the equally spaced points are exactly midway between the boundary points in the output value sequence 200, the optimization unit 103 may select either of the boundary points as the segment point {x}. Here, as shown in state 213, the optimization unit 103 selects the boundary point corresponding to element 223 of the weight sequence as the segment point {x}.
[0046] After determining the segment point {x}, the optimization unit 103 sets the weight of the difference in the output value corresponding to the transition image located at the determined segment point {x} to 1.0, and smoothly interpolates the other values to decrease them, thereby determining the values of each element of the weight sequence, as shown in state 214. Here, the values of elements 221, 222, and 223 in the weight sequence are 1.0, so the optimization unit 103 smoothly connects these points and determines the values of elements 224, 225, and 226 in the weight sequence to be 0.8.
[0047] The segment point {x} is an example of a "discrete boundary of the output." The weight of the difference of the output value located at the segment point {x} is an example of an "error weight for the first output corresponding to the discrete boundary of the output." The weight of the difference of the output value corresponding to the other boundary points is an example of an "error weight for the second output corresponding to a point other than the discrete boundary of the output." That is, when a specific attribute is determined to be a discrete attribute, the optimization unit 103 determines the error weight for the second output corresponding to a point other than the discrete boundary of the output so that it is smaller than the error weight for the first output corresponding to the discrete boundary of the output. More specifically, the optimization unit 103 determines the differences between the outputs corresponding to adjacent change data in the change order as multiple errors for the output. Then, the optimization unit 103 selects an error for the first output from the multiple errors for the output based on the order of the change data and the discrete boundary of the output, and determines the errors for the second output other than the error for the first output from the multiple errors for the output.
[0048] Next, the optimization unit 103 calculates a weighted difference by multiplying each weight of the difference in output values corresponding to the change image by the difference in the corresponding output values. Next, the optimization unit 103 calculates a loss value for the attribute of interest using the weighted difference. For example, assuming the case of Non-Patent Document 1, the optimization unit 103 calculates two types of loss values: total variation and orthogonalization penalty. Total variation is a loss value used to input a traversal image obtained by changing the value on the hyperplane representing the attribute of interest into the classification model 111 and determine samples that do not satisfy fairness due to large changes in the classification results. Furthermore, orthogonalization penalty is a loss value used to optimize a vector in the latent space so that it is orthogonal to the target attribute and different from known attributes. Furthermore, the optimization unit 103 calculates a loss value for continuous attributes using an unweighted difference. In this way, the optimization unit 103 trains the machine learning model based on the loss function using the determined error weights.
[0049] The optimization unit 103 then adjusts the parameters representing the hyperplane using the calculated loss value for each attribute to minimize the loss function, thereby generating a hyperplane for each attribute. Hereinafter, the hyperplane with the adjusted parameters will be referred to as an optimized hyperplane. The optimization unit 103 then outputs the optimized hyperplane for each attribute to the scanned image generation unit 104.
[0050] Here, depending on how the weighting is applied to the differences in output values corresponding to consecutive images, it is possible that the sum will be smaller than if no weighting is applied. In this case, if the same attribute is compared, this is not a problem because the weights are the same. However, when different attributes are compared, depending on how the weighting is applied, it is possible that unintended results will occur, such as the output value of one attribute being smaller than the other.
[0051] These issues can be resolved by devising weighting techniques. One method is to make values available for the number of steps to be considered. For example, when the number of steps is 6, i.e., when the number of boundary points is 5 and three segment points {x} are considered, the optimization unit 103 may assign a weight corresponding to segment point {x} of 5 / 3, which is the sum of the weights corresponding to each boundary point, divided by the number of segment points {x}, 3. This makes it possible to keep the total sum of all weights constant. In this case, unlike when consecutive images are generated using three steps, it is possible to fine-tune the parameters of the classification model 111 using five consecutive images generated at equal intervals.
[0052] Additionally, the optimization unit 103 can align the range of values that each attribute can take by normalization or the like. For example, the optimization unit 103 can convert the sum of the differences between the change data for each attribute into a value within a certain range, thereby enabling comparison between different attributes. Specifically, the optimization unit 103 may set the range of values that each attribute can take to be 0 to 1, and express the output value as a probability value.
[0053] For example, a specific example will be described in which the attribute set indicated by the dataset attribute 22 includes four attributes: "age," "gender," "smile," and "glasses." Here, the number of steps of consecutive images that change along the attribute hyperplane is assumed to be six. In addition, to make it easier to compare each attribute, the description will be given assuming that the output value is converted into a probability value. Furthermore, the description will be given assuming that the attribute determination unit 102 determines that the number of classifications for "age" is three.
[0054] The optimization unit 103 selects "age" as the attribute of interest. Next, the optimization unit 103 calculates the difference in probability values between adjacent six consecutive images obtained by changing the value along the hyperplane of "age." Next, the optimization unit 103 obtains the number of classifications for "age" as 3, which is the number of sections nν. Next, the optimization unit 103 initializes all of the values of five elements of the weight sequence corresponding to boundary points in the output value sequence to 1.0. Next, the optimization unit 103 selects points on both ends of the boundary point as segment points {x}. Next, the optimization unit 103 selects, from the boundary points in the output value sequence, equally spaced points with one point obtained by subtracting 2 from the number of sections nν. Then, the optimization unit 103 adds the selected boundary point to segment point {x}. Then, the optimization unit 103 sets the values of elements of the weight sequence corresponding to the three boundary points set as segment points {x} to 1.0. Furthermore, the optimization unit 103 sets the values of the elements of the weight series between the boundary points defined as the division points {x} by smoothly interpolating them so that they are smaller than 1.0. The optimization unit 103 then multiplies the determined weight by the difference in output values when the consecutive images are input, to calculate the weighted difference between the consecutive images according to "age." Thereafter, the optimization unit 103 uses the calculated weighted difference to calculate the loss value of the classification model 111 that performs classification based on "age."
[0055] The scanned image generation unit 104 receives an input of an optimized hyperplane for each attribute from the optimization unit 103. The scanned image generation unit 104 then inputs data changed along the optimized hyperplane for each attribute into the image generation model 120 to generate a scanned image, which is an image changed along the hyperplane for each attribute. In this case, the scanned image generation unit 104 may use a predetermined initial value of a vector for the image generation model 120, train the image generation model 120 based on information about a predetermined bias attribute, and then generate a scanned image using the trained image generation model 120. The scanned image output from the image generation model 120 is then input to the target attribute classification model 112, and the parameters of the target attribute classification model 112 are adjusted using the output to reduce bias.
[0056] 4 is a flowchart illustrating an overall process of generating a hyperplane in consideration of the discrete values of each attribute by the machine learning device according to Example 1. Next, the overall flow of the process of generating a hyperplane in consideration of the discrete values of each attribute by the machine learning device according to Example 1 will be described with reference to FIG.
[0057] The classification model training processing unit 101 uses the training dataset 21 and dataset attributes 22 to perform classification model training processing on the classification model 111 of each attribute included in the classification model group 110 stored in the memory unit 11 (step S1).
[0058] The attribute determination unit 102 executes an attribute determination process to determine whether each attribute other than the target attribute is discrete or continuous using the training dataset 21, dataset attributes 22, and the classification model 111 for each attribute (step S2).
[0059] The optimization unit 103 performs an optimization process to calculate the difference between consecutive images, the number of steps, and the inter-step weight using the classification number for the discrete attributes, and calculate the loss value using the calculated inter-step weight (step S3).
[0060] The optimization unit 103 generates an optimized hyperplane for each attribute using the loss value obtained by the optimization process (step S4).
[0061] The scanned image generation unit 104 generates scanned images along the hyperplanes of the bias attributes, which are attributes that can be biased, by using the hyperplanes of the bias attributes in the image generation model 120 (step S5). Then, by training the target attribute classification model 112 using the generated scanned images, it is possible to reduce bias due to the bias attributes in the estimation by the target attribute classification model 112.
[0062] Fig. 5 is a flowchart of the classification model training process. The flow shown in Fig. 5 shows an example of the process executed in step S1 in Fig. 4. Next, the flow of the classification model training process will be described with reference to Fig. 5.
[0063] The classification model training processing unit 101 acquires the training dataset 21 from the dataset storage device 2 (step S101). The classification model training processing unit 101 also acquires dataset attributes 22 that indicate attributes of the training data included in the training dataset 21.
[0064] Next, the classification model training processing unit 101 sets a variable i representing an attribute to 0 (step S102). Here, a case will be described in which there are L attributes indicated by the dataset attributes 22.
[0065] Next, the classification model training processing unit 101 selects an attribute ai as a target attribute from the set of attributes indicated by the dataset attributes 22 (step S103).
[0066] Next, the classification model training processing unit 101 identifies a classification model mi, which is a classification model 111 for classifying the attribute ai, from the classification model group 110 held in the storage unit 11 (step S104).
[0067] Then, the classification model training processing unit 101 performs training of the classification model mi using the training data included in the training data set 21 (step S105).
[0068] Thereafter, the classification model training processing unit 101 determines whether i=L-1 (step S106). If i=L-1 is not true (step S106: No), the classification model training processing unit 101 increments i by 1 (step S107). Thereafter, the classification model training processing unit 101 returns to step S103.
[0069] On the other hand, if i=L-1 (step S106: Yes), the classification model training processing unit 101 ends the classification model training process.
[0070] Fig. 6 is a flowchart of the attribute determination process. The flow shown in Fig. 6 shows an example of the process executed in step S2 in Fig. 4. Next, the flow of the attribute determination process will be described with reference to Fig. 6.
[0071] The attribute determination unit 102 selects an attribute ai as a target attribute from among the bias attributes included in the dataset attributes 22 (step S201).
[0072] Next, the attribute determination unit 102 identifies a classification model mi, which is the classification model 111 for the attribute ai, from the classification model group 110 stored in the storage unit 11. The attribute determination unit 102 inputs the training data included in the training data set 21 to each classification model mi (step S202).
[0073] Next, the attribute determination unit 102 collects output values for the number of training data items output from the classification model mi, and sets the collected values as determination outputs (step S203).
[0074] Next, the attribute determining unit 102 sets n, which is the number of categories of the target attribute, to 2 (step S204). Here, a case where the upper limit of the number of categories determined to be discrete is N will be described.
[0075] Next, the attribute determination unit 102 divides the determination outputs into n groups using a clustering method such as the k-nearest neighbor method (step S205).
[0076] Next, the attribute determining unit 102 determines whether the center of gravity of each group falls within an interval obtained by equally dividing the range of values that the output value can take (n intervals) (step S206).
[0077] If the center of gravity of each group falls within the n equally divided intervals (step S206: Yes), the attribute determining unit 102 determines that the number of classifications of the attribute ai is n and that the attribute ai is discrete (step S207).
[0078] On the other hand, if the center of gravity of each group does not fall within the n equally divided sections (step S206: No), the attribute determining unit 102 determines whether n=N (step S208).
[0079] If n=N is not satisfied (step S208: No), the attribute determining unit 102 increments n by 1 (step S209). After that, the attribute determining unit 102 returns to step S205.
[0080] On the other hand, if n=N (step S208: Yes), the attribute determining unit 102 determines that the number of categories of the target attribute is equal to or greater than N and that the attributes are continuous (step S210).
[0081] The attribute determination unit 102 changes the attribute ai to be set as the attribute of interest, and performs the determination process shown in steps S201 to S210 for all attributes other than the target attribute to determine whether they are discrete or continuous.
[0082] Fig. 7 is a flowchart of the optimization process. The flow shown in Fig. 7 shows an example of the process executed in step S3 in Fig. 4. Next, the flow of the attribute determination process will be described with reference to Fig. 7.
[0083] The optimization unit 103 selects an attribute ai as a target attribute from among the discrete bias attributes (step S301).
[0084] Next, the optimization unit 103 calculates the difference in output values of the classification model mi, which is the classification model 111 for the attribute ai, for the changed image of the attribute ai (step S302).
[0085] Next, the optimization unit 103 acquires n, which is the number of classifications of the attribute ai, as the number of intervals nv within the range in which the attribute ai can change (step S303).
[0086] Next, the optimization unit 103 initializes all of the values of elements in the difference weight sequence corresponding to the boundary points of the output value sequence to 1.0 (step S304).
[0087] Next, the optimization unit 103 selects the positions on both ends of the boundary point in the output value sequence as segment points {x} (step S305).
[0088] Next, the optimization unit 103 determines whether nν-2 is greater than 0, that is, whether the number of categories for the attribute ai is 2 (step S306). If nν-2=0 (step S306: No), the optimization unit 103 determines that the points at both ends of the boundary point already selected are all points included in the segment point {x}, and proceeds to step S309. If the number of categories is 2, the points at both ends of the boundary point are the center points of the output value sequence.
[0089] On the other hand, if nν−2 is greater than 0 (step S306: Yes), the optimization unit 103 extracts nν−2 equally spaced points from the boundary points in the output value sequence (step S307).
[0090] Then, the optimization unit 103 adds the extracted points to the segment points {x} (step S308).
[0091] Next, the optimization unit 103 sets the weight corresponding to the boundary point located at the determined segment point {x} to 1.0, and sets the values of the elements of each weight series by smoothly interpolating so that the weights corresponding to the other boundary points are smaller than 1.0 (step S309).
[0092] Next, the optimization unit 103 calculates a weighted difference by multiplying the difference in the output value of the transition image by each of the weights between the steps (step S310).
[0093] Then, the optimization unit 103 calculates the loss value of the attribute of interest using the weight difference (step S311).
[0094] As described above, the machine learning device according to this embodiment determines whether attributes other than a target attribute, which produces continuously changing output values, are discrete or continuous. Then, the machine learning device according to this embodiment generates weights for discrete attributes according to the number of classifications, and calculates a loss value by weighting the difference in output values. This enables classification using an evaluation scale equivalent to that used when labels are automatically and manually assigned, making it easier to discover meaningful attributes among attributes that produce unfair results. Therefore, the influence of bias in estimations made by machine learning models can be reduced, and the accuracy of estimations that ensure fairness can be improved.
[0095] Next, a second embodiment will be described. The machine learning device 1 according to this embodiment is also shown in the block diagram of FIG. 1. Depending on the type of model and loss function, even if the label is binary, the classification model 111 may output one or two values. For example, classification using binary cross entropy (binary_crossentropy) results in one output, while classification using two-class class cross entropy (categorical_crossentropy) results in two outputs. When there is one output, the distribution of output values can be considered on a number line as shown in FIG. 3, but when there are two outputs, it can also be considered as points on a two-dimensional plane.
[0096] Therefore, when there are two outputs for a binary label, the machine learning device 1 according to this embodiment considers the distribution of output values as two-dimensional points. The attribute determination unit 102 according to this embodiment considers attributes with level 2 as discrete attributes and attributes with level 3 or more as continuous attributes. Examples of attributes with level 2 include a class indicating non-smiling faces and smiling faces, and a class indicating faces without glasses and faces with glasses. Here, the two classes are class A and class B. The output value is represented by a probability value of class A and a probability value of class B.
[0097] FIG. 8 is a diagram illustrating a coordinate plane used in the attribute determination process by the machine learning device according to the second embodiment. The attribute determination unit 102 sets a coordinate plane as shown in FIG. 8 , with the probability value of class A being P(A) and the probability value of class B being P(B). In this case, the output value is P(A)+P(B)=1. That is, the output value is plotted on a straight line L shown in FIG. 8 . With respect to a center point P that bisects the straight line L, points located in the direction of arrow D1 represent output values determined to be class A, and points located in the direction of arrow D2 represent output values determined to be class B.
[0098] The attribute determination unit 102 performs clustering on the line L and determines whether the center of gravity is within an area divided according to a predetermined criterion, thereby determining whether the attribute is at level 2. Here, the attribute determination unit 102 can use, for example, a method of dividing the area into two areas, one on the arrow D1 side and one on the arrow D2 side, from the center point P of the line L, as a division method using a predetermined criterion. By using the above method, even when the attribute determination unit 102 has two outputs, it can determine whether the attribute label is binary and discrete, or whether the label is binary or more and continuous.
[0099] As described above, the machine learning device according to this embodiment can determine whether the attribute to be classified by a classification model is discrete or continuous, even if the classification model outputs two values as an output value representing a binary value. Therefore, even when a classification model that outputs two values as an output value representing a binary value is used, the influence of bias in estimation by the machine learning model can be reduced, and the accuracy of estimation can be improved while ensuring fairness.
[0100] (Hardware Configuration) Fig. 9 is a diagram showing the hardware configuration of the machine learning device 1. Next, an example of the hardware configuration for realizing each function of the machine learning device 1 will be described with reference to Fig. 9 .
[0101] 9, the machine learning device 1 includes, for example, a CPU (Central Processing Unit) 91, a memory 92, a hard disk 93, and a network interface 94. The CPU 91 is connected to the memory 92, the hard disk 93, and the network interface 94 via a bus.
[0102] The network interface 94 is an interface for communication between the machine learning device 1 and an external device. The network interface 94 relays communication between the dataset storage device 2 and the CPU 91, for example.
[0103] The hard disk 93 is an auxiliary storage device. The hard disk 93 realizes the function of the storage unit 11 illustrated in Fig. 1. The hard disk 93 also stores a nuclide program including programs for realizing the functions of the classification model training processing unit 101, the attribute determination unit 102, the optimization unit 103, and the scanned image generation unit 104 illustrated in Fig. 1.
[0104] The memory 92 is a main storage device, and may be, for example, a dynamic random access memory (DRAM).
[0105] The CPU 91 reads various programs from the hard disk 93, loads them into the memory 92, and executes them. In this way, the CPU 91 realizes the functions of the classification model training processing unit 101, the attribute determination unit 102, the optimization unit 103, and the scanned image generation unit 104 illustrated in FIG.
[0106] REFERENCE SIGNS LIST 1 Machine learning device 2 Data set storage device 10 Control unit 11 Memory unit 101 Classification model training processing unit 102 Attribute determination unit 103 Optimization unit 104 Scanned image generation unit
Claims
1. A machine learning program that causes a computer to execute the following processes: generating multiple change data by continuously changing a specific attribute using a generative model; determining whether the specific attribute is a discrete attribute or a continuous attribute; and if the specific attribute is determined to be a discrete attribute, determining, for multiple outputs obtained by inputting each of the multiple change data into a machine learning model, an error weight for a second output corresponding to a non-discrete boundary of the output so that the error weight for a first output corresponding to a discrete boundary of the output is smaller than the error weight for a second output, which corresponds to a non-discrete boundary of the output; and training the machine learning model based on a loss function including the determined error weight.
2. The machine learning program of claim 1, characterized in that the determination process includes the steps of: determining each of the output differences for adjacent change data according to the order of the changes as a plurality of errors for the output; selecting an error for the first output from among the plurality of errors for the output based on the order of the change data and the discrete boundaries of the outputs; and determining all of the plurality of errors for the output other than the error for the first output as errors for the second output.
3. The machine learning program of claim 1, characterized in that the judgment process includes a process of dividing judgment outputs obtained by inputting a plurality of data into the machine learning model into a predetermined number of groups based on the specific attribute, and judging whether the specific attribute is a discrete attribute or a continuous attribute based on whether the center of gravity of the judgment outputs for each group is included in each of the divided ranges obtained by equally dividing the range of possible outputs obtained by changing the specific attribute by the predetermined number.
4. A machine learning method characterized in that a computer executes the following processes: generating a plurality of change data by continuously changing a specific attribute using a generative model; determining whether the specific attribute is a discrete attribute or a continuous attribute; and if the specific attribute is determined to be a discrete attribute, determining, for a plurality of outputs obtained by inputting each of the plurality of change data into a machine learning model, an error weight for a second output corresponding to a non-discrete boundary of the output so that the error weight for a first output corresponding to a discrete boundary of the output is smaller than the error weight for a second output, which corresponds to a non-discrete boundary of the output; and training the machine learning model based on a loss function including the determined error weight.
5. A machine learning device comprising: a memory unit that stores a machine learning model that performs classification based on each of a plurality of attributes; and a control unit that executes the following processes: generating a plurality of change data by continuously changing a specific attribute using a generative model; determining whether the specific attribute is a discrete attribute or a continuous attribute; and, if the specific attribute is determined to be a discrete attribute, determining, for a plurality of outputs obtained by inputting each of the plurality of change data into the machine learning model, an error weight for a second output corresponding to a non-discrete boundary of the output so that the error weight for a first output corresponding to a discrete boundary of the output is smaller than the error weight for a first output, and training the machine learning model based on a loss function including the determined error weight.
Citation Information
Patent Citations
Method and device for outputting information, electronic device, storage medium, and computer program
JP2022534160A
