P value calculation method, system and related device based on federated learning scenario

By using a random orthogonal matrix to mask the original data in a federated scenario, data fusion and SVD decomposition are performed, the problem of P value calculation in a federated scenario is solved, and the accurate calculation of P value and the significance detection of the model are realized.

CN116384510BActive Publication Date: 2025-04-25INSIGHT TECHNOLOGY (XIONGAN) CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202310467022.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-04-24
Publication Date
2025-04-25
Estimated Expiration
2043-04-24

AI Technical Summary

Technical Problem

In the federated scenario, the original data is distributed in multiple parties, resulting in the inability to calculate the P value. The calculation amount and communication volume are huge in the process of matrix multiplication and inversion, and the accuracy loss is faced.

Method used

The initiator and the participant randomly generate the right orthogonal matrix and the left orthogonal matrix respectively, and the original data is masked to obtain the target data; then the trusted third party performs data fusion and local SVD decomposition to generate intermediate matrix and SVD results, and finally the P value is calculated by the initiator and the participant.

Benefits of technology

The accurate calculation of P value in the federal scenario is realized, which reduces the calculation amount and traffic volume, avoids accuracy loss, and conducts hypothesis testing under the premise of privacy protection, improving the model effect and reducing the risk of overfitting.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116384510B_ABST
    Figure CN116384510B_ABST
Patent Text Reader

Abstract

The embodiment of the present application discloses a P-value calculation method, system and related device based on a federated learning scenario, which is applied to a P-value calculation system based on a federated learning scenario, and the P-value calculation system based on a federated learning scenario includes: an initiator, a participant and a trusted third party; the initiator has the first original data; the participant has the second original data, and the method includes: after obtaining the U, S, and V matrices of the respective local data by using the federated SVD decomposition, taking the inverse of the non-zero elements of the diagonal of the eigenvalue matrix S, and then performing a local matrix multiplication operation, the inverse of the covariance matrix of the normalized original data can be directly calculated locally, and the parameter z test is performed based on the inverse matrix, the model chi-square value and the model parameters to obtain the P value of each parameter. The embodiment of the present application can be used to achieve accurate calculation of the P value in a federated scenario to accurately evaluate the significance of the model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of privacy computing technology or computer technology, and specifically to a P-value calculation method, system and related devices based on a federated learning scenario. Background Art

[0002] In practical applications, in hypothesis testing, when the null hypothesis is true, the probability of a result that is more extreme than the sample observation result is called the P value. A small P value indicates that the probability of the null hypothesis occurring is very small. If it occurs, according to the principle of small probability, there is reason to reject the null hypothesis. The smaller the P value, the more sufficient our reason for rejecting the null hypothesis. In short, the smaller the P value, the more significant the result. Generally, a p value less than 0.05 is considered significant.

[0003] In statistics, P value is often used to test whether each variable (or feature) of a linear model is significant. P value can provide a basis for feature screening, model parameter adjustment, model interpretation, etc. during modeling. If a variable (x_i) has no significant effect on the label (y), then the coefficient (w_i) corresponding to the variable should be 0 (that is, it is necessary to assume that the P value of the null hypothesis w_i=0 is less than 0.05. If it is, the effect of x_i is significant, otherwise it is not significant).

[0004] In practical applications, in federated scenarios, the original data is distributed among multiple parties, which makes it impossible to calculate the P value. Directly using homomorphic encryption or secret sharing methods in the process of matrix multiplication and inversion results in huge amounts of computation and communication, and faces a large loss of accuracy. Therefore, how to achieve accurate calculation of the P value in a federated scenario needs to be solved urgently. Summary of the invention

[0005] The embodiments of the present application provide a P-value calculation method, system and related devices based on a federated learning scenario, which can realize accurate calculation of the P-value in the federated scenario to accurately evaluate the significance of the model.

[0006] In a first aspect, an embodiment of the present application provides a P-value calculation method based on a federated learning scenario, which is applied to a P-value calculation system based on a federated learning scenario. The P-value calculation system based on the federated learning scenario includes: an initiator, a participant, and a trusted third party; the initiator has first original data; the participant has second original data; the method includes:

[0007] The initiator randomly generates a first right orthogonal matrix, determines weights according to model prediction values, determines a second right orthogonal matrix according to the first right orthogonal matrix and the weights, and sends the second right orthogonal matrix to the participant;

[0008] The initiator randomly generates a first left orthogonal matrix, and performs mask protection on the first original data by using the first left orthogonal matrix and the second right orthogonal matrix to obtain target first original data;

[0009] The participant randomly generates a second left orthogonal matrix, and performs mask protection on the second original data by using the second left orthogonal matrix and the second right orthogonal matrix to obtain target second original data;

[0010] The first target original data and the second target original data are fused and spliced ​​by the trusted third party to obtain fused data, and the fused data is subjected to local SVD decomposition to obtain a U matrix, an S matrix, and a V matrix;

[0011] Generate a first random reversible matrix by the initiator, and perturb the first left orthogonal matrix by the first random reversible matrix to obtain a target first left orthogonal matrix;

[0012] Generate a second random reversible matrix by the participant, and perturb the second left orthogonal matrix by the second random reversible matrix to obtain a target second left orthogonal matrix;

[0013] Determine a first intermediate matrix according to the first random reversible matrix and the V matrix by the trusted third party, and send the first intermediate matrix, the U matrix, and the S matrix to the initiator; determine a second intermediate matrix according to the second random reversible matrix and the V matrix, and send the second intermediate matrix and the S matrix to the participant;

[0014] Determining, by the initiator, a first SVD result according to the first intermediate matrix;

[0015] Determining, by the participant, a second SVD result according to the second intermediate matrix;

[0016] Calculating a first P value according to the first SVD result by the initiator;

[0017] A second P value is calculated by the participant according to the second SVD result.

[0018] In a second aspect, an embodiment of the present application provides a P-value calculation system based on a federated learning scenario, the P-value calculation system based on a federated learning scenario includes: an initiator, a participant, and a trusted third party; the initiator has first original data; the participant has second original data; wherein,

[0019] The initiator is used to randomly generate a first right orthogonal matrix, determine weights according to model prediction values, and determine a second right orthogonal matrix according to the first right orthogonal matrix and the weights, and send the second right orthogonal matrix to the participant;

