Fair prediction method and device for missing table data, and electronic device

By introducing attention mechanism regularization and contrastive learning into the Transformer neural network model to directly process missing table data, it solves the fairness and accuracy issues in missing data processing in the existing technology and achieves more efficient and fair predictions.

CN118378049BActive Publication Date: 2024-08-27ZHEJIANG UNIV
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202410806313.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-21
Publication Date
2024-08-27
Estimated Expiration
2044-06-21

AI Technical Summary

Technical Problem

When dealing with missing table data, the existing technology ignores the impact of missing data on fair predictions, and the interpolation method cannot accurately reflect the real data. Especially when there is a complex missing mechanism, additional bias may be introduced, affecting the fairness and accuracy of the model. Prediction accuracy.

Method used

Using the Transformer neural network model that integrates attention mechanism regularization calculation, by obtaining the missing table data feature matrix and the feature missing mask matrix, it performs masking operations and comparative learning, generates pre-training errors, learns the missing state distribution, and builds a fair prediction model. Handle missing data directly to reduce bias.

Benefits of technology

It improves the fairness and accuracy of prediction. Compared with the completion first and then fairness prediction algorithm, it is improved by 20%. It has higher prediction accuracy and efficiency, and can effectively handle tabular data under complex missing mechanisms.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118378049B
    Figure CN118378049B
Patent Text Reader

Abstract

The present invention discloses a method for fair prediction of missing tabular data, which comprises: obtaining a missing tabular data feature matrix, a tabular data label matrix and a feature missing mask matrix; constructing a Transformer neural network model that integrates regularized calculation of an attention mechanism; masking the missing tabular data feature matrix and calculating a reconstruction error; generating positive and negative samples for samples with known sensitive attributes in the missing tabular data feature matrix and calculating a contrastive learning error; weighting the reconstruction error and the contrastive learning error and pre-training the neural network model; mapping the missing tabular data feature matrix and the feature missing mask matrix to a high dimension through a linear layer; constructing a fine-tuning module and fine-tuning the pre-trained neural network model by minimizing the prediction label error to obtain a fair prediction model for missing tabular data; inputting the missing tabular data feature matrix and the feature missing mask matrix into the prediction model to obtain a final prediction result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of table data prediction, and in particular to a method and device for fair prediction of missing table data, and an electronic device. Background Art

[0002] Machine learning models are widely used in the real world and can make predictions based on data. For example, companies use machine learning software to screen candidate resumes and determine which candidates get interviews. However, the prediction results of machine learning models are closely related to the nature of their training data and the way the model is trained. If the training data contains bias or inequality, the behavior of the model trained on that training data may reflect or even amplify the bias. Sensitive attribute features result in different missing rates or missing mechanisms in different groups divided by sensitive attribute features, which exacerbates the discrimination of the model in downstream prediction tasks. Therefore, it is attractive and necessary to explore the problem of fair prediction of missing tabular data.

[0003] Existing studies on fair prediction of tabular data mainly focus on complete tabular data and cannot be directly applied to data containing missing values. A common approach to dealing with missing values ​​is to first perform interpolation to fill in the missing content with appropriate values, and then apply an off-the-shelf fair prediction model for tabular data to the imputed data. However, even with advanced interpolation techniques, the data they interpolate cannot accurately reflect the real data, especially when there are complex missing mechanisms, and the imbalance of missing data between different groups further exacerbates unfairness. In addition, interpolation loses key information in the missing pattern of the dataset, affecting the downstream predictions of the model. Therefore, it is crucial and urgent to develop a new fair prediction method for missing tabular data.

[0004] In the process of implementing the present invention, the inventors found that there are at least the following problems in the prior art:

[0005] First, existing methods ignore the impact of missing data on fair predictions and do not fully utilize missing information to correct the model. In addition, existing studies mostly consider interpolation when dealing with missing data. However, even with the most advanced interpolation techniques, the interpolated data cannot accurately reflect the real data, especially when there are complex missing mechanisms. This may introduce additional biases, affect the distribution of data, and lead to unfair decisions. Summary of the invention

[0006] In order to overcome the above technical problems, the present application implements and provides a method and device for fair prediction of missing table data, and an electronic device to ensure the fairness of the prediction.

[0007] According to a first aspect of an embodiment of the present application, a method for fair prediction of missing table data is provided, comprising:

[0008] S1: Obtain the missing table data feature matrix and the table data label matrix, and generate a corresponding feature missing mask matrix, wherein the missing table data feature matrix is ​​composed of a sensitive attribute feature matrix and a non-sensitive attribute feature matrix, both of which are missing;

