Method for training a fair classifier and medium

CN122594988APending Publication Date: 2026-08-18QUANZHOU NORMAL UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611055561.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-16
Publication Date
2026-08-18

AI Technical Summary

Technical Problem

而假设数据集是静态的或服从独立同分布的方式训练得到的模型,在面对动态变化的样本特征时,其输出结果的准确性将大大降低

Benefits of technology

[0036] The beneficial effects of this invention are as follows: First, feature vectors are generated based on non-sensitive attribute information, and an uncertainty score is constructed by fusing the uncertainty of the feature vectors relative to the model with the fairness difference across sensitive groups. This allows for assigning higher training weights to samples with high information content and high contribution to discrimination, guiding the model to focus on correcting key samples that cause group bias; while reducing the weights of samples with low information content and weak fairness impact, avoiding excessive interference from invalid samples in model training. Next, the weights corresponding to sensitive attribute groups are updated based on a weight iterative update algorithm, and the individual priority weight corresponding to each input sample is calculated based on the fairness information uncertainty score. The final weight corresponding to the input sample is also calculated based on the baseline weight and the individual priority weight. Thus, by combining the two layers of weights for fusion and iterative update, the overall fairness balance among various groups (multiple groups) is ensured, while the discrimination bias caused by a single sample can be specifically corrected. In summary, this invention does not assume that the data distribution is the same or follows independent and identical distribution during model training and deployment. Instead, it adaptively adjusts sample weights to enable the classifier to quickly adapt to constantly changing new environments, ensuring the fairness and accuracy of the model in long-term operation. At the same time, it selects samples by combining information content (uncertainty) and fairness measurement differences, thereby enabling fine-grained scoring modeling of samples with high information content and high unfairness, and prioritizing samples with high fairness information uncertainty scores, assigning them higher weights to improve the generalization ability of the fair classifier on test data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure FT_1
    Figure FT_1
  • Figure FT_2
    Figure FT_2
  • Figure FT_3
    Figure FT_3
Patent Text Reader

Abstract

The application discloses a training method of a fair classifier and a medium, wherein the method comprises the following steps: acquiring input samples; mapping non-sensitive attribute information into a feature vector; calculating a fair information uncertainty score value corresponding to the feature vector; constructing a classifier, and acquiring a plurality of sensitive attribute groups according to sensitive attribute information and category label information; updating the weight corresponding to the sensitive attribute group based on a weight iterative updating algorithm; calculating an individual priority weight corresponding to each input sample according to the fair information uncertainty score value; calculating a final weight corresponding to the input sample according to a benchmark weight and the individual priority weight; judging whether a training target is reached at present; and if yes, taking the current classifier as a final fair classifier. Thus, the unfairness of the model output is effectively eliminated, and meanwhile, the accuracy of the output result is ensured when dynamic data is faced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of machine learning technology, and in particular to a training method and medium for a fair classifier. Background Technology

[0002] In real life, machine learning (ML) has been widely applied in many critical decision-making areas, significantly improving the intelligence and efficiency of decision-making. However, ML algorithms can exhibit discriminatory behavior in unintended or even harmful ways. For example, research on the COMPAS dataset shows that automated recruitment systems may favor candidates with specific genders, ages, or racial backgrounds. The root cause of this phenomenon is that machine learning provides a channel for historical biases in society to influence the model through data. Biases generated during data collection or analysis and their classification results are persistent, allowing algorithms to further amplify the impact of historical biases. More importantly, biases often exist in a distributed form, making true fairness difficult to achieve simply by removing sensitive attributes from the data.

[0003] In related technologies, to eliminate the aforementioned unfairness, it is typically assumed that the dataset is static or follows an independent and identically distributed (IOD) model. While this approach allows the trained model to minimize bias on the training set, it cannot guarantee fairness on the test set when the model is deployed. Furthermore, in practical applications, sample characteristics are constantly changing (for example, continuous data streams from real-time cameras exhibit distributional characteristics that vary with time, location, and demographic features. Specifically, cameras near schools may capture a higher proportion of children at certain times, while at other times they primarily capture adults). Therefore, models trained using the assumption of a static dataset or an IOD model will experience a significant decrease in accuracy when faced with dynamically changing sample characteristics. Summary of the Invention

[0004] This invention aims to at least partially address one of the technical problems in related technologies. To this end, one objective of this invention is to propose a training method for a fair classifier that can effectively eliminate unfairness in model output; simultaneously, it ensures the accuracy of the output results when dealing with dynamic data.