[0020] The initiator is further used to randomly generate a first left orthogonal matrix, and mask the first original data using the first left orthogonal matrix and the second right orthogonal matrix to obtain target first original data;

[0021] The participant is used to randomly generate a second left orthogonal matrix, and mask the second original data using the second left orthogonal matrix and the second right orthogonal matrix to obtain target second original data;

[0022] The trusted third party is used to fuse and splice the target first original data and the target second original data to obtain fused data, and perform local SVD decomposition on the fused data to obtain a U matrix, an S matrix, and a V matrix;

[0023] The initiator is configured to generate a first random reversible matrix, and to perturb the first left orthogonal matrix by using the first random reversible matrix to obtain a target first left orthogonal matrix;

[0024] The participant is configured to generate a second random reversible matrix, and to perturb the second left orthogonal matrix by using the second random reversible matrix to obtain a target second left orthogonal matrix;

[0025] The trusted third party is configured to determine a first intermediate matrix according to the first random reversible matrix and the V matrix, and send the first intermediate matrix, the U matrix, and the S matrix to the initiator; determine a second intermediate matrix according to the second random reversible matrix and the V matrix, and send the second intermediate matrix and the S matrix to the participant;

[0026] The initiator is used to determine a first SVD result according to the first intermediate matrix;

[0027] The participant is used to determine a second SVD result according to the second intermediate matrix;

[0028] The initiator is configured to calculate a first P value according to the first SVD result;

[0029] The participant is used to calculate a second P value according to the second SVD result.

[0030] In a third aspect, an embodiment of the present application provides an electronic device, comprising a processor, a memory, a communication interface, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the processor, and the program includes instructions for executing the steps in the first aspect of the embodiment of the present application.

[0031] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program for electronic data exchange, wherein the computer program enables a computer to execute part or all of the steps described in the first aspect of the embodiment of the present application.

[0032] In a fifth aspect, an embodiment of the present application provides a computer program product, wherein the computer program product includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to cause a computer to execute some or all of the steps described in the first aspect of the embodiment of the present application. The computer program product may be a software installation package.

[0033] The implementation of the embodiments of the present application has the following beneficial effects:

[0034] It can be seen that the P-value calculation method, system and related device based on the federated learning scenario described in the embodiment of the present application are applied to the P-value calculation system based on the federated learning scenario, and the P-value calculation system based on the federated learning scenario includes: an initiator, a participant and a trusted third party; the initiator has the first original data; the participant has the second original data; the initiator randomly generates a first right orthogonal matrix, determines the weight according to the model prediction value, and determines the second right orthogonal matrix according to the first right orthogonal matrix and the weight, and sends the second right orthogonal matrix to the participant; the initiator randomly generates a first left orthogonal matrix, and the first The left orthogonal matrix and the second right orthogonal matrix mask the first original data to obtain the target first original data; the second left orthogonal matrix is ​​randomly generated by the participant, and the second original data is masked and protected by the second left orthogonal matrix and the second right orthogonal matrix to obtain the target second original data; the target first original data and the target second original data are fused and spliced ​​by a trusted third party to obtain fused data, and the fused data is locally decomposed by SVD to obtain U matrix, S matrix and V matrix; the first random reversible matrix is ​​generated by the initiator, and the first left orthogonal matrix is ​​perturbed by the first random reversible matrix to obtain to the target first left orthogonal matrix; generate a second random reversible matrix through the participant, and perturb the second left orthogonal matrix through the second random reversible matrix to obtain the target second left orthogonal matrix; determine the first intermediate matrix according to the first random reversible matrix and the V matrix through the trusted third party, and send the first intermediate matrix, the U matrix and the S matrix to the initiator; determine the second intermediate matrix according to the second random reversible matrix and the V matrix, and send the second intermediate matrix and the S matrix to the participant; determine the first SVD result according to the first intermediate matrix through the initiator; determine the second SVD result according to the second intermediate matrix through the participant; The first party calculates the first P value according to the first SVD result; the second party calculates the second P value according to the second SVD result. On the one hand, the original data can be protected in a masked manner, and the calculation amount and communication volume will not expand. Moreover, by utilizing the properties of the orthogonal matrix, the P value calculation result is lossless. On the other hand, it can help modelers to perform hypothesis testing under the premise of privacy protection, thereby realizing the significance detection of the parameters of the federated learning model, and providing a basis for feature screening, model parameter adjustment, model interpretation, etc. of linear models (linear regression, logistic regression, Poisson regression, etc.) in federated scenarios, thereby improving model effects and reducing the risk of model overfitting. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0036] Figure 1 It is a schematic diagram of the architecture of a P-value calculation system based on a federated learning scenario for implementing a P-value calculation method based on a federated learning scenario provided in an embodiment of the present application;

[0037] Figure 2 It is a flowchart of a method for calculating a P value based on a federated learning scenario provided in an embodiment of the present application;

[0038] Figure 3 It is a flowchart of a federated SVD decomposition of a P value calculation method based on a federated learning scenario provided in an embodiment of the present application;

[0039] Figure 4 It is a flowchart of a federated P value calculation method based on a federated learning scenario provided in an embodiment of the present application;

[0040] Figure 5 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0041] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0042] The terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, products or devices.

[0043] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0044] The initiator, participant or trusted third party described in the embodiments of the present application can all be electronic devices, which may include smart phones (such as Android phones, iOS phones, Windows Phone phones, etc.), tablet computers, PDAs, driving recorders, servers, laptops, mobile Internet devices (MID, Mobile Internet Devices) or wearable devices (such as smart watches, Bluetooth headsets), etc. The above are only examples and not exhaustive, including but not limited to the above electronic devices. The electronic device may also be a cloud server, or the electronic device may also be a computer cluster.

[0045] In the embodiments of the present application, the sample can be understood as: each row of data in the original data, and the sample contains: ID, features and labels. The identification (ID) is the unique identifier of each row of data, and each row is different, such as: ID number, mobile phone number or auto-increment number; the label is the target of modeling, and the sample is to predict a certain result, such as a borrower (ID is the ID number) defaulted (label), and another borrower did not default (label). Among them, the sample contains ID and label, and the label is a description of the ID and is also the target of a modeling.

