A federal learning non-commutative conformal risk control algorithm construction method and system
By combining locality-sensitive hashing and RACE kernel density estimation techniques with grid search and the maximum entropy principle, the problem of conformal risk control under data heterogeneity in federated learning is solved, achieving efficient risk assessment and accurate prediction under privacy protection. It is applicable to risk assessment and diagnosis systems in the financial and medical fields.
Patent Information
- Application Number
- CN202510988925.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-17
- Publication Date
- 2026-02-10
- Estimated Expiration
- 2045-07-17
AI Technical Summary
In federated learning, existing technologies struggle to effectively control the uncertainty risk of models, especially given the heterogeneity of data distribution and the need for privacy protection. Traditional methods cannot accurately assess and control the reliability of models, leading to erroneous predictions and potential risks.
Locality-sensitive hashing and RACE kernel density estimation techniques are used to capture data distribution characteristics on the client side. On the server side, weights and conservative values are calculated through grid search and the maximum entropy principle. Data from various clients are integrated to construct a conformal risk control prediction set.
While ensuring data privacy, it effectively estimates distributional differences, improves the reliability and accuracy of model predictions, adapts to data heterogeneity, reduces risk levels, and is applicable to risk assessment and diagnostic systems in fields such as finance and healthcare.
Smart Images