[0009] S2: constructing a Transformer neural network model integrating attention mechanism regularization calculation according to the missing table data feature matrix and feature missing mask matrix;

[0010] S3: Masking the missing table data feature matrix and the feature missing mask matrix, and inputting the masked samples into the neural network model to calculate the reconstruction error;

[0011] S4: Perform sensitive attribute flipping and Gaussian noise addition operations on samples with known sensitive attribute features in the sensitive attribute feature matrix to generate positive samples and negative samples, and input the samples with known sensitive attribute features and the positive and negative samples into the neural network model to calculate the contrastive learning error;

[0012] S5: weighting the reconstruction error and the contrastive learning error to obtain a pre-training error, and pre-training the neural network model using the pre-training error to obtain a pre-trained neural network model;

[0013] S6: dividing the missing table data feature matrix into a missing table data classification feature matrix and a missing table data continuous feature matrix, marking them in combination with their corresponding feature missing mask matrices, mapping the marked missing table data classification feature matrix and the missing table data continuous feature matrix to high dimensions through linear layers respectively, and concatenating the results to obtain a high-dimensional representation matrix;

[0014] S7: Input the high-dimensional representation matrix into the pre-trained neural network model to obtain a sample label prediction matrix, calculate the prediction label error based on the sample label prediction matrix and the table data label matrix, iteratively update the pre-trained neural network model by minimizing the prediction label error, and obtain a fair prediction model for missing table data;

[0015] S8: Inputting the missing table data feature matrix and the feature missing mask matrix into the missing table data fair prediction model to obtain the final prediction result.

[0016] According to a second aspect of an embodiment of the present application, a device for fair prediction of missing table data is provided, comprising:

[0017] An acquisition module is used to acquire a missing table data feature matrix and a table data label matrix, and generate a corresponding feature missing mask matrix, wherein the table data feature matrix is ​​composed of a sensitive attribute feature matrix and a non-sensitive attribute feature matrix, both of which are missing;

[0018] A construction module is used to construct a Transformer neural network model that incorporates attention mechanism regularization calculation according to the missing table data feature matrix and the feature missing mask matrix;

[0019] A first calculation module is used to mask the missing table data feature matrix and the feature missing mask matrix, and input the masked samples into the neural network model to calculate the reconstruction error;

[0020] A second calculation module is used to perform sensitive attribute flipping and Gaussian noise addition operations on samples with known sensitive attribute features in the sensitive attribute feature matrix to generate positive samples and negative samples, and input the samples with known sensitive attribute features and the positive and negative samples into the neural network model to calculate the contrastive learning error;

[0021] A pre-training module, used for weighting the reconstruction error and the contrastive learning error to obtain a pre-training error, and using the pre-training error to pre-train the neural network model to obtain a pre-trained neural network model;

[0022] A splicing module is used to divide the missing table data feature matrix into a missing table data classification feature matrix and a missing table data continuous feature matrix, and after marking them in combination with their corresponding feature missing mask matrices, the marked missing table data classification feature matrix and the missing table data continuous feature matrix are respectively mapped to high dimensions through linear layers, and the results are spliced ​​to obtain a high-dimensional representation matrix;

[0023] A model generation module, which inputs the high-dimensional representation matrix into the pre-trained neural network model to obtain a sample label prediction matrix, calculates a prediction label error based on the sample label prediction matrix and the table data label matrix, and iteratively updates the pre-trained neural network model by minimizing the prediction label error to obtain a fair prediction model for missing table data;

[0024] The prediction module is used to input the missing table data feature matrix and the feature missing mask matrix into the missing table data fair prediction model to obtain the final prediction result.

[0025] According to a third aspect of an embodiment of the present application, there is provided an electronic device, including:

[0026] one or more sensors;

[0027] one or more processors;

[0028] A memory for storing one or more programs;

[0029] When the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in the first aspect.

[0030] The technical solution provided by the embodiments of the present application may have the following beneficial effects:

[0031] Compared with the prior art, the improvements of the present invention are as follows: the multi-head attention mechanism in the Transformer is improved, and the deviation is reduced by introducing regularization processing for Key and Value, thereby enhancing the fairness of the prediction; through the masking operation, the neural network model can directly process the missing table data feature matrix, thereby overcoming the problem of introducing additional deviation and low efficiency by first filling in the missing table data feature matrix and then predicting the table data label; by pre-training, the missing state distribution is learned, and a contrastive learning loss function is constructed, and the known sensitive attribute feature information is fully utilized to alleviate the unfairness in data representation, thereby overcoming the problem of unfair and inaccurate prediction of missing table data; the prediction accuracy of this method is 20% higher than the current first-fill-then-fairness prediction algorithm, and has higher prediction accuracy and efficiency.