[0046] In the embodiment of the present application, the feature may refer to the description of each ID, which may lead to the label of the ID (whether it is a breach of contract), such as the age, occupation, recent consumption amount, etc. of an ID. The linear model learns the coefficients (model parameters) corresponding to each feature. The smaller the error between the inner product of these coefficients and the feature and the label, the better the model effect. In addition, if the p-value corresponding to each coefficient is very small, it indicates that the feature corresponding to the coefficient is significant, and the model is more interpretable.

[0047] In related technologies, the calculation of the P value requires the inverse of the covariance matrix (normalized_cov_inv) of the normalized original data, as well as the chi-square value of the predicted value and the label calculation, and the parameter z test is performed based on the covariance, chi-square value and model parameters to obtain the p-value of each parameter. In the federated scenario, the original data is distributed in multiple parties, and the inverse of the covariance of the normalized original data cannot be directly calculated. Directly using homomorphic encryption or secret sharing methods in the process of matrix multiplication and inversion is very computationally intensive and communication volume is very large, and there is a great loss of accuracy.

[0048] The following is a detailed description of the embodiments of the present application.

[0049] To overcome the deficiencies in the related art, please refer to Figure 1 , Figure 11 is a schematic diagram of the architecture of a P-value calculation system based on a federated learning scenario for implementing a P-value calculation method based on a federated learning scenario provided by an embodiment of the present application. As shown in the figure, the P-value calculation system based on the federated learning scenario includes: an initiator, a participant, and a trusted third party; the initiator has the first original data; the participant has the second original data; wherein,

[0050] The initiator is used to randomly generate a first right orthogonal matrix, determine weights according to model prediction values, and determine a second right orthogonal matrix according to the first right orthogonal matrix and the weights, and send the second right orthogonal matrix to the participant;

[0051] The initiator is further used to randomly generate a first left orthogonal matrix, and mask the first original data using the first left orthogonal matrix and the second right orthogonal matrix to obtain target first original data;

[0052] The participant is used to randomly generate a second left orthogonal matrix, and mask the second original data using the second left orthogonal matrix and the second right orthogonal matrix to obtain target second original data;

[0053] The trusted third party is used to fuse and splice the target first original data and the target second original data to obtain fused data, and perform local SVD decomposition on the fused data to obtain a U matrix, an S matrix, and a V matrix;

[0054] The initiator is configured to generate a first random reversible matrix, and to perturb the first left orthogonal matrix by using the first random reversible matrix to obtain a target first left orthogonal matrix;

[0055] The participant is configured to generate a second random reversible matrix, and to perturb the second left orthogonal matrix by using the second random reversible matrix to obtain a target second left orthogonal matrix;

[0056] The trusted third party is configured to determine a first intermediate matrix according to the first random reversible matrix and the V matrix, and send the first intermediate matrix, the U matrix, and the S matrix to the initiator; determine a second intermediate matrix according to the second random reversible matrix and the V matrix, and send the second intermediate matrix and the S matrix to the participant;

[0057] The initiator is used to determine a first SVD result according to the first intermediate matrix;

[0058] The participant is used to determine a second SVD result according to the second intermediate matrix;

[0059] The initiator is configured to calculate a first P value according to the first SVD result;

[0060] The participant is used to calculate a second P value according to the second SVD result.

[0061] Optionally, in determining the first SVD result according to the first intermediate matrix by the initiator, the initiator is specifically configured to:

[0062] Determine a first reference V matrix according to the first intermediate matrix and the first random reversible matrix; update the U matrix according to the first right orthogonal matrix to obtain the updated U matrix;

[0063] The first SVD result is determined according to the first reference V matrix, the updated U matrix and the S matrix.

[0064] Optionally, in determining the second SVD result according to the second intermediate matrix by the participant, the participant is specifically configured to:

[0065] Determine, by the participant, a second reference V matrix according to the second intermediate matrix and the second random reversible matrix;

[0066] The second SVD result is determined according to the updated U matrix, the S matrix and the second reference V matrix.

[0067] Optionally, in the aspect of calculating the first P value according to the first SVD result by the initiator, the initiator is specifically configured to:

[0068] Calculating, by the initiator according to the first SVD result, a first local component of the inverse of the covariance matrix of the first original data after normalization;

[0069] Determine the scale parameters based on the model type;

[0070] A parameter z check is performed using the model parameters corresponding to the first local feature of the initiator, the first local component, and the scale parameter to obtain the first P value.

[0071] Optionally, in the aspect of calculating the second P value according to the second SVD result by the participant, the participant is specifically configured to:

[0072] Calculate a second local component of the inverse of the covariance matrix of the second original data after normalization according to the second SVD result;

[0073] A parameter z check is performed using the model parameters corresponding to the second local feature of the participant, the second local component, and the scale parameter to obtain the second P value.

[0074] The P-value calculation system based on the federated learning scenario in the embodiment of the present application, on the one hand, can protect the original data in a masked manner, the calculation amount and communication volume will not expand, and by utilizing the properties of the orthogonal matrix, the P-value calculation result is lossless. On the other hand, it can help modelers to perform hypothesis testing under the premise of privacy protection, thereby realizing the significance detection of the parameters of the federated learning model, and providing a basis for feature screening, model parameter adjustment, model interpretation, etc. of linear models (linear regression, logistic regression, Poisson regression, etc.) in federated scenarios, thereby improving model effects and reducing the risk of model overfitting.

[0075] See also Figure 2 , Figure 2 : is a flowchart of a method for calculating a P value based on a federated learning scenario provided in an embodiment of the present application; it is applied to Figure 1 The P-value calculation system based on the federated learning scenario shown in the figure includes: an initiator, a participant and a trusted third party; the initiator has the first original data; the participant has the second original data; the method includes:

[0076] 201. The initiator randomly generates a first right orthogonal matrix, determines weights according to model prediction values, and determines a second right orthogonal matrix according to the first right orthogonal matrix and the weights, and sends the second right orthogonal matrix to the participants.

[0077] In the embodiment of the present application, the initiator may randomly generate a first right orthogonal matrix, and the shape of the first right orthogonal matrix may be m*m, where m is the number of samples and m is a positive integer. The first right orthogonal matrix may be denoted as P.

[0078] In the specific implementation, the model prediction value mu of the federated learning model in the federated learning scenario can be obtained, and the weight can be calculated based on the following formula:

[0079]

[0080] Where g' is the derivative of the linear model link function and Var represents the variance function.

