The present disclosure relates to a technique of generating training data for machine learning.
Machine learning has been used for decision-making on individuals for entrance examinations, employment, credit, etc.; however, the cases in which attributes (protected attributes) on which no discrimination is supposed to be made have an effect on the result of prediction have occurred.
In recent years, in consideration of potential social problems, such as discrimination, a technique of modifying an instance (known data) using a trained classifier, and the like, have been used as techniques of making corrections to eliminate biases from the result of prediction. For example, after calculating classification scored of instances using the classifier with respect to training data or test data, sorting by label, and changing the labels such that the probability matches between two groups, sorting according to the classification scores makes corrections to instances labeled as highly ambiguous. For example, related arts are disclosed in Japanese National Publication of International Patent Application No. 2019-519021
According to an aspect of an embodiment, a non-transitory computer-readable recording medium stores therein a training data generation program that causes a computer to execute a process. The process includes acquiring sets of data each of which is labeled as favorable or unfavorable, calculating a ratio of a number of sets of data labeled as favorable and a number of sets of data labeled as unfavorable with respect to each of a plurality of types determined by values of a combination of a first attribute and a second attribute that are associated with the sets of data, when a difference in the ratio that is calculated with respect to each of the plurality of types is not less than a threshold, with respect to each combination of a first type contained in the plurality of types and each of types other than the first type, based on the ratio, specifying candidate data to be changed from among a plurality of sets of data having values corresponding to the first type, based on the candidate data specified with respect to each of the combinations, selecting first data from among the plurality of sets of data, and generating training data by changing a label of the first data.
The object and advantages of the invention will be realized and attained by means of the elements and combinations particularly pointed out in the claims.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory and are not restrictive of the invention.
In the above-described technique, however, when only a certain attribute is focused on, the labels are changed and the instances are corrected to execute correction of fairness, there is a possibility that a bias (unfairness) in another attribute would increase.
For example, when there are a plurality of protected attributes, in the above-described technique, the protected attributes are corrected one by one in order. When one protected attribute is corrected however, because the breakdown of other attributes is not taken into consideration and therefore the discrimination on another protected attributes deteriorates, the result of another protected attribute that is corrected once is changed, and discrimination on the group of combinations of protected attributes is not corrected.
Note that, with respect to groups of combinations of a plurality of protected attributes, making a discrimination correction between selected two groups (a pair) is considered; however, because the content to be corrected is determined by the pair of the selected groups, the eventual correction result obtained by repeating selecting groups is sometimes a local solution. As described above, there is a possibility that, because of the features of part of the groups, a correction contrary to the entire features would be made.
Embodiments will be described in detail below based on the drawings. The embodiments do not limit the disclosure. Each embodiment may be combined within a range without inconsistency.
In recent years, machine learning has been used for decision-making on individuals for entrance examinations, employment, credit, etc. The cases in which protected attributes, such as genders and races, on which no discrimination is supposed to be made have an effect on the result of classification (prediction result) however have occurred and have been a problem. For this reason, fairness-considered machine learning that makes a correction to eliminate biases from a prediction result in consideration of potential social problems, such as discrimination, is expected.
Fairness of groups in fairness-considered machine learning is fairness between groups dependent on the values of protected attributes and indicates that probability of each group matches between the groups. For example, when the protected attribute is genders, it is in that there are a male group and a female group and a rate of employment and a rate of loan screening matches. Fairness-considered machine learning makes a correction by modifying data when there is a difference in probability between groups in data that is input and output. Fairness and accuracy are a trade-off and therefore reducing data modification as much as possible and meeting fairness are needed.
Furthermore, not a single protected attribute but multiple protected attributes may be specified. For example, the types and the number of attributes are determined according to the social background or the cultural background and the use case and, when multiple protected attributes are specified, there are groups of combinations of the protected attributes.
According to the disclosed technique, particularly, a difference (unfairness) in the result of classification between groups dependent on groups that are grouped by combinations of a plurality of protected attributes is corrected. To determine whether fairness is met, a certain threshold (tolerance) may be used. A tolerance may be set for each protected attribute and, in that case, the tolerance may be set at a relatively small value in the case of a protected attribute to be corrected strictly and, if not, the tolerance my be set at a relatively large value. An existing fairness algorithm capable of correcting fairness between groups that are grouped by a single protected attribute may be used directly. The fairness algorithm is targeted at data modification (pre-processing or post-processing). An algorithm (in-processing) that configures a model in consideration of fairness can be targeted at. The fairness algorithm may be targeted at issues of binary classification not causing inversion in order (for example, an order in the proportion of favorableness) between original groups. Particularly, the case in which pre-processing is targeted at will be described below.
In the data preparation phase, the information processing device 20 corrects training data 10. The training data 10 is unfair data in which protected attributes can have a significant effect on a classification result, that is, data without consideration of fairness. The unfairness is corrected by the information processing device 20 and data is generated as corrected training data 30.
In the training phase, a training device 40 generates a trained model 50 by machine learning using the corrected training data 30. In the classification phase, a classification device 60 performs classification (prediction) using the trained model 50.
The information processing device 20 executes data modification on the training data that meets fairness by minimum data modification on groups of combinations of a plurality of protected attributes. Specifically, the information processing device 20 acquires a plurality of sets of data each of which is labelled as favorable or unfavorable. Subsequently, the information processing device 20 calculates a ratio of the number of sets of favorable data and the number of sets of unfavorable data with respect to each of a plurality of types of combinations of first attributes and second attributes that are associated with the sets of data, respectively.
When the difference in the ratio that is calculated with respect to each of the types (groups) is at or above a threshold, with respect to each combination of the first type contained in the types and each of all other types, based on the ratio, the information processing device 20 specifies candidate data to be changed among the sets of data with which the first attribute and the second attribute corresponding to the first type are associated.
Subsequently, based on the candidate data to be changed that is specified with respect to each combination, the information processing device 20 selects the first data from among the sets of data with which the first attribute and the second attribute corresponding to the first type are associated. Thereafter, by changing the label of the first data contained in the sets of data, the information processing device 20 generates the corrected training data 30 that is training data.
In other words, the information processing device 20 generates groups of combinations of a plurality of protected attributes, make trials of discrimination correction processing on all pairs of two groups selected from the groups, aggregates the trial results with respect to each group, and modifies the instances in a descending order in the score. As described, the information processing device 20 is able to incorporate the idea of one-versus-one classification in which binary classification algorithm is applied to multiclass classification, reduce unnecessary data modification, and increase fairness in training data and classification data.
The training data 10 is input to the input unit 21. Using the training data 10 that is input to the input unit 21, the controller 22 generates the corrected training data 30. Details of the controller 22 will be described below. The storage unit 23 stores various programs necessary for processing performed by the controller 22 and various types of intermediate data that the controller 22 generates in a process of various types of processing. For example, the storage unit 23 stores the training data 10 and the corrected training data 30. The output unit 24 outputs the corrected training data 30 that is generated by the controller 22.
The controller 22 will be described in detail. The controller 22 includes an acquisition unit 221, a grouping unit 222, a correction trial unit 223, the aggregation unit 224, a calculator 225, a specifying unit 226, a selector 227, and a changer 228.
The acquisition unit 221 acquires the training data 10 that is input to the input unit 21 and stores the training data 10 in a storage 13. The example of the training data 10 will be described with reference to
Attributes are classified into protected attributes and non-protected attributes. Protected attributes are attributes whose effects on classification results are intended to be reduced. Non-protected attributes are attributes other than the protected attributes. An example of the protected attribute is gender, race, religion, or the like. An example of the non-protected attribute is age, address, score (for example, a score of a test), or the like. In
A label presents a classification result and specifically presents a favorable or unfavorable binary value. An example of favorableness and unfavorableness is, for example, passing and failing representing passing or failing in an examination.
Back to
Back to
The correction trial unit 223 has a trial of the correction processing between two groups configuring the pair with respect to each of the six pairs. The correction trial unit 223 has a trial of the correction processing using a fairness algorithm that is also referred to as a bias-bias algorithm. The fairness algorithm between two groups is known and therefore detailed description thereof is not given here. An example of the correction processing is changing the label of the instance. Changing the label includes a change from favorable to unfavorable and change from unfavorable to favorable. Another example of the correction processing is addition and modification of attributes. Except as particularly described, the correction processing is changing the label below. What the correction trial unit 223 performs is a trial of the correction processing and therefore note that, while the result of the correction processing can be acquired, fairness between two groups is not immediately corrected according to the result, that is, changing the label does not modifies the instance.
Back to
The aggregation unit 224 assigns a score to an instance. The timing of assigning a score is not particularly limited and the assignment can be executed until selecting by the selector 227 to be described below. The score is an index (confidence) indicating that there is a substantial need to modify the instance. The aggregation unit 224 determines a score such that the larger the number of results of trials according which the instance is to be modified is, the higher the score is. For example, the aggregation unit 224 determines a score based on the proportion of the number of results of trials (ratio, probability, etc.). In the example illustrated in
Back to
The calculator 225 calculates a fairness metric δ with respect to each of the pairs. A fairness metric δ is a metric for measuring fairness of data and a model. In order to determine fairness between the groups, a fairness metric δ taking a statistical parity that is calculated according to Equation (1) below as an example is used as an example. Note that, in addition to this, there are a variety of fairness metrics based on the probability, distance, distribution, etc., and any one of the metrics may be selected as appropriate according to the user case and may be used.
In Equation (1) above, Y denotes a label and Y=1 presents favorableness. D denotes a protected attribute, D=unprivileged presents that it is an unprivileged group, and D=privileged presents that it is a privileged group. The first term on the right side represents a favorable distribution of the unprivileged group. The second term on the right side represents a favorable distribution of the privileged group. It is represented that, the larger the value of the fairness metric δ is, the larger the unfairness between the groups is.
In
The calculator 225 calculates an excess from the fairness metrics δ. The excess presents how much the calculated fairness metric δ deviates from a tolerance E that is an example of a threshold that is set for the fairness metric δ. In the example, the calculator 225 calculates an excess with respect to each attribute and calculates a subtotal of the excesses. Accordingly, a different tolerance ε can be set according to the attribute. In
With reference to
Back to
The selector 227 selects (specifies) an instance to be modified from the instances contained in the group that is specified by the specifying unit 226. The changer 228 modifies the instance by changing the label of the selected instance. This will be described with reference to
The above-described sets of processing performed by the specifying unit 226, the selector 227, and the changer 228 that are described with reference to
For example, by correcting the training data 10 (
Depending on the fairness algorithm, a modification or an addition is made to the non-protected attributes and, in that case, the changer 228 may use and employ an appropriate aggregation function from candidates to be modified. For example, the changer 228 is able to employ majority vote in the case of a nominal scale or take an average in the case of a ratio scale.
The acquisition unit 221 acquires the training data 10 that is input to the input unit 21 (S1).
Subsequently, as described above with reference to
As described above with reference to
Thereafter, as described above with reference to
Subsequently, as described above with reference to
As described above with reference to
Subsequently, as described above with reference to
Thereafter, as described above with reference to
Thereafter, the controller 22 determines whether the excess is within a range of the tolerance ε (S9). When the excess is within the range of the tolerance ε (YES at S9), the controller 22 ends the process of the flowchart. If not (NO at S9), the controller 22 returns the process to S6. While the sets of processing of S6 to S9 are executed repeatedly, as described above, these sets of processing may be executed within the range in which fairness (the order in the proportion of favorableness) among the groups does not reverse. The flow on this will be exemplified in
The corrected training data 30 that is generated as described above is corrected such that, when there are a plurality of protected attributes, the protected attributes are combined and optimization is performed on the entire group. If there are a plurality of protected attributes and the protected attributes are corrected one by one in order, when one protected attribute is corrected, the content of another protected attribute is not taken into consideration and thus there is a problem in that discrimination in the other attribute gets worse. There are also a problem in that the result of another protected attribute that is corrected once is changed and a problem in that discrimination of the group of the combination of protected attributes is not corrected. Repeating, on groups of the combinations of protected attributes, a process of making a correction between selected two groups (a pair) and making a correction on the next pair is also considered. In this case, however, an instance to be modified is determined by the selected pair of groups, the result of modification results in a local solution. According to the method of the embodiment, these problems are reduced.
With reference to
With reference to
From among the four groups illustrated in
The method of generating corrected training data described above is an example only and a generation method is specified from various points of view. Some examples will be described with reference to
The correction trial unit 223 executes the correction processing using the fairness algorithm on all pairs of groups of combinations of protected attributes (S11). The specific example is as described above with reference to
Subsequently, the aggregation unit 224 aggregates results of the correction processing with respect to each of the groups and regards modified instances as candidates to be modified (S12). A specific example is as described above with reference to
The calculator 225 calculates element metrics of all the groups (for example, the proportion of favorableness) and determines privilege of the element groups of all the pairs (S13). A specific example is as described above with reference to
From the fairness metrics of all the pairs, the calculator 225 calculates pair-based attribute-based excesses and pair-based excesses (S14). A specific example is as described above with reference to
The calculator 225 calculates group-based excesses from the pair-based excesses and regards a group exceeding 0 as a group candidate to be corrected (S15). A specific example is as described above with reference to
The controller 22 determines whether there is a group candidate to be corrected. When there is a group candidate to be corrected (YES at S16), the controller 22 moves the process forward to S17. If not (NO at S16), the controller 22 ends the process of the flowchart.
The specifying unit 226 regards a group with the largest excess among the group candidates to be corrected as a group to be corrected (S17). A specific example is as described above.
The controller 22 determines whether there is an instance serving as a candidate to be modified in the group to be corrected (S18). When there is an instance serving as a candidate to be modified (YES at S18), the controller 22 moves the process forward to S19. If not (NO at S18), the controller 22 moves the process forward to S22.
Subsequently, the selector 227 calculates a confidence (score) with respect to each instance serving as a candidate to be modified and selects an instance with the highest confidence (S19). A specific example is as described above with reference to
When the selected instance is modified, the controller 22 determines whether the order of the element metrics (for example, the proportions of favorableness) changes (S20). When the order changes (YES at S20), the controller 22 moves the process forward to S22. If not (NO at S20), the controller 22 moves the process forward to S21.
The changer 228 reflects the content of modification of the selected instance to a group-based aggregation result and makes an exclusion from the candidates to be modified (S21). A specific example is as described above with reference to
Thereafter, the controller 22 makes an exclusion from the group candidates to be corrected (S22). In other words, the controller 22 excludes the group that is regarded as one to be corrected at preceding S17 from the group candidates to be corrected. After the processing of S22 completes, the controller 22 returns the process to S16.
For example, as described above, it is possible to generate the corrected training data 30. Particularly because of the processing of S20, the instances are corrected within a range such that the order of the element metrics (for example, the proportions of favorableness) does not change and thus the process converges easily.
The process of S31 to S35 is the same as the process of S11 to S15 described with reference to
The controller 22 determines whether there is a group candidate to be corrected (S36). When there is a group candidate to be corrected (YES at S36), the controller 22 moves the process forward to S37. If not (NO at S36), the controller 22 ends the process of the flowchart.
The controller 22 determines whether there are a plurality of groups with the largest excesses among the group candidates to be corrected (S37). When there are a plurality of groups with the largest excesses (YES at S37), the controller 22 moves the process forward to S38. If not (NO at S37), the controller 22 moves the process forward to S39.
The specifying unit 226 regards, as a group to be corrected, a group with the highest number of candidate instances to be modified or the highest confidence (score) among the groups with the largest excesses (S38). A specific example is as described above. After the processing of S38 completes, the controller 22 moves the process forward to S40.
The specifying unit 226 regards the group with the largest excess as a group to be corrected (S39). A specific example is as described above. After the processing of S39 completes, the controller 22 moves the process forward to S40.
The process of S40 to S44 is the same as the process of S18 to S22 described with reference to
For example, as described above, it is possible to generate the corrected training data 30. Particularly because of the processing of S37 to S39, even when there are a plurality of groups with the largest excesses, it is possible to specify a group to be corrected.
According to the information processing device 20 described above, the results of trials of the correction processing with respect to each pair of groups are aggregated and, based on the result of aggregation, the label is changed. Accordingly, for example, compared with the case where only a specific pair of groups is focused and the label is changed, it is possible to prevent the unfairness over the group from increasing. Accordingly, it is possible to increase fairness of the training data 10.
By modifying an instance of a group in a pair of groups with the largest excesses, it is possible to make an appropriate correction. By, after modifying one instance, modifying another instance, it is possible to further make a correction.
Calculating a fairness metric δ and specifying, as a group to be corrected, a group whose fairness metric δ exceeds a threshold makes it possible to specify a group to be corrected with high necessity of correcting fairness.
Specifying a group to be corrected based on the results of making an addition or subtraction of the subtotals of excesses of fairness metrics, for example, makes it possible to take into consideration the difference in the direction of correction between the privileged group that receives preferential treatment and the privileged group that receives cold treatment.
Selecting an instance to be modified using the fairness algorithm that corrects fairness between two groups makes it possible to utilize the existing fairness algorithm.
Changing the label when the order of the element metrics (for example, the proportions of favorableness) does not change, that is, correcting instances within a range such that the order does not change makes the process converge easily.
When there are a plurality of groups with the largest excesses, regarding, as a group to be corrected, a group with the highest number of candidate instances to be modified or the highest confidence (score) makes it possible to specify a group to be corrected.
Applying the process to a group of a combination of protected attributes makes it possible to reduce effects of the protected attributes on which no discrimination is to be made on the result of classification.
The example in which the process according to the embodiment is for pre-processing of correcting training data has been described. Note that the process according to the embodiment can be for post-processing of correcting classification data (prediction data) that is generated by a trained model. This is because the same method as that for pre-processing is applicable. The difference from pre-processing is only in the type of data and, while pre-processing changes labels (also referred to as observation labels or correct labels) of original data of training/test, post-processing changes labels of prediction data. As for the prediction data, protected attributes are also known in addition to the labels and the correction processing is performed on each pair using the protected attributes and the results are aggregated to determine an instance to be modified. With reference to
The process according to the embodiment can be for in-processing. This case, for example, employs a configuration in which the classification device 60 (a classification algorithm) illustrated in
The number and types of sets of training data, the types of protected attributes, etc., label examples, instance examples, etc., that are used in the above-described embodiment are an example only and they are changeable freely.
The process procedure, control procedure, specific names, and information including various types of data and parameters that are presented in the description above and the drawings are changeable freely.
Each component of each device illustrated in the drawings is of a functional idea and is not necessarily configured physically as illustrated in the drawings. In other words, specific modes of distribution and integration of each device are not limited to those illustrated in the drawings. In other words, all or part thereof can be configured by being distributed or integrated functionally or physically in any unit according to various types of load and usage. For example, element metrics can be calculated by the correction trial unit 223, the aggregation unit 224, the calculator 225, or the like, other than the grouping unit 222 of the controller 22. Assignment of scores can be executed also by the calculator 225 or the specifying unit 226.
Furthermore, all or given part of each processing function implemented by each device can be realized by a CPU (Central Processing Unit) and a program that is analyzed and executed by the CPU or can be realized as hardware according to a wired logic.
A hardware configuration of the information processing device 20 described above will be described with reference to
The communication device 20a is a network interface card, or the like, and communicates with another server. The display device 20b is a device that displays a correction result, etc., and is, for example, a touch panel or a display. The HDD 20c stores a program that runs the functions illustrated in
The processor 20e reads the program from the HDD 20c, or the like, and loads the program in the memory 20d, thereby running the process that executes each of the functions illustrated in
As described above, by reading and executing the program, the information processing device 20 runs as an information processing device that executes the method of generating corrected training data (training data). The information processing device 20 is also able to realize the same functions as those of the above-described example by reading the program from a recording medium using a medium reading device and executing the read program. Programs according to other examples are not limited to being executed by the information processing device 20. For example, the present invention is similarly applicable to the case where another computer or the server executes the program or where they execute the program cooperatively.
The program can be distributed via a network, such as the Internet. The program is recorded in a computer-readable recording medium, such as a hard disk, a flexible disk (FD), a CD-ROM, a MO (Magneto-Optical disk), or a DVD (Digital Versatile Disc), and is read by a computer from the recording medium, so that the program can be executed.
According to one aspect, it is possible to improve fairness of training data.
All examples and conditional language provided herein are intended for the pedagogical purposes of aiding the reader in understanding the invention and the concepts contributed by the inventors to further the art, and are not to be construed as limitations to such specifically recited examples and conditions, nor does the organization of such examples in the specification relate to a showing of the superiority and inferiority of the invention. Although one or more embodiments of the present invention have been described in detail, it should be understood that the various changes, substitutions, and alterations could be made hereto without departing from the spirit and scope of the invention.
This application is a continuation application of International Application PCT/JP2020/031769, filed on Aug. 24, 2020, and designating the U.S., the entire contents of which are incorporated herein by reference.
Number | Date | Country | |
---|---|---|---|
Parent | PCT/JP20/31769 | Aug 2020 | US |
Child | 18099266 | US |