[0005] According to the training method of a fair classifier of the present invention, input samples are obtained, the input samples including sensitive attribute information, non-sensitive attribute information, and category label information; a feature extractor is constructed, and the non-sensitive attribute information is mapped into a feature vector based on the feature extractor; the information uncertainty estimate of the feature vector relative to the current model is calculated, and the fairness difference value of the feature vector for different sensitive attribute information is calculated, and the corresponding fairness information uncertainty score is calculated based on the information uncertainty estimate and the fairness difference value; a classifier is constructed, and multiple sensitive attribute groups are obtained based on the sensitive attribute information and the category label information; the initial weights corresponding to the sensitive attribute groups are calculated, and the weights corresponding to the sensitive attribute groups are updated based on the weight iterative update algorithm; the individual priority weights corresponding to each input sample are calculated based on the fairness information uncertainty score; the final weights corresponding to the input samples are calculated based on the baseline weights and the individual priority weights; it is determined whether the training objective has been achieved; if so, the current classifier is used as the final fair classifier. This effectively eliminates the unfairness of the model output; at the same time, it ensures the accuracy of the output results when facing dynamic data.

[0006] In some embodiments, the information uncertainty estimate is calculated according to the following formula:

[0007]

[0008] in, Indicates the first Feature vector of each input sample The corresponding information is an uncertain estimate. The value representing the category label information is... , The value of the sensitive attribute information is indicated. , Indicates having category labels ,and Grouping of sensitive attributes Represents classifier right The prediction results; Indicates sensitive attribute grouping eigenvectors The predicted probability distribution This represents non-sensitive attribute information. Feature extractor right Perform feature mapping.

[0009] In some embodiments, the fairness difference value is calculated according to the following formula:

[0010]

[0011] in, Indicates the first Feature vector of each input sample The corresponding fairness difference value, The value representing the category label information is... , The value of the sensitive attribute information is indicated. , Indicates having a label ,and Feature vectors in sensitive attribute grouping The predicted probability distribution Indicates having a label ,and Feature vectors in sensitive attribute grouping The predicted probability distribution express The average probability distribution, This represents the total number of input samples.

[0012] In some embodiments, the fairness information uncertainty score is calculated according to the following formula:

[0013]

[0014] in, This represents the score indicating uncertainty about fair information. This indicates an uncertain estimate of the information. Indicates the relative importance parameter, This represents the difference in fairness.

[0015] In some embodiments, after calculating the corresponding fairness information uncertainty score based on the information uncertainty estimate and the fairness difference value, the training method further includes:

[0016] The uncertainty score for the fair information is normalized.

[0017] The normalization process is performed according to the following formula:

[0018]

[0019] in, This represents the normalized score for uncertainty regarding fair information. This represents the score indicating uncertainty about fair information. Indicates having a label ,and Grouping of sensitive attributes Indicates sensitive attribute grouping The minimum fairness information uncertainty score obtained from the medium sample. Indicates sensitive attribute grouping The maximum fairness information uncertainty score obtained from the medium sample. Represents a minimal constant. .

[0020] In some embodiments, the training objective function of the classifier is expressed by the following formula:

[0021]

[0022] in, Indicates the first The baseline weights of each input sample. Represents the cross-entropy loss function. Indicates category label information, Represents classifier right The prediction results This represents non-sensitive attribute information. This indicates information about sensitive attribute grouping. express The sum of the cross-entropy losses of each input sample. This represents the total number of input samples.

[0023] In some embodiments, the initial weights corresponding to sensitive attribute groups are calculated according to the following formula:

[0024]

[0025] in, Indicates sensitive attribute grouping The corresponding initial weights, Indicates predicted label And the sensitive attribute is The expected probability distribution at time, Indicates predicted label And the sensitive attribute is The probability distribution of observation at that time Indicates predicted label The total number of input samples, Represents sensitive attribute information The total number of input samples, Indicates predicted label And sensitive attribute information The total number of input samples, This represents the total number of input samples;

[0026] The weight iterative update algorithm is expressed by the following formula:

[0027]

[0028] in, Indicates the first Sensitive attribute grouping obtained in the next iteration The corresponding weights Indicates the first Sensitive attribute grouping obtained in the next iteration The corresponding weights Indicates the first The predicted label obtained in the next iteration This represents the adjustment weight constant. This represents the total number of training iterations.

[0029] In some embodiments, the individual priority weight is calculated using the following formula:

[0030]

