Fair restoration method for constructing table data classification model of multiple loss items

By adjusting the weight of the fairness regularization term in the loss function and introducing a contrastive loss term, a multi-loss term framework is constructed, which solves the problem of poor fairness repair performance of deep learning models in cross-group scenarios, achieving a balance between fairness and performance. It is applicable to scenarios such as credit assessment, recruitment screening, and identity authentication.

CN121858665APending Publication Date: 2026-04-14BEIJING INST OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-26
Publication Date
2026-04-14

AI Technical Summary

Technical Problem

Existing deep learning models are not effective in correcting fairness in cross-groups, and there is an imbalance between fairness and performance. Single sensitive attribute correction methods are prone to causing imbalances in the prediction of other attributes, and multi-model integration strategies are difficult to implement in cross-group sparse sample scenarios.

Method used

By statistically analyzing the proportion of sensitive attributes in the training set, adjusting the weight of the fairness regularization term in the loss function, and introducing a contrastive loss term, a multi-loss term framework is constructed for model retraining, ensuring a balance between fairness and accuracy.

Benefits of technology

It achieves full coverage of cross-groups and accurate capture of implicit discrimination, improving the comprehensiveness and accuracy of fairness restoration, while reducing deployment costs, and is suitable for practical scenarios with sparse samples and limited computing power.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121858665A_ABST
    Figure CN121858665A_ABST
Patent Text Reader

Abstract

The invention relates to a fairness repairing method for constructing a table data classification model of multiple loss items, and belongs to the field of artificial intelligence and machine learning. The method comprises the following steps: firstly, counting the number proportion of various different sensitive attributes in a training set, adjusting the weight of a fair regular term of a loss function according to the proportion to retrain a model, and calculating a change ratio of a fairness index to an accuracy index by utilizing a test set; secondly, randomly replacing each attribute of the table with a reconstructed sample, and calculating the similarity between an original sample and the reconstructed sample as a model comparison loss item; and finally, adjusting the weight of a fair regular term and comparing the weight of a loss term by using the change ratio, and retraining the model to generate a fair repair model. Aiming at the problems that prediction fairness imbalance of a model to other sensitive attributes is easily caused by only processing a single sensitive attribute and the accuracy is influenced by deleting the sensitive attributes in the existing method, fairness repair under the condition that the model accuracy is kept is realized through training sample reconstruction and sensitive attribute weight distribution.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to a technology for fairness repair and performance tuning of multiple sensitive attributes in deep learning models, belonging to the field of artificial intelligence and machine learning technology. It is particularly suitable for decision-making scenarios with stringent requirements for both fairness and performance, such as credit assessment, recruitment screening, and identity authentication. Background Technology

[0002] In recent years, deep learning models have been widely applied in the field of intelligent decision-making due to their powerful feature learning and decision-making capabilities, gradually replacing traditional rule-driven decision-making systems. Traditional decision-making systems rely on developers to directly define explicit decision logic, making the decision-making process transparent and traceable. In contrast, data-driven deep learning models need to automatically learn decision rules from massive amounts of training data. Their internal mining of feature associations (especially the implicit association between sensitive attributes and decision results) often exceeds the developers' preconceived notions. This core difference makes deep learning models exhibit significant "black box" characteristics—developers cannot clearly analyze the model's decision logic for cross-groups (such as "A1+B2" and "A2+C2"). At the same time, the massive parameter scale and complex feature interaction relationships also render traditional fairness detection and performance tuning methods that rely on manual verification completely ineffective.