[0032] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0034] Figure 1 It is a flowchart of a fair prediction method for missing table data provided in an embodiment of the present application.

[0035] Figure 2 It is a training block diagram for fair prediction of missing table data provided in an embodiment of the present application.

[0036] Figure 3 It is a block diagram of a device for fair prediction of missing table data provided in an embodiment of the present application. DETAILED DESCRIPTION

[0037] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0038] Existing studies on fair prediction for tabular data focus mainly on complete tabular data and cannot be directly applied to data with missing values. A common approach to dealing with missing values ​​is to first perform interpolation to fill in the missing content with appropriate values, and then apply an off-the-shelf fair prediction algorithm to the imputed data. However, even with advanced interpolation techniques, the data they interpolate do not accurately reflect the real data, especially when there are complex missing mechanisms, and missing data can exacerbate unfairness when there is an imbalance between groups. In addition, interpolation loses key information in the missing pattern of the dataset, affecting the downstream prediction accuracy of the model.

[0039] In order to overcome the above technical problems, the embodiments of the present application provide a missing table data fairness prediction method and device, and an electronic device to improve the fairness, accuracy and efficiency of the prediction.

[0040] The missing table data fairness prediction method provided by the present application can be applied to the fairness prediction of table data in almost all scenarios, such as lender credit assessment, resume screening, patient health status assessment, etc., and provides a good solution to the data prediction problem in the data missing state. In order to facilitate the description of the table data prediction method of the present application, the patient health status assessment is used as an example for explanation in this embodiment.

[0041] Figure 1 is a flowchart of a fair prediction method for removing missing table data provided by the present application according to an exemplary implementation example, Figure 2 is a training block diagram for fair prediction of missing table data provided by an embodiment of the present application, such as Figure 1 and Figure 2 As shown, the method may include the following steps:

[0042] S1: Obtain the missing table data feature matrix and the table data label matrix, and generate a corresponding feature missing mask matrix, wherein the missing table data feature matrix is ​​composed of a sensitive attribute feature matrix and a non-sensitive attribute feature matrix, both of which are missing; this step may include the following sub-steps:

[0043] S11: Obtain the missing table data feature matrix and table data label matrix collected by the sensor;

[0044] Specifically, sensors can be used to collect patients' health data, where the data may have multiple fields, such as a patient's blood pressure, blood sugar level, heart rate, weight, height and other characteristic fields; some health data fields may be missing due to doctors' omission of information, measurement equipment failure and other reasons.

[0045] S12: using the missing table data feature matrix and the table data label matrix as a training data set, wherein the missing table data feature matrix can be divided into a sensitive attribute feature matrix and a non-sensitive attribute feature matrix;

[0046] Specifically, the input missing table data feature matrix can be expressed as , where N is the number of samples; in particular, the missing table data feature matrix includes a sensitive attribute feature matrix and a non-sensitive attribute feature matrix, that is, , where the sensitive attribute feature matrix is , the non-sensitive attribute feature matrix is ; Depending on whether the sensitive attribute is missing, the entire data set D can be divided into a data set with known sensitive attribute features and datasets with unknown sensitive attribute characteristics For example, in medical health data, the patient's basic personal information such as gender, ethnicity or age will be used as sensitive attributes, and other characteristics will be used as non-sensitive attributes.

[0047] S13: generating a corresponding feature missing mask matrix according to the missing condition of the feature matrix in the missing table data feature matrix;

[0048] Specifically, due to improper collection, lost records, resource limitations, or privacy concerns, there may be missing samples, so it is necessary to generate a feature missing mask matrix based on the missing conditions. ,in Indicates The feature missing state of samples, the first k items represent the missing state of non-sensitive attribute features, and the latter The item represents the missing state of the sensitive attribute feature. It indicates that the current feature is in an observable state, whereas 0 indicates that the data is missing.

[0049] S2: constructing a Transformer neural network model integrating attention mechanism regularization calculation according to the missing table data feature matrix and the feature missing mask matrix; this step may include the following sub-steps:

[0050] Specifically, a Transformer neural network model that integrates regularization calculations of the attention mechanism is constructed, and the neural network model includes an embedding layer and multiple Transformer blocks. The embedding layer is composed of multiple learnable multi-layer perceptrons, and each Transformer block is composed of a multi-head attention mechanism, a feedforward neural network, a residual connection, and layer normalization, among which the multi-head attention mechanism integrates regularization operations for Key and Value;