[0031] in, Indicates the first The result of the iteration is the first Individual priority weights for each input sample. This represents the normalized score for uncertainty regarding fair information. Indicates the learning step size. Indicates sensitive attribute grouping The total number of input samples, Represented by natural constant Exponential function with base .

[0032] In some embodiments, the final weight is calculated using the following formula:

[0033]

[0034] in, Indicates the first The result of the iteration is the first The final weights of each input sample. Indicates the first Sensitive attribute grouping obtained in the next iteration The corresponding weights Indicates the first The result of the iteration is the first Individual priority weights for each input sample. Indicates sensitive attribute grouping The ratio of the number of input samples to the total number of input samples. , Indicates the first The feature vector of each input sample This represents the total number of training iterations.

[0035] Secondly, embodiments of the present invention provide a computer-readable storage medium storing a training program for a fair classifier, which, when executed by a processor, implements the training method for the fair classifier as described above.

[0036] The beneficial effects of this invention are as follows: First, feature vectors are generated based on non-sensitive attribute information, and an uncertainty score is constructed by fusing the uncertainty of the feature vectors relative to the model with the fairness difference across sensitive groups. This allows for assigning higher training weights to samples with high information content and high contribution to discrimination, guiding the model to focus on correcting key samples that cause group bias; while reducing the weights of samples with low information content and weak fairness impact, avoiding excessive interference from invalid samples in model training. Next, the weights corresponding to sensitive attribute groups are updated based on a weight iterative update algorithm, and the individual priority weight corresponding to each input sample is calculated based on the fairness information uncertainty score. The final weight corresponding to the input sample is also calculated based on the baseline weight and the individual priority weight. Thus, by combining the two layers of weights for fusion and iterative update, the overall fairness balance among various groups (multiple groups) is ensured, while the discrimination bias caused by a single sample can be specifically corrected. In summary, this invention does not assume that the data distribution is the same or follows independent and identical distribution during model training and deployment. Instead, it adaptively adjusts sample weights to enable the classifier to quickly adapt to constantly changing new environments, ensuring the fairness and accuracy of the model in long-term operation. At the same time, it selects samples by combining information content (uncertainty) and fairness measurement differences, thereby enabling fine-grained scoring modeling of samples with high information content and high unfairness, and prioritizing samples with high fairness information uncertainty scores, assigning them higher weights to improve the generalization ability of the fair classifier on test data.

[0037] Additional aspects and advantages of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. Attached Figure Description

[0038] Figure 1 This is a flowchart illustrating the training method of a fair classifier according to an embodiment of the present invention;

[0039] Figure 2 This is a schematic diagram comparing the accuracy performance of the training method of the fair classifier according to an embodiment of the present invention with that of some baseline methods;

[0040] Figure 3 This is a schematic diagram comparing the chance entropy performance of the training method of the fair classifier according to an embodiment of the present invention with that of other baseline methods.

[0041] Figure 4 This is a schematic diagram comparing the population isentropy performance results of the training method of the fair classifier according to an embodiment of the present invention with those of other baseline methods.

[0042] Figure 5 This is a schematic diagram comparing the accuracy performance of the training method of the fair classifier according to an embodiment of the present invention with that of some other baseline methods. Detailed Implementation

[0043] Embodiments of the present invention are described in detail below, examples of which are illustrated in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain the present invention, and should not be construed as limiting the present invention.

[0044] The training method of the fair classifier according to an embodiment of the present invention is described below with reference to the accompanying drawings.

[0045] Please see Figure 1 , Figure 1 This is a flowchart illustrating the training method for a fair classifier according to an embodiment of the present invention, as shown below. Figure 1 As shown, the training method for this fair classifier includes the following steps:

[0046] S101, Obtain input samples, which include sensitive attribute information, non-sensitive attribute information, and category label information.

[0047] S102, construct a feature extractor and map insensitive attribute information into feature vectors based on the feature extractor.

[0048] As an example, the original dataset is obtained and preprocessed to obtain input samples, where each input sample includes sensitive attribute information, non-sensitive attribute information, and category label information. Next, a feature extractor is constructed. And through a feature extractor, non-sensitive attributes in the input samples are extracted. Mapped to feature vectors in, Feature extractor right Perform feature mapping.

[0049] S103, calculate the information uncertainty estimate of the feature vector relative to the current model, calculate the fairness difference value of the feature vector with respect to different sensitive attribute information, and calculate the corresponding fairness information uncertainty score based on the information uncertainty estimate and the fairness difference value.

[0050] In some embodiments, the information uncertainty estimate is calculated according to the following formula:

[0051]