Figure CN120832965B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of federated learning technology, and in particular to a method and system for controlling the non-commutative conformal risk of federated learning, which is used to quantitatively assess the uncertainty of federated learning models and effectively control the risk level while protecting data privacy. Background Technology
[0002] Federated learning, as an emerging machine learning paradigm, allows learning from distributed datasets stored locally by multiple agents. Its core idea is that multiple participants (such as devices, institutions, or servers) collaboratively train a globally shared machine learning model without sharing the original data. Data remains locally, and joint training is achieved only through exchanging model parameters or gradient updates. Its advantage lies in the fact that the original data does not leave the local storage, mitigating the risk of data leakage. Currently, it complies with strict data privacy regulations (such as GDPR and HIPAA), which is particularly crucial in sensitive fields such as healthcare and finance.
[0003] In recent years, federated learning has primarily focused on how to combine data from various clients to train a more powerful predictive model. However, in its practical applications in fields such as healthcare and finance, the predictive power of a model alone cannot meet the actual needs of use; it is also necessary to evaluate the reliability of the model's predictions, i.e., model uncertainty. Traditional deep learning models typically output a single prediction result (such as classification probability or regression value), lacking an assessment of their own predictive reliability. This "overconfidence" may lead the model to give incorrect but high-confidence results in noisy data, out-of-distribution samples, or marginal cases, causing serious risks. For example, in autonomous driving, if the model cannot recognize unknown obstacles (such as objects that have not been trained on), it may lead to fatal accidents; in medical image diagnosis, the model may fail to provide confidence intervals for results in segmentation or classification tasks, misleading doctors and causing medical accidents.
[0004] In recent years, conformal prediction has become a widely accepted methodology for assessing the uncertainty quantification of models, particularly in addressing the problem of model uncertainty quantification. This method is a statistical framework designed to provide machine learning models with mathematically guaranteed confidence intervals or sets of predictions, assuming only the commutativity of the data. The user specifies a significance level, and the algorithm generates predictions based on this level. The set significance level limits the frequency of errors the algorithm is allowed to produce in its output; for example, a significance level of 0.1 means the algorithm can only make a maximum of 10% incorrect predictions. To meet this requirement, conformal prediction outputs a set of predictions, rather than the single-point predictions of traditional supervised learning models. These sets can be small or large. For regression tasks, the output is a prediction interval, where a smaller significance level (allowing fewer errors) generates a wider interval (less specific prediction); conversely, a higher significance level (allowing more errors) generates a narrower prediction interval. Conformal prediction has been widely applied in various fields, including large language models and time series models.
[0005] As an extension of conformal prediction, conformal risk control provides a broader form of uncertainty quantification. Similar to conformal prediction, it still outputs a set of predictions, but it is no longer limited to controlling the frequency of model errors. Instead, it can control various types of risk losses, such as FNR in multi-objective classification tasks and F1-score in text generation prediction tasks, which are more complex model performance evaluation metrics. This invention will mainly study the relevant content of conformal risk control to adapt to a wider range of application scenarios.
[0006] This invention aims to combine the advantages of conformal risk control with the data privacy protection of federated learning. However, constructing a conformal risk control algorithm under the federated learning paradigm faces numerous challenges because this process must also be completed without accessing centralized data, and it also requires data privacy algorithms similar to those used in federated learning. Furthermore, in conformal risk control under federated learning, the data sample size of a single client is small, and the corresponding calibration set data available for conformal risk control is even scarcer. Therefore, the effectiveness of conformal risk control methods on a single client is usually poor. Thus, it is necessary to combine calibration set data from various clients to assist in the construction of the prediction set. However, the heterogeneity of data distribution among clients naturally breaks the data exchangeability prerequisite required for conformal risk control, posing a challenge to the theoretical foundation. Summary of the Invention
[0007] To address the problems existing in the prior art, this invention provides a method for constructing a federated learning non-commutative conformal risk control algorithm.
[0008] This invention is implemented as follows: a method for controlling non-commutative conformal risks in federated learning, the method comprising:
[0009] S1, The client calculates a privacy distribution sketch of the local calibration set data, captures the distribution characteristics of the local data, calculates the loss function value for each calibration data point on the client, and captures the loss score used for conformal risk control;
[0010] S2, the server collects a sketch of the calibration data distribution from each client, as well as the loss function value for each client. It then calculates the weight values corresponding to the calibration data from each client and uses a grid search method to solve for the conformal risk control conservative parameters.
[0011] S3, the server distributes conservative value parameters to the corresponding clients, and the corresponding clients use the parameters and conservative values locally to calculate the conformal risk control prediction set.
[0012] Furthermore, the specific steps for the client to calculate the local calibration set data privacy distribution sketch include:
[0013] Initialize a zero matrix to approximate a histogram of the local data distribution;
[0014] Using the RACE method of the repeated count estimator array, a hash function is used to update the zero matrix by mapping the local data one by one, thus obtaining the client's data distribution sketch RACE matrix;
[0015] The client uploads the updated data distribution sketch matrix to the server;
[0016] The client calculates the loss function value of the local calibration set data and uploads it to the server.
[0017] Furthermore, the specific steps for the server to solve for the weight magnitude and the conformal risk control conservative value parameters include:
[0018] Receive a sketch of the client's data distribution and the loss function values;
[0019] The server provides a data distribution sketch and calculates the total variation of the data distribution for each client and the target client.
[0020] The server calculates the weight of each client based on the obtained total variation using the maximum entropy principle.
[0021] The server assigns the required weights, aggregates the loss function values of each client using a weighted average, and uses a grid search method to find the minimum conservative value required to meet the risk control requirements.
[0022] The server distributes the desired conservative value to the target clients.
[0023] Furthermore, the specific steps of the client-side module for calculating the conformal risk control prediction set include:
[0024] The client accepts conservatively valued parameters distributed by the server.
[0025] The client calculates the prediction set for the test points based on the conservative parameter and the loss function value of the local calibration data.
[0026] Furthermore, the client-side data distribution sketching module satisfies the corresponding convergence theorem, which provides theoretical support for the client to estimate the data distribution, specifically including:
[0027] Assumptions:
[0028] Assumption 1: It is required that the client datasets D ~ p(x) satisfy independent and identically distributed (i.i.d.), which is a common constraint in federated learning algorithms;
[0029] Theorem content:
[0030] Assuming assumption 1 holds, for the client distribution sketch S, let k(x,y) be a locality-sensitive hash kernel, then... This holds true, meaning that as the client dataset expands, the distribution sketch converges probabilistically to its sum density estimate, with a convergence rate of... R represents the number of hash functions in the distribution sketch; the theorem shows that as the amount of data in the dataset increases, the client model can better capture the characteristics of the local data and effectively adapt to the local data.
[0031] Furthermore, the weights of each client data and the minimum conservative value calculated by the server satisfy the conformal risk control theorem, which proves that the prediction set calculated according to the algorithm of this invention will meet the requirements of conformal risk control.
[0032] Furthermore, the non-commutative conformal risk control property satisfied by the server in solving for the minimum conservative value is as follows:
[0033] Assumptions:
[0034] Assumption 2: Suppose that for any The loss function L(λ;(x,y)) is non-increasing with respect to λ and bounded for any λ, which is a basic requirement for general conformal risk control;
[0035] Assume 3 for a single calibration set of data from K clients. For the same k, the data points satisfy an independent pass-through distribution, which simplifies the theoretical analysis;
[0036] Assume a column of weights. The fact that it is independent of the data demonstrates the robustness of the algorithm;
[0037] Theorem content:
[0038] When all four pairs of assumptions hold true, let the risk control level α∈[A,B], and let... and For test points satisfy in Here S k With S k' Let k and k' represent client k and client k', respectively.
[0039] Furthermore, the server's module for solving for optimal weights and minimum conservative values satisfies the following conformal risk control property, described in the following text:
[0040] (a) The loss function L(λ;(x,y)) is non-increasing with respect to the conservative value λ, and is bounded for any λ.
[0041] (b) Data within different clients is independent and identically distributed, and there are no requirements regarding the data distribution relationship between different clients;
[0042] (c) Sample weights are independent of the data;
[0043] (d) Under the above assumptions, the risk level of the prediction set of the test data is controlled within the range of a given risk control level plus the sum of the weighted total variation of the data distribution. That is...
[0044]
[0045] Furthermore, the server module for solving for weights and conservative values further includes:
[0046] (a) The weights sought are data-independent and do not depend on test and calibration data;
[0047] (b) The optimal weights are obtained by optimizing the following problem based on the maximum entropy principle;
[0048]
[0049] (c) The optimal conservative value is obtained through a grid search on the monotonic function:
[0050] Compute grid Λ at the central end G Weighted average loss
[0051]
[0052] Find using grid search method The infinite boundary is
[0053]
[0054] Another objective of this invention is to provide a federated learning non-commutative conformal risk control system based on the aforementioned federated learning non-commutative conformal risk control method, the system comprising:
[0055] The client-side data distribution sketch calculation module is used to capture the characteristics of local data by using the RACE kernel density estimation method on the client side and mapping with the locality-sensitive hash function.
[0056] The server-side module for finding optimal weights and conservative values calculates the weights of each client's data based on the data distribution sketch uploaded by the client, and then uses a grid search method to find the minimum conservative value.
[0057] Another object of the present invention is to provide a computer device including a memory and a processor, the memory storing a computer program, which, when executed by the processor, causes the processor to perform the steps of the federated learning non-commutative conformal risk control.
[0058] Another object of the present invention is to provide a computer-readable storage medium storing a computer program that, when executed by a processor, causes the processor to perform the steps of the federated learning non-commutative conformal risk control.
[0059] Another objective of this invention is to provide an information data processing terminal for implementing the federated learning non-commutative conformal risk control algorithm.
[0060] Based on the above technical solutions and the technical problems solved, the advantages and positive effects of the technical solution to be protected by this invention are as follows:
[0061] First, this invention specifically relates to effectively estimating the distribution differences (total variation) of calibration sets and test data from different clients while ensuring data privacy: It proposes a distribution sketching algorithm based on Locality Sensitive Hash (LSH) and RACE kernel density estimation. This algorithm efficiently estimates the data distribution differences between clients through a single traversal of client data and satisfies differential privacy requirements, providing an effective solution for controlling non-commutative conformal risks in federated learning.
[0062] In this invention, the core task of the server in solving for the optimal weights and minimum conservative values is to integrate the distribution sketch information from each client to obtain a higher quality conservative value estimate. Based on the distribution sketches estimated by the clients, the distribution differences among the clients are calculated, and the weights of the calibration set data are set to construct the final prediction set, thereby achieving tighter risk control. Based on the maximum entropy principle and regularized optimization framework, a weight calculation method is proposed: the weight solving problem is transformed into solving an optimization problem. satisfy in It is the entropy function, and β>0 is the temperature parameter. The solution to this problem satisfies This method avoids excessive peaking of the weight distribution while ensuring a small coverage interval.
[0063] In addition, this invention has two other important objectives. First, it provides a computer-readable storage medium storing a computer program. When a processor executes this computer program, it enables the processor to complete the various steps of the federated learning non-commutative conformal risk control algorithm. Second, it provides an information data processing terminal that can be used to implement the aforementioned federated learning non-commutative conformal risk control algorithm.
[0064] This invention provides a non-commutative conformal risk control algorithm for federated learning. Combining the above-mentioned technical solutions and the technical problems solved, the advantages and positive effects of the technical solution protected by this invention are as follows:
[0065] Adapting to data heterogeneity and improving model prediction reliability: This invention employs a sample weighting method based on differences in data distribution. Unlike traditional conformal risk control methods, it considers the differences in data distribution among clients, enabling data from clients with similar distributions to mutually reinforce each other, effectively improving the risk control level of the model's prediction set. In experiments on multiple datasets such as MNIST, FashionMNIST, and MedMNIST, the method of this invention significantly improves prediction accuracy compared to other baseline methods.
[0066] The invention demonstrates superior performance and robustness in scenarios with insufficient data on a single client: its federated learning design offers significant advantages over single-client scenarios with limited data. With limited data on a single client, the calculated conservative values can easily become too large, rendering the resulting prediction set unusable. However, the federated learning framework of this invention allows data with similar distributions to mutually reinforce each other, optimizing the conservative values and minimizing the size of the prediction set, thus making the constructed prediction set practically applicable to production. Furthermore, the method exhibits less fluctuation in risk level, providing more stable and reliable results and demonstrating strong robustness when facing the dual challenges of data heterogeneity and limited data volume in distributed learning.
[0067] In summary, the federated learning non-commutative risk control algorithm provided by this invention has multiple advantages and positive effects. It employs innovative methods in characterizing client-side data distribution and in solving the data point weights and minimum conservative value solution surface on the server, thereby reducing the risk level of the prediction set. Simultaneously, the inclusion of computer-readable storage media and information data processing terminals facilitates the practical application of the algorithm, contributing to the widespread application of federated learning non-commutative conformal risk control in real-world scenarios.
[0068] Secondly, as supplementary evidence of the inventive step of the claims of this invention, it is also reflected in the following important aspects:
[0069] (1) The expected benefits and commercial value of the technical solution of this invention after transformation are as follows:
[0070] In the financial sector, such as credit risk assessment, Fed-Non-X-CRC can improve the accuracy and reliability of assessment models by leveraging data from multiple institutions while protecting customer privacy. This reduces credit risk, saves financial institutions significant potential losses, and attracts more customers, increasing business volume and revenue. In the healthcare sector, for disease diagnosis models, Fed-Non-X-CRC can integrate patient data from multiple hospitals, improving diagnostic accuracy, reducing misdiagnosis rates, enhancing service quality for healthcare institutions, and generating positive word-of-mouth and more patient resources. Its potential applications in multiple high-value areas indicate considerable commercial value.
[0071] (2) The technical solution of this invention fills a technical gap in the industry both domestically and internationally:
[0072] Currently, existing conformal risk control methods, when applied to federated learning, lack the ability to assess the differences in data distribution among clients, failing to accurately identify discrepancies between different clients. This results in the inclusion of data inconsistent with the test point distribution during prediction set construction, leading to an inability to control the risk level of the final prediction set within a given range. The Fed-Non-X-CRC method of this invention uses RACE kernel density estimation technology based on locality-sensitive hashing on the client side to characterize the client data distribution, and employs the maximum entropy criterion and grid search technology on the server side to solve for optimal weights and conservative values. This fills the technological gap in conformal risk control for non-interchangeable data in federated learning, providing a new technical path and solution for this field.
[0073] (3) The technical solution of the present invention solves a technical problem that people have long wanted to solve but have never been able to solve successfully:
[0074] In federated learning, achieving accurate uncertainty estimation and risk control with non-independent and identically distributed data has long been a challenge. Existing methods struggle to characterize the data heterogeneity of different clients and cannot effectively handle the calculation of client weights and conservative values. Fed-Non-X-CRC, through innovative technical methods, successfully solves these problems, realizing a conformal risk control algorithm in the context of non-interchangeable data federated learning, providing a key breakthrough for the development of this field. Attached Figure Description
[0075] Figure 1 This is a comparison result between the present invention and a single client (risk control level = 0.3) provided by the embodiments of the present invention;
[0076] Figure 2 This is a comparison result between the present invention and a single client (risk control level = 0.2) provided by the embodiments of the present invention;
[0077] Figure 3 This is a comparison result between the present invention and a single client (risk control level = 0.1) provided in the embodiments of the present invention;
[0078] Figure 4 This is a comparison result between the present invention and the ordinary CRC algorithm (risk control level = 0.3);
[0079] Figure 5 This is a comparison result between the present invention and the ordinary CRC algorithm (risk control level = 0.2);
[0080] Figure 6 This is a comparison result between the present invention and the ordinary CRC algorithm (risk control level = 0.1);
[0081] Figure 7 This is a flowchart of the federated learning non-commutative conformal risk control algorithm provided in an embodiment of the present invention. Detailed Implementation
[0082] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.
[0083] This invention provides a method for controlling non-commutative conformal risks in federated learning, the method comprising:
[0084] S1, The client calculates a privacy distribution sketch of the local calibration set data, captures the distribution characteristics of the local data, calculates the loss function value for each calibration data point on the client, and captures the loss score used for conformal risk control;
[0085] S2, the server collects a sketch of the calibration data distribution from each client, as well as the loss function value for each client. It then calculates the weight values corresponding to the calibration data from each client and uses a grid search method to solve for the conformal risk control conservative parameters.
[0086] S3, the server distributes conservative value parameters to the corresponding clients, and the corresponding clients use the parameters and conservative values locally to calculate the conformal risk control prediction set.
[0087] The specific steps for the client to calculate the local calibration set data privacy distribution sketch include:
[0088] Initialize a zero matrix to approximate a histogram of the local data distribution;
[0089] Using the RACE method of the repeated count estimator array, a hash function is used to update the zero matrix by mapping the local data one by one, thus obtaining the client's data distribution sketch RACE matrix;
[0090] The client uploads the updated data distribution sketch matrix to the server;
[0091] The client calculates the loss function value of the local calibration set data and uploads it to the server.
[0092] The specific steps for the server to solve for the weight magnitude and the conformal risk control conservative value parameters include:
[0093] Receive a sketch of the client's data distribution and the loss function values;
[0094] The server provides a data distribution sketch and calculates the total variation of the data distribution for each client and the target client.
[0095] The server calculates the weight of each client based on the obtained total variation using the maximum entropy principle.
[0096] The server assigns the required weights, aggregates the loss function values of each client using a weighted average, and uses a grid search method to find the minimum conservative value required to meet the risk control requirements.
[0097] The server distributes the desired conservative value to the target clients.
[0098] The specific steps of the client-side module for calculating the conformal risk control prediction set include:
[0099] The client accepts conservatively valued parameters distributed by the server.
[0100] The client calculates the prediction set for the test points based on the conservative parameter and the loss function value of the local calibration data.
[0101] The client-side module for calculating the data distribution sketch satisfies the corresponding convergence theorem, which provides theoretical support for the client to estimate the data distribution, specifically including:
[0102] Assumptions:
[0103] Assumption 1: It is required that the client datasets D ~ p(x) satisfy independent and identically distributed (i.i.d.), which is a common constraint in federated learning algorithms;
[0104] Theorem content:
[0105] Assuming assumption 1 holds, for the client distribution sketch S, let k(x,y) be a locality-sensitive hash kernel, then... This holds true, meaning that as the client dataset expands, the distribution sketch converges probabilistically to its sum density estimate, with a convergence rate of... R represents the number of hash functions in the distribution sketch; the theorem shows that as the amount of data in the dataset increases, the client model can better capture the characteristics of the local data and effectively adapt to the local data.
[0106] The weights of each client data and the minimum conservative value calculated by the server satisfy the conformal risk control theorem, which proves that the prediction set calculated according to the algorithm of this invention will meet the requirements of conformal risk control.
[0107] The server solves for the minimum conservative value and satisfies the following non-commutative conformal risk control property:
[0108] Assumptions:
[0109] Assumption 2: Suppose that for any The loss function L(λ;(x,y)) is non-increasing with respect to λ and bounded for any λ, which is a basic requirement for general conformal risk control;
[0110] Assume 3 for a single calibration set of data from K clients. For the same k, the data points satisfy an independent pass-through distribution, which simplifies the theoretical analysis;
[0111] Assume a column of weights. The fact that it is independent of the data demonstrates the robustness of the algorithm;
[0112] Theorem content:
[0113] When all four pairs of assumptions hold true, let the risk control level α∈[A,B], and let... and For test points satisfy in Here S k With S k'Let k and k' represent client k and client k', respectively.
[0114] The server module for solving the optimal weights and minimum conservative values satisfies the following conformal risk control property, described in the following text:
[0115] (a) The loss function L(λ;(x,y)) is non-increasing with respect to the conservative value λ, and is bounded for any λ.
[0116] (b) Data within different clients is independent and identically distributed, and there are no requirements regarding the data distribution relationship between different clients;
[0117] (c) Sample weights are independent of the data;
[0118] (d) Under the above assumptions, the risk level of the prediction set of the test data is controlled within the range of a given risk control level plus the sum of the weighted total variation of the data distribution. That is...
[0119]
[0120] The server module for solving weights and conservative values further includes:
[0121] (a) The weights sought are data-independent and do not depend on test and calibration data;
[0122] (b) The optimal weights are obtained by optimizing the following problem based on the maximum entropy principle;
[0123]
[0124] (c) The optimal conservative value is obtained through a grid search on the monotonic function:
[0125] Compute grid Λ at the central end G Weighted average loss
[0126]
[0127] Find using grid search method The infinite boundary is
[0128]
[0129] This invention provides a federated learning non-commutative conformal risk control system based on the federated learning non-commutative conformal risk control method, the system comprising:
[0130] The client-side data distribution sketch calculation module is used to capture the characteristics of local data by using the RACE kernel density estimation method on the client side and mapping with the locality-sensitive hash function.
[0131] The server-side module for finding optimal weights and conservative values calculates the weights of each client's data based on the data distribution sketch uploaded by the client, and then uses a grid search method to find the minimum conservative value.
[0132] This invention provides a computer device, which includes a memory and a processor. The memory stores a computer program, and when the computer program is executed by the processor, the processor performs the steps of the federated learning non-commutative conformal risk control.
[0133] This invention provides a computer-readable storage medium storing a computer program that, when executed by a processor, causes the processor to perform the steps of the federated learning non-commutative conformal risk control.
[0134] This invention provides an information data processing terminal for implementing the federated learning non-commutative conformal risk control algorithm.
[0135] The specific steps for calculating the client distribution sketch provided in this embodiment of the invention include:
[0136] Let the distribution sketch S be a two-dimensional matrix with R rows and B columns. For a given data D, first initialize a zero matrix. and R LSH functions h1,…,h R Here, each hash function h i Generate an integer hash value from the set of integers [B]. And suggest that R is...
[0137] Next, for any x∈D, compute its R hash values {h1(x),…,h...} R (x)}, and finally we take each i∈[R] as a matrix element. Add 1, and finally use |D| to regularize matrix S.
[0138] The specific steps for the server-side to solve for the optimal weights and minimum conservative values based on the client data distribution sketch and loss function values provided in this embodiment of the invention include:
[0139] The server receives data distribution sketch matrices and loss function value grids uploaded from various clients;
[0140] The server calculates the optimal sample weights based on a data distribution sketch.
[0141] The server searches for the minimum conservative value based on the optimal sample weight grid.
[0142] The server returns the minimum conservative value to the client.
[0143] Specifically, in the client, for each client k, k∈[K], compute the privacy distribution sketch S for that client. k Then, the loss function value for each calibration data point on the client is calculated. Here C λ The calculation requires first determining the value of λ. Since the loss function is non-increasing with respect to λ, and finding the optimal λ is a problem of finding a lower bound, a simple iterative method or grid search method can be used to solve it.
[0144] Due to the communication efficiency loss caused by iterative methods, each client calculates the loss value on the grid separately, and then performs a grid search at the central end to solve for the optimal conservative level. Let λ be the value of Λ after meshing. G ={λ1,…,λ N}, where N is the number of grid cells, and λ1≤λ2≤…≤λ N Then each client calculates Λ G loss function value on Where k = 1, ..., K, i = 1, ..., n k ,j=1,…,N.
[0145] The next part is the central computing section, where the central end collects a sketch S of the calibration set distribution from each client. k Test point data distribution S T and the grid of loss functions for each client.
[0146] Next, the weights corresponding to each calibration data are calculated based on the maximum entropy principle. Specifically, the weight sought should be the solution to the following optimization problem.
[0147]
[0148] Compute grid Λ at the central end g Weighted average loss
[0149]
[0150] Next, we will use the grid search method to find... The infinite boundary is
[0151]
[0152] That is what we asked for, and finally return. Send the data to client T and calculate the predicted data point (X). T ,Y T Prediction set on ) The algorithm is complete. This invention provides a non-commutative conformal risk control theorem, which offers theoretical support for risk level control of conformal risk control prediction sets; specifically as follows:
[0153] Assumptions:
[0154] Assumption 2: Suppose that for any The loss function L(λ;(x,y)) is non-increasing with respect to λ and bounded for any λ, which is a basic requirement for general conformal risk control;
[0155] Assume 3 for a single calibration set of data from K clients. For the same k, the data points satisfy an independent pass-through distribution, which simplifies the theoretical analysis;
[0156] Assume a column of weights. The fact that it is independent of the data demonstrates the robustness of the algorithm;
[0157] Theorem content:
[0158] When all four pairs of assumptions hold true, let the risk control level α∈[A,B], and let... and For test points satisfy
[0159] in Here S k With S k' Let k and k' represent client k and client k', respectively.
[0160] The non-commutative conformal risk control prediction set algorithm provided in this embodiment of the invention satisfies the non-commutative conformal risk control theorem, which proves that the risk level of the prediction set calculated by this algorithm can be controlled within a certain range. This ensures the effectiveness and accuracy of the algorithm.
[0161] Another object of the present invention is to provide a computer device including a memory and a processor, the memory storing a computer program that, when executed by the processor, causes the processor to perform the steps of the federated learning non-commutative conformal risk control algorithm.
[0162] Another object of the present invention is to provide a computer-readable storage medium storing a computer program that, when executed by a processor, causes the processor to perform the steps of the federated learning non-commutative conformal risk control algorithm.
[0163] Another objective of this invention is to provide an information data processing terminal for implementing the federated learning non-commutative conformal risk control algorithm.
[0164] Specific implementation of the present invention:
[0165] Federated learning: Federated learning is an advanced distributed machine learning method that allows multiple devices or computing nodes (often called clients) to collaboratively train a global model without sharing their local raw data. Federated learning does not require centralized data storage; clients only need to upload model parameters or update gradients to a central server for aggregation, thus helping to protect data privacy.
[0166] Commutativity: Let and These represent the input and output spaces, respectively. We say that the data distribution... Commutative if and only if For any finite sample And this holds true for any permutation function π.
[0167] Conformal prediction framework: Conformal prediction is a flexible statistical framework designed to quantify the uncertainty of machine learning model predictions with statistical reliability guarantees. Its core idea is to measure the deviation between the prediction and the true value by calculating the non-conformal score of the samples, and to determine the confidence interval or prediction set based on the quantiles of historical data or a calibration set. This method guarantees marginal coverage probability (e.g., the true value falls into the prediction set at 95% confidence) without relying on data distribution assumptions, making it suitable for various tasks such as classification and regression. The advantages of conformal prediction include compatibility with any prediction model (e.g., neural networks, random forests), computational efficiency, and the ability to dynamically adapt to data distribution shifts. It is widely used in scenarios requiring high-confidence decision-making, such as medical diagnosis and financial risk control, providing interpretable and rigorous mathematical guarantees for the uncertainty of model outputs.
[0168] Conformal Risk Control Framework: Conformal Risk Control provides a broader form of uncertainty quantification. Similar to conformal prediction, it still outputs a set of predictions, but it is no longer limited to controlling the frequency of model errors. Instead, it can control various types of risk losses, such as FNR in multi-objective classification tasks and F1-score in text generation and prediction tasks, which are more complex model performance evaluation metrics. This paper will mainly study the relevant content of conformal risk control to adapt to a wider range of application scenarios.
[0169] RACE kernel density estimation: RACE is an efficient kernel density estimator with wide applications in anomaly detection, graph compression, genetic feature analysis, and continuous learning. RACE constructs a two-dimensional matrix using R locality-sensitive hash functions. Each LSH function h i Will The vectors in [B] are mapped to an integer in the set of integers [B]. Given a dataset... For any x∈D, RACE maps it to R distinct hash values. Then, for each i∈[R], we take the elements of matrix A... Add 1. In this way, RACE maintains a matrix where each column can be viewed as a histogram of dataset D. Therefore, we can use matrix A for kernel density estimation and its downstream tasks.
[0170] Distribution sketch convergence theorem:
[0171] Assumptions:
[0172] Assumption 1: It is required that the client datasets D ~ p(x) satisfy independent and identically distributed (i.i.d.), which is a common constraint in federated learning algorithms;
[0173] Theorem content:
[0174] Assuming assumption 1 holds, for the client distribution sketch S, let k(x,y) be a locality-sensitive hash kernel, then... This holds true, meaning that as the client dataset expands, the distribution sketch converges probabilistically to its sum density estimate, with a convergence rate of... R represents the number of hash functions in the distribution sketch. The theorem states that as the amount of data in the dataset increases, the client model can better capture the characteristics of the local data and effectively adapt to the local data.
[0175] Federated Learning Non-commutative Conformal Risk Control Theorem:
[0176] Assumptions:
[0177] Assumption 2: Suppose that for any The loss function L(λ;(x,y)) is non-increasing with respect to λ and bounded for any λ, which is a basic requirement for general conformal risk control;
[0178] Assume 3 for a single calibration set of data from K clients. For the same k, the data points satisfy an independent pass-through distribution, which simplifies the theoretical analysis;
[0179] Assume a column of weights. The fact that it is independent of the data demonstrates the robustness of the algorithm;
[0180] Theorem content:
[0181] When all four pairs of assumptions hold true, let the risk control level α∈[A,B], and let... and For test points satisfy
[0182] in Here S k With S k' Let k and k' represent client k and client k', respectively.
[0183] The non-commutative conformal risk control prediction set algorithm provided in this embodiment of the invention satisfies the non-commutative conformal risk control theorem, which proves that the risk level of the prediction set calculated by this algorithm can be controlled within a certain range. This ensures the effectiveness and accuracy of the algorithm.
[0184] In this invention, the federated learning non-commutative conformal risk control algorithm, based on the appendix... Figure 5 The algorithm steps include:
[0185]
[0186]
[0187] I. Specific application areas or related products of this invention.
[0188] 1. Financial Sector - Credit Risk Assessment System
[0189] In the financial industry, accurate credit risk assessment is crucial. Traditional methods face challenges in handling customer data scattered across different financial institutions, including data privacy protection and the issue of non-independent and identically distributed data. A credit risk assessment system based on Fed-Non-X-CRC effectively integrates multi-source data for model training. Multiple banks or financial institutions act as clients, each possessing extensive data on customer credit records, financial conditions, and other information. Under the Fed-Non-X-CRC framework, each client obtains augmented conservative values from data from other institutions with similar data distributions on the server, constructing a local prediction set. Compared to traditional methods, this not only protects customer data privacy but also improves the accuracy of risk assessment, providing strong support for financial institutions to formulate reasonable credit policies and reducing potential risks in credit operations.
[0190] 2. Medical Field - Disease Diagnosis Assistance Systems
[0191] Medical data is highly sensitive, and data from different hospitals exhibits significant non-independent and identically distributed characteristics. A disease diagnosis assistance system built on Fed-Non-X-CRC enables collaborative utilization of data from multiple hospitals. Multiple hospitals act as clients, each storing a large amount of patient medical records, examination reports, imaging data, etc. Hospitals obtain augmented conservative values from data from other hospitals with similar data distributions obtained from the server, constructing local prediction sets. Ultimately, doctors can use this system to obtain more comprehensive and accurate diagnostic references, improving the accuracy of disease diagnosis, reducing misdiagnosis and missed diagnosis, and providing patients with more reliable medical services.
[0192] 3. Internet of Things (IoT) Field - Equipment Failure Prediction System
[0193] In IoT scenarios, data generated by numerous devices is widely distributed and exhibits non-independent and identically distributed characteristics. Taking industrial equipment failure prediction as an example, an equipment failure prediction system based on federated learning and non-commutative conformal risk control can integrate data from multiple factories or equipment areas. Each factory's equipment acts as a client, collecting operational status data such as temperature, pressure, and vibration. Each factory obtains augmented conservative values from the server, based on data similar to other factories with similar distributions, to construct its local prediction set. In this way, the system can more accurately predict equipment failures, proactively schedule maintenance, reduce equipment downtime, improve production efficiency, and lower enterprise operating costs.
[0194] II. Evidence related to the technical effects obtained by the embodiments of the present invention.
[0195] like Figure 3 To comprehensively and thoroughly evaluate the performance of the Fed-Non-X-CRC (Fed-Non-X-CRC) method for federated learning proposed in this invention, a series of rigorous experiments were meticulously planned and implemented. The specific experimental setup covers several key aspects, including the comparison method, dataset, model, hyperparameters, and experimental environment, as detailed below:
[0196] Experimental environment
[0197] All experiments were run on a Macbook M1 Pro with 32GB of RAM. This hardware configuration provides powerful computing capabilities, ensuring efficient and stable experimentation and minimizing the impact of hardware performance differences on the results. To guarantee the reliability and reproducibility of the results, each experiment was run five times independently, with performance metrics recorded for each run. The final result was presented as the average and standard error of the five runs. Throughout the experiments, strict control was maintained over the consistency of the experimental environment, including the versions of the operating system, deep learning framework, and other relevant dependent libraries, to ensure the accuracy and comparability of the results.
[0198] Comparison Methods
[0199] To accurately measure the advantages of the method of this invention, several representative federated learning datasets and methods were selected for comparison.
[0200] Single-Client Conformal Risk Control Algorithm (Single-Client CRC Algorithm): In practical applications, the client data participating in federated learning may face the problem of insufficient data volume. Furthermore, conformal risk control requires reserving additional step-wise data for model calibration, further exacerbating the data shortage. Therefore, due to the limited amount of data available for calibration from a single client, the optimal conservative value obtained is too high, resulting in an excessively large prediction set and rendering calibration meaningless. Therefore, this paper first demonstrates through experiments that when single-client data is insufficient, combining data from multiple clients can enhance the prediction set coverage of the single client. This demonstrates the necessity of combining conformal risk control with federated learning.
[0201] Fed-Non-X-CRC algorithm without considering data heterogeneity (ordinary CRC algorithm): Compared with conformal risk control algorithm without considering client data heterogeneity, i.e. without considering the differences in data distribution among clients and without considering that each sample has different weights, it helps to demonstrate the unique value of Fed-Non-X-CRC in optimizing model training and convergence.
[0202] Dataset
[0203] Artificially synthesized dataset: In a multivariate multi-objective binary classification logistic regression model, construct a dataset. And there are This indicates that the model has a feature dimension of M and the number of classifiers is M. Where X i From the standard normal distribution They satisfy independent and identically distributed conditions, and coefficient matrix The matrix is an identity matrix, and b = -0.5. We set the total data size to n = 1000, M = 10, and K = 5 clients to evenly and randomly distribute this data, i.e., n1 = n2 = ... = n k =200, of which each client takes 180 data points for model training, and the remaining 20 data points are used to calibrate the model through a conformal risk control algorithm.
[0204] The MNIST dataset, composed of images of handwritten digits, is a classic dataset widely used in machine learning. It contains 70,000 samples, with 60,000 used for training and 10,000 for testing. These images are all 28×28 pixel grayscale images, with each sample corresponding to one of the 10 digits from 0 to 9. The MNIST dataset has a moderate size and relatively simple image structure, making it very suitable as a foundational dataset for initially validating the performance of algorithms on basic image classification tasks.
[0205] The FashionMNIST dataset, also containing 70,000 samples, is consistent in size and partitioning as the MNIST dataset. It's a dataset of images of fashion items, covering 10 different categories such as T-shirts, pants, and shoes. Compared to the MNIST dataset, FashionMNIST's images are more diverse. Although both are 28×28 pixel grayscale images, the feature differences between categories are relatively smaller, increasing the difficulty of classification. This allows for further testing of FedWBA's performance when handling more challenging image data.
[0206] The TissueMNIST dataset: MedMNIST is a large-scale, standardized biomedical image collection similar to MNIST, comprising 12 2D datasets and 6 3D datasets. All images are preprocessed to 28x28 (2D) or 28x28x28 (3D) sizes and come with corresponding classification labels. Covering the main data modalities in biomedical images, MedMNIST is designed for classifying lightweight 2D and 3D images with various data sizes (from 100 to 100,000) and diverse tasks (binary / multiclass, ordered regression, and multi-label). We used the 28x28 Tissue-MNIST dataset, which contains 8 labels and a total sample size of 17,092.
[0207] The SVHN (Street View House Numbers) dataset is a real-world image dataset that can be viewed as similar to MNIST (e.g., the images are small cropped digits), but contains an order of magnitude more labeled data (over 600,000 digit images) and stems from a significantly more difficult, unsolved real-world problem (identifying digits and numbers in natural scene images). SVHN is derived from house numbers in Google Street View images. The dataset contains 32x32 pixel images, each with a sequence of numbers in the center, with a maximum sequence length of 4.
[0208] Construction of Non-Independent and Identically Distributed Data: To simulate the non-independent and identically distributed characteristics of client data in real-world scenarios, the aforementioned datasets underwent special processing. For the MNIST, FMNIST, TissueMNIST, and SVHN datasets, samples with different labels were randomly assigned to clients using a Dirichlet distribution. In this way, experimental datasets with varying degrees of data heterogeneity were constructed, more closely reflecting the data distribution in real-world applications.
[0209] Model selection
[0210] Considering the limitations of client computing power and memory in federated learning, suitable models were selected for different datasets.
[0211] In this multi-task binary classification and logistic regression task on an artificially synthesized dataset, a single-hidden-layer multilayer perceptron (MLP) is employed. This model has a relatively simple structure and low computational cost. The false negative rate (FNR) is used as the risk loss metric.
[0212] MNIST, FMNIST, and TissueMNIST datasets: A multilayer perceptron (MLP) with a single hidden layer is used. This model has a relatively simple structure and low computational cost, yet it can effectively handle image classification tasks on these three datasets. Accuracy is used as the risk loss metric.
[0213] SVHN Dataset: A pre-trained VGG16 model was used for evaluation. Since the experimental images are three-channel (RGB) images, directly calculating the distribution sketch would result in a 3x32x32 dimension for each image, which is too high. Therefore, this experiment extracted the final 1024-dimensional Dense layer output of VGG16 as its data representation, and calculated the distribution sketch based on this 1024-dimensional vector. Because this experiment is a multi-label task, the F1-score was used as the risk loss function, i.e., the harmonic mean of the accuracy and recall of the predicted digit set was used as the risk loss metric.
[0214] Hyperparameter settings
[0215] In the experiment, key hyperparameters were carefully set and adjusted.
[0216] Algorithm and Learning Rate Optimization: The AdaGrad algorithm with momentum is used to determine the learning rate η during federated learning. The AdaGrad algorithm adaptively adjusts the learning rate based on the parameter update frequency, which helps accelerate model convergence and improve training stability. In experiments, multiple sets of tests were conducted on the global learning rate η and the smoothing term λ to prevent the denominator from being zero in the AdaGrad algorithm to determine the optimal parameter combination. For example, η was set to different values such as 0.01, 0.02, and 0.03, and λ was set to 10.-7 10 -8 10 -9 10 -10 By observing the model's performance under different parameter combinations and using different values, the parameter combination with the best overall performance on each dataset was finally selected for the formal experiment.
[0217] Number of hash functions in RACE kernel density estimation: The number of hash functions used for RACE kernel density estimation is set to 8. Extensive preliminary experiments and comparative analyses have shown that this value excels in balancing model performance and computational efficiency. Under different datasets and model configurations, this value effectively estimates the local data distribution.
[0218] Example 1: Comparison Experiment with Single Client / Ordinary CRC Algorithm on Artificially Synthesized Dataset
[0219] In the experimental investigation of this invention, in order to comprehensively evaluate the performance of the proposed method, it was compared with a single-client conformal risk control algorithm and a common CRC algorithm that does not consider the weight of sample points on an artificially synthesized dataset. The risk control levels of 0.1, 0.2 and 0.3 were carefully set for the experiments, and the false negative rate was used as the core metric for the test risk level on the artificially synthesized dataset.
[0220] Under different risk levels (α = 0.1, 0.2, 0.3), the Fed-Non-X-CRC algorithm combining multi-client calibration data... The value is significantly lower than when using only single-client data. The value indicates that the former has a smaller prediction set. As can be seen from the right side of the image, the average risk level per client with a larger prediction set is lower than that of Fed-Non-X-CRC. This is consistent with... The higher the value, the lower the risk level. This aligns with the intuition that the higher the value, the lower the risk level. However, from an overall distribution perspective, the risk level distribution using a single client has a larger variance. In contrast, the Fed-Non-X-CRC algorithm, while ensuring that the risk level is mostly below a given threshold, has a more concentrated distribution, meaning that the prediction set is more stable across multiple rounds of experiments.
[0221] As shown in Table 1 and Figure 1 , 2 As shown in Figure 3, Fed-Non-X-CRC at different α levels The mean is lower than that of the single-client algorithm, and the average empirical risk level reaches the same given risk level as the single-client algorithm, but the former has less fluctuation in risk level.
[0222] Table 1. Experimental results comparing different risk control levels for a single client.
[0223]
[0224]
[0225] With other parameters kept constant, the comparison results of ordinary conformal risk control and the Fed-Non-X-CRC algorithm at risk control levels (α = 0.1, 0.2, 0.3) are shown in Table 2. Figure 4 , 5 As shown in Figure 6, it can be seen that the Fed-Non-X-CRC algorithm estimates the risk level under different risk levels. The value is higher than that of a typical CRC algorithm, which is intuitive because the former considers the weight configuration of different data points to achieve a lower risk level. Under different risk levels, the empirical risk level of the Fed-Non-X-CRC algorithm is below a given threshold, while the ordinary CRC algorithm does not. This demonstrates the effectiveness of the former in setting weights for heterogeneous data distribution.
[0226] Table 2 compares experimental results with the ordinary CRC algorithm under different risk control levels.
[0227]
[0228] Example 2: Comparison Experiment with Ordinary CRC Algorithm on Empirical Dataset
[0229] In the experimental investigation of this invention, in order to comprehensively evaluate the performance of the proposed method, experiments were conducted on several empirical datasets, including MNIST, FMNIST, TissueMNIST, and SVHN, with risk control levels of 0.2 and 0.3 carefully set in the federated learning scenario. The test experience risk level was used as the core metric, and a detailed comparison was made with the conformal risk control method that only uses a single client dataset. The specific experimental results are shown in Tables 2 and 3 below.
[0230] Under different risk control levels, on the three datasets, the empirical risk level of Fed-Non-X-CRC is lower than that of ordinary CRC algorithm. As a trade-off, the mean level of the conservative value λ of Fed-Non-X-CRC algorithm is also higher. In scenarios with strict requirements on risk level, Fed-Non-X-CRC algorithm has certain advantages.
[0231] The experimental results clearly and strongly demonstrate that, on the MNIST, FMNIST, and TissueMNIST datasets and under different risk levels, the test risk level of the method of this invention is significantly improved compared to the comparative methods in each scenario. This fully demonstrates the outstanding effectiveness and significant superiority of the method of this invention in controlling the risk level of the prediction set in federated learning. Table 3 compares the performance of the method with the ordinary CRC algorithm on the MNIST, FMNIST, and TissueMNIST datasets (risk control level = 0.2).
[0232]
[0233] Table 4 compares the performance of the algorithm with that of the standard CRC algorithm on the MNIST, FMNIST, and TissueMNIST datasets (risk control level = 0.3).
[0234]
[0235] The comparison results between the Fed-Non-X-CRC algorithm and the ordinary CRC algorithm on more complex SVHN data are shown in the table below.
[0236] Compared with the ordinary CRC algorithm, the Fed-Non-X-CRC algorithm can control the risk of the prediction set below a given level under different risk control levels, which also demonstrates the effectiveness of the Fed-Non-X-CRC algorithm proposed in this paper.
[0237] Multiple experiments based on the MNIST series datasets and the SVHN dataset show that, on empirical data, the Fed-Non-X-CRC algorithm of this invention can well adapt to the data heterogeneity problem of different clients and successfully control the empirical risk level of different risk loss functions at different levels.
[0238] Table 5 compares the performance of the algorithm with the ordinary CRC algorithm on the SVHN dataset.
[0239]
[0240] Example 3: Ablation Experiment
[0241] This embodiment conducts ablation experiments to deeply analyze the impact of each key component in the Fed-Non-CRC algorithm on model performance, further revealing the characteristics and advantages of the method of this invention. The experimental environment settings are consistent with those described above, and the research is carried out on artificially synthesized datasets, MNIST, FMNIST, TissueMNIST and other datasets.
[0242] The impact of data heterogeneity on algorithms
[0243] We conducted comparative experiments on different algorithms using the following parameters for the Dirichlet distribution: β = 0.1 (representing high heterogeneity), β = 1 (representing moderate heterogeneity), and IID without using the Dirichlet distribution. We set the risk control level α = 0.2 and the performance on different datasets is as follows.
[0244] As the heterogeneity of data among clients increases, the conservative value estimates of both the ordinary CRC algorithm and the Fed-Non-X-CRC algorithm increase. The latter still shows a greater increase in conservative value estimates, thus ensuring that the empirical risk level remains below a given level. This indicates that the Fed-Non-X-CRC algorithm is sensitive to changes in data distribution heterogeneity.
[0245] When the data distribution of each client is IID, both algorithms can guarantee that the empirical risk level is lower than the given level. At this time, the conservative value estimate of the Fed-Non-X-CRC algorithm is slightly higher than that of the ordinary CRC algorithm. When the difference between the two is significantly reduced in the case of high heterogeneity, it indicates that the Fed-Non-X-CRC algorithm is robust in the case of low heterogeneity, which is consistent with the theoretical analysis above.
[0246] Table 6 Ablation experiments showing the magnitude of data heterogeneity (β = 0.1)
[0247]
[0248] Table 7 Ablation experiments showing the magnitude of data heterogeneity (β = 1)
[0249]
[0250]
[0251] Table 8. Ablation experiments (IID case) showing the magnitude of data heterogeneity.
[0252]
[0253] The impact of RACE representation ability on algorithm performance
[0254] In RACE kernel density estimation, the number of hash functions R determines the expressive power of RACE; the larger the R value, the stronger the expressive power, but the higher the computational cost. In an artificially synthesized dataset, with R values of 4, 8, and 16, and a risk control level of 0.3, the experimental results are as follows.
[0255] As the kernel density estimation parameter is improved, the conformal risk control algorithm becomes more conservative in constructing the prediction set, and the empirical risk level also decreases. Furthermore, the standard deviation of the average risk level on different test sets also decreases, indicating that the more accurate the characterization of the data distribution, the higher the stability of the conformal risk control algorithm.
[0256] Table 9 shows the ablation test results for RACE.
[0257]
[0258] The impact of model complexity on algorithm performance
[0259] The performance of the Fed-Non-CRC algorithm is significantly affected by model complexity. In artificially synthesized datasets, the performance of the Fed-Non-X-CRC algorithm deteriorates as the covariate dimension increases from 16 to 32. This is intuitive, as an increase in the dimensionality of the predictor variables leads to increased model complexity, which in turn increases the difficulty of model training. Conformal risk control does not change the quality of the model; it merely "adapts" to the quality of the model. More complex and harder-to-train models tend to have higher conservative prediction values and higher average risk levels.
[0260] When the model complexity is low, the model trained by the federated learning algorithm has a strong predictive ability, resulting in a smaller prediction set constructed by conformal risk control and a relatively lower empirical risk level. However, when the model complexity increases to 64 dimensions, the quality of model training becomes dominant, leading to an excessively large prediction set generated by the conformal risk control algorithm and poor performance of the empirical risk level on the test set.
[0261] Table 9 Ablation Experiment of Model Complexity
[0262]
[0263] It should be noted that embodiments of the present invention can be implemented in hardware, software, or a combination of both. The hardware portion can be implemented using dedicated logic; the software portion can be stored in memory and executed by a suitable instruction execution system, such as a microprocessor or dedicated-design hardware. Those skilled in the art will understand that the above-described devices and methods can be implemented using computer-executable instructions and / or included in processor control code, for example, such code provided on a carrier medium such as a disk, CD, or DVD-ROM, a programmable memory such as read-only memory (firmware), or a data carrier such as an optical or electronic signal carrier. The devices and modules of the present invention can be implemented by hardware circuitry such as very large-scale integrated circuits or gate arrays, semiconductors such as logic chips, transistors, or programmable hardware devices such as field-programmable gate arrays, programmable logic devices, etc., or by software executed by various types of processors, or by a combination of the above-described hardware circuitry and software, such as firmware.
[0264] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any modifications, equivalent substitutions, and improvements made by those skilled in the art within the scope of the technology disclosed in the present invention, and within the spirit and principles of the present invention, should be covered within the scope of protection of the present invention.
Claims
1. A method for controlling non-commutative conformal risk in federated learning, characterized in that, Includes the following steps: Step 1: The client constructs a distribution sketch of the local calibration data based on the locality-sensitive hash function, records the loss function value of each calibration sample, and uploads it to the server; Step 2: The server receives the distribution sketches and loss function values from each client, calculates the total variation distance between the target client and the distributions of the other clients, and determines the data weights of each client based on the maximum entropy principle. Step 3: The server performs a grid search on the weighted total calibration loss to determine the minimum conservative value that satisfies the given risk level. Step 4: The server sends a conservative value to the corresponding client, and the client uses the conservative value in conjunction with the local loss value to generate a conformal risk control prediction set. The process of the client building the distribution sketch in step one includes: a. Initialize the zero matrix as a histogram approximation; b. The calibration samples are sequentially mapped to matrix cells using multiple sets of hash functions and then incrementally counted using the RACE kernel density estimation technique; c. Employing multi-hash combination improves estimation accuracy, enabling the distribution sketch to converge with a logarithmic-square root relation as the number of hash functions increases; RACE kernel density estimation: RACE is an efficient kernel density estimator. RACE uses... A two-dimensional matrix is constructed using locality-sensitive hash functions. Each LSH function Will Vectors in the set are mapped to sets of integers. One of the integers; given a dataset For any RACE maps it to Each has a different hash value; then for each... , matrix elements in Add 1; in this way, RACE maintains a matrix where each column is considered a part of the dataset. The histogram.
2. The method as described in claim 1, characterized in that, In step two, when the server determines the data weights, it minimizes the weighted sum of the total variation of the distributions of each client and the target client, and introduces an entropy regularization term to improve the uniformity of the weight distribution.
3. The method as described in claim 1, characterized in that, In step three, the server constructs a discrete grid within the monotonically bounded loss function domain, calculates the weighted average loss point by point, and selects the conservative value that ensures the risk level does not exceed a preset threshold for the first time as the minimum conservative value.
4. A federated learning non-commutative conformal risk control system, characterized in that, include: The client module is used to perform the distribution sketch construction and local loss calculation as described in claim 1, and to generate a prediction set based on the conservative values sent by the server. The server module is used to perform the data weight calculation as described in claim 2 and the conservative value search as described in claim 3, and to send the results to the client. The communication module is used to transmit distribution sketches, loss values, weights, and conservative values between the client and the server.
5. The system as described in claim 4, characterized in that, The client module includes a processor, memory, and a communication interface. The processor executes instructions in memory to generate a distribution sketch, calculate the loss value, and form a prediction set.
6. The system as described in claim 4, characterized in that, The server module includes a processor, memory, and a network interface. The processor executes instructions in memory to calculate the total variation distance, solve for the maximum entropy weights, perform grid search, and distribute conservative values.
7. The system as described in claim 4, characterized in that, The communication module uses an end-to-end encrypted channel to transmit the distribution sketch and loss value to prevent unauthorized access and ensure data privacy and security.
8. A computer-readable storage medium storing computer program instructions that, when executed by a processor, cause a computer to perform the method of claim 1.
9. A computer program product, comprising a carrier and program instructions stored on the carrier, wherein the instructions, when executed by a processor, cause the program to run according to the method steps of claim 1.
Citation Information
Patent Citations
Method and device for constructing cross-island heterogeneous federated learning system based on homomorphic encryption
CN117892322A
Privacy protection heterogeneous federal learning method with Byzantine robustness
CN120257362A