[0051] Among them, the calculation formula of the multi-head attention mechanism is as follows:

[0052]

[0053] in , and is a learnable linear layer, Represents element-wise multiplication.

[0054] When calculating the attention score for the Transformer model, the Query and Key values ​​are regularized to make the prediction results more fair;

[0055] Specifically, assume that the regularization function is defined as n x =[ xE[x] Var x ] , then for a given Query and Key , the regularized result is , where abs() means taking the absolute value, for , Dimensions;

[0056]

[0057] in, is based on the feature missing mask matrix Got it, Indicates that the characteristics of the cell are known, if Indicates that the feature of the cell is missing, then . Softmax is the softmax function.

[0058] S3: Masking the missing table data feature matrix and the feature missing mask matrix, and inputting the masked samples into the neural network model to calculate the reconstruction error; this step may include the following sub-steps:

[0059] S31: performing information masking at a cell granularity on the non-sensitive attribute feature matrix using a masking rate to generate a masking matrix;

[0060] Specifically, for all non-sensitive attribute feature matrices, the masking rate Generate a masking matrix. ,in . When it is 0, it means that the feature of the cell is manually masked, otherwise it is 1, which means that the feature of the cell is known. This application uses a method of masking at the cell granularity to promote the model to learn the distribution of observed data in missing table data and the complex missing mechanism of missing data.

[0061] S32: Fill the masked information in the non-sensitive attribute feature matrix with 0, and set the masked cell state in the feature missing mask matrix to missing, to obtain a masked non-sensitive attribute feature matrix and a feature missing mask matrix;

[0062] Specifically, for cells that are manually masked, all their information will be manually filled with 0 to obtain a masked feature missing mask matrix, and the masked cells in the feature missing mask matrix are set to missing to obtain a masked non-sensitive attribute feature matrix and a feature missing mask matrix.

[0063] S33: splicing the masked non-sensitive attribute feature matrix, the feature missing mask matrix and the sensitive attribute feature matrix, and inputting the spliced ​​matrix into the neural network model to obtain a high-dimensional representation matrix;

[0064] Specifically, the masked non-sensitive attribute feature matrix, sensitive attribute feature matrix and feature missing mask matrix are concatenated as input to obtain the model input: [(X,S)⊙ M ¯ ||M⊙ M ¯ ] ,in Indicates a connection operation;

[0065] First, the embedding layer in the neural network model is used in an independent manner between feature variables. The embedding layer uses multiple multi-layer perceptrons to map the input to δ dimensions to obtain an embedding matrix , the specific process is as follows:

[0066] X ⃗ = W p ⋅[(X,S)⊙ M ¯ ||M⊙ M ¯ ]

[0067] The embedding matrix is ​​then input into a neural network consisting of L layers of Transformer blocks to represent the tabular data. Specifically, for the embedding matrix , each layer of the Transformer block will output an intermediate representation ,in In each layer, the model first captures the dependencies between different positions through a multi-head attention mechanism and layer normalization, and then outputs through a fully connected layer and a residual connection layer. The process is as follows:

[0068]

[0069]

[0070] Among them, MHA, LN, and MLP represent multi-head attention operation, layer normalization operation, and fully connected layer operation respectively. Then we can get the representation This application concatenates the tabular data and the missing information and inputs them into the model for representation, so that the model can perceive the missing state information of the tabular data, thereby improving the prediction accuracy and fairness, and finally obtaining a high-dimensional representation matrix.

[0071] S34: Map the high-dimensional representation matrix back to the eigenvalue through a linear layer to obtain the reconstructed eigenvalue, calculate the difference between the reconstructed eigenvalue and the real feature, and obtain the reconstruction error .

[0072] Specifically, in the pre-training stage, multiple linear layers are used to project different feature representations to obtain , where LL represents a linear operation. The reconstruction error is calculated, where the reconstruction error loss function is as follows:

[0073]

[0074] in is the missing matrix, To manually mask the missing matrix, It is for The mean absolute error function or cross entropy loss function of the jth feature of samples (depending on the category of this dimension, the cross entropy loss function for categorical data and the mean absolute error function for continuous data) is used.

[0075] S4: Perform sensitive attribute flipping and Gaussian noise addition operations on samples with known sensitive attribute features in the sensitive attribute feature matrix to generate positive samples and negative samples, and input the samples with known sensitive attribute features and the positive and negative samples into the neural network model to calculate the comparative learning error; this step may include the following sub-steps:

