A fairness-enhancing model training method
By adjusting the classification label of the training sample data set, the binary classification machine learning model is trained cyclically, which solves the problem of the model's differentiation of certain sample groups during the training process, and enhances the fairness and training effect of the model.
Patent Information
- Application Number
- CN202411212622.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-30
- Publication Date
- 2025-08-19
- Estimated Expiration
- 2044-08-30
AI Technical Summary
Existing models have differential treatment behaviors for certain sample groups during training, resulting in the model being non-compliant or unfair.
By adjusting the classification label of the training sample dataset, the binary classification machine learning model is trained cyclically to ensure that there is no sample differential treatment problem on the training and test sample datasets, and the fairness of the model is enhanced.
It realizes that there is basically no sample differential treatment problem on the training and testing sample data sets, thereby enhancing the fairness and training effect of the model.
Smart Images

Figure CN119046687B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of model training, and more specifically, to a model training method for enhancing fairness. Background Art
[0002] With the rapid development of artificial intelligence (AI), its applications are becoming increasingly widespread, and it has been applied to a variety of fields, including image analysis, speech recognition, text processing, intelligent recommendations, and security detection. However, for various reasons, trained models inevitably discriminate against certain sample groups, resulting in non-compliant or unfair training. Summary of the Invention
[0003] The purpose of the embodiments of the present application is to provide a model training method that enhances fairness, which can perform cyclic training on the model by strategically modifying the classification labels of the training sample data set, thereby enhancing the fairness of the model.
[0004] The first aspect of the present application provides a fairness-enhancing model training method, comprising:
[0005] Obtaining a training sample data set and a test sample data set; wherein the training sample data set includes a first sample set in the differentially treated group and a second sample set in the normal group; and the test sample data set includes a third sample set in the differentially treated group and a fourth sample set in the normal group;
[0006] Training a preset binary classification machine learning model based on the training sample data set to obtain a target model and control variables corresponding to the target model;
[0007] When it is determined based on the test sample data set that the target model meets the statistical fairness requirement, outputting the target model;
[0008] When it is determined based on the test sample data set that the target model does not meet the statistical fairness requirement, determining a model training optimization direction based on the control variables;
[0009] Determining an optimized sample data set in the training sample data set based on the model training optimization direction;
[0010] Extracting the target sample with the largest sample loss value from the optimized sample data set;
[0011] Invert the sample labels of the target samples in the training sample data set to obtain a new training sample data set, and trigger the step of training the preset binary classification machine learning model based on the training sample data set to obtain the target model and the control variables corresponding to the target model.
[0012] In the above implementation process, this method can cyclically train the binary classification machine learning model by adjusting the training sample data set, so that there is basically no problem of sample discrimination at both the training sample data set and the test sample data set levels, thereby enhancing the fairness of the trained target model.
[0013] Furthermore, the training of a preset binary classification machine learning model based on the training sample data set to obtain a target model and control variables corresponding to the target model includes:
[0014] Training a preset binary classification machine learning model based on the training sample data set to obtain a target model;
[0015] Inputting the first sample set and the second sample set into the target model to obtain a first positive sample set, a first negative sample set, a second positive sample set, and a second negative sample set;
[0016] Calculating a first ratio between the number of samples in the first positive sample set and the number of samples in the first sample set, and calculating a second ratio between the number of samples in the second positive sample set and the number of samples in the second sample set;
[0017] Determine whether a difference obtained by subtracting the first ratio from the second ratio is greater than a preset fairness tolerance threshold constant; wherein the fairness tolerance threshold constant is ε;
[0018] If yes, then set the control variable corresponding to the target model to ε;
[0019] If not, then the control variable corresponding to the target model is set to 1.
[0020] In the above implementation process, the method can determine the control variable TH corresponding to the target model by calculation, so that the control variable TH guides the cyclic training process of the model, thereby making the target model finally trained have good fairness.
[0021] Furthermore, the method further comprises:
[0022] Inputting the third sample set and the fourth sample set into the target model to obtain a third positive sample set, a third negative sample set, a fourth positive sample set and a fourth negative sample set;
[0023] Calculating a third ratio between the number of samples in the third positive sample set and the number of samples in the third sample set, and calculating a fourth ratio between the number of samples in the fourth positive sample set and the number of samples in the fourth sample set;
[0024] Determining whether an absolute value of a difference between the third ratio and the fourth ratio is greater than a preset fairness tolerance threshold constant; wherein the fairness tolerance threshold constant is ε;
[0025] If not, determining that the target model meets the statistical fairness requirement;
[0026] If so, it is determined that the target model does not meet the statistical fairness requirement.
[0027] In the above implementation process, this method can evaluate the performance of the trained target model through a test sample data set, thereby determining whether the target model meets the statistical fairness requirements or promoting further training of the target model, thereby achieving result-oriented excellent model training effects.
[0028] Furthermore, when it is determined based on the test sample data set that the target model does not meet the statistical fairness requirement, determining the model training optimization direction based on the control variables includes:
[0029] When it is determined based on the test sample data set that the target model does not meet the statistical fairness requirement, the difference obtained by subtracting the fourth ratio from the third ratio is greater than ε, and the control variable is not -1, the control variable is set to -1; or when it is determined based on the test sample data set that the target model does not meet the statistical fairness requirement, the difference obtained by subtracting the third ratio from the fourth ratio is greater than ε, and the control variable is -1, the control variable is set to 1;
[0030] The optimization direction of model training is determined based on the control variables.
[0031] In the above implementation process, this method can adjust the control variables when it is assessed that the target model does not meet the statistical fairness requirements, thereby providing direction for the training optimization of the model, making the training optimization of the model more purposeful and ensuring the training effect of the model.
[0032] Further, when the control variable is greater than or equal to 0, the model training optimization direction is determined to be positive;
[0033] When the model training optimization direction is positive, the optimized sample data set includes the first negative sample set and the second positive sample set;
[0034] The sample loss value is the cross entropy classification loss value;
[0035] The sample label is positive or negative.
[0036] In the above implementation process, this method can promote the target model to perform positive modification of sample labels when the control variable TH≥0, thereby gradually improving the target model's problem of differential treatment of differentially treated groups.
[0037] Furthermore, after inverting the sample labels of the target samples in the training sample dataset to obtain a new training sample dataset, the method further includes:
[0038] When the control variable is ε, the new training sample data set is input into the target model to obtain a new first positive sample set, a new first negative sample set, a new second positive sample set, and a new second negative sample set;
[0039] Calculating a first intermediate ratio between the number of samples in the new first positive sample set and the number of samples in the new first sample set, and calculating a second intermediate ratio between the number of samples in the new second positive sample set and the number of samples in the new second sample set;
[0040] When the difference obtained by subtracting the first intermediate ratio from the second intermediate ratio is greater than ε, the step of determining the optimized sample data set in the training sample data set based on the model training optimization direction is triggered to execute until the difference obtained by subtracting the first intermediate ratio from the second intermediate ratio is no greater than ε.
[0041] In the above implementation process, when the training results of the training sample data set show that there is a problem of sample discrimination, the method can loop the sample label forward modification process to solve the problem.
[0042] Furthermore, when the control variable is less than 0, the model training optimization direction is determined to be reverse;
[0043] When the model training optimization direction is reverse, the optimized sample data set includes the first positive sample set and the second negative sample set;
[0044] The sample loss value is the cross entropy classification loss value;
[0045] The sample label is positive or negative.
[0046] In the above implementation process, this method can promote the target model to perform reverse modification of sample labels when the control variable TH is less than 0, thereby gradually improving the problem of over-correction of the target model.
[0047] A second aspect of the present application provides a fairness-enhancing model training device, the fairness-enhancing model training device comprising:
[0048] an acquisition unit, configured to acquire a training sample data set and a test sample data set; wherein the training sample data set includes a first sample set in the differentially treated group and a second sample set in the normal group; and the test sample data set includes a third sample set in the differentially treated group and a fourth sample set in the normal group;
[0049] A training unit, configured to train a preset binary classification machine learning model based on the training sample data set to obtain a target model and control variables corresponding to the target model;
[0050] an output unit, configured to output the target model when it is determined based on the test sample data set that the target model meets the statistical fairness requirement;
[0051] A first determining unit is configured to determine a model training optimization direction based on the control variables when it is determined based on the test sample data set that the target model does not meet the statistical fairness requirement;
[0052] A second determining unit is configured to determine an optimized sample data set in the training sample data set based on the model training optimization direction;
[0053] An extraction unit, configured to extract a target sample with the largest sample loss value from the optimized sample data set;
[0054] An optimization unit is used to invert the sample labels of the target samples in the training sample data set to obtain a new training sample data set, and trigger the training unit to perform the operation of training the preset binary classification machine learning model based on the training sample data set to obtain the target model and the control variables corresponding to the target model.
[0055] Furthermore, the training unit includes:
[0056] A training subunit, configured to train a preset binary classification machine learning model based on the training sample data set to obtain a target model;
[0057] a prediction subunit, configured to input the first sample set and the second sample set into the target model to obtain a first positive sample set, a first negative sample set, a second positive sample set, and a second negative sample set;
[0058] a calculation subunit, configured to calculate a first ratio between the number of samples in the first positive sample set and the number of samples in the first sample set, and calculate a second ratio between the number of samples in the second positive sample set and the number of samples in the second sample set;
[0059] a judging subunit, configured to judge whether a difference obtained by subtracting the first ratio from the second ratio is greater than a preset fairness tolerance threshold constant; wherein the fairness tolerance threshold constant is ε;
[0060] a first setting subunit, configured to set the control variable corresponding to the target model to ε when a difference obtained by subtracting the first ratio from the second ratio is greater than a preset fairness tolerance threshold constant;
[0061] The first setting subunit is further configured to set the control variable corresponding to the target model to 1 when a difference obtained by subtracting the first ratio from the second ratio is not greater than a preset fairness tolerance threshold constant.
[0062] Furthermore, the fairness-enhancing model training device further includes:
[0063] A first prediction unit is configured to input the third sample set and the fourth sample set into the target model to obtain a third positive sample set, a third negative sample set, a fourth positive sample set, and a fourth negative sample set;
[0064] a first calculation unit, configured to calculate a third ratio between the number of samples in the third positive sample set and the number of samples in the third sample set, and calculate a fourth ratio between the number of samples in the fourth positive sample set and the number of samples in the fourth sample set;
[0065] a judging unit, configured to judge whether an absolute value of a difference between the third ratio and the fourth ratio is greater than a preset fairness tolerance threshold constant; wherein the fairness tolerance threshold constant is ε;
[0066] a third determining unit, configured to determine that the target model meets a statistical fairness requirement when an absolute value of a difference between the third ratio and the fourth ratio is not greater than a preset fairness tolerance threshold constant;
[0067] The third determining unit is further configured to determine that the target model does not meet the statistical fairness requirement when an absolute value of a difference between the third ratio and the fourth ratio is greater than a preset fairness tolerance threshold constant.
[0068] Furthermore, the first determining unit includes:
[0069] a second setting subunit, configured to set the control variable to -1 when it is determined based on the test sample data set that the target model does not meet the statistical fairness requirement, the difference obtained by subtracting the fourth ratio from the third ratio is greater than ε, and the control variable is not -1; or to set the control variable to 1 when it is determined based on the test sample data set that the target model does not meet the statistical fairness requirement, the difference obtained by subtracting the third ratio from the fourth ratio is greater than ε, and the control variable is -1;
[0070] A determination subunit is used to determine the model training optimization direction based on the control variables.
[0071] Further, when the control variable is greater than or equal to 0, the model training optimization direction is determined to be positive;
[0072] When the model training optimization direction is positive, the optimized sample data set includes the first negative sample set and the second positive sample set;
[0073] The sample loss value is the cross entropy classification loss value;
[0074] The sample label is positive or negative.
[0075] Furthermore, the fairness-enhancing model training device further includes:
[0076] a second prediction unit, configured to, after the optimization unit inverts the sample labels of the target samples in the training sample data set to obtain a new training sample data set, input the new training sample data set into the target model when the control variable is ε, to obtain a new first positive sample set, a new first negative sample set, a new second positive sample set, and a new second negative sample set;
[0077] a second calculation unit, configured to calculate a first intermediate ratio between the number of samples in the new first positive sample set and the number of samples in the new first sample set, and calculate a second intermediate ratio between the number of samples in the new second positive sample set and the number of samples in the new second sample set;
[0078] The second determination unit is also used to determine the optimized sample data set in the training sample data set based on the model training optimization direction when the difference obtained by subtracting the first intermediate ratio from the second intermediate ratio is greater than ε, until the difference obtained by subtracting the first intermediate ratio from the second intermediate ratio is no greater than ε.
[0079] Furthermore, when the control variable is less than 0, the model training optimization direction is determined to be reverse;
[0080] When the model training optimization direction is reverse, the optimized sample data set includes the first positive sample set and the second negative sample set;
[0081] The sample loss value is the cross entropy classification loss value;
[0082] The sample label is positive or negative.
[0083] The third aspect of this application provides a method for training a resume screening model, comprising:
[0084] Obtaining a training sample data set and a test sample data set; wherein the training sample data set includes a first sample set extracted from the resumes of female job applicants and a second sample set extracted from the resumes of male job applicants; and the test sample data set includes a third sample set extracted from the resumes of female job applicants and a fourth sample set extracted from the resumes of male job applicants;
[0085] Training a preset binary classification machine learning model based on the training sample data set to obtain a resume screening model and control variables corresponding to the resume screening model;
[0086] When it is determined based on the test sample data set that the resume screening model meets the statistical fairness requirement, outputting the resume screening model;
[0087] When it is determined based on the test sample data set that the resume screening model does not meet the statistical fairness requirement, determining a model training optimization direction based on the control variables;
[0088] Determining an optimized sample data set in the training sample data set based on the model training optimization direction;
[0089] Extracting the target sample with the largest sample loss value from the optimized sample data set;
[0090] The sample labels of the target samples in the training sample data set are reversed to obtain a new training sample data set, and the steps of training a preset binary classification machine learning model based on the training sample data set to obtain a resume screening model and control variables corresponding to the resume screening model are triggered.
[0091] A fourth aspect of the present application provides a resume screening method, comprising:
[0092] Obtain applicant resumes;
[0093] The applicant is input into a resume screening model, and a screening result of whether the applicant's resume meets the recruitment requirements is output; wherein, the resume screening model is trained according to the fairness-enhancing model training method described in any one of the first aspects of this application.
[0094] In a fifth aspect, the present application provides an electronic device, including a memory and a processor, wherein the memory is used to store a computer program, and the processor runs the computer program to enable the electronic device to perform the fairness enhancement model training method described in any one of the first aspects of the present application.
[0095] In a sixth aspect, the present application provides a computer-readable storage medium storing computer program instructions. When the computer program instructions are read and executed by a processor, the fairness-enhancing model training method described in any one of the first aspects of the present application is executed.
[0096] In a seventh aspect, the present application provides a computer program product, which includes a computer program. When the computer program is executed by a processor, it executes the fairness-enhancing model training method described in any one of the first aspects of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0097] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments of the present application. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can be obtained based on these drawings without creative work.
[0098] Figure 1 A flowchart of a fairness-enhancing model training method provided in an embodiment of the present application;
[0099] Figure 2 A schematic diagram of a technical implementation flow of a fairness-enhancing model training method provided in an embodiment of the present application;
[0100] Figure 3 A flowchart of another fairness-enhancing model training method provided in an embodiment of the present application;
[0101] Figure 4 A schematic diagram of the structure of a fairness-enhancing model training device provided in an embodiment of the present application;
[0102] Figure 5 A schematic structural diagram of another fairness-enhancing model training device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0103] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.
[0104] It should be noted that similar reference numerals and letters represent similar items in the following drawings. Therefore, once an item is defined in one drawing, it does not need to be further defined or explained in subsequent drawings. At the same time, in the description of this application, the terms "first", "second", etc. are only used to distinguish the description and should not be understood as indicating or implying relative importance.
[0105] Example 1
[0106] Please see Figure 1 , Figure 1 The following is a flow chart of a fairness-enhancing model training method provided in this embodiment. The fairness-enhancing model training method includes:
[0107] S101. Obtain a training sample data set and a test sample data set; wherein the training sample data set includes a first sample set in the differentially treated group and a second sample set in the normal group; and the test sample data set includes a third sample set in the differentially treated group and a fourth sample set in the normal group.
[0108] S102: Train the preset binary classification machine learning model based on the training sample data set to obtain the target model and the control variables corresponding to the target model, and execute step S103 or S104.
[0109] S103: When it is determined based on the test sample data set that the target model meets the statistical fairness requirements, the target model is output and the process ends.
[0110] S104: When it is determined based on the test sample data set that the target model does not meet the statistical fairness requirements, a model training optimization direction is determined based on the control variables.
[0111] S105: Determine an optimized sample data set in the training sample data set based on the model training optimization direction.
[0112] S106. Extract the target sample with the largest sample loss value in the optimized sample data set.
[0113] S107 : Invert the sample labels of the target samples in the training sample dataset to obtain a new training sample dataset, and trigger the execution of step S102 .
[0114] Please see Figure 2 , Figure 2 The following is a technical implementation flow chart of a fairness-enhancing model training method. The control variable is TH, and the training sample dataset is T. r , the test sample data set is Te .
[0115] In this embodiment, the execution subject of the method may be a computing device such as a computer or a server, and this is not limited in this embodiment.
[0116] It can be seen that the fairness-enhancing model training method described in this embodiment can enhance the fairness of the model by strategically modifying the classification labels of the training sample data set to perform cyclic training on the model.
[0117] Example 2
[0118] Please see Figure 3 , Figure 3 The following is a flow chart of a fairness-enhancing model training method provided in this embodiment. The fairness-enhancing model training method includes:
[0119] S201. Obtain a training sample data set and a test sample data set; wherein the training sample data set includes a first sample set in the differentially treated group and a second sample set in the normal group; and the test sample data set includes a third sample set in the differentially treated group and a fourth sample set in the normal group.
[0120] In this embodiment, the training sample data set is T r , T r By treating group G differently a The first sample set T ra and normal group G b The second sample set T rb It consists of two parts.
[0121] In this embodiment, the test sample data set is T e , T e By treating group G differently a The third sample set T ea and normal group G b The fourth sample set T eb It consists of two parts.
[0122] S202: Train a preset binary classification machine learning model based on the training sample data set to obtain a target model.
[0123] In this embodiment, the target model is T r The samples in are predicted to be of class "+" or "-". a Being treated differently refers to group G a The probability that the sample in the model is predicted as category "+" is lower than that of group G b The probability that the sample in is predicted by the model to be class “+”.
[0124] In this embodiment, the above-mentioned category “+” or “-” is the sample label.
[0125] In this embodiment, the first execution of step S202 is a preliminary training process of the model.
[0126] In this embodiment, step S202 can be based on T r Train a binary classification machine learning model M so that the model M classifies each training sample as "+" or "-".
[0127] In this example, L is the model M in the dataset T r The cross entropy loss function on .
[0128] In this embodiment, the training cutoff condition of the model is: when L converges or the number of training rounds exceeds the threshold R th hour.
[0129] S203 : Input the first sample set and the second sample set into the target model to obtain a first positive sample set, a first negative sample set, a second positive sample set, and a second negative sample set.
[0130] In this embodiment, T ra The samples whose classification results on the target model are “+” are the first positive sample set; ra The samples whose classification results on the target model are “-” are the first negative sample set; rb The samples whose classification results on the target model are “+” are the second positive sample set; rb The samples whose classification results on the target model are “-” are the second negative sample set.
[0131] S204: Calculate a first ratio between the number of samples in the first positive sample set and the number of samples in the first sample set, and calculate a second ratio between the number of samples in the second positive sample set and the number of samples in the second sample set.
[0132] In this embodiment, the ratio of the number of samples in the first positive sample set to the number of samples in the first sample set is a first ratio p. ra The ratio of the number of samples in the second positive sample set to the number of samples in the second sample set is the second ratio p rb .
[0133] S205: Determine whether the difference obtained by subtracting the first ratio from the second ratio is greater than a preset fairness tolerance threshold constant ε. If so, set the control variable corresponding to the target model to ε; if not, set the control variable corresponding to the target model to 1.
[0134] In this embodiment, the fairness tolerance threshold constant is ε, ε∈[0, 1]. For example, ε may be 1%.
[0135] In this embodiment, the control variable corresponding to the target model is TH.
[0136] In this embodiment, if p rb -p ra >ε, then let the variable TH = ε; otherwise, let the variable TH = 1.
[0137] In this embodiment, the training round threshold R th It is used to represent the maximum number of rounds of cyclic training of the model (i.e. one of the cyclic cutoff conditions), R th is a preset positive integer constant.
[0138] In this embodiment, the method initializes the control variables based on the training sample data set in the first round of preliminary training; and updates the values of the control variables based on the test sample data set in the second and subsequent rounds of training.
[0139] S206: Input the third sample set and the fourth sample set into the target model to obtain a third positive sample set, a third negative sample set, a fourth positive sample set, and a fourth negative sample set.
[0140] In this embodiment, the target model is used to test the sample data set T e The samples in the prediction classification are obtained to obtain the third sample set T ea The third positive sample set in which the samples are classified as “+”, the third sample set T ea The third negative sample set and the fourth sample set T eb The fourth positive sample set in which the samples are classified as “+”, the fourth sample set T eb The fourth negative sample set in which samples are classified as “-”.
[0141] S207 : Calculate a third ratio between the number of samples in the third positive sample set and the number of samples in the third sample set, and calculate a fourth ratio between the number of samples in the fourth positive sample set and the number of samples in the fourth sample set.
[0142] In this embodiment, T ea The proportion of samples in the third positive sample set classified as "+" is p ea ;T eb The proportion of samples in the fourth positive sample set classified as "+" is p eb .
[0143] S208 , determining whether the absolute value of the difference between the third ratio and the fourth ratio is greater than a preset fairness tolerance threshold constant ε; if so, executing step S210 ; if not, executing step S209 .
[0144] In this embodiment, steps S206 to S208 illustrate the model performance evaluation steps.
[0145] In this embodiment, if |p eb -p ea |≤ε, the target model is determined to meet the statistical fairness requirement and all training processes are terminated. Statistical fairness corresponds to statistical parity or group parity.
[0146] S209: Output the target model and end this process.
[0147] S210. When the difference obtained by subtracting the fourth ratio from the third ratio is greater than ε and the control variable is not -1, set the control variable to -1; or when the difference obtained by subtracting the third ratio from the fourth ratio is greater than ε and the control variable is -1, set the control variable to 1.
[0148] In this embodiment, step S210 can be simplified into the following two contents:
[0149] If p ea -p eb >ε and TH≠-1, then let TH=-1;
[0150] If p eb -p ea >ε and TH=-1, then set TH=1.
[0151] S211. Determine the optimization direction of model training based on the control variables.
[0152] In this embodiment, the model training optimization direction refers to forward optimization and reverse optimization.
[0153] In this embodiment, forward optimization refers to the forward modification of sample labels, and reverse optimization refers to the reverse modification of sample labels.
[0154] S212: Determine an optimized sample data set in the training sample data set based on the model training optimization direction.
[0155] In this embodiment, when the control variable is greater than or equal to 0, the model training optimization direction is determined to be positive;
[0156] When the model training optimization direction is positive, the optimized sample data set includes a first negative sample set and a second positive sample set.
[0157] In this embodiment, when TH≥0, T ra The first negative sample set with the sample label “-” and T rb The second positive sample set with the sample label “+” is put into the set R (i.e., the optimized sample data set).
[0158] In this embodiment, when the control variable is less than 0, the model training optimization direction is determined to be reverse;
[0159] When the model training optimization direction is reverse, the optimized sample data set includes a first positive sample set and a second negative sample set.
[0160] In this embodiment, when TH<0, the method sets T ra The first positive sample set with the sample label “+” and T rb The second negative sample set with the sample label “-” is put into the set R (i.e., the optimized sample data set).
[0161] S213. Extract the target sample with the largest sample loss value in the optimized sample data set.
[0162] In this embodiment, the sample loss value is a cross entropy classification loss value.
[0163] In this embodiment, the method predicts and classifies the samples in the above set R through the target model, and calculates the cross entropy classification loss L of each sample i in the set R on the target model. i Then, the loss L is taken from the set R without replacement i The largest sample i.
[0164] S214: Invert the sample labels of the target samples in the training sample dataset to obtain a new training sample dataset, and trigger the execution of step S202.
[0165] In this embodiment, the sample label is positive or negative, that is, the sample label is "+" or "-".
[0166] In this embodiment, if the sample label of the extracted sample i is “+”, then T r The sample label of the sample and the classification result on the target model are changed to "-";
[0167] If the sample label of the extracted sample i is "-", then T r The sample label of the sample and the classification result on the target model are changed to "+".
[0168] As an optional implementation, the method further includes:
[0169] Determine whether the current training round is greater than or equal to the training round threshold R th ;
[0170] If yes, then the target model's cyclic training ends (i.e., this process ends);
[0171] If not, execute step S202.
[0172] As an optional implementation, after inverting the sample labels of the target samples in the training sample dataset to obtain a new training sample dataset, the method further includes:
[0173] When the control variable is ε, the new training sample data set is input into the target model to obtain a new first positive sample set, a new first negative sample set, a new second positive sample set, and a new second negative sample set;
[0174] Calculating a first intermediate ratio between the number of samples in the new first positive sample set and the number of samples in the new first sample set, and calculating a second intermediate ratio between the number of samples in the new second positive sample set and the number of samples in the new second sample set;
[0175] When the difference between the second intermediate ratio and the first intermediate ratio is greater than ε, the step of determining the optimized sample data set in the training sample data set based on the model training optimization direction is triggered until the difference between the second intermediate ratio and the first intermediate ratio is no greater than ε.
[0176] In this embodiment, when TH=ε, the method calculates T ra The number of samples in the first positive sample set whose classification result on the target model is “+” accounts for |T ra The ratio of |p ra (i.e., the first intermediate ratio), and T rb The number of samples in the second positive sample set whose classification result on the target model is “+” accounts for |T rb The ratio of |p rb , and cyclically execute the steps of “forward modification of sample labels” (i.e., steps S212 to S214 executed when TH≥0) until p rb -p ra ≤ε.
[0177] In this embodiment, the execution subject of the method may be a computing device such as a computer or a server, and this is not limited in this embodiment.
[0178] It can be seen that the fairness-enhancing model training method described in this embodiment can use the classification loss to screen the best samples for modification of classification labels, so as to reduce the impact of modified sample labels on the model classification accuracy; it can also predict the number of training data modifications based on the positive judgment rate of the classification results on the training set (the proportion of the number of samples with the sample label of "+" in the classification results on the training set to the total number of samples in the training set), and fine-tune the number of training data modifications based on the fairness evaluation results on the test set; it can also use the classification loss of the model to guide the modification process of the training data, and then use the modified data to retrain the model, sacrificing the least model classification accuracy in exchange for improved model fairness.
[0179] Example 3
[0180] This embodiment provides a fairness-enhancing model training method for application in the scenario of intelligent resume screening model training. In this scenario, the resume contains the applicant's user attribute information data (including the job position, applicant category, work / practical experience, personal skills, graduation school, major, personal education, gender, and age). The fairness-enhancing model training method includes:
[0181] S301. Numerize all the user attribute information data contained in each applicant's resume, and construct a 9-dimensional vector using the 9 digitized data. Each 9-dimensional vector is a piece of sample data.
[0182] In this embodiment, the four attribute information of the applied position (such as R&D position, sales position, pre-sales position, management position, administrative position, research position, finance position, and logistics position), the applicant category (fresh graduate, social personnel), the major studied (meeting the application requirements, not meeting the application requirements), and gender (male, female) are digitized according to the one-hot encoding. The five attributes of work / practical experience (total number of internships and working months), personal skills (the number of skills that meet the application requirements), graduation school (domestic 985 universities or foreign QS top 100 universities, domestic non-985 211 universities or foreign QS top 300 universities, domestic ordinary universities or foreign universities ranked after QS 300), personal academic qualifications (PhD, Master, Bachelor, College, below College), and age are digitized according to positive integers.
[0183] S302: Multiple sample data corresponding to multiple applicant resumes constitute a sample data set T for model training. r and the sample dataset T for model testing e , treat group G differently a For female applicants, normal group G b For male applicants, T r By treating group G differently a The sample data set T ra and normal group G b The sample data set T rb It consists of two parts, T e By treating group G differently a The sample data set T ea and normal group G b The sample data set T eb It consists of two parts.
[0184] In this embodiment, the machine learning model uses T r and T eThe sample data in is predicted as category “+” or “-”, “+” means that the candidate resume corresponding to the sample data meets the recruitment requirements, and “-” means that the candidate resume corresponding to the sample data does not meet the recruitment requirements.
[0185] In this embodiment, one of the training requirements of the resume intelligent screening model is that the model output results cannot discriminate against gender, that is, men and women have equal opportunities to be hired. Whether men and women have equal opportunities to be hired can be specifically determined by T ra The number of samples whose classification results on model M are “+” accounts for |T ra The ratio of |p ra , and T rb The number of samples whose classification results on model M are “+” accounts for |T rb The ratio of |p rb Determine whether they are equal.
[0186] S303, using Tr as the training data set to train the user intelligent evaluation model M (such as Bayesian classification network, ResNet50 deep neural network), the model M classifies each sample as "+" or "-", L is the model M in the data set T r The cross entropy loss function on .
[0187] In this embodiment, when L converges or the number of training rounds exceeds the threshold R th =1000, the initial model training ends.
[0188] S304, calculate T ra The number of samples whose classification results on model M are “+” accounts for |T ra |=500000 proportion p ra , and T rb The number of samples whose classification results on model M are “+” accounts for |T rb |=700000 proportion p rb If p rb -p ra >ε=0.01, then set the variable TH=ε; otherwise, set the variable TH=1.
[0189] S305, using model M to test sample data set T e The samples are classified and the calculation model M is T ea The number of samples classified as “+” accounts for |T ea |=50000 proportion p ea , and model M will T eb The number of samples classified as “+” accounts for |T eb |=70000 proportion p eb .
[0190] S306, if |p eb -p ea |≤ε, then it can be determined that the model M meets the statistical fairness requirements and all training processes are terminated; if p ea -p eb >ε and TH≠-1, then let TH=-1; if p eb -p ea >ε and TH=-1, then set variable TH=1. Then execute steps S307 to S309 or step S310.
[0191] S307. If TH≥0, then T ra The samples with the above category labels “-” and T rb The samples with the category label "+" are put into the set R, and the samples in the set R are classified using the model M. The cross entropy classification loss L of each sample i in the set R on the model M is calculated. i .
[0192] S308. Take the loss L from the set R without replacement i The largest sample i. If the category label of i is "+", then T r The category label of the sample and the classification result on the model M are modified to "-"; if the category label of i is "-", then T r The category label of the sample and the classification result on the model M are modified to "+", which triggers the execution of step S312.
[0193] S309. If TH = ε, calculate T ra The number of samples whose classification results on model M are “+” accounts for |T ra The ratio of |p ra , and T rb The number of samples whose classification results on model M are “+” accounts for |T rb The ratio of |p rb , loop through steps S307 to S308 until p rb -p ra ≤ε.
[0194] S310, if TH<0, then T ra The samples with the above category labels all being “+” and T rb The samples with the category label "-" are put into the set R, and the samples in the set R are classified using the model M. The cross entropy classification loss L of each sample i in the set R on the model M is calculated. i .
[0195] S311. Take the loss L from the set R without replacementi The largest sample i. If the category label of i is "-", then T r The category label of the sample and the classification result on the model M are modified to "+"; if the category label of i is "+", then T r The category label of the sample and the classification result on the model M are modified to "-", triggering the execution of step S311.
[0196] S312, with the modified T r Retrain model M for the training data, when L converges or the number of training rounds exceeds the threshold R th = 1000, the model training ends. Steps S305 to S306 are executed in a loop.
[0197] As an optional implementation, the method may include:
[0198] Obtaining a training sample data set and a test sample data set; wherein the training sample data set includes a first sample set extracted from the resumes of female job applicants and a second sample set extracted from the resumes of male job applicants; and the test sample data set includes a third sample set extracted from the resumes of female job applicants and a fourth sample set extracted from the resumes of male job applicants;
[0199] Training a preset binary classification machine learning model based on the training sample data set to obtain a resume screening model and control variables corresponding to the resume screening model;
[0200] When it is determined based on the test sample data set that the resume screening model meets the statistical fairness requirement, outputting the resume screening model;
[0201] When it is determined based on the test sample data set that the resume screening model does not meet the statistical fairness requirement, determining a model training optimization direction based on the control variables;
[0202] Determining an optimized sample data set in the training sample data set based on the model training optimization direction;
[0203] Extracting the target sample with the largest sample loss value from the optimized sample data set;
[0204] The sample labels of the target samples in the training sample data set are reversed to obtain a new training sample data set, and the steps of training a preset binary classification machine learning model based on the training sample data set to obtain a resume screening model and control variables corresponding to the resume screening model are triggered.
[0205] As a further optional implementation, the method further includes:
[0206] Obtain applicant resumes;
[0207] The applicant is input into the resume screening model, and a screening result is output to determine whether the applicant's resume meets the recruitment requirements.
[0208] In this embodiment, the execution subject of the method may be a computing device such as a computer or a server, and this is not limited in this embodiment.
[0209] It can be seen that the fairness-enhancing model training method described in this embodiment can enhance the fairness of the model by strategically modifying the classification labels of the training sample data set to perform cyclic training on the model.
[0210] Example 4
[0211] Please see Figure 4 , Figure 4 This is a schematic diagram of the structure of a model training device for enhancing fairness provided in this embodiment. Figure 4 As shown, the fairness-enhancing model training device includes:
[0212] An acquisition unit 410 is configured to acquire a training sample data set and a test sample data set; wherein the training sample data set includes a first sample set in the differentially treated group and a second sample set in the normal group; and the test sample data set includes a third sample set in the differentially treated group and a fourth sample set in the normal group.
[0213] A training unit 420 is configured to train a preset binary classification machine learning model based on a training sample data set to obtain a target model and control variables corresponding to the target model;
[0214] An output unit 430 is configured to output the target model when it is determined based on the test sample data set that the target model meets the statistical fairness requirement;
[0215] A first determining unit 440 is configured to determine a model training optimization direction based on a control variable when it is determined based on the test sample data set that the target model does not meet the statistical fairness requirement;
[0216] A second determining unit 450 is configured to determine an optimized sample data set in the training sample data set based on the model training optimization direction;
[0217] An extraction unit 460 is used to extract a target sample with the largest sample loss value from the optimized sample data set;
[0218] The optimization unit 470 is used to reverse the sample labels of the target samples in the training sample data set to obtain a new training sample data set, and trigger the training unit to perform training on the preset binary classification machine learning model based on the training sample data set to obtain the target model and the control variables corresponding to the target model.
[0219] In this embodiment, the explanation of the model training device for enhancing fairness can refer to the description in Example 1 or Example 2, and will not be further elaborated in this embodiment.
[0220] It can be seen that the fairness-enhancing model training device described in this embodiment can enhance the fairness of the model by strategically modifying the classification labels of the training sample data set to perform cyclic training on the model.
[0221] Example 5
[0222] Please see Figure 5 , Figure 5 This is a schematic diagram of the structure of a model training device for enhancing fairness provided in this embodiment. Figure 5 As shown, the fairness-enhancing model training device includes:
[0223] An acquisition unit 410 is configured to acquire a training sample data set and a test sample data set; wherein the training sample data set includes a first sample set in the differentially treated group and a second sample set in the normal group; and the test sample data set includes a third sample set in the differentially treated group and a fourth sample set in the normal group.
[0224] A training unit 420 is configured to train a preset binary classification machine learning model based on a training sample data set to obtain a target model and control variables corresponding to the target model;
[0225] An output unit 430 is configured to output the target model when it is determined based on the test sample data set that the target model meets the statistical fairness requirement;
[0226] A first determining unit 440 is configured to determine a model training optimization direction based on a control variable when it is determined based on the test sample data set that the target model does not meet the statistical fairness requirement;
[0227] A second determining unit 450 is configured to determine an optimized sample data set in the training sample data set based on the model training optimization direction;
[0228] An extraction unit 460 is used to extract a target sample with the largest sample loss value from the optimized sample data set;
[0229] The optimization unit 470 is used to reverse the sample labels of the target samples in the training sample data set to obtain a new training sample data set, and trigger the training unit 420 to perform training on the preset binary classification machine learning model based on the training sample data set to obtain the target model and the control variables corresponding to the target model.
[0230] As an optional implementation, the training unit 420 includes:
[0231] The training subunit 421 is used to train a preset binary classification machine learning model based on the training sample data set to obtain a target model;
[0232] A prediction subunit 422 is configured to input the first sample set and the second sample set into a target model to obtain a first positive sample set, a first negative sample set, a second positive sample set, and a second negative sample set;
[0233] a calculation subunit 423, configured to calculate a first ratio between the number of samples in the first positive sample set and the number of samples in the first sample set, and calculate a second ratio between the number of samples in the second positive sample set and the number of samples in the second sample set;
[0234] The judging subunit 424 is configured to judge whether a difference obtained by subtracting the first ratio from the second ratio is greater than a preset fairness tolerance threshold constant; wherein the fairness tolerance threshold constant is ε;
[0235] A first setting subunit 425 is configured to set the control variable corresponding to the target model to ε when a difference obtained by subtracting the first ratio from the second ratio is greater than a preset fairness tolerance threshold constant;
[0236] The first setting subunit 425 is further configured to set the control variable corresponding to the target model to 1 when the difference obtained by subtracting the first ratio from the second ratio is not greater than a preset fairness tolerance threshold constant.
[0237] As an optional implementation, the fairness-enhancing model training apparatus further includes:
[0238] The first prediction unit 480 is configured to input the third sample set and the fourth sample set into the target model to obtain a third positive sample set, a third negative sample set, a fourth positive sample set, and a fourth negative sample set;
[0239] a first calculation unit 490 configured to calculate a third ratio between the number of samples in the third positive sample set and the number of samples in the third sample set, and to calculate a fourth ratio between the number of samples in the fourth positive sample set and the number of samples in the fourth sample set;
[0240] The judging unit 500 is configured to judge whether the absolute value of the difference between the third ratio and the fourth ratio is greater than a preset fairness tolerance threshold constant; wherein the fairness tolerance threshold constant is ε;
[0241] a third determining unit 510, configured to determine that the target model meets the statistical fairness requirement when the absolute value of the difference between the third ratio and the fourth ratio is not greater than a preset fairness tolerance threshold constant;
[0242] The third determining unit 510 is further configured to determine that the target model does not meet the statistical fairness requirement when the absolute value of the difference between the third ratio and the fourth ratio is greater than a preset fairness tolerance threshold constant.
[0243] As an optional implementation manner, the first determining unit 440 includes:
[0244] The second setting subunit 441 is configured to set the control variable to -1 when it is determined based on the test sample data set that the target model does not meet the statistical fairness requirement, the difference obtained by subtracting the fourth ratio from the third ratio is greater than ε, and the control variable is not -1; or to set the control variable to 1 when it is determined based on the test sample data set that the target model does not meet the statistical fairness requirement, the difference obtained by subtracting the third ratio from the fourth ratio is greater than ε, and the control variable is -1;
[0245] The determination subunit 442 is used to determine the model training optimization direction based on the control variables.
[0246] In this embodiment, when the control variable is greater than or equal to 0, the model training optimization direction is determined to be positive;
[0247] When the model training optimization direction is positive, the optimized sample data set includes a first negative sample set and a second positive sample set;
[0248] The sample loss value is the cross entropy classification loss value;
[0249] Sample labels are positive or negative.
[0250] As an optional implementation, the fairness-enhancing model training apparatus further includes:
[0251] A second prediction unit 520 is configured to, after the optimization unit 470 inverts the sample labels of the target samples in the training sample data set to obtain a new training sample data set, input the new training sample data set into the target model when the control variable is ε, to obtain a new first positive sample set, a new first negative sample set, a new second positive sample set, and a new second negative sample set;
[0252] A second calculation unit 530 is configured to calculate a first intermediate ratio between the number of samples in the new first positive sample set and the number of samples in the new first sample set, and calculate a second intermediate ratio between the number of samples in the new second positive sample set and the number of samples in the new second sample set;
[0253] The second determination unit 540 is also used to determine the optimized sample data set in the training sample data set based on the model training optimization direction when the difference obtained by subtracting the first intermediate ratio from the second intermediate ratio is greater than ε, until the difference obtained by subtracting the first intermediate ratio from the second intermediate ratio is not greater than ε.
[0254] In this embodiment, when the control variable is less than 0, the model training optimization direction is determined to be reverse;
[0255] When the model training optimization direction is reverse, the optimized sample data set includes a first positive sample set and a second negative sample set;
[0256] The sample loss value is the cross entropy classification loss value;
[0257] Sample labels are positive or negative.
[0258] In this embodiment, the explanation of the model training device for enhancing fairness can refer to the description in Example 1 or Example 2, and will not be further elaborated in this embodiment.
[0259] It can be seen that the model training device for enhancing fairness described in this embodiment can use classification loss to screen the best samples for modifying classification labels, so as to reduce the impact of modified sample labels on the model classification accuracy; it can also predict the number of training data modifications based on the positive judgment rate of the classification results on the training set (the proportion of the number of samples with the sample label of "+" in the classification results on the training set to the total number of samples in the training set), and fine-tune the number of training data modifications based on the fairness evaluation results on the test set; it can also use the classification loss of the model to guide the modification process of the training data, and then use the modified data to retrain the model, sacrificing the least model classification accuracy in exchange for improved model fairness.
[0260] An embodiment of the present application provides an electronic device, including a memory and a processor, wherein the memory is used to store a computer program, and the processor runs the computer program to enable the electronic device to perform the fairness-enhancing model training method in embodiment 1 or embodiment 2 of the present application.
[0261] An embodiment of the present application provides a computer-readable storage medium storing computer program instructions. When the computer program instructions are read and executed by a processor, the fairness-enhancing model training method of embodiment 1 or embodiment 2 of the present application is executed.
[0262] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely illustrative. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architectures, functions and operations of the devices, methods and computer program products according to the multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of the code, and the module, program segment or a part of the code contains one or more executable instructions for implementing the specified logical functions. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart, can be implemented using a dedicated hardware-based system that performs the specified function or action, or can be implemented using a combination of dedicated hardware and computer instructions.
[0263] In addition, the functional modules in each embodiment of the present application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.
[0264] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0265] The foregoing is merely an embodiment of the present application and is not intended to limit the scope of protection of the present application. Various modifications and variations are possible for those skilled in the art. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included within the scope of protection of the present application. It should be noted that similar reference numerals and letters represent similar items in the following figures. Therefore, once an item is defined in one figure, it does not need to be further defined or explained in subsequent figures.
[0266] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in the present application should be included in the scope of protection of the present application. Therefore, the scope of protection of the present application should be based on the scope of protection of the claims.
[0267] It should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply the existence of any such actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or device comprising the element.
Claims
1. A fairness-enhancing model training method, characterized in that: The fairness-enhancing model training method is used in the training process of a resume screening model in the field of fair screening of administrative data, and includes: Obtain a training sample dataset and a test sample dataset; wherein the training sample dataset includes a first sample set from the differentiated treatment group and a second sample set from the normal group; the test sample dataset includes a third sample set from the differentiated treatment group and a fourth sample set from the normal group; and both the training sample dataset and the test sample dataset are resume sample datasets; Training a preset binary classification machine learning model based on the training sample data set to obtain a target model and control variables corresponding to the target model; When it is determined based on the test sample data set that the target model meets the statistical fairness requirement, the target model is output; the target model is used to fairly screen the received job resumes; When it is determined based on the test sample data set that the target model does not meet the statistical fairness requirement, determining a model training optimization direction based on the control variables; Determining an optimized sample data set in the training sample data set based on the model training optimization direction; Extracting the target sample with the largest sample loss value from the optimized sample data set; Inverting the sample labels of the target samples in the training sample data set to obtain a new training sample data set, and triggering the step of training a preset binary classification machine learning model based on the training sample data set to obtain a target model and control variables corresponding to the target model; The step of training a preset binary classification machine learning model based on the training sample data set to obtain a target model and control variables corresponding to the target model includes: Training a preset binary classification machine learning model based on the training sample data set to obtain a target model; Inputting the first sample set and the second sample set into the target model to obtain a first positive sample set, a first negative sample set, a second positive sample set, and a second negative sample set; Calculating a first ratio between the number of samples in the first positive sample set and the number of samples in the first sample set, and calculating a second ratio between the number of samples in the second positive sample set and the number of samples in the second sample set; Determine whether a difference obtained by subtracting the first ratio from the second ratio is greater than a preset fairness tolerance threshold constant; wherein the fairness tolerance threshold constant is ε; If yes, then set the control variable corresponding to the target model to ε; If not, then the control variable corresponding to the target model is set to 1.
2. The fairness-enhancing model training method according to claim 1, characterized in that: The method further comprises: Inputting the third sample set and the fourth sample set into the target model to obtain a third positive sample set, a third negative sample set, a fourth positive sample set and a fourth negative sample set; Calculating a third ratio between the number of samples in the third positive sample set and the number of samples in the third sample set, and calculating a fourth ratio between the number of samples in the fourth positive sample set and the number of samples in the fourth sample set; Determining whether an absolute value of a difference between the third ratio and the fourth ratio is greater than a preset fairness tolerance threshold constant; wherein the fairness tolerance threshold constant is ε; If not, determining that the target model meets the statistical fairness requirement; If so, it is determined that the target model does not meet the statistical fairness requirement.
3. The fairness-enhancing model training method according to claim 2, characterized in that: When it is determined based on the test sample data set that the target model does not meet the statistical fairness requirement, determining the model training optimization direction based on the control variables includes: When it is determined based on the test sample data set that the target model does not meet the statistical fairness requirement, the difference obtained by subtracting the fourth ratio from the third ratio is greater than ε, and the control variable is not -1, the control variable is set to -1; or when it is determined based on the test sample data set that the target model does not meet the statistical fairness requirement, the difference obtained by subtracting the third ratio from the fourth ratio is greater than ε, and the control variable is -1, the control variable is set to 1; The optimization direction of model training is determined based on the control variables.
4. The fairness-enhancing model training method according to claim 1, characterized in that: When the control variable is greater than or equal to 0, determining that the model training optimization direction is positive; When the model training optimization direction is positive, the optimized sample data set includes the first negative sample set and the second positive sample set; The sample loss value is the cross entropy classification loss value; The sample label is positive or negative.
5. The fairness-enhancing model training method according to claim 1, characterized in that: After inverting the sample labels of the target samples in the training sample dataset to obtain a new training sample dataset, the method further includes: When the control variable is ε, the new training sample data set is input into the target model to obtain a new first positive sample set, a new first negative sample set, a new second positive sample set, and a new second negative sample set; Calculating a first intermediate ratio between the number of samples in the new first positive sample set and the number of samples in the new first sample set, and calculating a second intermediate ratio between the number of samples in the new second positive sample set and the number of samples in the new second sample set; When the difference obtained by subtracting the first intermediate ratio from the second intermediate ratio is greater than ε, the step of determining the optimized sample data set in the training sample data set based on the model training optimization direction is triggered to execute until the difference obtained by subtracting the first intermediate ratio from the second intermediate ratio is no greater than ε.
6. The fairness-enhancing model training method according to claim 1, characterized in that: When the control variable is less than 0, determining that the model training optimization direction is reverse; When the model training optimization direction is reverse, the optimized sample data set includes the first positive sample set and the second negative sample set; The sample loss value is the cross entropy classification loss value; The sample label is positive or negative.
7. A training method for a resume screening model, characterized in that: include: Obtaining a training sample data set and a test sample data set; wherein the training sample data set includes a first sample set extracted from the resumes of female job applicants and a second sample set extracted from the resumes of male job applicants; and the test sample data set includes a third sample set extracted from the resumes of female job applicants and a fourth sample set extracted from the resumes of male job applicants; Training a preset binary classification machine learning model based on the training sample data set to obtain a resume screening model and control variables corresponding to the resume screening model; When it is determined based on the test sample data set that the resume screening model meets the statistical fairness requirement, outputting the resume screening model; When it is determined based on the test sample data set that the resume screening model does not meet the statistical fairness requirement, determining a model training optimization direction based on the control variables; Determining an optimized sample data set in the training sample data set based on the model training optimization direction; Extracting the target sample with the largest sample loss value from the optimized sample data set; Inverting the sample labels of the target samples in the training sample dataset to obtain a new training sample dataset, and triggering the step of training a preset binary classification machine learning model based on the training sample dataset to obtain a resume screening model and control variables corresponding to the resume screening model; The method of training a preset binary classification machine learning model based on the training sample data set to obtain a resume screening model and control variables corresponding to the resume screening model includes: Training a preset binary classification machine learning model based on the training sample data set to obtain a resume screening model; Inputting the first sample set and the second sample set into the resume screening model to obtain a first positive sample set, a first negative sample set, a second positive sample set, and a second negative sample set; Calculating a first ratio between the number of samples in the first positive sample set and the number of samples in the first sample set, and calculating a second ratio between the number of samples in the second positive sample set and the number of samples in the second sample set; Determine whether a difference obtained by subtracting the first ratio from the second ratio is greater than a preset fairness tolerance threshold constant; wherein the fairness tolerance threshold constant is ε; If yes, then set the control variable corresponding to the resume screening model to ε; If not, then the control variable corresponding to the resume screening model is set to 1.
8. A method for screening job resumes, characterized in that: include: Obtain applicant resumes; The applicant is input into a resume screening model, and a screening result of whether the applicant's resume meets the recruitment requirements is output; wherein the resume screening model is trained according to the fairness-enhancing model training method according to any one of claims 1 to 6.
9. An electronic device, characterized in that: The electronic device includes a memory and a processor, the memory is used to store a computer program, and the processor runs the computer program to enable the electronic device to perform the fairness-enhancing model training method according to any one of claims 1 to 6.
10. A readable storage medium, characterized in that: The readable storage medium stores computer program instructions, and when the computer program instructions are read and executed by a processor, the fairness-enhancing model training method according to any one of claims 1 to 6 is executed.
11. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the fairness-enhancing model training method according to any one of claims 1 to 6 is executed.
Citation Information
Patent Citations
Platform for delivering data-centric machine learning solutions
US20240185121A1
Cited By
Confusion matrix based model oriented confusion detection method
CN122637139A