[0052] in, Indicates the first Feature vector of each input sample The corresponding information is an uncertain estimate. The value representing the category label information is... , The value of the sensitive attribute information is indicated. , Indicates having category labels ,and Grouping of sensitive attributes Represents classifier right The prediction results; Indicates sensitive attribute grouping eigenvectors The predicted probability distribution This represents non-sensitive attribute information. Feature extractor right Perform feature mapping.

[0053] In some embodiments, the fairness difference value is calculated according to the following formula:

[0054]

[0055] in, Indicates the first Feature vector of each input sample The corresponding fairness difference value, The value representing the category label information is... , The value of the sensitive attribute information is indicated. , Indicates having a label ,and Feature vectors in sensitive attribute grouping The predicted probability distribution Indicates having a label ,and Feature vectors in sensitive attribute grouping The predicted probability distribution express The average probability distribution, This represents the total number of input samples.

[0056] In some embodiments, the fairness information uncertainty score is calculated according to the following formula:

[0057]

[0058] in, This represents the score indicating uncertainty about fair information. This indicates an uncertain estimate of the information. Indicates the relative importance parameter, This represents the difference in fairness.

[0059] In other words, firstly, the information uncertainty estimate of the feature vector relative to the current model is calculated; then, the fairness difference value of the feature vector with respect to different sensitive attribute information is calculated; then, the information uncertainty estimate and the fairness difference value are fused to calculate the fairness information uncertainty score corresponding to the input sample; thus, samples with high information content and high contribution to discrimination are given higher training weights to guide the model to focus on correcting key samples that cause group bias; and samples with low information content and weak fairness impact are given lower weights to avoid invalid samples from excessively interfering with model training.

[0060] In some embodiments, after calculating the corresponding fairness information uncertainty score based on the information uncertainty estimate and the fairness difference value, the training method further includes:

[0061] The score for uncertainty regarding fair information is normalized.

[0062] The normalization process is performed according to the following formula:

[0063]

[0064] in, This represents the normalized score for uncertainty regarding fair information. This represents the score indicating uncertainty about fair information. Indicates having a label ,and Grouping of sensitive attributes Indicates sensitive attribute grouping The minimum fairness information uncertainty score obtained from the medium sample. Indicates sensitive attribute grouping The maximum fairness information uncertainty score obtained from the medium sample. Represents a minimal constant. To prevent division by zero.

[0065] In other words, the fairness information uncertainty score obtained for each input sample is normalized by using the maximum and minimum values ​​obtained from the sensitive attribute grouping.

[0066] S104, construct a classifier and obtain multiple sensitive attribute groups based on sensitive attribute information and category label information.

[0067] In some embodiments, the training objective function of the classifier is expressed by the following formula:

[0068]

[0069] in, Indicates the first The baseline weights of each input sample. Represents the cross-entropy loss function. Indicates category label information, Represents classifier right The prediction results This represents non-sensitive attribute information. Indicates sensitive attribute information, express The sum of the cross-entropy losses of each input sample. This represents the total number of input samples.

[0070] In other words, a classifier is constructed by establishing a weighted training objective function, where... The objective function is to find The minimum value; Indicates calculation and The cross-entropy loss value between them.

[0071] S105, calculate the initial weights corresponding to the sensitive attribute groups, and update the weights corresponding to the sensitive attribute groups based on the weight iterative update algorithm.

[0072] In some embodiments, the initial weights corresponding to sensitive attribute groups are calculated according to the following formula:

[0073]

[0074] in, Indicates sensitive attribute grouping The corresponding initial weights, Indicates predicted label And the sensitive attribute is The expected probability distribution at time, Indicates predicted label And the sensitive attribute is The probability distribution of observation at that time Indicates predicted label The total number of input samples, Represents sensitive attribute information The total number of input samples, Indicates predicted label And sensitive attribute information The total number of input samples, This represents the total number of input samples;

[0075] The weight iterative update algorithm is expressed by the following formula:

[0076]

[0077] in, Indicates the first Sensitive attribute grouping obtained in the next iteration The corresponding weights Indicates the first Sensitive attribute grouping obtained in the next iteration The corresponding weights Indicates the first The predicted label obtained in the next iteration This represents the adjustment weight constant. This represents the total number of training iterations.

[0078] It should be noted that this weight iterative update algorithm is used to determine the weights between groups.

[0079] S106, Calculate the individual priority weight corresponding to each input sample based on the fairness information uncertainty score.

[0080] In some embodiments, the individual priority weight is calculated using the following formula:

[0081]