[0076] S41: extracting samples with known sensitive attribute features from the sensitive attribute feature matrix;

[0077] Specifically, for samples with known sensitive attribute features in the sensitive attribute feature matrix, the set .

[0078] S42: Flip the sensitive attribute features of the samples with known sensitive attribute features to obtain positive samples;

[0079] Specifically, we generate new samples by flipping the sensitive attribute features. Each data sample in , its sensitive attribute characteristics are , the sensitive attribute features after flipping are , assuming that the sensitive attribute feature is binary, the value is , the original sensitive attribute feature value is , then the inverted sensitive attribute feature value is Based on this positive sample .

[0080] S43: Add Gaussian noise to the non-sensitive attribute features in the samples with known sensitive attribute features to construct negative samples;

[0081] Specifically, we construct negative samples by adding Gaussian noise to the non-sensitive attribute features in samples with known sensitive attributes. First, we determine the parameters of Gaussian noise: the mean is , the standard deviation is Assuming the original data , for each non-sensitive attribute feature , from the mean , the standard deviation is The noise is sampled from the Gaussian distribution , add noise to the corresponding non-sensitive attribute features to obtain the perturbed features Based on this negative sample is .

[0082] S44: inputting the current sample, the positive sample and the negative sample into the neural network model to obtain three high-dimensional representation matrices;

[0083] Specifically, the current sample , positive sample , negative samples Input into the neural network model to obtain its high-dimensional representation matrix , .

[0084] S45: Construct a contrastive learning loss function, which is calculated based on the distance between three high-dimensional representation matrices to obtain the contrastive learning error ,The purpose of the contrastive learning loss function is to increase the distance between the positive sample and the current sample, and reduce the distance between the negative sample and the current sample.

[0085] Specifically, the loss function of contrastive learning is defined as follows:

[0086]

[0087]

[0088] S5: weighting the reconstruction error and the contrastive learning error to obtain a pre-training error, and pre-training the neural network model using the pre-training error to obtain a pre-trained neural network model; this step may include the following sub-steps:

[0089] S51: performing weighted summation on the reconstruction error and the contrastive learning error to obtain a pre-training error;

[0090] Specifically, the reconstruction error and the contrastive learning error are weighted and summed to obtain the pre-training error. The specific weighting method is as follows:

[0091]

[0092] in is a hyperparameter that is used to balance the reconstruction error and contrastive learning error.

[0093] S52: Pre-training the neural network model by minimizing the pre-training error to obtain a pre-trained neural network model.

[0094] By pre-training the model, the model can learn the missing state distribution and alleviate the deviation caused by missing data, allowing the model to obtain robust initial parameters and ensure the fairness and accuracy of the model.

[0095] S6: Divide the missing table data feature matrix into a missing table data classification feature matrix and a missing table data continuous feature matrix, mark them in combination with their corresponding feature missing mask matrices, map the marked missing table data classification feature matrix and missing table data continuous feature matrix to high dimensions through linear layers respectively, and concatenate the results to obtain a high-dimensional representation matrix; this step may include the following sub-steps:

[0096] S61: dividing the missing table data feature matrix into a missing table data classification feature matrix and a missing table data continuous feature matrix according to data categories;

[0097] Specifically, the missing table data feature matrix is ​​divided into a missing table data classification feature matrix and a missing table data continuous feature matrix according to the definition of data columns.

[0098] S62: According to the feature missing mask matrix, the missing cells in the missing table data classification feature matrix are filled with -1, and the missing cells in the missing table data continuous feature matrix are filled with 0, so as to obtain the marked missing table data classification feature matrix and the missing table data continuous feature matrix;

[0099] Specifically, the missing cells in the missing table data classification feature matrix are filled with -1, and the missing cells in the missing table data continuous feature matrix are filled with 0, so as to obtain the marked missing table data classification feature matrix and the missing table data continuous feature matrix. In this way, the missing values ​​of the missing table data classification feature matrix and the missing table data continuous feature matrix are marked as different special values.

[0100] S63: Map the marked missing table data classification feature matrix and the missing table data continuous feature matrix to high dimensions through different linear layers respectively, and concatenate the results to obtain a high-dimensional missing table data representation matrix.

[0101] S7: Input the high-dimensional representation matrix into the pre-trained neural network model to obtain a sample label prediction matrix, calculate the prediction label error based on the sample label prediction matrix and the table data label matrix, iteratively update the pre-trained neural network model by minimizing the prediction label error, and obtain a fair prediction model for missing table data; this step may include the following sub-steps:

