A model optimization method to enhance fairness
By adding specific structural optimization units to the artificial intelligence model, the problem of discriminatory behavior during the training process is solved, and the model's fairness improvement and compliance guarantee is achieved.
Patent Information
- Application Number
- CN202411212624.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-30
- Publication Date
- 2025-04-11
- Estimated Expiration
- 2044-08-30
AI Technical Summary
Existing artificial intelligence models are prone to discriminatory behaviors against certain sample groups during training, resulting in the model being non-compliant or unfair.
The fairness of the model is improved by adding optimization units, including neurons of specific structures, to construct and adjust parameters of optimization units to overcome discriminatory behaviors of sample groups.
Effectively enhance the fairness of the model, ensure that the model's prediction results among different sample groups are more fair, and avoid the risk of model non-compliance.
Smart Images

Figure CN119046763B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and more specifically, to a model optimization method for enhancing fairness. Background Art
[0002] At present, with the rapid development of artificial intelligence technology, the application of artificial intelligence technology is becoming more and more extensive. It has been applied to many fields such as image analysis, speech recognition, text processing, intelligent recommendation, security detection, etc. Federated learning and large model technology have become the forefront of artificial intelligence technology. However, in practice, it is found that the trained models often show discriminatory behavior against certain sample groups, resulting in non-compliant or unfair models. Summary of the invention
[0003] The purpose of the embodiments of the present application is to provide a model optimization method for enhancing fairness, which can improve the fairness of the model by adding optimization units to the model after the model training is completed.
[0004] The first aspect of the present application provides a model optimization method for enhancing fairness, comprising:
[0005] Acquire a training sample data set and a test sample data set; the training sample data set includes a discriminated training sample set and a normal training sample set; the test sample data set includes a discriminated test sample set and a normal test sample set;
[0006] Performing preliminary training of a binary classification machine learning model according to the training sample data set to obtain a first model;
[0007] Constructing an optimization unit in the first model to obtain a second model with a modified model structure;
[0008] Setting the optimization unit parameters of the optimization unit in the second model according to the preset optimization unit parameter values to obtain a third model;
[0009] Circularly optimizing the third model according to the training sample data set to obtain the optimal optimization unit parameter value;
[0010] According to the optimal optimization unit parameter value, the optimization unit parameters of the optimization unit in the third model are set to obtain a fourth model;
[0011] Fine-tune and optimize the fourth model according to the test sample data set to obtain fine-tune and optimize unit parameter values;
[0012] The optimization unit parameters of the optimization unit in the fourth model are set according to the fine-tuning optimization unit parameter values to obtain the optimized target model.
[0013] In the above implementation process, the method can perform preliminary training of the binary classification machine learning model based on samples of the discriminated group and samples of the normal group, so that the discriminatory behavior of the sample group exists initially, making preliminary preparations for the subsequent addition of optimization units to optimize it; then, the method can also make multiple adjustments to the optimization unit based on the discriminatory behavior of the sample group, so that it can better overcome the discriminatory behavior of the sample group, thereby enhancing fairness.
[0014] Furthermore, the training cutoff condition of the first model is that a preset cross entropy loss function converges or the number of training cycles exceeds a preset iteration threshold;
[0015] The first model includes a model front part and a sigmoid unit;
[0016] In the second model, the optimization unit includes a first neuron and a second neuron in a first layer, and a third neuron in a second layer;
[0017] The inputs of the first neuron and the second neuron are both group attribute labels of training samples in the training sample data set;
[0018] The input of the front part of the model is the training samples in the training sample data set;
[0019] The output of the front part of the model, the output of the first neuron and the output of the second neuron are respectively connected to the input of the third neuron;
[0020] The output of the third neuron is connected to the input of the sigmoid unit;
[0021] The output of the sigmoid unit is the output of the second model;
[0022] The optimization unit parameters of the optimization unit include a first weight parameter of the first neuron, a first bias parameter of the first neuron, a second weight parameter of the second neuron, a second bias parameter of the second neuron, a third weight parameter of the third neuron, and a third bias parameter of the third neuron.
[0023] In the above implementation process, the method disassembles the binary classification machine learning model (i.e., the first model) and adds optimization units with specific structures at specific positions, so that the second model with modified model structure has the basic ability to overcome the discriminatory behavior of the sample group.
[0024] Furthermore, the output of the third neuron in the second model is:
[0025] ;
[0026] in, is the output of the third neuron, is the first weight parameter, is the first bias parameter, is the second weight parameter, is the second bias parameter, and are the third weight parameter, is the third bias parameter, is the output of the front part of the model for the training sample, is the group attribute label of the training sample;
[0027] The preset optimization unit parameter values are specifically:
[0028] ;
[0029] ;
[0030] After setting the optimization unit parameters of the optimization unit in the second model according to the preset optimization unit parameter values to obtain the third model, the output of the third neuron in the third model is:
[0031] .
[0032] In the above implementation process, the method specifically defines the optimization unit and proposes a simplified application solution, which can determine the calculation structure of the optimization unit, thereby preparing for subsequent parameter adjustments.
[0033] Furthermore, the cyclic optimization of the third model according to the training sample data set to obtain the optimal optimization unit parameter value includes:
[0034] Performing initial model optimization on the third model according to the training sample data set to obtain initial optimization unit parameter values;
[0035] The third model is subjected to model loop optimization according to the training sample data set and the initial optimized unit parameter values to obtain the optimal optimized unit parameter values.
[0036] In the above implementation process, this method divides the parameter determination process of the optimization unit into two parts, which can respectively play the effects of initial model optimization and model cycle optimization, thereby ensuring the parameter determination effect of the optimization unit and further solving the sample discrimination problem of the preliminary model.
[0037] Furthermore, performing initial model optimization on the third model according to the training sample data set to obtain initial optimized unit parameter values includes:
[0038] Set the value of the second weight parameter to 0 and keep it unchanged;
[0039] Continuously increasing the value of the first weight parameter from 0 according to a first preset value increasing algorithm until the difference between the first positive detection rate of the third model on the discriminated training sample set and the second positive detection rate of the third model on the normal training sample set is within a first preset range, determining the value of the first weight parameter as the first weight parameter value, and calculating the first accuracy rate of the third model on the training sample data set;
[0040] Determining the first accuracy rate as the historical maximum accuracy rate;
[0041] The first weight parameter value and the second weight parameter value are determined as initial optimization unit parameter values.
[0042] In the above implementation process, the method fixes the second weight parameter to 0, and preferentially obtains the optimal value of the first weight parameter, while recording the corresponding accuracy, thereby achieving high-quality initialization of the optimization unit value and paving the way for subsequent parameter value optimization.
[0043] Furthermore, the performing model loop optimization on the third model according to the training sample data set and the initial optimization unit parameter values to obtain the optimal optimization unit parameter values includes:
[0044] Setting the value of the first weight parameter to 0, determining the value of the first weight parameter as the current cycle value, and keeping it unchanged;
[0045] Continuously reducing the value of the second weight parameter from 0 according to a preset value reduction algorithm until the difference between the third positive detection rate of the third model on the discriminated training sample set and the fourth positive detection rate of the third model on the normal training sample set is within a second preset range, determining the value of the second weight parameter as the second weight parameter value, and calculating the second accuracy of the third model on the training sample data set;
[0046] When the second accuracy rate is greater than the historical maximum accuracy rate, determining the second accuracy rate as the historical maximum accuracy rate;
[0047] Temporarily setting the current cycle value and the second weight parameter value as the optimal optimization unit parameter value;
[0048] Determine whether the current cycle value is greater than the first weight parameter value;
[0049] Increasing the value of the first weight parameter according to a second preset value increasing algorithm to obtain a current cycle value, and keeping it unchanged;
[0050] If yes, the provisional optimal optimization unit parameter value is determined as the optimal optimization unit parameter value;
[0051] If not, then trigger the execution of the preset value reduction algorithm to continuously reduce the value of the second weight parameter from 0 until the difference between the third positive search rate of the third model on the discriminated training sample set and the fourth positive search rate of the third model on the normal training sample set is within a second preset range, determine the value of the second weight parameter as the second weight parameter value, and calculate the second accuracy of the third model on the training sample data set.
[0052] In the above implementation process, the method can further select the optimal first weight parameter and second weight parameter within the restricted range of the first weight parameter value, so as to implement the parameters of the optimization unit and enable the optimization model to overcome the problem of sample discrimination.
[0053] Furthermore, the method further comprises:
[0054] When the second accuracy rate is not greater than the historical maximum accuracy rate, the method of increasing the value of the first weight parameter according to the second preset value increasing algorithm is triggered to obtain the current cycle value, which remains unchanged.
[0055] In the above implementation process, the method can perform parameter space search for the two parameters included in the optimal optimization unit parameter value (the search process is an ordered exhaustive traversal process), thereby determining and retaining the searched optimal result as the final result.
[0056] A second aspect of the present application provides a model optimization device for enhancing fairness, the model optimization device for enhancing fairness comprising:
[0057] An acquisition unit, used to acquire a training sample data set and a test sample data set; the training sample data set includes a discriminated training sample set and a normal training sample set; the test sample data set includes a discriminated test sample set and a normal test sample set;
[0058] A preliminary training unit, used to perform preliminary training of a binary classification machine learning model according to the training sample data set to obtain a first model;
[0059] A structure modification unit, used to construct an optimization unit in the first model to obtain a second model after the model structure is modified;
[0060] A parameter setting unit, used to set the optimization unit parameters of the optimization unit in the second model according to the preset optimization unit parameter values, so as to obtain a third model;
[0061] A loop optimization unit, used for loop optimization of the third model according to the training sample data set to obtain the optimal optimization unit parameter value;
[0062] A parameter determination unit, used for setting the optimization unit parameters of the optimization unit in the third model according to the optimal optimization unit parameter value, so as to obtain a fourth model;
[0063] A fine-tuning optimization unit, used to perform fine-tuning optimization on the fourth model according to the test sample data set to obtain parameter values of the fine-tuning optimization unit;
[0064] The model generation unit is used to set the optimization unit parameters of the optimization unit in the fourth model according to the fine-tuning optimization unit parameter values to obtain the optimized target model.
[0065] Furthermore, the training cutoff condition of the first model is that a preset cross entropy loss function converges or the number of training cycles exceeds a preset iteration threshold;
[0066] The first model includes a model front part and a sigmoid unit;
[0067] In the second model, the optimization unit includes a first neuron and a second neuron in a first layer, and a third neuron in a second layer;
[0068] The inputs of the first neuron and the second neuron are both group attribute labels of training samples in the training sample data set;
[0069] The input of the front part of the model is the training samples in the training sample data set;
[0070] The output of the front part of the model, the output of the first neuron and the output of the second neuron are respectively connected to the input of the third neuron;
[0071] The output of the third neuron is connected to the input of the sigmoid unit;
[0072] The output of the sigmoid unit is the output of the second model;
[0073] The optimization unit parameters of the optimization unit include a first weight parameter of the first neuron, a first bias parameter of the first neuron, a second weight parameter of the second neuron, a second bias parameter of the second neuron, a third weight parameter of the third neuron, and a third bias parameter of the third neuron.
[0074] Furthermore, the output of the third neuron in the second model is:
[0075] ;
[0076] in, is the output of the third neuron, is the first weight parameter, is the first bias parameter, is the second weight parameter, is the second bias parameter, and are the third weight parameter, is the third bias parameter, is the output of the front part of the model for the training sample, is the group attribute label of the training sample;
[0077] The preset optimization unit parameter values are specifically:
[0078] ;
[0079] ;
[0080] After setting the optimization unit parameters of the optimization unit in the second model according to the preset optimization unit parameter values to obtain the third model, the output of the third neuron in the third model is:
[0081] .
[0082] Furthermore, the loop optimization unit comprises:
[0083] An initial optimization subunit, used to perform initial model optimization on the third model according to the training sample data set to obtain initial optimization unit parameter values;
[0084] The loop optimization subunit is used to perform model loop optimization on the third model according to the training sample data set and the initial optimization unit parameter values to obtain the optimal optimization unit parameter values.
[0085] Furthermore, the initial optimization subunit includes:
[0086] A first setting module, used for setting the value of the second weight parameter to 0 and keeping it unchanged;
[0087] an initial optimization module, configured to continuously increase the value of the first weight parameter from 0 according to a first preset value increasing algorithm until a difference between a first positive detection rate of the third model on the discriminated training sample set and a second positive detection rate of the third model on the normal training sample set is within a first preset range, determine the value of the first weight parameter as a first weight parameter value, and calculate a first accuracy rate of the third model on the training sample data set;
[0088] A first determining module, configured to determine the first accuracy rate as a historical maximum accuracy rate;
[0089] The first determination module is further used to determine the first weight parameter value and the second weight parameter value as initial optimization unit parameter values.
[0090] Furthermore, the cycle optimization subunit includes:
[0091] A second setting module is used to set the value of the first weight parameter to 0, determine the value of the first weight parameter as the current cycle value, and keep it unchanged;
[0092] a loop optimization module, configured to continuously reduce the value of the second weight parameter from 0 according to a preset value reduction algorithm until the difference between the third positive detection rate of the third model on the discriminated training sample set and the fourth positive detection rate of the third model on the normal training sample set is within a second preset range, determine the value of the second weight parameter as the second weight parameter value, and calculate the second accuracy of the third model on the training sample data set;
[0093] A second determination module, configured to determine the second accuracy rate as the historical maximum accuracy rate when the second accuracy rate is greater than the historical maximum accuracy rate;
[0094] A provisional module, used for provisionally setting the current cycle value and the second weight parameter value as the optimal optimization unit parameter value;
[0095] A calculation module, used for increasing the value of the first weight parameter according to a second preset value increasing algorithm to obtain a current cycle value and keep it unchanged;
[0096] A judging module, used to judge whether the current cycle value is greater than the first weight parameter value;
[0097] The second determination module is further configured to determine the provisional optimal optimization unit parameter value as the optimal optimization unit parameter value when the judgment result of the judgment module is yes;
[0098] The second setting module is also used to trigger the loop optimization module to execute the preset value reduction algorithm to continuously reduce the value of the second weight parameter from 0 when the judgment result of the judgment module is no, until the difference between the third positive check rate of the third model on the discriminated training sample set and the fourth positive check rate of the third model on the normal training sample set is within a second preset range, determine the value of the second weight parameter as the second weight parameter value, and calculate the second accuracy of the third model on the training sample data set.
[0099] Furthermore, the judgment module is also used to trigger the calculation module to execute the method of increasing the value of the first weight parameter according to the second preset value increase algorithm when the second accuracy rate is not greater than the historical maximum accuracy rate, to obtain the current cycle value and keep it unchanged.
[0100] The third aspect of the present application provides a method for training a resume screening model, comprising:
[0101] Obtain a training sample data set and a test sample data set; the training sample data set includes a first female applicant resume set and a first male applicant resume set; the test sample data set includes a second female applicant resume set and a second male applicant resume set;
[0102] Performing preliminary training of a binary classification machine learning model according to the training sample data set to obtain a first model;
[0103] Constructing an optimization unit in the first model to obtain a second model with a modified model structure;
[0104] Setting the optimization unit parameters of the optimization unit in the second model according to the preset optimization unit parameter values to obtain a third model;
[0105] Circularly optimizing the third model according to the training sample data set to obtain the optimal optimization unit parameter value;
[0106] According to the optimal optimization unit parameter value, the optimization unit parameters of the optimization unit in the third model are set to obtain a fourth model;
[0107] Fine-tune and optimize the fourth model according to the test sample data set to obtain fine-tune and optimize unit parameter values;
[0108] The optimization unit parameters of the optimization unit in the fourth model are set according to the fine-tuning optimization unit parameter values to obtain an optimized resume screening model.
[0109] A fourth aspect of the present application provides a resume screening method, comprising:
[0110] Obtain applicant resumes;
[0111] 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 obtained according to the model optimization method for enhancing fairness described in any one of the first aspects of this application.
[0112] 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 model optimization method for enhancing fairness as described in any one of the first aspect of the present application.
[0113] 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 model optimization method for enhancing fairness described in any one of the first aspect of the present application is executed.
[0114] 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 model optimization method for enhancing fairness described in any one of the first aspects of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0115] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments of the present application will be briefly introduced below. 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 related drawings can be obtained based on these drawings without paying creative work.
[0116] Figure 1 A flowchart of a model optimization method for enhancing fairness provided in an embodiment of the present application;
[0117] Figure 2 A flowchart of another model optimization method for enhancing fairness provided in an embodiment of the present application;
[0118] Figure 3 A schematic diagram of the structure of a second model provided in an embodiment of the present application;
[0119] Figure 4 A schematic diagram of the structure of a model optimization device for enhancing fairness provided in an embodiment of the present application;
[0120] Figure 5 A schematic diagram of the structure of another model optimization device for enhancing fairness provided in an embodiment of the present application. DETAILED DESCRIPTION
[0121] 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.
[0122] It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and 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 cannot be understood as indicating or implying relative importance.
[0123] Example 1
[0124] Please see Figure 1 , Figure 1 A schematic diagram of a flow chart of a model optimization method for enhancing fairness provided in this embodiment. The model optimization method for enhancing fairness includes:
[0125] S101, obtaining a training sample data set and a test sample data set; the training sample data set includes a discriminated training sample set and a normal training sample set; the test sample data set includes a discriminated test sample set and a normal test sample set.
[0126] S102. Perform preliminary training of a binary classification machine learning model based on the training sample data set to obtain a first model.
[0127] In this embodiment, the training cutoff condition of the first model is that a preset cross entropy loss function converges or the number of training cycles exceeds a preset iteration threshold;
[0128] The first model includes the model front part and the sigmoid unit.
[0129] S103: construct an optimization unit in the first model to obtain a second model after the model structure is modified.
[0130] In this embodiment, in the second model, the optimization unit includes a first neuron and a second neuron in the first layer, and a third neuron in the second layer;
[0131] The inputs of the first neuron and the second neuron are both group attribute labels of the training samples in the training sample data set;
[0132] The input to the front part of the model is the training samples in the training sample dataset;
[0133] The output of the front part of the model, the output of the first neuron, and the output of the second neuron are connected to the input of the third neuron respectively;
[0134] The output of the third neuron is connected to the input of the sigmoid unit;
[0135] The output of the sigmoid unit is the output of the second model;
[0136] The optimization unit parameters of the optimization unit include a first weight parameter of the first neuron, a first bias parameter of the first neuron, a second weight parameter of the second neuron, a second bias parameter of the second neuron, a third weight parameter of the third neuron, and a third bias parameter of the third neuron.
[0137] In this embodiment, the output of the third neuron in the second model is:
[0138] ;
[0139] in, is the output of the third neuron, is the first weight parameter, is the first bias parameter, is the second weight parameter, is the second bias parameter, and are the third weight parameters, is the third bias parameter, is the output of the front part of the model for the training sample, is the group attribute label of the training sample;
[0140] The preset optimization unit parameter values are as follows:
[0141] ;
[0142] ;
[0143] After setting the optimization unit parameters of the optimization unit in the second model according to the preset optimization unit parameter values to obtain the third model, the output of the third neuron in the third model is:
[0144] .
[0145] S104. Setting the optimization unit parameters of the optimization unit in the second model according to preset optimization unit parameter values to obtain a third model.
[0146] S105. cyclically optimize the third model according to the training sample data set to obtain the optimal optimization unit parameter values.
[0147] S106. Setting the optimization unit parameters of the optimization unit in the third model according to the optimal optimization unit parameter values to obtain a fourth model.
[0148] S107. Fine-tune and optimize the fourth model according to the test sample data set to obtain fine-tune and optimize unit parameter values.
[0149] S108. Setting the optimization unit parameters of the optimization unit in the fourth model according to the fine-tuning optimization unit parameter values to obtain the optimized target model.
[0150] In this embodiment, the execution subject of the method may be a computing device such as a computer or a server, and no limitation is made in this embodiment.
[0151] It can be seen that the model optimization method for enhancing fairness described in this embodiment can improve the fairness of the model by adding optimization units to the model after the model training is completed.
[0152] Example 2
[0153] Please see Figure 2 , Figure 2 A schematic diagram of a flow chart of a model optimization method for enhancing fairness provided in this embodiment. The model optimization method for enhancing fairness includes:
[0154] S201, obtaining a training sample data set and a test sample data set; the training sample data set includes a discriminated training sample set and a normal training sample set; the test sample data set includes a discriminated test sample set and a normal test sample set.
[0155] In this embodiment, the training sample data set is T r ; Test sample data set T e .
[0156] In this embodiment, the discriminated group is G a ; Normal group is G b .
[0157] In this embodiment, the discriminated training sample set is T ra , the normal training sample set is T rb .
[0158] In this embodiment, the training sample data set of the machine learning model is T r , T r By the discriminated group G a The sample set T ra and normal group G b The sample set T rb It consists of two parts.
[0159] In this embodiment, the discriminated test sample set is T ea , the normal test sample set is T eb .
[0160] In this embodiment, the test sample data set of the machine learning model is T e , Te By the discriminated group G a The sample set T ea and normal group G b The sample set T eb It consists of two parts.
[0161] In this embodiment, the machine learning model uses T r The samples in are predicted as class "1" or "0". a The discriminated group is G a The probability that the sample in the group is predicted by the model as category "1" is lower than that of group G b The probability that the sample in is predicted by the model as category "1". It can be understood that the situation where the positive rate of the sample group is relatively low is regarded as the sample group being discriminated against.
[0162] S202. Perform preliminary training of a binary classification machine learning model based on the training sample data set to obtain a first model.
[0163] In this embodiment, the method uses T r A binary classification machine learning model M (i.e., the first module) is trained for the training sample data set. The last layer of the model M uses a sigmoid unit, and the remaining part of the model M after removing the last layer of sigmoid units is recorded as the front part of the model M (i.e., the front part of the model).
[0164] In this embodiment, L is the model M in the training sample data set T r The cross entropy loss function on .
[0165] In this embodiment, when L converges or the number of training rounds exceeds the threshold R th When , this method ends the initial model training; where R th is a preset positive integer constant.
[0166] S203: construct an optimization unit in the first model to obtain a second model after the model structure is modified.
[0167] Please see Figure 3 , Figure 3 A schematic diagram of the structure of the second model is shown. The optimization unit includes three neurons, which are divided into two layers. The first layer includes two neurons n1 and n2, and the second layer includes one neuron n3. Figure 3 It can be seen that the inputs of the above neurons n1 and n2 are both c i , c i is the input i-th training sample x i The group attribute label, c i The value is 1 or 0, where c i =0 means that the training sample x iBelong to the normal group G b , c i =1 means that the training sample x i Belong to the discriminated group G a ; The output of neurons n1 and n2 and the output of the front of model M are the input of neuron n3, and the output of neuron n3 is the input of the sigmoid unit; the output of the sigmoid unit is y i .
[0168] In this embodiment, the second model after adding the optimization unit is denoted as M'; wherein 1≤i≤N, i and N are both positive integers, and N is the total number of training samples.
[0169] S204. Setting the optimization unit parameters of the optimization unit in the second model according to preset optimization unit parameter values to obtain a third model.
[0170] S205. Set the value of the second weight parameter to 0 and keep it unchanged.
[0171] In this embodiment, when step S205 is executed, the round r of optimization training is initialized to 1.
[0172] S206. Continuously increase the value of the first weight parameter from 0 according to the first preset value increasing algorithm until the difference between the first positive detection rate of the third model on the discriminated training sample set and the second positive detection rate of the third model on the normal training sample set is within the first preset range, determine the value of the first weight parameter as the first weight parameter value, and calculate the first accuracy of the third model on the training sample data set.
[0173] In this embodiment, the difference between the first positive rate of the third model on the discriminated training sample set and the second positive rate of the third model on the normal training sample set can be a positive number or a negative number. The first preset range is [-A, A], and A is a first preset non-negative real number.
[0174] In this embodiment, the execution condition of this step may also be "when the absolute value of the difference between the first positive search rate of the third model on the discriminated training sample set and the second positive search rate of the third model on the normal training sample set is less than A", where A is a first preset non-negative real number.
[0175] In this embodiment, the number of samples whose group attribute label is "1" predicted by the machine learning model as category "1" on the training sample data set is recorded as TP (True Positive);
[0176] The number of samples whose group attribute label is "1" and predicted as category "0" is recorded as FN (False Negative);
[0177] The number of samples with a group attribute label of "0" predicted as category "1" is recorded as FP (False Positive);
[0178] The number of samples whose group attribute label is “0” is predicted to be of category “0” is recorded as TN (Ture Negative).
[0179] It can be seen that the label "1"→"1" is TP, the label "1"→"0" is FN, the label "0"→"1" is FP, and the label "0"→"0" is TN.
[0180] In this embodiment, the model is used in the test sample set T e The classification threshold for the sigmoid unit output determined by the above test is recorded as TH∈(0,1), that is, if the model output is greater than or equal to TH, the predicted category is "1", otherwise the predicted category is "0".
[0181] In this embodiment, the positive detection rate of the model on the training sample set is defined as:
[0182] ;
[0183] Among them, the positive rate can also be called the detection rate of label "1";
[0184] On the other hand, the accuracy is:
[0185] .
[0186] Based on this, the model is applied to the sample set T ra 、T rb The positive rate on the ra and PR rb .
[0187] In this embodiment, the first preset value increasing algorithm can be a step-by-step algorithm (arithmetic progressive algorithm) or an adaptive algorithm (an algorithm that adaptively adjusts the increase amount based on the result). The second preset value increasing algorithm and the value decreasing algorithm are similar.
[0188] S207: Determine the first accuracy rate as the historical maximum accuracy rate.
[0189] S208. Determine the first weight parameter value and the second weight parameter value as the initial optimization unit parameter value.
[0190] For example, the “initial model optimization” step of steps S205 to S208 includes:
[0191] When r=1, keep w2=0 unchanged, and continuously increase the value of w1 (that is, the value of the first weight parameter) from 0 and calculate the model M' in the training sample set Tra and T rb The positive rate PR ra and PR rb Until PR ra ≈PR rb , the value of w1 is recorded as w 1m (i.e. the value of the first weight parameter), calculate the model M' in the training sample set T r The accuracy of ACC r , let the historical maximum accuracy ACC max =ACC r , r=r+1, optimal parameter w opt =[w1,w2]. Let w1=0.
[0192] In this embodiment, the value of the first weight parameter represents the undetermined first weight parameter, and the value of the first weight parameter represents the determined first weight parameter. The second weight parameter is represented in the same way.
[0193] S209: Set the value of the first weight parameter to 0, determine the value of the first weight parameter as the current cycle value, and keep it unchanged.
[0194] In this embodiment, when step S209 is executed, the round r of optimization training is changed to 2.
[0195] S210. Continuously reduce the value of the second weight parameter from 0 according to a preset value reduction algorithm until the difference between the third positive search rate of the third model on the discriminated training sample set and the fourth positive search rate of the third model on the normal training sample set is within a second preset range, determine the value of the second weight parameter as the second weight parameter value, and calculate the second accuracy of the third model on the training sample data set.
[0196] In this embodiment, the difference between the third positive rate of the third model on the discriminated training sample set and the fourth positive rate of the third model on the normal training sample set can be a positive number or a negative number. The second preset range is [-B, B], and B is a second preset non-negative real number.
[0197] In this embodiment, the execution condition of this step may also be "when the absolute value of the difference between the third positive check rate of the third model on the discriminated training sample set and the fourth positive check rate of the third model on the normal training sample set is less than B". Wherein, B is a second preset non-negative real number.
[0198] In this embodiment, when step S210 is executed for the first time, the number of rounds r of optimization training is 2; when the loop is executed, r=r+1 for each loop.
[0199] S211: When the second accuracy rate is greater than the historical maximum accuracy rate, determine the second accuracy rate as the historical maximum accuracy rate.
[0200] As an optional implementation, the method further includes:
[0201] When the second accuracy is not greater than the historical maximum accuracy, the above-mentioned method of increasing the value of the first weight parameter according to the second preset value increasing algorithm is triggered to obtain the current cycle value, which remains unchanged.
[0202] In this embodiment, the step S213 is triggered to execute in the above steps.
[0203] S212. Temporarily set the current cycle value and the second weight parameter value as the optimal optimization unit parameter value.
[0204] S213: Increase the value of the first weight parameter according to the second preset value increasing algorithm to obtain the current cycle value, and keep it unchanged.
[0205] S214, determine whether the current cycle value is greater than the first weight parameter value, if so, execute step S215; if not, execute step S210.
[0206] S215. Determine the provisional optimal optimization unit parameter value as the optimal optimization unit parameter value.
[0207] For example, the steps of “model cycle optimization” described in steps S209 to S215 include: if w1>w 1m , then terminate the loop execution of the "model loop optimization" step; if w1≤w 1m , then calculate the model M' in the training sample set T ra and T rb The positive rate PR ra and PR rb , keep w1 unchanged, start from 0 and continuously reduce the value of w2 and calculate the model M' in the training sample set T ra and T rb The positive rate PR ra and PR rb Until PR ra ≈PR rb , calculate the model M' in the training sample set T r The accuracy of ACC r At this time, if ACC r >ACC max , then let ACC max =ACC r , r=r+1, optimal parameter w opt=[w1, w2], appropriately increase the value of w1, and repeat the "model cycle optimization" step; if ACC r ≤ACC max , then let r=r+1, increase the value of w1 appropriately, and repeat the "model loop optimization" step.
[0208] S216. Setting the optimization unit parameters of the optimization unit in the third model according to the optimal optimization unit parameter values to obtain a fourth model.
[0209] S217. Fine-tune and optimize the fourth model according to the test sample data set to obtain fine-tune and optimize unit parameter values.
[0210] In this embodiment, the specific steps of “updating the final model” described in step S217 include: opt The saved values of w1 and w2 are assigned to the corresponding weight parameters of the optimization unit. e The values of w1 and w2 are fine-tuned, and the values of w1 and w2 after fine-tuning are the final values of the corresponding weight parameters of the optimization unit.
[0211] S218. Setting the optimization unit parameters of the optimization unit in the fourth model according to the fine-tuning optimization unit parameter values to obtain the optimized target model.
[0212] In this embodiment, the execution subject of the method may be a computing device such as a computer or a server, and no limitation is made in this embodiment.
[0213] It can be seen that the model optimization method for enhancing fairness described in this embodiment can improve the fairness of the model by adding optimization units to the model after the model training is completed.
[0214] Example 3
[0215] Example 3 provides a schematic diagram of an example process of applying a fairness-enhancing model optimization method to an intelligent resume screening model. The process includes:
[0216] In the scenario of intelligent screening of job resumes, the job resume contains the user attribute information data of the applicant (including the applied position, applicant category, work / practical experience, personal skills, graduation school, major studied, personal education, gender, and age).
[0217] 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 sample data.
[0218] In this embodiment, this step can digitize the four attribute information of the applied position (such as R&D position, sales position, pre-sales position, management position, administrative position, research position, financial 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) according to the unique hot coding; the five attributes of work / practical experience (total number of internship and work 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 QS 300 universities), personal education (doctorate, master, undergraduate, college, below college), and age are digitized according to positive integers.
[0219] S302: Multiple sample data corresponding to multiple applicant resumes are used to form a sample data set T for model training. r ; Among them, the discriminated group is G a , the normal group is G b , T r By the discriminated group G a A sample data set T ra and normal group G b A sample data set T rb It consists of two parts.
[0220] In this embodiment, the method is used to eliminate the above-mentioned discrimination.
[0221] In this embodiment, the machine learning model uses T r The sample data in is predicted as category "1" or "0". "1" means that the candidate's resume corresponding to the sample data meets the recruitment requirements, and "0" means that the candidate's resume corresponding to the sample data does not meet the recruitment requirements.
[0222] In this embodiment, one of the training requirements of the resume intelligent screening model is that the output of the model cannot discriminate against gender, that is, men and women have equal opportunities to be hired. Specifically, the model can be used to test whether men and women have equal opportunities to be hired in the test sample set T ea and T eb The positive rate PR ea and PR eb Determine whether they are equal.
[0223] S303: The number of rounds of model optimization training is recorded as r, and r is initialized to 1. rTrain a binary classification machine learning model M (such as ResNet50 deep neural network) for the training data. The last layer of model M uses sigmoid units. The remaining part of model M after removing the last layer of sigmoid units is recorded as the front of model M. L is the model M in the dataset T. r When L converges or the number of training rounds exceeds the threshold R th =1000 to end the initial model training.
[0224] S304. Construct an optimization unit using three neurons.
[0225] In this embodiment, the optimization unit is divided into two layers, the first layer contains two neurons n1 and n2, and the second layer contains one neuron n3. The model after adding the optimization unit is denoted as M'. The output of neuron n3 is:
[0226] ;
[0227] in, ;
[0228] ; ; .
[0229] S305, when r=1, keep w2=0 unchanged, and continuously increase the value of w1 from 0 and calculate the model M' in the training sample set T ra and T rb The positive rate PR ra and PR rb Until PR ra ≈PR rb , the value of w1 is recorded as w 1m , calculate the model M' in the training sample set T r The accuracy of ACC r , let the historical maximum accuracy ACC max =ACC r , r=r+1, optimal parameter w opt =[w1,w2], let w1=0.
[0230] S306: Determine whether w1 is greater than w 1m , if w1>w 1m , then terminate the loop execution of step S306; if w1≤w 1m , then calculate the model M' in the training sample set T ra and T rb The positive rate PR ra and PR rb, keep w1 unchanged, start from 0 and continuously reduce the value of w2 and calculate the model M' in the training sample set T ra and T rb The positive rate PR ra and PR rb Until PR ra ≈PR rb , calculate the model M' in the training sample set T r The accuracy of ACC r .
[0231] At this time, if ACC r >ACC max , then let ACC max =ACC r , r=r+1, optimal parameter w opt =[w1, w2], increase w1, and execute step S306 in a loop;
[0232] If ACC r ≤ACC max , then set r=r+1, increase w1, and execute step S306 in a loop.
[0233] S307, the optimal parameter w opt The saved values of w1 and w2 are assigned to the corresponding weight parameters of the optimization unit. Referring to steps S305 and S306, in the test sample set T e The values of w1 and w2 are fine-tuned, and the values of w1 and w2 after fine-tuning are the final values of the corresponding weight parameters of the optimization unit.
[0234] As an optional implementation, the method may include the following when training a resume screening model:
[0235] Obtain a training sample data set and a test sample data set; the training sample data set includes a first female applicant resume set and a first male applicant resume set; the test sample data set includes a second female applicant resume set and a second male applicant resume set;
[0236] Performing preliminary training of a binary classification machine learning model according to the training sample data set to obtain a first model;
[0237] Constructing an optimization unit in the first model to obtain a second model with a modified model structure;
[0238] Setting the optimization unit parameters of the optimization unit in the second model according to the preset optimization unit parameter values to obtain a third model;
[0239] Circularly optimizing the third model according to the training sample data set to obtain the optimal optimization unit parameter value;
[0240] According to the optimal optimization unit parameter value, the optimization unit parameters of the optimization unit in the third model are set to obtain a fourth model;
[0241] Fine-tune and optimize the fourth model according to the test sample data set to obtain fine-tune and optimize unit parameter values;
[0242] The optimization unit parameters of the optimization unit in the fourth model are set according to the fine-tuning optimization unit parameter values to obtain an optimized resume screening model.
[0243] As a further optional implementation, the method further includes:
[0244] Obtain applicant resumes;
[0245] The applicant is input into a resume screening model, and a screening result is output to determine whether the applicant's resume meets the recruitment requirements.
[0246] In this embodiment, the execution subject of the method may be a computing device such as a computer or a server, and no limitation is made in this embodiment.
[0247] It can be seen that the model optimization method for enhancing fairness described in this embodiment can add an optimization unit to the job resume intelligent screening model to improve the fairness of the model, thereby eliminating certain existing discrimination.
[0248] Example 4
[0249] Please see Figure 4 , Figure 4 This is a schematic diagram of the structure of a model optimization device for enhancing fairness provided in this embodiment. Figure 4 As shown, the fairness-enhancing model optimization device includes:
[0250] The acquisition unit 410 is used to acquire a training sample data set and a test sample data set; the training sample data set includes a discriminated training sample set and a normal training sample set; the test sample data set includes a discriminated test sample set and a normal test sample set;
[0251] A preliminary training unit 420 is used to perform preliminary training of a binary classification machine learning model according to a training sample data set to obtain a first model;
[0252] A structure modification unit 430 is used to construct an optimization unit in the first model to obtain a second model after the model structure is modified;
[0253] A parameter setting unit 440, configured to set the optimization unit parameters of the optimization unit in the second model according to preset optimization unit parameter values to obtain a third model;
[0254] A loop optimization unit 450, configured to perform loop optimization on the third model according to the training sample data set to obtain optimal optimization unit parameter values;
[0255] A parameter determination unit 460, configured to set the optimization unit parameters of the optimization unit in the third model according to the optimal optimization unit parameter value, so as to obtain a fourth model;
[0256] A fine-tuning optimization unit 470 is used to perform fine-tuning optimization on the fourth model according to the test sample data set to obtain parameter values of the fine-tuning optimization unit;
[0257] The model generation unit 480 is used to set the optimization unit parameters of the optimization unit in the fourth model according to the fine-tuning optimization unit parameter values to obtain the optimized target model.
[0258] In this embodiment, the explanation of the model optimization 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 optimization device for enhancing fairness described in this embodiment can improve the fairness of the model by adding optimization units to the model after the model training is completed.
[0260] Example 5
[0261] Please see Figure 5 , Figure 5 This is a schematic diagram of the structure of a model optimization device for enhancing fairness provided in this embodiment. Figure 5 As shown, the fairness-enhancing model optimization device includes:
[0262] The acquisition unit 410 is used to acquire a training sample data set and a test sample data set; the training sample data set includes a discriminated training sample set and a normal training sample set; the test sample data set includes a discriminated test sample set and a normal test sample set;
[0263] A preliminary training unit 420 is used to perform preliminary training of a binary classification machine learning model according to a training sample data set to obtain a first model;
[0264] A structure modification unit 430 is used to construct an optimization unit in the first model to obtain a second model after the model structure is modified;
[0265] A parameter setting unit 440, configured to set the optimization unit parameters of the optimization unit in the second model according to preset optimization unit parameter values to obtain a third model;
[0266] A loop optimization unit 450, configured to perform loop optimization on the third model according to the training sample data set to obtain optimal optimization unit parameter values;
[0267] A parameter determination unit 460, configured to set the optimization unit parameters of the optimization unit in the third model according to the optimal optimization unit parameter value, so as to obtain a fourth model;
[0268] A fine-tuning optimization unit 470 is used to perform fine-tuning optimization on the fourth model according to the test sample data set to obtain parameter values of the fine-tuning optimization unit;
[0269] The model generation unit 480 is used to set the optimization unit parameters of the optimization unit in the fourth model according to the fine-tuning optimization unit parameter values to obtain the optimized target model.
[0270] In this embodiment, the training cutoff condition of the first model is that a preset cross entropy loss function converges or the number of training cycles exceeds a preset iteration threshold;
[0271] The first model includes the front part of the model and the sigmoid unit;
[0272] In the second model, the optimization unit includes a first neuron and a second neuron in the first layer, and a third neuron in the second layer;
[0273] The inputs of the first neuron and the second neuron are both group attribute labels of the training samples in the training sample data set;
[0274] The input to the front part of the model is the training samples in the training sample dataset;
[0275] The output of the front part of the model, the output of the first neuron, and the output of the second neuron are connected to the input of the third neuron respectively;
[0276] The output of the third neuron is connected to the input of the sigmoid unit;
[0277] The output of the sigmoid unit is the output of the second model;
[0278] The optimization unit parameters of the optimization unit include a first weight parameter of the first neuron, a first bias parameter of the first neuron, a second weight parameter of the second neuron, a second bias parameter of the second neuron, a third weight parameter of the third neuron, and a third bias parameter of the third neuron.
[0279] In this embodiment, the output of the third neuron in the second model is:
[0280] ;
[0281] in, is the output of the third neuron, is the first weight parameter, is the first bias parameter, is the second weight parameter, is the second bias parameter, and are the third weight parameters, is the third bias parameter, is the output of the front part of the model for the training sample, is the group attribute label of the training sample;
[0282] The preset optimization unit parameter values are as follows:
[0283] ;
[0284] ;
[0285] After setting the optimization unit parameters of the optimization unit in the second model according to the preset optimization unit parameter values to obtain the third model, the output of the third neuron in the third model is:
[0286] .
[0287] As an optional implementation, the loop optimization unit 450 includes:
[0288] The initial optimization subunit 451 is used to perform initial optimization of the third model according to the training sample data set to obtain initial optimization unit parameter values;
[0289] The loop optimization subunit 452 is used to perform model loop optimization on the third model according to the training sample data set and the initial optimization unit parameter values to obtain the optimal optimization unit parameter values.
[0290] As an optional implementation, the initial optimization subunit 451 includes:
[0291] A first setting module, used to set the value of the second weight parameter to 0 and keep it unchanged;
[0292] an initial optimization module, configured to continuously increase the value of the first weight parameter from 0 according to a first preset value increasing algorithm until a difference between a first positive detection rate of the third model on the discriminated training sample set and a second positive detection rate of the third model on the normal training sample set is within a first preset range, determine the value of the first weight parameter as the first weight parameter value, and calculate a first accuracy rate of the third model on the training sample data set;
[0293] A first determining module, configured to determine the first accuracy rate as the historical maximum accuracy rate;
[0294] The first determination module is further used to determine the first weight parameter value and the second weight parameter value as the initial optimization unit parameter value.
[0295] As an optional implementation, the loop optimization subunit 452 includes:
[0296] A second setting module is used to set the value of the first weight parameter to 0, determine the value of the first weight parameter as the current cycle value, and keep it unchanged;
[0297] A loop optimization module, used for continuously reducing the value of the second weight parameter from 0 according to a preset value reduction algorithm until the difference between the third positive check rate of the third model on the discriminated training sample set and the fourth positive check rate of the third model on the normal training sample set is within a second preset range, determining the value of the second weight parameter as the second weight parameter value, and calculating the second accuracy of the third model on the training sample data set;
[0298] A second determination module, configured to determine the second accuracy rate as the historical maximum accuracy rate when the second accuracy rate is greater than the historical maximum accuracy rate;
[0299] A provisional module, used to provisionally set the current cycle value and the second weight parameter value as the optimal optimization unit parameter value;
[0300] A calculation module, used to increase the value of the first weight parameter according to a second preset value increasing algorithm to obtain a current cycle value and keep it unchanged;
[0301] A judgment module, used to judge whether the current cycle value is greater than the first weight parameter value;
[0302] The second determination module is further used to determine the provisional optimal optimization unit parameter value as the optimal optimization unit parameter value when the judgment result of the judgment module is yes;
[0303] The second setting module is also used to trigger the loop optimization module to execute a preset value reduction algorithm to continuously reduce the value of the second weight parameter from 0 when the judgment result of the judgment module is no, until the difference between the third positive check rate of the third model on the discriminated training sample set and the fourth positive check rate of the third model on the normal training sample set is within a second preset range, determine the value of the second weight parameter as the second weight parameter value, and calculate the second accuracy of the third model on the training sample data set.
[0304] As an optional implementation, the judgment module is also used to trigger the calculation module to execute the above-mentioned method of increasing the value of the first weight parameter according to the second preset value increase algorithm when the second accuracy rate is not greater than the historical maximum accuracy rate, to obtain the current cycle value and keep it unchanged.
[0305] In this embodiment, the explanation of the model optimization device for enhancing fairness can refer to the description in Example 1 or Example 2, and will not be further elaborated in this embodiment.
[0306] It can be seen that the model optimization device for enhancing fairness described in this embodiment can improve the fairness of the model by adding optimization units to the model after the model training is completed.
[0307] 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 model optimization method for enhancing fairness in embodiment 1 or embodiment 2 of the present application.
[0308] 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 model optimization method for enhancing fairness in Embodiment 1 or Embodiment 2 of the present application is executed.
[0309] An embodiment of the present application provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the model optimization method for enhancing fairness in embodiment 1 or embodiment 2 of the present application is executed.
[0310] In several embodiments provided in the present 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 schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to 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 a code, and the module, a program segment or a part of a code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order 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 with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0311] In addition, the functional modules in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
[0312] If the function is implemented in the form of a software function module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, and other media that can store program codes.
[0313] The above description is only an embodiment of the present application and is not intended to limit the scope of protection of the present application. For those skilled in the art, the present application may have various changes and variations. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the scope of protection of the present application. It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in the subsequent drawings.
[0314] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0315] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
Claims
1. A model optimization method for enhancing fairness, characterized in that: include: Obtain training sample data set and test sample data set; The training sample data set includes a discriminated training sample set and a normal training sample set; The test sample data set includes a discriminated test sample set and a normal test sample set; wherein the training sample data set and the test sample data set are a collection of applicant resumes; wherein the applicant resume contains the user attribute information data of the applicant, and the user attribute information data includes the job position, applicant category, work practice experience, personal skills, graduation school, major studied, personal education, gender, and age; Preliminary training of a binary classification machine learning model is performed according to the training sample data set to obtain a first model; the first model is an initial model for job resume screening; Constructing an optimization unit in the first model to obtain a second model with a modified model structure; Setting the optimization unit parameters of the optimization unit in the second model according to the preset optimization unit parameter values to obtain a third model; Circularly optimizing the third model according to the training sample data set to obtain the optimal optimization unit parameter value; According to the optimal optimization unit parameter value, the optimization unit parameters of the optimization unit in the third model are set to obtain a fourth model; Fine-tune and optimize the fourth model according to the test sample data set to obtain fine-tune and optimize unit parameter values; The optimization unit parameters of the optimization unit in the fourth model are set according to the fine-tuning optimization unit parameter values to obtain a target model that has completed the optimization; wherein the target model is a resume screening model; the resume screening model is used to receive an input applicant resume and output a screening result of whether the applicant resume meets the recruitment requirements; Wherein, in the second model, the optimization unit includes a first neuron and a second neuron in the first layer, and a third neuron in the second layer; The inputs of the first neuron and the second neuron are both group attribute labels of the training samples in the training sample data set; The input to the front part of the model is the training samples in the training sample dataset; The output of the front part of the model, the output of the first neuron, and the output of the second neuron are connected to the input of the third neuron respectively; The output of the third neuron is connected to the input of the sigmoid unit; The output of the sigmoid unit is the output of the second model.
2. The fairness-enhancing model optimization method according to claim 1, characterized in that: The training cutoff condition of the first model is that a preset cross entropy loss function converges or the number of training cycles exceeds a preset iteration threshold; The first model includes a model front part and a sigmoid unit; In the second model, the optimization unit includes a first neuron and a second neuron in a first layer, and a third neuron in a second layer; The inputs of the first neuron and the second neuron are both group attribute labels of training samples in the training sample data set; The input of the front part of the model is the training samples in the training sample data set; The output of the front part of the model, the output of the first neuron and the output of the second neuron are respectively connected to the input of the third neuron; The output of the third neuron is connected to the input of the sigmoid unit; The output of the sigmoid unit is the output of the second model; The optimization unit parameters of the optimization unit include a first weight parameter of the first neuron, a first bias parameter of the first neuron, a second weight parameter of the second neuron, a second bias parameter of the second neuron, a third weight parameter of the third neuron, and a third bias parameter of the third neuron.
3. The fairness-enhancing model optimization method according to claim 2, characterized in that: The output of the third neuron in the second model is: ; in, is the output of the third neuron, is the first weight parameter, is the first bias parameter, is the second weight parameter, is the second bias parameter, and are the third weight parameter, is the third bias parameter, is the output of the front part of the model for the training sample, is the group attribute label of the training sample; The preset optimization unit parameter values are specifically: ; ; After setting the optimization unit parameters of the optimization unit in the second model according to the preset optimization unit parameter values to obtain the third model, the output of the third neuron in the third model is: 。 4. The fairness-enhancing model optimization method according to claim 2, characterized in that: The step of cyclically optimizing the third model according to the training sample data set to obtain the optimal optimization unit parameter value includes: Performing initial model optimization on the third model according to the training sample data set to obtain initial optimization unit parameter values; The third model is subjected to model loop optimization according to the training sample data set and the initial optimized unit parameter values to obtain the optimal optimized unit parameter values.
5. The fairness-enhancing model optimization method according to claim 4, characterized in that: The performing initial model optimization on the third model according to the training sample data set to obtain initial optimization unit parameter values includes: Set the value of the second weight parameter to 0 and keep it unchanged; Continuously increasing the value of the first weight parameter from 0 according to a first preset value increasing algorithm until the difference between the first positive detection rate of the third model on the discriminated training sample set and the second positive detection rate of the third model on the normal training sample set is within a first preset range, determining the value of the first weight parameter as the first weight parameter value, and calculating the first accuracy rate of the third model on the training sample data set; Determining the first accuracy rate as the historical maximum accuracy rate; The first weight parameter value and the second weight parameter value are determined as initial optimization unit parameter values.
6. The fairness-enhancing model optimization method according to claim 5, characterized in that: The performing model loop optimization on the third model according to the training sample data set and the initial optimization unit parameter values to obtain the optimal optimization unit parameter values includes: Setting the value of the first weight parameter to 0, determining the value of the first weight parameter as the current cycle value, and keeping it unchanged; Continuously reducing the value of the second weight parameter from 0 according to a preset value reduction algorithm until the difference between the third positive detection rate of the third model on the discriminated training sample set and the fourth positive detection rate of the third model on the normal training sample set is within a second preset range, determining the value of the second weight parameter as the second weight parameter value, and calculating the second accuracy of the third model on the training sample data set; When the second accuracy rate is greater than the historical maximum accuracy rate, determining the second accuracy rate as the historical maximum accuracy rate; Temporarily setting the current cycle value and the second weight parameter value as the optimal optimization unit parameter value; Increasing the value of the first weight parameter according to a second preset value increasing algorithm to obtain a current cycle value, and keeping it unchanged; Determine whether the current cycle value is greater than the first weight parameter value; If yes, the provisional optimal optimization unit parameter value is determined as the optimal optimization unit parameter value; If not, then trigger the execution of the preset value reduction algorithm to continuously reduce the value of the second weight parameter from 0 until the difference between the third positive search rate of the third model on the discriminated training sample set and the fourth positive search rate of the third model on the normal training sample set is within a second preset range, determine the value of the second weight parameter as the second weight parameter value, and calculate the second accuracy of the third model on the training sample data set.
7. The fairness-enhancing model optimization method according to claim 6, characterized in that: The method further comprises: When the second accuracy rate is not greater than the historical maximum accuracy rate, the method of increasing the value of the first weight parameter according to the second preset value increasing algorithm is triggered to obtain the current cycle value, which remains unchanged.
8. A training method for a resume screening model, characterized in that: include: Obtain training sample data set and test sample data set; The training sample data set includes a first female job applicant resume set and a first male job applicant resume set; The test sample data set includes a second female applicant resume set and a second male applicant resume set; wherein the applicant resume includes the applicant's user attribute information data, and the user attribute information data includes the job position, applicant category, work practice experience, personal skills, graduation school, major studied, personal education, gender, and age; Performing preliminary training of a binary classification machine learning model according to the training sample data set to obtain a first model; Constructing an optimization unit in the first model to obtain a second model with a modified model structure; Setting the optimization unit parameters of the optimization unit in the second model according to the preset optimization unit parameter values to obtain a third model; Circularly optimizing the third model according to the training sample data set to obtain the optimal optimization unit parameter value; According to the optimal optimization unit parameter value, the optimization unit parameters of the optimization unit in the third model are set to obtain a fourth model; Fine-tune and optimize the fourth model according to the test sample data set to obtain fine-tune and optimize unit parameter values; The optimization unit parameters of the optimization unit in the fourth model are set according to the fine-tuning optimization unit parameter value, so as to obtain an optimized resume screening model; the resume screening model is used to receive the input applicant resume and output a screening result of whether the applicant resume meets the recruitment requirements; Wherein, in the second model, the optimization unit includes a first neuron and a second neuron in the first layer, and a third neuron in the second layer; The inputs of the first neuron and the second neuron are both group attribute labels of the training samples in the training sample data set; The input to the front part of the model is the training samples in the training sample dataset; The output of the front part of the model, the output of the first neuron, and the output of the second neuron are connected to the input of the third neuron respectively; The output of the third neuron is connected to the input of the sigmoid unit; The output of the sigmoid unit is the output of the second model.
9. A resume screening method, characterized in that: include: Obtain applicant resumes; The applicant resume contains the applicant's user attribute information data, including the job position, applicant category, work experience, personal skills, graduation school, major, personal education, gender, and age; The applicant resume is input into a resume screening model, and a screening result of whether the applicant resume meets the recruitment requirements is output; wherein the resume screening model is obtained according to the model optimization method for enhancing fairness according to any one of claims 1 to 7.
10. An electronic device, characterized in that: The electronic device comprises 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 optimization method according to any one of claims 1 to 7.
11. 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 optimization method according to any one of claims 1 to 7 is executed.
12. 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 optimization method according to any one of claims 1 to 7 is executed.
Citation Information
Patent Citations
Method for improving convolutional neural network training based on jump-out local minimum
CN116663615A
Link prediction method fusing attention mechanism and graph contrast learning
CN118210976A