[0082] in, Indicates the first The result of the iteration is the first Individual priority weights for each input sample. This represents the normalized score for uncertainty regarding fair information. Indicates the learning step size. Indicates sensitive attribute grouping The total number of input samples, Represented by natural constant Exponential function with base .

[0083] S107, calculate the final weight corresponding to the input sample based on the baseline weight and the individual priority weight.

[0084] In some embodiments, the final weight is calculated using the following formula:

[0085]

[0086] in, Indicates the first The result of the iteration is the first The final weights of each input sample. Indicates the first Sensitive attribute grouping obtained in the next iteration The corresponding weights Indicates the first The result of the iteration is the first Individual priority weights for each input sample. Indicates sensitive attribute grouping The ratio of the number of input samples to the total number of input samples. , Indicates the first Sample features of each input sample This represents the total number of training iterations.

[0087] S108 determines whether the training objective has been achieved.

[0088] S109, if so, then use the current classifier as the final fair classifier.

[0089] As an example, let the total number of training iterations be... The stopping iteration threshold is Then, the classifier is iteratively trained using the adaptive reweighting algorithm described above until the function value of the current iteration is less than the iteration threshold. Or the current iteration count has reached the total number of training iterations. The current classifier is used as the final fair classifier. That is, when the function value of the current iteration is less than the iteration threshold... Or the current iteration count has reached the total number of training iterations. All of these are considered as having achieved the current training objective.

[0090] It should be noted that, assuming the above classifier training process is applicable to achieving population equality (DP) fairness, its further extension can achieve equality of opportunity (EOP) fairness and equality of probability (EOD) fairness.

[0091] The effects of the present invention will be further explained below with reference to experimental examples.

[0092] First, the fairness metrics are set as follows (using binary as an example):

[0093] Demographic parity requires the model's prediction results to be equal. It is fair to different groups with different sensitivity attributes (S): .

[0094] The equal odds principle requires that, given a label Y, instances with any sensitive attribute have an equal probability of being predicted positive. .

[0095] Equal opportunity requires that, given a positive class label Y = 1, instances with any sensitivity attribute have an equal probability of being predicted positive. .

[0096] Based on the above fairness metrics, the metrics used in the experiment are as follows:

[0097] 1) Population equality (ΔDP): .

[0098] 2) Equal probability arithmetic (ΔEOD): .

[0099] 3) Difference of equal opportunity (ΔEOP): .

[0100] The smaller the values ​​of ΔDP, ΔEOD, and ΔEOP, the fairer the model.

[0101] 4) Equal Entropy of Population (EDP): The closer the value is to 1, the more equitable it is. It can be formalized as:

[0102]

[0103] 5) Equal Opportunity Entropy (EEOP): The closer the value is to 1, the more fair the event. It can be formalized as:

[0104]

[0105] Regarding dataset processing:

[0106] Experimental dataset 1 comes from UCI Adult Income, one of the most popular datasets in fairness awareness classification research. It statistically analyzed the basic information of American residents at that time and their corresponding annual income. The dataset contains 15 attributes and has a data volume of 45,222. The sensitive attribute is gender ("gender"), and the category label is income ("income"), which determines whether a person's annual salary is greater than 50,000.

[0107] Experimental dataset 2 comes from New York Stop-and-Frisk (NYSF), a real-world dataset from 2011 New York City Police Department operations, recording whether a pedestrian stopped for suspected possession of a weapon actually possessed one. The experiment treats race as a sensitive attribute for each data sample, with the category label "frisked," indicating the determination of whether a pedestrian actually possesses a weapon. This dataset includes data from five cities: Manhattan, Brooklyn, Queens, the Bronx, and Staten. Therefore, the experiment treats the data from each city as an environment (domain). The data in each environment (domain) is further divided into three tasks, each corresponding to one month's dataset from one city, for a total of 15 tasks.

[0108] Experimental setup:

[0109] For the static dataset (Adult Income), the experiments used a logistic regression (LR) model for classification prediction. For the hyperparameter η, the values ​​for ΔDP, ΔEOD, and ΔEOP were 3.1, 3.9, and 4.8, respectively; while for the hyperparameter δ, the value was 100 for ΔDP and ΔEOD, and 10 for ΔEOP. For the online dataset (NYSF), the feature extractor consisted of one linear layer, followed by a LeakyReLU activation function and a Batch Normalization layer; the classifier consisted of one Batch Normalization layer, a linear layer, and a Sigmoid activation function. During training, the batch size hyperparameter was set to 4096, the epochs hyperparameter to 30, and the values ​​for η and δ were both set to 1. All experiments were repeated three times with fixed hyperparameter settings, and the average of the three repeated experiments was used as the final result.