[0102] S71: Mapping the high-dimensional representation matrix into a sample label prediction matrix through a linear layer;

[0103] Specifically, a one-dimensional full 0-dimensional CLStoken is added to the head of the classification feature matrix of the missing table data. This column will integrate the rest of the values ​​of the feature matrix in the representation to form a sample label prediction matrix.

[0104] S72: According to the sample label prediction matrix, the prediction label error is calculated to fine-tune the pre-trained neural network model to obtain a fair prediction model for missing table data;

[0105] Specifically, a linear layer is used to project the CLStoken representation to obtain , where LL represents the linear layer, The representation layer is normalized. The formula for calculating the prediction label error is as follows:

[0106]

[0107] in is the number of label categories; specifically, the pre-trained neural network model is fine-tuned by minimizing the supervision error; the application fine-tunes the model by minimizing the prediction label error, so that the model can better adapt to downstream tasks, thereby improving the prediction accuracy and fairness in the prediction task.

[0108] S8: Inputting the missing table data feature matrix and the feature missing mask matrix into the missing table data fair prediction model to obtain the final prediction result.

[0109] Specifically, the missing table data feature matrix and the feature missing mask matrix are connected to obtain [(X|S)||M] The missing table data is input into the fair prediction model to obtain the prediction result, and the CLStoken is input into a linear layer to obtain the final label prediction result.

[0110] The fair prediction method for missing table data of the present invention is implemented on an Ubuntu 18.04 system running on an Intel core 2.80GHz server with 192GB memory, and the performance of the embodiment of the present invention on the Adult data set is tested under different missing mechanisms (MCAR, MAR, MNAR) when the missing rate is 10%. For the metric of model accuracy, we use the AUC indicator, which represents the area under the ROC curve. The larger the value of this indicator, the higher the prediction accuracy of the model; for the metric of fairness, we use the EOPP indicator. The smaller the value of this indicator, the fairer the prediction result. The calculation formula is as follows:

[0111]

[0112] in represents the predicted label value, represents the actual label value, Indicates a sensitive attribute.

[0113] The performance of the fair prediction method for missing table data (i.e., MissFair) proposed in the present invention is analyzed through experimental tests, and the results are shown in Tables 1, 2, and 3. It can be seen that MissFair improves fairness by more than 20% compared with the existing fairness decision algorithms (ARL, DRO, SURE, FairFR), because it considers the missing information in the data by pre-training, and achieves debiasing by adjusting the structure of the model, making the final prediction more fair.

[0114] Table 1: Comparison of algorithm performance when the missing mechanism is MCAR

[0115]

[0116] Table 2: Comparison of algorithm performance when the missing mechanism is MAR

[0117]

[0118] Table 3: Comparison of algorithm performance when the missing mechanism is MNAR

[0119]

[0120] Corresponding to the aforementioned embodiment of the fair prediction method for missing table data, the present application also provides an embodiment of the fair prediction method for missing table data.

[0121] Figure 3 is a block diagram of the missing table data fair prediction method device of the present application. Figure 3 , the device comprises:

[0122] Acquisition module 1, used to acquire missing table data feature matrix and table data label matrix, and generate corresponding feature missing mask matrix, wherein the table data feature matrix is ​​composed of sensitive attribute feature matrix and non-sensitive attribute feature matrix, both of which are missing;

[0123] Construction module 2 is used to construct a Transformer neural network model that integrates attention mechanism regularization calculation according to the missing table data feature matrix and the feature missing mask matrix;

[0124] The first calculation module 3 is used to mask the missing table data feature matrix and the feature missing mask matrix, and input the masked samples into the neural network model to calculate the reconstruction error;

[0125] The second calculation module 4 is used to perform sensitive attribute flipping and Gaussian noise addition operations on samples with known sensitive attribute features in the sensitive attribute feature matrix to generate positive samples and negative samples, and input the samples with known sensitive attribute features and the positive and negative samples into the neural network model to calculate the contrast learning error;

[0126] A pre-training module 5 is used to weight the reconstruction error and the contrastive learning error to obtain a pre-training error, and use the pre-training error to pre-train the neural network model to obtain a pre-trained neural network model;

[0127] A splicing module 6 is used to divide the missing table data feature matrix into a missing table data classification feature matrix and a missing table data continuous feature matrix, and after marking them in combination with their corresponding feature missing mask matrices, the marked missing table data classification feature matrix and the missing table data continuous feature matrix are respectively mapped to high dimensions through linear layers, and the results are spliced ​​to obtain a high-dimensional representation matrix;