[0081] Furthermore, the first right orthogonal matrix and the weight may be multiplied to obtain a second right orthogonal matrix. Specifically, the second right orthogonal matrix may be obtained based on the following formula, as follows:

[0082] P w =P*w

[0083] Among them, P w represents the second right orthogonal matrix, P represents the first right orthogonal matrix, and w represents the weight.

[0084] Furthermore, the initiator may send the second right orthogonal matrix to the participants.

[0085] 202. The initiator randomly generates a first left orthogonal matrix, and performs mask protection on the first original data by using the first left orthogonal matrix and the second right orthogonal matrix to obtain target first original data.

[0086] In the embodiment of the present application, the initiator can randomly generate a first left orthogonal matrix Q C , whose shape can be n C *n C , n C is a positive integer and is filled with 0 to n*n C ,Right now

[0087] In a specific implementation, the transpose of the first left orthogonal matrix can also be determined, and then the first original data can be masked and protected by the transpose of the first left orthogonal matrix and the second right orthogonal matrix to obtain the target first original data, which is equivalent to obtaining random perturbation data. This can be implemented according to the following formula:

[0088]

[0089] in, represents the first original data of the target, P w represents the second right orthogonal matrix, represents the transpose of the first left orthogonal matrix, X C Represents the first original data.

[0090] Furthermore, the initiator may send the target first original data to a trusted third party.

[0091] In the embodiment of the present application, the original data is protected in a masked manner, and the amount of calculation and communication will not increase.

[0092] 203. Randomly generate a second left orthogonal matrix by the participant, and perform mask protection on the second original data by using the second left orthogonal matrix and the second right orthogonal matrix to obtain target second original data.

[0093] In the embodiment of the present application, the parameter side can randomly generate a second left orthogonal matrix Q B , whose shape can be n B *n B , n B is a positive integer and is filled with 0 to n*n B ,Right now

[0094] In a specific implementation, the transpose of the second left orthogonal matrix can also be determined, and then the second original data is masked and protected by the transpose of the second left orthogonal matrix and the second right orthogonal matrix to obtain the target second original data, which is equivalent to obtaining random perturbation data, and can be implemented according to the following formula:

[0095]

[0096] in, Represents the target second original data, P w represents the second right orthogonal matrix, represents the transpose of the second left orthogonal matrix, X B Represents the second original data.

[0097] Furthermore, the participant may send the target second original data to a trusted third party.

[0098] 204. The first target original data and the second target original data are fused and spliced ​​by the trusted third party to obtain fused data, and local SVD decomposition is performed on the fused data to obtain a U matrix, an S matrix, and a V matrix.

[0099] In the embodiment of the present application, the trusted third party may merge and splice the target first original data and the target second original data to obtain fused data, which may be obtained specifically in the following manner:

[0100]

[0101] Among them, X r represents fused data, represents the target first original data, Indicates the target second original data.

[0102] Next, the fused data can be subjected to local singular value SVD decomposition to obtain the U matrix, the S matrix, and the V matrix.

[0103] 205. Generate a first random reversible matrix through the initiator, and perturb the first left orthogonal matrix through the first random reversible matrix to obtain a target first left orthogonal matrix.

[0104] In the embodiment of the present application, the initiator can generate a first random reversible matrix R C , the first left orthogonal matrix can also be perturbed by the first random reversible matrix, that is, the first left orthogonal matrix can be multiplied by the first random reversible matrix to obtain the target first left orthogonal matrix, as follows:

[0105]

[0106] in, represents the target first left orthogonal matrix, Q C represents the first left orthogonal matrix, R C Denotes the first random reversible matrix.

[0107] Furthermore, the initiator may send the target first left orthogonal matrix to the trusted third party.

[0108] 206. Generate a second random reversible matrix through the participant, and perturb the second left orthogonal matrix through the second random reversible matrix to obtain a target second left orthogonal matrix.

[0109] In the embodiment of the present application, the participants can generate a second random reversible matrix R B , the second left orthogonal matrix can also be perturbed by the second random reversible matrix, that is, the second left orthogonal matrix can be multiplied by the second random reversible matrix to obtain the target second left orthogonal matrix, as follows:

[0110]

[0111] in, represents the target second left orthogonal matrix, Q B represents the second left orthogonal matrix, R B Denotes the second random reversible matrix.

[0112] Furthermore, the initiator may send the target second left orthogonal matrix to the trusted third party.

[0113] 207. Determine a first intermediate matrix according to the first random reversible matrix and the V matrix through the trusted third party, and send the first intermediate matrix, the U matrix and the S matrix to the initiator; determine a second intermediate matrix according to the second random reversible matrix and the V matrix, and send the second intermediate matrix and the S matrix to the participants.

[0114] In the embodiment of the present application, the trusted third party may determine the first intermediate matrix according to the first random reversible matrix and the V matrix, that is, the V matrix may be multiplied by the first random reversible matrix, as follows:

[0115]

[0116] in, represents the first intermediate matrix, V represents the V matrix, Denotes the first random reversible matrix.

[0117] In addition, in the embodiment of the present application, the trusted third party may determine the second intermediate matrix according to the second random reversible matrix and the V matrix, that is, the V matrix may be multiplied by the second random reversible matrix, as follows:

[0118]

[0119] in, represents the second intermediate matrix, V represents the V matrix, Denotes the second random reversible matrix.

[0120] 208. Determine a first SVD result according to the first intermediate matrix by the initiator.

[0121] In a specific implementation, the initiator may determine the first SVD result according to the first intermediate matrix.

[0122] Optionally, the above step 208, determining the first SVD result by the initiator according to the first intermediate matrix, may include the following steps:

[0123] 81. The initiator determines a first reference V matrix according to the first intermediate matrix and the first random reversible matrix; updates the U matrix according to the first right orthogonal matrix to obtain an updated U matrix;

[0124] 82. Determine the first SVD result according to the first reference V matrix, the updated U matrix and the S matrix.

[0125] In the embodiment of the present application, the initiator may determine the inverse matrix of the first random reversible matrix, and then multiply the first intermediate matrix and the inverse matrix of the first random reversible matrix to obtain the first reference V matrix, as follows:

[0126]

[0127] Among them, V C represents the first reference V matrix, represents the first intermediate matrix, represents the inverse matrix of the first random reversible matrix.