[0110] Experimental Results and Conclusions:

[0111] To verify the performance of the proposed fair classifier training method in terms of classification accuracy and fairness, Table 1 compares the performance of the proposed method with ten baseline methods on the Adult Income test set. The proposed method (ARFIU) in the table is the training method of the fair classifier proposed in this invention.

[0112] Table 1

[0113]

[0114] As can be seen, post-processing algorithms (i.e., EO and CEO) improve fairness compared to the fairness-unconscious logistic regression (LR) method, but at the cost of significant classification accuracy. Among pre-processing methods, Fair batch and LBC methods adaptively learn the sample probabilities or weights in each subgroup, thus outperforming reweighting methods. However, these two methods exhibit poor generalization ability because they assign the same weights to samples in each subgroup and ignore differences between samples. Similarly, among mid-processing methods, although FC, AD, and RFI methods improve fairness by training algorithms with fairness constraints, their performance on the test set is not good. The FairMixup method focuses on addressing the generalization problem of fairness metrics, but also significantly compromises classification accuracy. In contrast, the APW method achieves relatively better performance results. This method achieves adaptive weighting by assigning higher weights to samples closer to the decision boundary, which greatly improves the algorithm's fairness generalization ability on the test set. The proposed method achieves the best performance among all baseline methods, with superior classification accuracy and fairness metrics compared to the APW method.

[0115] To further verify the fairness generalization ability of the proposed method on the test set, an experimental study was conducted using the Adult Income dataset. The results are shown in Table 2-4. In the table, the model performance difference is calculated by subtracting the performance index on the training set from the performance index on the test set. As can be seen from the table, although these algorithms exhibit good fairness on the training set, their fairness does not generalize well to the test set. Conversely, the proposed method achieves the best results, especially showing significant results on the ΔDP and ΔEOP metrics.

[0116] Table 2 Comparison of performance results of ΔDP index

[0117]

[0118] Table 3 Comparison of performance results of ΔEOD index

[0119]

[0120] Table 4 Comparison of performance results of ΔEOP index

[0121]

[0122] In addition, to more intuitively demonstrate the real-time performance evaluation results of the proposed method (ARFIU) compared with other baseline methods in terms of fairness and accuracy, the following is specifically shown: Figures 2-5 .in, Figure 2 and Figure 3 To achieve a set of comparison results when opportunities are equal, Figure 4 and Figure 5 A set of comparison results to achieve population equality. Figure 2 This is a comparison chart showing the accuracy performance of the invention proposed in this paper with some baseline methods. Figure 2 In the diagram, the blue curve represents the performance results of the FairSAOML algorithm, the yellow curve represents the performance results of the FairDolce algorithm, the green curve represents the performance results of the ConSCFairOL algorithm, and the black curve represents the performance results of the training method proposed in this invention. Figure 3 This is a comparison chart of the performance results of equal chance entropy. Figure 3 In the diagram, the blue curve represents the performance results of the FairSAOML algorithm, the yellow curve represents the performance results of the FairDolce algorithm, the green curve represents the performance results of the ConSCFairOL algorithm, and the black curve represents the performance results of the training method proposed in this invention. Figure 4 A comparison chart of population isoentropy performance results; Figure 4 In the diagram, the blue curve represents the performance results of the FairSAOML algorithm, the yellow curve represents the performance results of the FairDolce algorithm, the red curve represents the performance results of the LTFconVAE algorithm, and the black curve represents the performance results of the training method proposed in this invention. Figure 5 This is a comparison chart of the accuracy performance results of the invention proposed in this paper and some other baseline methods; Figure 5 In the diagram, the blue curve represents the performance results of the FairSAOML algorithm, the yellow curve represents the performance results of the FairDolce algorithm, the red curve represents the performance results of the LTFconVAE algorithm, and the black curve represents the performance results of the training method proposed in this invention.