[0003] For a long time, fairness optimization in deep learning models was limited to the "single-objective dilemma" approach, which involved resampling and simple regularization constraints to correct fairness. These methods directly ignored the implicit bias of cross-groups and caused a significant drop in core performance (such as accuracy and recall) due to over-constraining model learning. In recent years, researchers have begun to attempt to balance fairness and performance, proposing a white-box optimization method for neuron coverage—which corrects bias by constraining the activation states of neurons related to sensitive attributes while preserving the learning depth of non-sensitive features. However, existing methods only focus on the response characteristics of individual neurons, ignoring the collaborative encoding effect of neuron combinations on cross-group features. This results in the problem of "single-attribute fairness but cross-attribute bias" still existing in the corrected model, and due to the blind constraint on neurons, it is still difficult to avoid a performance loss of more than 5%. In addition, multi-model ensemble strategies have also been widely explored, constructing a "fairness sub-model" and a "performance sub-model" and weightedly fusing the output results. However, this strategy requires a sufficient number of labeled samples for each group to train a fair sub-model, which makes it difficult for the model to converge. Furthermore, the fusion weights rely on massive amounts of validation data for debugging, making it difficult to implement in real-world scenarios where samples from cross-groups are sparse. In addition, deploying multiple models can double the system's computing power cost.

[0004] In summary, existing methods that only handle a single sensitive attribute are prone to causing an imbalance in the model's prediction fairness for other sensitive attributes, and removing sensitive attributes affects accuracy. Summary of the Invention

[0005] The purpose of this invention is to address the problems of poor fairness repair and imbalance between fairness and performance in existing technologies by proposing a technology for fair repair and performance assurance of cross-groups in deep learning models.

[0006] The design principle of this invention is as follows: First, the proportion of each sensitive attribute such as gender and race in the training set is statistically analyzed. Based on this proportion, the weight of the fairness regularization term in the loss function is adjusted to retrain the model. The change ratio of the fairness and accuracy indicators is calculated using the test set. Then, each attribute in the table is randomly replaced to reconstruct the samples. The similarity between the original samples and the reconstructed samples is calculated as the model's comparison loss term. Finally, the weights of the fairness regularization term and the comparison loss term are adjusted using the aforementioned change ratio to retrain the model and generate a fair repair model.

[0007] The technical solution of the present invention is achieved through the following steps:

[0008] Step 1: Sensitive Attribute Statistics and Data Preprocessing

[0009] Step 1.1, Sensitive Attribute Statistics and Proportion Calculation: Extract all sensitive attributes such as gender, race, and age from the dataset, and calculate the proportion of each value of each sensitive attribute in the training set. This proportion is used to adjust the weights of the subsequent fairness regularization term, making the model's treatment of different sensitive attributes more balanced.

[0010] Step 1.2, sample cleaning and feature standardization, remove samples with missing labels, missing sensitive attributes, or abnormal non-sensitive features; use Z-score standardization for numerical non-sensitive features, and use one-hot encoding for categorical non-sensitive features to obtain the standardized dataset.

[0011] Step 1.3: Split the dataset into training, validation, and test sets in an 8:1:1 ratio.

[0012] Step 2: Construct the model framework and initial parameters based on multiple loss terms.

[0013] Step 2.1, Model Structure Construction: Construct a tabular data classification model, including:

[0014] Basic prediction branch: responsible for the original classification task;

[0015] Fairness regularization module: Adds fairness constraints related to sensitive attributes to the loss function;

[0016] Contrast loss module: used to handle similarity learning between reconstructed samples and original samples.

[0017] The three parts form a comprehensive optimization framework with multiple loss terms.

[0018] Step 2.2, Setting the weights of the fairness regularization term

[0019] Based on the results of the proportion of sensitive attributes in step 1.1, the initial weights of the fairness regularization term are set so that sensitive attributes with imbalanced sample numbers can be compensated in the early stage of training.

[0020] Step 2.3: Initialize training parameters, set the model learning rate, batch size, optimizer type, iteration rounds, early stopping conditions, etc., and enter them into the configuration file.

[0021] Step 3: Iterative optimization based on fairness and contrast loss

[0022] Step 3.1, Initial Model Training and Fairness Change Calculation: The model is trained for the first time using a fairness regularization term weighted by the proportion of sensitive attributes. The ratio of changes in the model's fairness indicators (such as group differences and equality gaps) and accuracy indicators is calculated on the test set to guide the dynamic adjustment of the loss proportion in subsequent steps.