[0128] Furthermore, the initiator may also determine the inverse matrix of the first right orthogonal matrix, and then perform multiplication operation on the inverse matrix of the first right orthogonal matrix and the U matrix to obtain the updated U matrix, as follows:

[0129] U=P -1 *U

[0130] Among them, P -1 represents the inverse matrix of the first right orthogonal matrix, and U represents the U matrix.

[0131] Furthermore, the initiator may determine the transpose of the first reference V matrix You can The updated U matrix and S matrix are used as the first SVD results.

[0132] 209. Determine a second SVD result by the participant according to the second intermediate matrix.

[0133] In the embodiment of the present application, the participating parties may determine the second SVD result according to the second intermediate matrix.

[0134] Optionally, the above step 209, determining the second SVD result by the participant according to the second intermediate matrix, may include the following steps:

[0135] 91. Determine, by the participant, a second reference V matrix according to the second intermediate matrix and the second random reversible matrix;

[0136] 92. Determine the second SVD result according to the updated U matrix, the S matrix and the second reference V matrix.

[0137] In the embodiment of the present application, the participants may determine the inverse matrix of the second random reversible matrix, and perform multiplication operation on the second intermediate matrix and the inverse matrix of the second random reversible matrix, as follows:

[0138]

[0139] Among them, V B represents the second reference V matrix, represents the second intermediate matrix, represents the inverse matrix of the second random reversible matrix.

[0140] Furthermore, the participants can determine the transpose of the second reference V matrix Then transpose the updated U matrix, S matrix and the second reference V matrix as the second SVD result.

[0141] 210. Calculate a first P value according to the first SVD result by the initiator.

[0142] In an embodiment of the present application, the properties of the orthogonal matrix are utilized to make the P-value calculation result lossless. In a specific implementation, the initiator may calculate the first P-value based on the first SVD result. The first P-value may include one or more values, that is, the first P-value is the P-value corresponding to the local variable model parameters of the initiator. Thus, it can help modelers to perform hypothesis testing under the premise of privacy protection, improve model effects, and reduce the risk of model overfitting.

[0143] Optionally, the above step 210, calculating the first P value according to the first SVD result by the initiator, may include the following steps:

[0144] A1. The initiator calculates a first local component of the inverse of the covariance matrix of the first original data after normalization according to the first SVD result;

[0145] A2. Determine scale parameters based on model type;

[0146] A3. Perform parameter z check using the model parameters corresponding to the first local feature of the initiator, the first local component, and the scale parameter to obtain the first P value.

[0147] In an embodiment of the present application, the initiator can calculate the first local component of the inverse of the covariance matrix of the first original data after normalization based on the first SVD result. Specifically, after using the federal first SVD result to decompose to obtain the U, S, and V matrices of the local data, the initiator takes the inverse of the non-zero elements on the diagonal of the eigenvalue matrix S, and then performs a local matrix multiplication operation, that is, the inverse of the covariance matrix of the original data after normalization (normalized_cov_inv) can be directly calculated locally, that is, the first local component is obtained.

[0148] In an embodiment of the present application, the first local feature may refer to a description of each ID of the initiator, which may lead to a label for the ID (whether it is a breach of contract), such as the age, occupation, recent consumption amount, etc. of an ID. The linear model learns the coefficients (model parameters) corresponding to each feature. The smaller the error between the inner product of these coefficients and the feature and the label, the better the model effect. In addition, if the p-value corresponding to each coefficient is very small, it indicates that the feature corresponding to the coefficient is significant, and the model is more interpretable. The model parameter of the first local feature may refer to the model coefficient corresponding to each feature, specifically: the inner product result can be regarded as the result of the model fitting label.

[0149] Next, the scale parameter can be determined according to the model type. In specific implementation, the scale parameter scale can be calculated according to the model type. For example, in linear regression, Poisson regression, and logistic regression, the scale is 1; in gamma regression and Tweedie regression, the scale is the chi-square value. The parameter z check is performed using the model parameters, the first local component, and the scale parameter corresponding to the first local feature of the initiator, and the first P value can be obtained.

[0150] 211. Calculate a second P value according to the second SVD result by the participant.

[0151] In the embodiment of the present application, the properties of the orthogonal matrix are utilized to make the P-value calculation result lossless. In the specific implementation, the participant can calculate the second P-value based on the second SVD result. The second P-value may include one or more values, that is, the second P-value is the P-value corresponding to the local variable model parameters of the participant. Therefore, it can help modelers to perform hypothesis testing under the premise of privacy protection, improve model effects and reduce the risk of model overfitting.

[0152] Optionally, the above step 211, calculating the second P value by the participant according to the second SVD result, may include the following steps:

[0153] B1. The participant calculates, according to the second SVD result, a second local component of the inverse of the covariance matrix of the second original data after normalization;

[0154] B2. Perform parameter z check using the model parameters corresponding to the second local feature of the participant, the second local component and the scale parameter to obtain the second P value.

[0155] In the embodiment of the present application, the second local feature may refer to the description of each ID of the participant, which may lead to the label of the ID (whether it is a breach of contract), such as the age, occupation, recent consumption amount, etc. of an ID. The linear model learns the coefficients (model parameters) corresponding to each feature. The smaller the error between the inner product of these coefficients and the feature and the label, the better the model effect. In addition, if the p-value corresponding to each coefficient is very small, it indicates that the feature corresponding to the coefficient is significant, and the interpretability of the model is stronger. The model parameter of the second local feature may refer to the model coefficient corresponding to each feature, specifically: the inner product result can be regarded as the result of the model fitting label.

[0156] In an embodiment of the present application, the participating party can calculate the second local component of the inverse of the covariance matrix of the normalized second original data based on the second SVD result. Specifically, after the participating party uses the federal second SVD result to decompose to obtain the U, S, and V matrices of the local data, it takes the inverse of the non-zero elements on the diagonal of the eigenvalue matrix S, and then performs a local matrix multiplication operation, that is, the inverse of the covariance matrix of the normalized original data (normalized_cov_inv) can be directly calculated locally to obtain the second local component.

[0157] Next, the parameter z check is performed using the model parameters, the second local components and the scale parameters corresponding to the second local features of the participants, and the second P value can be obtained.