[0123] It should be noted that for all methods in the figure, higher values ​​are better. As shown in the figure, ConSCFairOL, FairDolce, and LTFconVAE generally achieve good fairness results over time, with EEOP / EDP values ​​all above 0.8. While the proposed method did not dominate performance in the early rounds, its EEOP / EDP values ​​in later rounds consistently exceeded 0.8, achieving the best performance. Furthermore, regarding model accuracy over time, ConSCFairOL, FairDolce, and LTFconVAE maintained good performance, while the proposed method achieved the best result, outperforming the others. This further illustrates that in balancing fairness and accuracy, the proposed method prioritizes model utility in early tasks. As iterations progress, the individual priority weights allow the model to learn more effectively from information-rich and unfair samples, thus achieving a better balance between fairness and utility. LTFconVAE and FairDolce primarily learn invariant representations through separation of representations in the latent space, which effectively isolates them from various variable environmental factors. ConSCFairOL mainly uses (conditionally) supervised contrastive learning to deentangle variable environmental factors with the learned representations, resulting in robust representations that resist environmental interventions. FairSAOML performs well in terms of bias control, but it assumes that the number of learning iterations is known in advance and remains constant. Furthermore, the long time intervals reduce the model's learning efficiency, leading to a decreased ability to adapt to new environments.

[0124] In summary, the training method for a fair classifier according to embodiments of the present invention involves: acquiring input samples, which include sensitive attribute information, non-sensitive attribute information, and category label information; constructing a feature extractor and mapping the non-sensitive attribute information into feature vectors based on the feature extractor; calculating the information uncertainty estimate of the feature vectors relative to the current model, and calculating the fairness difference value of the feature vectors for different sensitive attribute information, and calculating the corresponding fairness information uncertainty score based on the information uncertainty estimate and the fairness difference value; constructing a classifier and acquiring multiple sensitive attribute groups based on the sensitive attribute information and the category label information; calculating the initial weights corresponding to the sensitive attribute groups and updating the weights corresponding to the sensitive attribute groups based on a weight iteration update algorithm; calculating the individual priority weights corresponding to each input sample based on the fairness information uncertainty score; calculating the final weights corresponding to the input samples based on the baseline weights and the individual priority weights; determining whether the training objective has been achieved; and if so, using the current classifier as the final fair classifier. This effectively eliminates the unfairness of the model output and ensures the accuracy of the output results when dealing with dynamic data.

[0125] Secondly, embodiments of the present invention provide a computer-readable storage medium storing a training program for a fair classifier, which, when executed by a processor, implements the training method for the fair classifier as described above.

[0126] It should be noted that the logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be specifically implemented in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-included system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of computer-readable media include: an electrical connection having one or more wires (electronic device), a portable computer disk drive (magnetic device), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Alternatively, the computer-readable medium may be paper or other suitable media on which the program can be printed, since the program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in a computer memory.

[0127] It should be understood that various parts of the present invention can be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.

[0128] In the description of this specification, references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.

[0129] In the description of this invention, it should be understood that the terms "center," "longitudinal," "lateral," "length," "width," "thickness," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," "outer," "clockwise," "counterclockwise," "axial," "radial," and "circumferential" indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are used only for the convenience of describing this invention and simplifying the description, and are not intended to indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on this invention.

[0130] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this invention, "a plurality of" means at least two, such as two, three, etc., unless otherwise explicitly specified.

[0131] In this invention, unless otherwise explicitly specified and limited, the terms "installation," "connection," "linking," and "fixing," etc., should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral part; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; they can refer to the internal communication of two components or the interaction between two components, unless otherwise explicitly limited. Those skilled in the art can understand the specific meaning of the above terms in this invention according to the specific circumstances.

[0132] In this invention, unless otherwise explicitly specified and limited, "above" or "below" the second feature can mean that the first and second features are in direct contact, or that they are in indirect contact through an intermediate medium. Furthermore, "above," "over," and "on top" of the second feature can mean that the first feature is directly above or diagonally above the second feature, or simply indicates that the first feature is at a higher horizontal level than the second feature. "Below," "below," and "under" the second feature can mean that the first feature is directly below or diagonally below the second feature, or simply indicates that the first feature is at a lower horizontal level than the second feature.

[0133] Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of the present invention.

Claims

1. A method for training a fair classifier, characterized in that, Includes the following steps: Obtain an input sample, which includes sensitive attribute information, non-sensitive attribute information, and category label information; Construct a feature extractor, and map the non-sensitive attribute information into a feature vector based on the feature extractor; Calculate the information uncertainty estimate of the feature vector relative to the current model, calculate the fairness difference value of the feature vector for different sensitive attribute information, and calculate the corresponding fairness information uncertainty score based on the information uncertainty estimate and the fairness difference value; Construct a classifier and obtain multiple sensitive attribute groups based on the sensitive attribute information and the category label information; Calculate the initial weights corresponding to the sensitive attribute groups, and update the weights corresponding to the sensitive attribute groups based on the weight iterative update algorithm; Calculate the individual priority weight corresponding to each input sample based on the fairness information uncertainty score; The final weight corresponding to the input sample is calculated based on the baseline weight and the individual priority weight; Determine whether the training objective has been achieved. If so, the current classifier will be used as the final fair classifier.