[0023] Step 3.2, Sample Reconstruction and Comparative Loss Calculation

[0024] Perform random replacement on each non-sensitive attribute of the tabular data to generate reconstructed samples; calculate the feature similarity between the original samples and the reconstructed samples, and use it as the contrastive loss to constrain the model to learn a more robust and fair latent representation.

[0025] Step 3.3, Constructing the total loss and dynamically adjusting the loss weights, constructing a total loss function consisting of three parts:

[0026] Classification performance loss

[0027] Fairness regularization term loss

[0028] Comparative loss

[0029] Based on the ratio of fairness to accuracy changes calculated in step 3.1, the weights of the fairness regularization term and the contrast loss are dynamically adjusted so that the model gradually restores fairness while ensuring accuracy.

[0030] Step 3.4: Update model parameters, perform backpropagation and parameter optimization based on total loss, and record the performance and fairness metrics for each training round.

[0031] Step 4, Model Validation and Output

[0032] Step 4.1, dual-dimensional verification of fairness and performance: simultaneously verify on the test set whether the fairness indicators of each sensitive attribute dimension reach the preset threshold and whether the overall classification accuracy of the model meets the requirements.

[0033] Step 4.2, Model Output and Loop Optimization: If all the above indicators meet the standards, the final fair repair model and performance report will be output; if they do not meet the standards, the loss weights or training parameters will be updated and iterative training will be performed again.

[0034] Step 4.3, Termination condition judgment: The training process is terminated when the preset number of iterations is reached or the early stopping condition is triggered.

[0035] Beneficial effects

[0036] Compared to fairness restoration methods that only focus on a single sensitive attribute, this invention achieves full coverage of cross-groups and accurate capture of implicit discrimination through a full combinatorial approach and neuronal combinatorial feature mining, thereby improving the comprehensiveness and accuracy of fairness restoration.

[0037] Compared to traditional regularization and multi-model ensemble methods, this invention introduces a contrastive loss term into the loss function, which minimizes performance loss while restoring fairness; moreover, it does not require additional labeling of cross-group samples or multi-model deployment, resulting in lower deployment costs and making it more suitable for real-world testing scenarios with sparse samples and limited computing power. Attached Figure Description

[0038] Figure 1 This is a schematic diagram illustrating the principle of the fairness repair method for constructing a tabular data classification model with multiple loss terms in this invention. Detailed Implementation

[0039] To better illustrate the purpose and advantages of the present invention, the implementation methods of the present invention will be further described in detail below with reference to examples.

[0040] To better illustrate the purpose and advantages of the present invention, the implementation methods of the present invention will be further described in detail below with reference to examples.

[0041] The experimental data came from the open-source COMPAS (Correctional Offender Management Profiling for Alternative Sanctions) dataset, containing approximately 11,000 sentencing-related samples. The core content included: predicted labels ("high recidivism risk = 1 / low recidivism risk = 0"), three protected sensitive attributes (A: A1 / A2; B: B1 / B2 / B3; C: C1 / C2 / C3), and eight non-sensitive features (crime type, number of prior convictions, current charge level, length of incarceration, education level, employment status, home address type, and drug use history). After preprocessing, the dataset was divided into an 8:1:1 ratio for the training set (7920 samples), validation set (990 samples), and test set (990 samples). The "A2+B2+C1" group accounted for 2.1% and was labeled as a sparse crossover group.

[0042] The model to be optimized in the experiment was a fully connected deep learning model with the structure of "input layer → 128-neuron hidden layer → 64-neuron hidden layer → 32-neuron hidden layer → output layer". The activation function of the hidden layer was ReLU, and the output layer was Sigmoid. Before the fix, the model had Acc=82%, Mac-F1=80% on the test set, and the SPD of the "A2+B2+C1" group was 0.27 (this group was predicted to have a 27% higher probability of "high risk of recidivism" than the average of other groups).