[0158] In practical applications, the main difficulty in calculating the P value in the federated learning scenario is to solve the inverse of the covariance matrix after normalization of the original data across multiple parties. The calculation process usually involves multiplication and inversion of the ciphertext matrix across multiple parties. Taking into account the amount of calculation, communication volume and accuracy, in an embodiment of the present application, a P value scheme based on a random orthogonal matrix mask is proposed. After obtaining the U, S, and V matrices of each local data using the federated SVD decomposition, the inverse of the non-zero elements of the diagonal of the eigenvalue matrix S is taken, and then the local matrix multiplication operation is performed. The inverse of the covariance matrix after normalization of the original data (normalized_cov_inv) can be directly calculated locally, and the parameter z test is performed based on the inverse matrix, the model chi-square value and the model parameters to obtain the P value of each parameter.

[0159] In the specific implementation, parameter verification includes parameter z-test. Parameter test is a method of inferring the parameters of the population distribution, such as mean and variance, in statistics when the population distribution is known. Parameter Z-test is used to determine whether the sample mean is significantly different from the population mean. The probability of the difference is inferred by the normal distribution theory, so as to compare whether the difference between the two means is significant. It can be implemented using the scientific computing package scipy, which is an open source Python algorithm library and mathematical toolkit.

[0160] In the specific implementation process, in the embodiment of the present application, the specific implementation can be roughly divided into two parts: federated SVD decomposition and federated P value calculation. Taking the vertical federated learning scenario of two parties (nodeB, nodeC) as an example, nodeC is the initiator and owns the original data X_C; nodeB is the participant and owns the original data X_B; and a trusted third party nodeA is introduced to assist in the calculation.

[0161] Among them, Figure 3 As shown, the federated SVD decomposition may include the following steps:

[0162] 1.nodeC randomly generates a right orthogonal matrix P with a shape of m*m, where m is the number of samples. NodeC calculates the weight w based on the model prediction value mu, where g' is the derivative of the linear model link function, Var represents the variance function, P w =P*w.

[0163] 2.P w Sent to nodeB.

[0164] 3.nodeC and nodeB each randomly generate a left orthogonal matrix Q locally C , Q B , the shapes are n C *n C , n B*n B , and fill it with 0 to n*n C , n*n B , where n is the total feature dimension, n C is the characteristic dimension of the initiator, n B is the characteristic dimension of the participants. Specifically, nodeC randomly generates an orthogonal matrix Q C , with shape n C *n C , and fill it with 0 to n*n C ,Right now nodeB randomly generates a left orthogonal matrix Q B , with shape n B *n B , and fill it with 0 to n*n B ,Right now

[0165] 4.nodeC calculation NodeB calculation

[0166] 5.nodeC sends Send to nodeA and nodeB to nodeA.

[0167] 6.nodeC generates a random reversible matrix R C , and calculate nodeB generates a random reversible matrix R B , and calculate

[0168] 7.nodeA obtains random perturbation data And perform local SVD decomposition on it to obtain U, S, V.

[0169] 8.nodeC sends Send to nodeA and nodeB to nodeA.

[0170] 9.nodeA calculation

[0171] 10.nodeA sends U, S, To nodeC; nodeA sends S, To nodeB.

[0172] 11.nodeC calculation U=P -1 *U; nodeC sends U to nodeB; nodeB calculates

[0173] 12.nodeC outputs U, S, nodeB outputs U, S,

[0174] Next, if Figure 4 As shown, the federal P value is calculated:

[0175] 1. Federated SVD algorithm.

[0176] 2. nodeC calculates the local component normalized_cov_inv_C of the inverse of the covariance matrix of the original data after normalization based on the SVD result; nodeB calculates the local component normalized_cov_inv_B of the inverse of the covariance matrix of the original data after normalization based on the SVD result.

[0177] 3. Calculate scale (scalar, 1 or chi-square value).

[0178] 4.Synchronize scale.

[0179] 5. Check the parameter z of nodeC; check the parameter z of nodeB.

[0180] 6.nodeC outputs P value, nodeB outputs P value.

[0181] In the embodiment of the present application, the original data is protected by masking, and the amount of calculation and communication will not expand. And by using the properties of the orthogonal matrix, the P value calculation result is lossless, the calculation efficiency is high, the communication volume is low, the calculation result is lossless, and it can help modelers to perform hypothesis testing under the premise of privacy protection, thereby realizing the significance detection of the parameters of the federated learning model.

[0182] Among them, the calculation and communication processes are both plain text (after random matrix perturbation), and the amount of calculation and communication will not expand. Compared with other methods, such as the solution based on homomorphic encryption and multi-party secure computing MPC in the embodiments of the present application, the original data will expand into a large integer, and the amount of calculation and communication will increase significantly.

[0183] In the embodiments of the present application, a basis can be provided for feature screening, model parameter adjustment, model interpretation, etc. in federated scenarios, thereby improving model effects and reducing the risk of overfitting.

[0184] It can be seen that the P-value calculation method based on the federated learning scenario described in the embodiment of the present application is applied to the P-value calculation system based on the federated learning scenario, and the P-value calculation system based on the federated learning scenario includes: an initiator, a participant and a trusted third party; the initiator has the first original data; the participant has the second original data; the initiator randomly generates a first right orthogonal matrix, determines the weight according to the model prediction value, and determines the second right orthogonal matrix according to the first right orthogonal matrix and the weight, and sends the second right orthogonal matrix to the participant; the initiator randomly generates a first left orthogonal matrix, and determines the weight according to the first left orthogonal matrix and the second right orthogonal matrix. The second right orthogonal matrix masks the first original data to obtain the target first original data; the participant randomly generates a second left orthogonal matrix, and the second original data is masked and protected by the second left orthogonal matrix and the second right orthogonal matrix to obtain the target second original data; the target first original data and the target second original data are fused and spliced ​​by a trusted third party to obtain fused data, and the fused data is locally decomposed by SVD to obtain U matrix, S matrix and V matrix; the initiator generates a first random reversible matrix, and the first left orthogonal matrix is ​​perturbed by the first random reversible matrix to obtain the target A left orthogonal matrix; a second random reversible matrix is ​​generated by the participant, and the second left orthogonal matrix is ​​perturbed by the second random reversible matrix to obtain a target second left orthogonal matrix; a first intermediate matrix is ​​determined by a trusted third party according to the first random reversible matrix and the V matrix, and the first intermediate matrix, the U matrix and the S matrix are sent to the initiator; a second intermediate matrix is ​​determined according to the second random reversible matrix and the V matrix, and the second intermediate matrix and the S matrix are sent to the participant; the initiator determines a first SVD result according to the first intermediate matrix; the participant determines a second SVD result according to the second intermediate matrix; the initiator determines a first SVD result according to the first intermediate matrix; the initiator ... The first P value is calculated according to the first SVD result; the second P value is calculated by the participating party according to the second SVD result. On the one hand, the original data can be protected in a masked manner, and the calculation amount and communication volume will not expand. Moreover, by utilizing the properties of the orthogonal matrix, the P value calculation result is lossless. On the other hand, it can help modelers to perform hypothesis testing under the premise of privacy protection, thereby realizing the significance detection of the parameters of the federated learning model, and providing a basis for feature screening, model parameter adjustment, model interpretation, etc. of linear models (linear regression, logistic regression, Poisson regression, etc.) in federated scenarios, thereby improving model effects and reducing the risk of model overfitting.