[0128] The model generation module 7 inputs the high-dimensional representation matrix into the pre-trained neural network model to obtain a sample label prediction matrix, calculates the prediction label error based on the sample label prediction matrix and the table data label matrix, iteratively updates the pre-trained neural network model by minimizing the prediction label error, and obtains a fair prediction model for missing table data. Regarding the device in the above embodiment, the specific way in which each module performs the operation has been described in detail in the embodiment of the method, and will not be explained in detail here.

[0129] For the device embodiment, since it basically corresponds to the method embodiment, the relevant parts can refer to the partial description of the method embodiment. The device embodiment described above is only schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present application scheme. A person of ordinary skill in the art can understand and implement it without paying any creative work.

[0130] Accordingly, the present application also provides an electronic device, comprising: one or more sensors; one or more processors; a memory for storing one or more programs; when the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in the first aspect.

[0131] Accordingly, the present application also provides a computer-readable storage medium on which computer instructions are stored, and when the instructions are executed by a processor, the above-mentioned missing table data fairness prediction method is implemented.

[0132] Those skilled in the art will readily appreciate other embodiments of the present application after considering the description and practicing the contents disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present application. The description and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the claims.

[0133] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.

Claims

1. A fair prediction method for missing table data, characterized in that: include: S1: Obtain the missing table data feature matrix and the table data label matrix, and generate a corresponding feature missing mask matrix, wherein the missing table data feature matrix is ​​composed of a sensitive attribute feature matrix and a non-sensitive attribute feature matrix, both of which are missing; S2: constructing a Transformer neural network model integrating attention mechanism regularization calculation according to the missing table data feature matrix and feature missing mask matrix; S3: Masking the missing table data feature matrix and the feature missing mask matrix, and inputting the masked samples into the neural network model to calculate the reconstruction error; S4: Perform sensitive attribute flipping and Gaussian noise addition operations on samples with known sensitive attribute features in the sensitive attribute feature matrix to generate positive samples and negative samples, and input the samples with known sensitive attribute features and the positive and negative samples into the neural network model to calculate the contrastive learning error; S5: weighting the reconstruction error and the contrastive learning error to obtain a pre-training error, and pre-training the neural network model using the pre-training error to obtain a pre-trained neural network model; S6: dividing the missing table data feature matrix into a missing table data classification feature matrix and a missing table data continuous feature matrix, marking them in combination with their corresponding feature missing mask matrices, mapping the marked missing table data classification feature matrix and the missing table data continuous feature matrix to high dimensions through linear layers respectively, and concatenating the results to obtain a high-dimensional representation matrix; S7: Input the high-dimensional representation matrix into the pre-trained neural network model to obtain a sample label prediction matrix, calculate the prediction label error based on the sample label prediction matrix and the table data label matrix, iteratively update the pre-trained neural network model by minimizing the prediction label error, and obtain a fair prediction model for missing table data; S8: Inputting the missing table data feature matrix and the feature missing mask matrix into the missing table data fair prediction model to obtain the final prediction result.

2. The method according to claim 1, characterized in that S1 specifically includes: S11: Obtain the missing table data feature matrix and table data label matrix collected by the sensor; S12: using the missing table data feature matrix and the table data label matrix as a training data set, wherein the missing table data feature matrix can be divided into a sensitive attribute feature matrix and a non-sensitive attribute feature matrix; S13: Generate a corresponding feature missing mask matrix according to the missing status of the feature matrix in the missing table data feature matrix.

3. The method according to claim 1, characterized in that The neural network model consists of an embedding layer and multiple Transformer blocks, wherein the embedding layer consists of a learnable linear mapping matrix and a position encoding layer, and each Transformer block consists of a multi-head attention mechanism, a feedforward neural network, a residual connection and layer normalization, wherein the multi-head attention mechanism integrates regularization operations for Key and Value.

4. The method according to claim 1, characterized in that: S3 specifically includes: S31: performing information masking at a cell granularity on the non-sensitive attribute feature matrix using a masking rate to generate a masking matrix; S32: Fill the masked information in the non-sensitive attribute feature matrix with 0, and set the masked cell state in the feature missing mask matrix to missing, to obtain a masked non-sensitive attribute feature matrix and a feature missing mask matrix; S33: splicing the masked non-sensitive attribute feature matrix, the feature missing mask matrix and the sensitive attribute feature matrix, and inputting the spliced ​​matrix into the neural network model to obtain a high-dimensional representation matrix; S34: Map the high-dimensional representation matrix back to the eigenvalue through a linear layer to obtain the reconstructed eigenvalue, calculate the difference between the reconstructed eigenvalue and the real feature, and obtain the reconstruction error.