[0043] This experiment was conducted on a computer with the following specifications: Intel Core i5-12600kf@3.7GHz, 32GB RAM, GeForce RTX 3060 GPU, and Windows 11 64-bit operating system.

[0044] The specific procedure for this experiment is as follows:

[0045] Step 1: Cross-group construction and data preprocessing.

[0046] Step 1.1: Generate 2×3×3=18 cross groups in the form of "attribute 1 + attribute 2 + attribute 3" using the full combination method, establish a mapping table of "group ID - sample index - sensitive attribute combination", mark "A2+B2+C1" as a weak sensitive combination, and give it higher weight in the subsequent fair regularization item.

[0047] Step 1.2: Remove samples with missing labels, unclear sensitive attributes, or abnormal non-sensitive features. Perform Z-score standardization on numerical features such as "number of juvenile serious crimes" and "number of juvenile minor crimes".

[0048]

[0049] in The characteristic mean, The standard deviation is the feature value. One-hot encoding is performed on the categorical features to form a structured tabular input that can be used for model training.

[0050] Step 1.3: Divide the training set (7920 records), validation set (990 records), and test set (990 records) in an 8:1:1 ratio.

[0051] Step 2: Construction of the multiple loss term model and parameter initialization.

[0052] Step 2.1: Model structure construction. The prediction branch uses the pre-trained parameters of the model to be optimized. The fairness regularization module adjusts the loss weights based on the proportion of the sensitive attribute group. Positive and negative samples are constructed by randomly replacing the sensitive and non-sensitive attributes of the samples for subsequent comparison loss calculation.

[0053] Step 2.2: Initialize the fairness regularization term and contrastive loss weights. The fairness regularization term weights are initially assigned based on the proportion of sensitive attributes in Step 1.1: the smaller the proportion, the larger the weight. For weakly sensitive combinations, an additional 1.2 times weight compensation is applied. A lower bound on the weights is applied to prevent weight degradation. Performance weights are also set. Fair weighting Dynamically adjust step size Performance degradation tolerance threshold The fairness standards are: SPD absolute value ≤ 0.1 and EOD absolute value ≤ 0.08.

[0054] Step 2.3: Configure hyperparameters: epoch=180, mini-batch=64, optimizer is AdamW (initial learning rate=0.0005, weight decay=1e-4), early stopping parameter patience=12 (triggered if the fluctuation of the two-dimensional index is <1% for 12 consecutive rounds).

[0055] Step 3: Iterative optimization driven by multiple loss terms.

[0056] Step 3.1: For each batch, a stratified sampling strategy is adopted: non-sparse groups are sampled according to their sample proportion (e.g., “A1+B1+C2” accounts for 24%, so 64×24%≈15 samples are sampled), and sparse groups are forcibly sampled with 4 samples. If the sample is insufficient, supplementary samples are taken from the non-sparse group with the highest proportion to ensure that each batch covers 18 cross groups, so that the fairness regularization term can be updated stably.

[0057] Step 3.2, calculate the multidimensional loss.

[0058] Predicting losses Cross-entropy loss is used.

[0059]

[0060] in The true label for the sample (0 or 1). To predict probabilities for the model, This represents the batch sample size.

[0061] Comparative loss Comparative loss is used.

[0062]

[0063] in For the original sample, To reconstruct the sample, This is the cosine similarity calculation function. For temperature coefficient, This serves as an index for other samples within the batch.

[0064] Cross-fair loss :

[0065]

[0066] in For cross-group weights, For the statistical parity difference of group g ( ), For group g, the difference in the equality of chance ( ).

[0067] Step 3.3, Construction of total loss and dynamic adjustment of weights:

[0068]