2. The training method for the fair classifier as described in claim 1, characterized in that, The uncertainty estimate of the information is calculated using the following formula: in, Indicates the first Feature vector of each input sample The corresponding information is an uncertain estimate. The value representing the category label information is... , The value of the sensitive attribute information is indicated. , Indicates having category labels ,and Grouping of sensitive attributes Represents classifier right The prediction results; Indicates sensitive attribute grouping eigenvectors The predicted probability distribution This represents non-sensitive attribute information. Feature extractor right Perform feature mapping.

3. The training method for the fair classifier as described in claim 1, characterized in that, The fairness difference value is calculated using the following formula: in, Indicates the first Feature vector of each input sample The corresponding fairness difference value, The value representing the category label information is... , The value of the sensitive attribute information is indicated. , Indicates having a label ,and Feature vectors in sensitive attribute grouping The predicted probability distribution Indicates having a label ,and Feature vectors in sensitive attribute grouping The predicted probability distribution express The average probability distribution, This represents the total number of input samples.

4. The training method for the fair classifier as described in claim 1, characterized in that, The fairness information uncertainty score is calculated according to the following formula: in, This represents the score indicating uncertainty about fair information. This indicates an uncertain estimate of the information. Indicates the relative importance parameter, This represents the difference in fairness.

5. The training method for a fair classifier as described in claim 1, characterized in that, After calculating the corresponding fairness information uncertainty score based on the information uncertainty estimate and the fairness difference value, the training method further includes: The uncertainty score for the fair information is normalized. The normalization process is performed according to the following formula: in, This represents the normalized score for uncertainty regarding fair information. This represents the score indicating uncertainty about fair information. Indicates having a label ,and Grouping of sensitive attributes Indicates sensitive attribute grouping The minimum fairness information uncertainty score obtained from the medium sample. Indicates sensitive attribute grouping The maximum fairness information uncertainty score obtained from the medium sample. Represents a minimal constant. .

6. The training method for a fair classifier as described in claim 1, characterized in that, The training objective function of the classifier is expressed by the following formula: in, Indicates the first The baseline weights of each input sample. Represents the cross-entropy loss function. Indicates category label information, Represents classifier right The prediction results This represents non-sensitive attribute information. Indicates sensitive attribute information, express The sum of the cross-entropy losses of each input sample. This represents the total number of input samples.

7. The training method for a fair classifier as described in claim 1, characterized in that, The initial weights corresponding to the sensitive attribute groups are calculated according to the following formula: in, Indicates sensitive attribute grouping The corresponding initial weights, Indicates predicted label And the sensitive attribute is The expected probability distribution at time, Indicates predicted label And the sensitive attribute is The probability distribution of observation at that time Indicates predicted label The total number of input samples, Represents sensitive attribute information The total number of input samples, Indicates predicted label And sensitive attribute information The total number of input samples, This represents the total number of input samples; The weight iterative update algorithm is expressed by the following formula: in, Indicates the first Sensitive attribute grouping obtained in the next iteration The corresponding weights Indicates the first Sensitive attribute grouping obtained in the next iteration The corresponding weights Indicates the first The predicted label obtained in the next iteration This represents the adjustment weight constant. This represents the total number of training iterations.

8. The training method for a fair classifier as described in claim 1, characterized in that, The individual priority weight is calculated using the following formula: in, Indicates the first The result of the iteration is the first Individual priority weights for each input sample. This represents the normalized score for uncertainty regarding fair information. Indicates the learning step size. Indicates sensitive attribute grouping The total number of input samples, Represented by natural constant Exponential function with base .

9. The training method for a fair classifier as described in claim 1, characterized in that, The final weight is calculated using the following formula: in, Indicates the first The result of the iteration is the first The final weights of each input sample. Indicates the first Sensitive attribute grouping obtained in the next iteration The corresponding weights Indicates the first The result of the iteration is the first Individual priority weights for each input sample. Indicates sensitive attribute grouping The ratio of the number of input samples to the total number of input samples. , Indicates the first Sample features of each input sample This represents the total number of training iterations.

10. A computer-readable storage medium, characterized in that, It stores a training program for a fair classifier, which, when executed by a processor, implements the training method for a fair classifier as described in any one of claims 1-9.