[0185] In accordance with the above embodiment, please refer to Figure 5 , Figure 5: is a structural diagram of an electronic device provided in an embodiment of the present application. As shown in the figure, the electronic device includes a processor, a memory, a communication interface and one or more programs. The one or more programs are stored in the memory and are configured to be executed by the processor. In the embodiment of the present application, the electronic device is applied to a P-value calculation system based on a federated learning scenario. The P-value calculation system based on a federated learning scenario includes: an initiator, a participant and a trusted third party; the initiator has the first original data; the participant has the second original data; the program includes instructions for executing the following steps:

[0186] The initiator randomly generates a first right orthogonal matrix, determines weights according to model prediction values, determines a second right orthogonal matrix according to the first right orthogonal matrix and the weights, and sends the second right orthogonal matrix to the participant;

[0187] The initiator randomly generates a first left orthogonal matrix, and performs mask protection on the first original data by using the first left orthogonal matrix and the second right orthogonal matrix to obtain target first original data;

[0188] The participant randomly generates a second left orthogonal matrix, and performs mask protection on the second original data by using the second left orthogonal matrix and the second right orthogonal matrix to obtain target second original data;

[0189] The first target original data and the second target original data are fused and spliced ​​by the trusted third party to obtain fused data, and the fused data is subjected to local SVD decomposition to obtain a U matrix, an S matrix, and a V matrix;

[0190] Generate a first random reversible matrix by the initiator, and perturb the first left orthogonal matrix by the first random reversible matrix to obtain a target first left orthogonal matrix;

[0191] Generate a second random reversible matrix by the participant, and perturb the second left orthogonal matrix by the second random reversible matrix to obtain a target second left orthogonal matrix;

[0192] Determine a first intermediate matrix according to the first random reversible matrix and the V matrix by the trusted third party, and send the first intermediate matrix, the U matrix, and the S matrix to the initiator; determine a second intermediate matrix according to the second random reversible matrix and the V matrix, and send the second intermediate matrix and the S matrix to the participant;

[0193] Determining, by the initiator, a first SVD result according to the first intermediate matrix;

[0194] Determining, by the participant, a second SVD result according to the second intermediate matrix;

[0195] Calculating a first P value according to the first SVD result by the initiator;

[0196] A second P value is calculated by the participant according to the second SVD result.

[0197] Optionally, in the aspect of determining the first SVD result according to the first intermediate matrix by the initiator, the program includes instructions for performing the following steps:

[0198] The initiator determines a first reference V matrix according to the first intermediate matrix and the first random reversible matrix; updates the U matrix according to the first right orthogonal matrix to obtain an updated U matrix;

[0199] The first SVD result is determined according to the first reference V matrix, the updated U matrix and the S matrix.

[0200] Further, optionally, in the aspect of determining the second SVD result according to the second intermediate matrix by the participant, the program includes instructions for performing the following steps:

[0201] Determine, by the participant, a second reference V matrix according to the second intermediate matrix and the second random reversible matrix;

[0202] The second SVD result is determined according to the updated U matrix, the S matrix and the second reference V matrix.

[0203] Further, optionally, in the aspect of calculating the first P value according to the first SVD result by the initiator, the program includes instructions for performing the following steps:

[0204] Calculating, by the initiator according to the first SVD result, a first local component of the inverse of the covariance matrix of the first original data after normalization;

[0205] Determine the scale parameters based on the model type;

[0206] A parameter z check is performed using the model parameters corresponding to the first local feature of the initiator, the first local component, and the scale parameter to obtain the first P value.

[0207] Further, optionally, in the aspect of calculating the second P value according to the second SVD result by the participant, the program includes instructions for performing the following steps:

[0208] Calculating, by the participant, a second local component of the inverse of the covariance matrix of the second original data after normalization according to the second SVD result;

[0209] A parameter z check is performed using the model parameters corresponding to the second local feature of the participant, the second local component, and the scale parameter to obtain the second P value.

[0210] An embodiment of the present application also provides a computer storage medium, wherein the computer storage medium stores a computer program for electronic data exchange, wherein the computer program enables a computer to execute part or all of the steps of any method described in the above method embodiments, and the above computer includes an electronic device.

[0211] The embodiment of the present application also provides a computer program product, the computer program product includes a non-transitory computer-readable storage medium storing a computer program, the computer program is operable to cause a computer to execute some or all of the steps of any method described in the method embodiment. The computer program product may be a software installation package, and the computer includes an electronic device.

[0212] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.

[0213] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0214] In the several embodiments provided in the present application, it should be understood that the disclosed device can be implemented in other ways. For example, the device embodiments described above are only schematic, such as the division of the above-mentioned units, which is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, and the indirect coupling or communication connection of devices or units can be electrical or other forms.

[0215] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0216] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0217] If the above-mentioned integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a memory, including a number of instructions to enable a computer device (which can be a personal computer, server or network device, etc.) to perform all or part of the steps of the above-mentioned methods of each embodiment of the present application. The aforementioned memory includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or CD-ROM and other media that can store program codes.

[0218] A person skilled in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable memory, and the memory can include: a flash drive, a read-only memory (English: Read-Only Memory, abbreviated as: ROM), a random access memory (English: Random Access Memory, abbreviated as: RAM), a magnetic disk or an optical disk, etc.