5. The method according to claim 1, characterized in that S4 specifically includes: S41: extracting samples with known sensitive attribute features from the sensitive attribute feature matrix; S42: Flip the sensitive attribute features of the samples with known sensitive attribute features to obtain positive samples; S43: Add Gaussian noise to the non-sensitive attribute features in the samples with known sensitive attribute features to construct negative samples; S44: inputting the current sample, the positive sample and the negative sample into the neural network model to obtain three high-dimensional representation matrices; S45: Construct a contrastive learning loss function, which is calculated based on the distance between the three high-dimensional representation matrices to obtain the contrastive learning error.

6. The method according to claim 1, characterized in that S5 specifically includes: S51: performing weighted summation on the reconstruction error and the contrastive learning error to obtain a pre-training error; S52: Pre-training the neural network model by minimizing the pre-training error to obtain a pre-trained neural network model.

7. The method according to claim 1, characterized in that S6 specifically includes: S61: dividing the missing table data feature matrix into a missing table data classification feature matrix and a missing table data continuous feature matrix according to data categories; S62: According to the feature missing mask matrix, the missing cells in the missing table data classification feature matrix are filled with -1, and the missing cells in the missing table data continuous feature matrix are filled with 0, so as to obtain the marked missing table data classification feature matrix and the missing table data continuous feature matrix; S63: Map the marked missing table data classification feature matrix and the missing table data continuous feature matrix to high dimensions through different linear layers respectively, and concatenate the results to obtain a high-dimensional representation matrix.

8. The method according to claim 1, characterized in that S7 specifically includes: S71: Mapping the high-dimensional representation matrix into a sample label prediction matrix through a linear layer; S72: According to the sample label prediction matrix, the prediction label error is calculated to fine-tune the pre-trained neural network model to obtain a fair prediction model for missing table data.

9. A device for fair prediction of missing table data, characterized in that: include: An acquisition module is used to acquire a missing table data feature matrix and a table data label matrix, and generate a corresponding feature missing mask matrix, wherein the table data feature matrix is ​​composed of a sensitive attribute feature matrix and a non-sensitive attribute feature matrix, both of which are missing; A construction module is used to construct a Transformer neural network model that incorporates attention mechanism regularization calculation according to the missing table data feature matrix and the feature missing mask matrix; A first calculation module is used to mask the missing table data feature matrix and the feature missing mask matrix, and input the masked samples into the neural network model to calculate the reconstruction error; A second calculation module is used to perform sensitive attribute flipping and Gaussian noise addition operations on samples with known sensitive attribute features in the sensitive attribute feature matrix to generate positive samples and negative samples, and input the samples with known sensitive attribute features and the positive and negative samples into the neural network model to calculate the contrastive learning error; A pre-training module, used for weighting the reconstruction error and the contrastive learning error to obtain a pre-training error, and using the pre-training error to pre-train the neural network model to obtain a pre-trained neural network model; A splicing module is used to divide the missing table data feature matrix into a missing table data classification feature matrix and a missing table data continuous feature matrix, and after marking them in combination with their corresponding feature missing mask matrices, the marked missing table data classification feature matrix and the missing table data continuous feature matrix are respectively mapped to high dimensions through linear layers, and the results are spliced ​​to obtain a high-dimensional representation matrix; A model generation module, which inputs the high-dimensional representation matrix into the pre-trained neural network model to obtain a sample label prediction matrix, calculates a prediction label error based on the sample label prediction matrix and the table data label matrix, and iteratively updates the pre-trained neural network model by minimizing the prediction label error to obtain a fair prediction model for missing table data; The prediction module is used to input the missing table data feature matrix and the feature missing mask matrix into the missing table data fair prediction model to obtain the final prediction result.

10. An electronic device, characterized in that: include: one or more sensors; one or more processors; A memory for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Deep learning model depolarization method and device based on mask shielding

    CN115131816A

  • Microservice call chain anomaly detection method and device based on graph convolutional neural network

    CN115185736A

  • Traffic data completion method based on sequence attention mechanism and electronic equipment

    CN117786330A

  • Depolarization missing table end-to-end prediction method and device and electronic equipment

    CN117875287A

  • Generative adversarial multi-head attention neural network self-learning method for aero-engine data reconstruction

    WO2024087129A1