[0069] Improvement in fairness of computation on the validation set every 15 rounds With the magnitude of performance degradation ( According to the ratio Dynamic adjustment (Performance weight) and (Fair weighting), if Then increase ,reduce ;like Then increase ,reduce This ensures a balance between fairness constraints and the preservation of feature information.

[0070] Step 3.4, parameter update and metric recording: Update the weights and bias parameters of the prediction loss and contrast loss using the AdamW optimizer; simultaneously update the weights of the fairness regularization term in each round. (Perform gradient updates and lower bound constraints), and record. , , , Indicators such as mean and moving average loss for each group.

[0071] Step 4, Model Validation and Output.

[0072] Step 4.1, the early stop condition is triggered in round 162 (12 consecutive rounds). fluctuation (And the two-dimensional indicators are stable). Test set validation results: 18 cross-groups. absolute value , absolute value ; (loss ), (loss ), (loss ), performance loss .

[0073] Step 4.2: Output HDF5 format model file (including classification loss weights, fairness regularization term weights, and contrastive loss weights) and related index values.

[0074] Step 4.3: Terminate the experimental procedure.

[0075] Test results:

[0076] The experiment, based on the repair model generated by the technology of this invention, achieved 100% fairness in 18 cross-groups on the test set. Among them, the SPD of the sparse group "A2+B2+C1" decreased from 0.27 to 0.09, a reduction of 66.7%. In the core performance indicators, the Acc loss was 3.0% and the Mac-F1 loss was 2.2%, both controlled within the preset 4% threshold.

[0077] The above detailed description further illustrates the purpose, technical solution, and beneficial effects of the invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A fairness repair method for constructing a tabular data classification model with multiple loss terms, characterized in that... The method includes the following steps: Step 1: Extract three sensitive attributes, A, B, and C; count the proportion of each attribute value in the training set and label the weakly sensitive combinations; standardize the numerical features, encode the categorical features, and configure the training hyperparameters. Step 2: Perform stratified sampling to generate mini-batch based on the proportion of sensitive attributes. For each sample, randomly reconstruct some non-sensitive attributes to generate reconstructed samples, and calculate the similarity between the original sample and the reconstructed sample for comparison loss. Step 3: Calculate the classification loss and the fairness index of each sensitive attribute combination, and update the group weights according to the proportion of sensitive attributes. Step 4: Construct a total loss function that includes classification loss, fairness regularization term, and contrastive loss; Step 5: Adaptively adjust the performance weight α and fairness weight β based on the performance degradation on the validation set and the fairness improvement, and then backpropagate to update the model; Step 6: Repeat steps 2–5 until the iteration limit is reached or the early stopping condition is met; Step 7: If the test set performance and fairness both meet the standards, output the trained fair repair model; otherwise, adjust the parameters and retrain.

2. The fairness repair technique for constructing multiple loss terms according to claim 1, characterized in that, In step 1: 1) Preprocessing of non-sensitive features: Numerical features are standardized using Z-core. Non-type features are encoded using one-hot encoding; 2) The fair regularization term is defined as: ,in For cross-group weights, For the statistical parity difference of group g, For group g, the chances of equality differ.

3. The fairness repair technique for constructing multiple loss terms according to claim 1, characterized in that, Randomly reconstructed samples are generated by replacing some insensitive attribute values ​​or applying perturbations to numerical features. The contrastive loss is: ,in For the original sample, To reconstruct the sample.

4. The method according to claim 1, characterized in that, The stratified sampling strategy includes: mandatory sampling of at least a preset number of samples for weak sensitive combinations, sampling of the remaining sensitive combinations according to their proportions, and supplementing the batch with the highest proportion when the combined batch is insufficient to form a complete batch.

5. The fairness repair technique for constructing multiple loss terms according to claim 1, characterized in that: 1) The formula for sample cross-entropy loss in step 3 is: ,in The true label for the sample (0 or 1). To predict probabilities for the model, 1) Batch sample size; 2) The total loss function formula is: 3) Adaptive adjustment rule in step 6: Calculate the improvement in fairness. With the magnitude of performance degradation ( According to the ratio Dynamic adjustment (Performance weight) and (Fair weighting), if Then increase ,reduce ;like Then increase ,reduce .