[0219] The embodiments of the present application are introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method and core idea of ​​the present application. At the same time, for general technical personnel in this field, according to the idea of ​​the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A P value calculation method based on a federated learning scenario, characterized in that: A P-value calculation system based on a federated learning scenario is applied, and the P-value calculation system based on the federated learning scenario includes: an initiator, a participant, and a trusted third party; the initiator has first original data; the participant has second original data; the method includes: The initiator randomly generates a first right orthogonal matrix, determines weights according to model prediction values, determines a second right orthogonal matrix according to the first right orthogonal matrix and the weights, and sends the second right orthogonal matrix to the participant; The initiator randomly generates a first left orthogonal matrix, and performs mask protection on the first original data by using the first left orthogonal matrix and the second right orthogonal matrix to obtain target first original data; The participant randomly generates a second left orthogonal matrix, and performs mask protection on the second original data by using the second left orthogonal matrix and the second right orthogonal matrix to obtain target second original data; The first target original data and the second target original data are fused and spliced ​​by the trusted third party to obtain fused data, and the fused data is subjected to local SVD decomposition to obtain a U matrix, an S matrix, and a V matrix; Generate a first random reversible matrix by the initiator, and perturb the first left orthogonal matrix by the first random reversible matrix to obtain a target first left orthogonal matrix; Generate a second random reversible matrix by the participant, and perturb the second left orthogonal matrix by the second random reversible matrix to obtain a target second left orthogonal matrix; Determine a first intermediate matrix according to the first random reversible matrix and the V matrix by the trusted third party, and send the first intermediate matrix, the U matrix, and the S matrix to the initiator; determine a second intermediate matrix according to the second random reversible matrix and the V matrix, and send the second intermediate matrix and the S matrix to the participant; Determining, by the initiator, a first SVD result according to the first intermediate matrix; Determining, by the participant, a second SVD result according to the second intermediate matrix; Calculating a first P value according to the first SVD result by the initiator; A second P value is calculated by the participant according to the second SVD result.

2. The method according to claim 1, characterized in that The determining, by the initiator, a first SVD result according to the first intermediate matrix includes: The initiator determines a first reference V matrix according to the first intermediate matrix and the first random reversible matrix; updates the U matrix according to the first right orthogonal matrix to obtain an updated U matrix; The first SVD result is determined according to the first reference V matrix, the updated U matrix and the S matrix.

3. The method according to claim 2, characterized in that The determining, by the participant, a second SVD result according to the second intermediate matrix includes: Determine, by the participant, a second reference V matrix according to the second intermediate matrix and the second random reversible matrix; The second SVD result is determined according to the updated U matrix, the S matrix and the second reference V matrix.

4. The method according to claim 3, characterized in that The calculating, by the initiator, a first P value according to the first SVD result includes: Calculating, by the initiator according to the first SVD result, a first local component of the inverse of the covariance matrix of the first original data after normalization; Determine the scale parameters based on the model type; A parameter z check is performed using the model parameters corresponding to the first local feature of the initiator, the first local component, and the scale parameter to obtain the first P value.

5. The method according to claim 4, characterized in that The calculating, by the participant, a second P value according to the second SVD result includes: Calculating, by the participant, a second local component of the inverse of the covariance matrix of the second original data after normalization according to the second SVD result; A parameter z check is performed using the model parameters corresponding to the second local feature of the participant, the second local component, and the scale parameter to obtain the second P value.

6. A P-value calculation system based on a federated learning scenario, characterized in that: The P-value calculation system based on the federated learning scenario includes: an initiator, a participant and a trusted third party; the initiator has the first original data; the participant has the second original data; wherein, The initiator is used to randomly generate a first right orthogonal matrix, determine weights according to model prediction values, and determine a second right orthogonal matrix according to the first right orthogonal matrix and the weights, and send the second right orthogonal matrix to the participant; The initiator is further used to randomly generate a first left orthogonal matrix, and mask the first original data using the first left orthogonal matrix and the second right orthogonal matrix to obtain target first original data; The participant is used to randomly generate a second left orthogonal matrix, and mask the second original data using the second left orthogonal matrix and the second right orthogonal matrix to obtain target second original data; The trusted third party is used to fuse and splice the target first original data and the target second original data to obtain fused data, and perform local SVD decomposition on the fused data to obtain a U matrix, an S matrix, and a V matrix; The initiator is configured to generate a first random reversible matrix, and to perturb the first left orthogonal matrix by using the first random reversible matrix to obtain a target first left orthogonal matrix; The participant is configured to generate a second random reversible matrix, and to perturb the second left orthogonal matrix by using the second random reversible matrix to obtain a target second left orthogonal matrix; The trusted third party is configured to determine a first intermediate matrix according to the first random reversible matrix and the V matrix, and send the first intermediate matrix, the U matrix, and the S matrix to the initiator; determine a second intermediate matrix according to the second random reversible matrix and the V matrix, and send the second intermediate matrix and the S matrix to the participant; The initiator is used to determine a first SVD result according to the first intermediate matrix; The participant is used to determine a second SVD result according to the second intermediate matrix; The initiator is configured to calculate a first P value according to the first SVD result; The participant is used to calculate a second P value according to the second SVD result.

7. The system according to claim 6, characterized in that In the aspect of determining the first SVD result according to the first intermediate matrix by the initiator, the initiator is specifically configured to: Determine a first reference V matrix according to the first intermediate matrix and the first random reversible matrix; update the U matrix according to the first right orthogonal matrix to obtain the updated U matrix; The first SVD result is determined according to the first reference V matrix, the updated U matrix and the S matrix.

8. The system according to claim 7, characterized in that In the aspect of determining the second SVD result according to the second intermediate matrix by the participant, the participant is specifically configured to: Determine, by the participant, a second reference V matrix according to the second intermediate matrix and the second random reversible matrix; The second SVD result is determined according to the updated U matrix, the S matrix and the second reference V matrix.

9. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory is used to store one or more programs and is configured to be executed by the processor, wherein the program comprises instructions for executing the steps in the method according to any one of claims 1 to 5.

10. A computer-readable storage medium, characterized in that: A computer program for electronic data exchange is stored, wherein the computer program enables a computer to execute the method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Determining and / or mitigating predicted effective degree of reconstruction from model updates transmitted in federated learning

    CN116783601A