Dynamic pruning verification method and device for gradient reconstruction contribution degree evaluation
Through the dynamic pruning verification method, gradient reconstruction and weight sampling technology are used to solve the problem of high computational complexity and time-consuming of contribution evaluation in federated learning, achieving efficient and fair contribution evaluation, and shortening the single-round verification time.
Patent Information
- Application Number
- CN202510582602.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-07
- Publication Date
- 2025-08-19
AI Technical Summary
In federated learning, existing methods are computationally complex and time-consuming when evaluating contributions to each participant, especially in large-scale environments and are not ideal for evaluation.
Through the dynamic pruning verification method, gradient reconstruction and weight sampling technology are used to shorten the single-round verification time, dynamically adjust the difficulty of the verification set sample, reduce the number of verifications, and improve the evaluation efficiency.
It has achieved a significant shortening of single-round verification time while maintaining evaluation accuracy, improving the evaluation speed, and improving the diversity and fairness of evaluation methods.
Smart Images

Figure CN120508787A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the fields of federated learning and statistics, and in particular relates to a dynamic pruning verification method and device for gradient reconstruction contribution evaluation. Background Art
[0002] In today's era of artificial intelligence, data is the raw material for AI algorithms and training. High-quality, large amounts of diverse data can significantly improve the accuracy and efficiency of AI models. In areas such as image recognition and natural language processing, sufficient training data enables AI to reach or even exceed human performance in specific tasks. However, smaller businesses often lack sufficient data for appropriate training, so they need to use the data of others. Due to the reproducibility and susceptibility of data to leakage, experts have proposed federated learning, a distributed machine learning method designed to address data silos and privacy protection issues. Under the federated learning framework, data does not have to leave its respective device or organization (i.e., "data does not leave the domain"), but instead the algorithm is sent to the location of the data for training. This means that multiple participants can jointly train a global model without directly sharing the original data.
[0003] However, in a federated learning system, measuring the contribution of each participant is a critical and complex challenge. A scientific and fair contribution measurement system can incentivize participation and data sharing, ensure sustained collaboration, optimize resource allocation, and prevent individuals from engaging in strategic behavior. Unfair measurement methods can severely undermine participation, leaving participants with significant contributions without proper rewards. Furthermore, they can encourage some individuals to engage in strategic behavior to gain undue advantage.
[0004] The Shapley value is a method used in cooperative game theory to fairly distribute the benefits of cooperation. It determines each player's share of the benefits based on their marginal contribution to all possible cooperative combinations. While the Shapley value is a classic fair distribution method that exhibits certain advantages in assessing participant contributions, its high computational complexity makes it difficult to directly apply, particularly in large-scale federated learning environments. To address this issue, previous research has explored approximate Shapley value calculation methods. For example, Monte Carlo methods generate a large number of random samples to simulate system states or processes, thereby estimating the statistical properties of the parameters or outcomes of interest, such as the expected value and variance. Other methods reduce the overall computational effort by truncating some of the computations. However, these methods either sacrifice estimation accuracy or are not ideal for handling dynamic participants. Furthermore, calculations based on the Shapley value often require retraining the model, which is unacceptable in large-scale federated learning environments. Related research suggests using gradients to reconstruct the model, avoiding the significant waste of resources required to train the model from scratch. While gradient reconstruction solves the problem of model retraining, existing experiments have shown that Shapley-based multi-party contribution calculation consumes a significant amount of time during model performance verification. This is because gradient aggregation-based methods such as Mutil Rounds Reconstruction (MR) require 2^N verifications of the validation set (where N is the number of clients) per round of contribution calculation. Existing methods reduce the number of evaluations through sampling, but further accelerating this verification process remains an open question. Summary of the Invention
[0005] In response to the shortcomings of the existing technology, the present invention provides a dynamic pruning verification method and device for gradient reconstruction contribution evaluation. This method shortens the single-round verification time through dynamic pruning while fitting the original accuracy.
[0006] The present invention is achieved through the following technical solutions:
[0007] A dynamic pruning verification method based on gradient reconstruction contribution evaluation, the method comprising the following steps:
[0008] (1) The server and the client establish a connection, and the server sends the global model M (t) Send it to each client to make;
[0009] (2) Using local data to analyze the model M (t) Perform corresponding training; after one local training round, calculate the updated gradient Δ of the model i ;
[0010] (3) Update the client's gradient and upload it to the server;
[0011] (4) By weighting the gradients {Δ i} Perform gradient aggregation to obtain the next round of model M sent to the customer (t+1) ;
[0012] (5) Based on all the gradients uploaded by all parties, a total of 2 n sub-models, and verify these sub-models in turn;
[0013] (6) Based on the contribution of each round, a weighted operation is performed to obtain the final contribution value of each client in this training.
[0014] Furthermore, the step (5) specifically includes the following sub-steps:
[0015] (5.1) Obtain the samples that actually need to be verified from the dynamic pruning verification set;
[0016] (5.2) Validate the sub-model on the pruned validation set to obtain its validation metrics; and collect the validation results and confidence levels.
[0017] (5.3) Finally, through verification, we can get 2 n Verification indicators are calculated, and then the contribution of each party in this round is measured. Steps (1) to (5) are repeated until all training rounds are completed.
[0018] Furthermore, the step (5.1) specifically includes the following sub-steps:
[0019] (5.1.1) Determine whether the conditions for starting the dynamic validation set have been met; that is, whether the amount of judgment information collected has reached a certain number of rounds. If not, return the full validation set data; otherwise, proceed to step (5.1.2);
[0020] (5.1.2) Obtaining a sampling ratio based on the number of gradients of the combination of the sub-models, wherein the number of gradients of the combination of the sub-models is negatively correlated with the size of the sampling ratio;
[0021] (5.1.3) Based on the deviation between the predicted results and the true value of each sample in the previous rounds, select the samples that are correct in these rounds and mark them as easy verification samples, and mark the other samples as difficult verification samples.
[0022] (5.1.4) For samples marked as simple verification samples, obtain their confidence in the most recent round, which is generated by the SoftMax function during classification; through function transformation, samples with small confidence have a high selection rate in weight-based sampling; and a sampling ratio of 10% to 30% is used to extract some samples from the simple verification samples to form a regression sample subset.
[0023] (5.1.5) Combine the regression sample subset and the difficult samples to form a pruned validation set.
[0024] Furthermore, the step (5.2) is specifically as follows:
[0025] (5.2.1) Obtain information about the sub-model’s validation on the pruned validation set, including whether the judgment for each sample is correct and the confidence level for each sample judgment;
[0026] (5.2.2) Traverse the original full validation set. If the sample exists in the pruned validation set, add its validation set result and confidence score to the dynamic validation set. If not, it means that the sample is a simple validation sample that was pruned. Set its validation result to correct and multiply the confidence score of the sample in the previous round by the decay coefficient β to increase the probability of being selected as a regression sample in the next round. Add the judgment result and confidence score of the sample in the simulated round to the record until all sample records are completed.
[0027] (5.2.3) Check whether the number of result record rounds is greater than the set value. If not, end directly. Otherwise, delete the earliest record to meet the requirements.
[0028] Specifically, the contribution of each party in this round is calculated in step (5.3), and its expression is as follows:
[0029]
[0030] where φ i represents the contribution of client i, C is a scaling constant, N represents the set with all clients, N\{i} represents the set remaining after removing client i from the full set; S is a subset of N\{i}, M S represents the model obtained by aggregating the gradients of the set S, U represents the utility function, and n is the total number of clients.
[0031] The second aspect of the present invention is a dynamic pruning verification device for gradient reconstruction contribution evaluation, which includes the following modules:
[0032] Model module: The server and client establish a connection, and the server sends the global model M (t) Send it to each client to make;
[0033] Local training module: Use local data to train the model M (t) Perform corresponding training; after one local training round, calculate the updated gradient Δ of the model i ;
[0034] Upload gradient module: Update the gradient of the client and upload it to the server;
[0035] Aggregation model module: Aggregate the gradients {Δ i} Perform gradient aggregation to obtain the next round of model M sent to the customer (t+1) ;
[0036] Contribution calculation module: Based on all the gradients uploaded by all parties, the total number of combinations created is 2 n sub-models, and verify these sub-models in turn;
[0037] Weighted operation module: Perform weighted operations based on the contribution of each round to obtain the final contribution value of each client in this training.
[0038] The third aspect of the present invention is an electronic device, comprising:
[0039] one or more processors;
[0040] a memory for storing one or more programs;
[0041] When the one or more programs are executed by the one or more processors, the one or more processors implement the dynamic pruning verification method for gradient reconstruction contribution evaluation.
[0042] The fourth aspect of the present invention: A computer-readable storage medium having computer instructions stored thereon, which, when executed by a processor, implement the steps of the dynamic pruning verification method for gradient reconstruction contribution evaluation.
[0043] The beneficial effects of the present invention are as follows:
[0044] Compared to traditional federated learning contribution assessment methods, this method utilizes Shapley values to ensure fairness and rationality, introduces gradient reconstruction to avoid model retraining, and dynamically prunes the validation dataset to reduce the time required for a single assessment, further accelerating the assessment process. Furthermore, by adjusting the weights of samples of different difficulty levels in the contribution assessment, the evaluation method can be diversified, facilitating comparative analysis of data quality. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0046] Figure 1 It is the overall flow chart of the present invention;
[0047] Figure 2 Generate a schematic diagram for the dynamic pruning validation set of the present invention;
[0048] Figure 3 This is a schematic diagram of the dynamic verification set adjustment of the present invention. DETAILED DESCRIPTION
[0049] Exemplary embodiments are described in detail herein, with examples illustrated in the accompanying drawings. When the following description refers to the drawings, identical numerals in different drawings represent identical or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all embodiments consistent with this application.
[0050] The terms used in this application are for the purpose of describing specific embodiments only and are not intended to limit this application. As used in this application and the appended claims, the singular forms "a," "an," "the," and "the" are intended to include the plural forms, unless the context clearly indicates otherwise. It should also be understood that the term "and / or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
[0051] The server referred to in this invention is the aggregation end of the model, and the client is the training end with local data.
[0052] like Figure 1-3 As shown, the present invention discloses a dynamic pruning verification method for gradient reconstruction contribution evaluation, which specifically includes the following steps:
[0053] There are n participants in total. The following is a detailed explanation of the technical solution through a classification model.
[0054] (1) Model distribution: The server and client establish a connection, and the server sends the global model M (t) Send it to each client to make;
[0055] (2) Local training: Use local data to train the model M (t) Perform corresponding training; after one local training round, calculate the updated gradient Δ of the model i ;
[0056] (3) Upload gradient: Update the gradient of the client and upload it to the server;
[0057] (4) Aggregation model: Aggregate the gradients {Δ i} Perform gradient aggregation to obtain the next round of model M sent to the customer (t+1) ;
[0058] (5) Contribution calculation: Based on all the gradients uploaded by each party, the total number of combined creations is 2 n These sub-models are verified in turn.
[0059] (5.1) Obtain the samples that need to be verified from the dynamic pruning verification set. This process is as follows Figure 2 shown.
[0060] (5.1.1) Determine whether the conditions for starting the dynamic verification set have been met, such as whether the amount of judgment information collected has reached a certain number of rounds. If not, return the full verification set data. Otherwise, proceed to step (5.1.2)
[0061] (5.1.2) The sampling ratio is obtained based on the number of gradients of the combination of the sub-models. Generally speaking, the more gradients of the combined sub-models, the smaller the sampling ratio.
[0062] (5.1.3) Based on the deviation between the predicted results and the true value of each sample in the previous rounds, select the samples that are correct in these rounds and mark them as easy verification samples, and mark the other samples as difficult verification samples.
[0063] (5.1.4) For samples marked as simple validation samples, we obtain their confidence scores for the most recent round, generated by the SoftMax function during classification. This function transformation ensures that samples with low confidence scores have a higher probability of being selected in weighted sampling. A subset of samples is drawn from the simple validation samples at a sampling ratio of 10% to 30% to form the regression sample subset.
[0064] (5.1.5) Combine the regression sample subset and the difficult samples to form a pruned validation set.
[0065] (5.2) The sub-model is validated on the pruned validation set to obtain its validation indicators, such as accuracy. The validation results and confidence levels are collected. The collection process is as follows: Figure 3 shown.
[0066] (5.2.1) Obtain information about the sub-model’s validation on the pruned validation set, including whether the judgment on each sample is correct or not and the confidence level of each sample’s judgment.
[0067] (5.2.2) Traverse the original full validation set. If the sample exists in the pruned validation set, add its validation set result and confidence score to the dynamic validation set. If not, it means that the sample is a simple validation sample that was pruned. Its validation result can be set to correct. The confidence score of the sample in the previous round is multiplied by the decay coefficient β to reduce the confidence in this result, so that it has a higher probability of being selected as a regression sample in the next round. The judgment result and confidence score of the sample in the simulated round are added to the record until all sample records are completed.
[0068] (5.2.3) Check whether the number of result record rounds is greater than the set value. If not, end directly. Otherwise, delete the earliest record to meet the requirements.
[0069] (5.3) Finally, through verification, we can get 2 n Verification indicators are calculated according to the following formula to obtain the contribution of each party in this round. Repeat steps (1) to (5) until all training rounds are completed. The formula is as follows:
[0070]
[0071] where φ i represents the contribution of client i, C is a scaling constant, N represents the set with all clients, N\{i} represents the set remaining after removing client i from the full set; S is a subset of N\{i}, M S represents the model obtained by aggregating the gradients of the set S, U represents the utility function (usually measured by accuracy), and n is the total number of clients.
[0072] (6) Based on the contribution of each round, a weighted operation can be performed to obtain the final contribution value of each client in this training.
[0073] The present invention also provides a dynamic pruning verification device for gradient reconstruction contribution evaluation, which includes the following modules:
[0074] Model module: The server and client establish a connection, and the server sends the global model M (t) Send it to each client to make;
[0075] Local training module: Use local data to train the model M (t) Perform corresponding training; after one local training round, calculate the updated gradient Δ of the model i ;
[0076] Upload gradient module: Update the gradient of the client and upload it to the server;
[0077] Aggregation model module: Aggregate the gradients {Δ i} Perform gradient aggregation to obtain the next round of model M sent to the customer (t+1) ;
[0078] Contribution calculation module: Based on all the gradients uploaded by all parties, the total number of combinations created is 2 n sub-models, and verify these sub-models in turn;
[0079] Weighted operation module: Perform weighted operations based on the contribution of each round to obtain the final contribution value of each client in this training.
[0080] The present invention further provides an electronic device comprising: one or more processors; a memory for storing one or more programs; wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the dynamic pruning and verification method for gradient reconstruction contribution evaluation. Furthermore, a computer-readable storage medium is provided, on which computer instructions are stored, which, when executed by the processor, implement the steps of the dynamic pruning and verification method for gradient reconstruction contribution evaluation.
[0081] Those skilled in the art will readily conceive of other embodiments of the present application after considering the specification and practicing the contents disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present application that follow the general principles of this application and include common knowledge or customary techniques in the art that are not disclosed in this application.
[0082] It will be understood that the present application is not limited to the exact construction that has been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof.
Claims
1. A dynamic pruning verification method for gradient reconstruction contribution evaluation, characterized in that: The method comprises the following steps: (1) The server and the client establish a connection, and the server sends the global model M (t) Send it to each client to make; (2) Using local data to analyze the model M (t) Perform corresponding training; after one local training round, calculate the updated gradient Δ of the model i ; (3) Update the client's gradient and upload it to the server; (4) By weighting the gradients {Δ i } Perform gradient aggregation to obtain the next round of model M sent to the customer (t+1) ; (5) Based on all the gradients uploaded by all parties, a total of 2 n sub-models, and verify these sub-models in turn; (6) Based on the contribution of each round, a weighted operation is performed to obtain the final contribution value of each client in this training.
2. A dynamic pruning verification method for gradient reconstruction contribution evaluation according to claim 1, characterized in that: The step (5) includes the following sub-steps: (5.1) Obtain the samples that actually need to be verified from the dynamic pruning verification set; (5.2) Validate the sub-model on the pruned validation set to obtain its validation metrics; and collect the validation results and confidence levels. (5.3) Finally, through verification, we can get 2 n Verification indicators are calculated, and then the contribution of each party in this round is measured. Steps (1) to (5) are repeated until all training rounds are completed.
3. A dynamic pruning verification method for gradient reconstruction contribution evaluation according to claim 1, characterized in that: The step (5.1) is specifically as follows: (5.1.1) Determine whether the conditions for starting the dynamic validation set have been met; that is, whether the amount of judgment information collected has reached a certain number of rounds. If not, return the full validation set data; otherwise, proceed to step (5.1.2); (5.1.2) Obtaining a sampling ratio based on the number of gradients of the combination of the sub-models, wherein the number of gradients of the combination of the sub-models is negatively correlated with the size of the sampling ratio; (5.1.3) Based on the deviation between the predicted results and the true value of each sample in the previous rounds, select the samples that are correct in these rounds and mark them as easy verification samples, and mark the other samples as difficult verification samples. (5.1.4) For samples marked as simple verification samples, obtain their confidence in the most recent round, which is generated by the SoftMax function during classification; through function transformation, samples with small confidence have a high selection rate in weight-based sampling; and a sampling ratio of 10% to 30% is used to extract some samples from the simple verification samples to form a regression sample subset. (5.1.5) Combine the regression sample subset and the difficult samples to form a pruned validation set.
4. A dynamic pruning verification method for gradient reconstruction contribution evaluation according to claim 1, characterized in that: The step (5.2) is specifically as follows: (5.2.1) Obtain information about the sub-model’s validation on the pruned validation set, including whether the judgment for each sample is correct and the confidence level for each sample judgment; (5.2.2) Traverse the original full validation set. If the sample exists in the pruned validation set, add its validation set result and confidence score to the dynamic validation set. If not, it means that the sample is a simple validation sample that was pruned. Set its validation result to correct and multiply the confidence score of the sample in the previous round by the decay coefficient β to increase the probability of being selected as a regression sample in the next round. Add the judgment result and confidence score of the sample in the simulated round to the record until all sample records are completed. (5.2.3) Check whether the number of result record rounds is greater than the set value. If not, end directly. Otherwise, delete the earliest record to meet the requirements.
5. A dynamic pruning verification method for gradient reconstruction contribution evaluation according to claim 2, characterized in that: The contribution of each party in this round is calculated in step (5.3), and its expression is as follows: where φ i represents the contribution of client i, C is a scaling constant, N represents the set with all clients, N\{i} represents the set remaining after removing client i from the full set; S is a subset of N\{i}, M S represents the model obtained by aggregating the gradients of the set S, U represents the utility function, and n is the total number of clients.
6. A dynamic pruning verification device for gradient reconstruction contribution evaluation, characterized in that: The device includes the following modules: (1) Model module: The server and client establish a connection, and the server sends the global model M (t) Send it to each client to make; (2) Local training module: Use local data to train the model M (t) Perform corresponding training; after one local training round, calculate the updated gradient Δ of the model i ; (3) Upload gradient module: Update the gradient of the client and upload it to the server; (4) Aggregation model module: Aggregate the gradients {Δ i } Perform gradient aggregation to obtain the next round of model M sent to the customer (t+1) ; (5) Contribution calculation module: Based on all the gradients uploaded by each party, the total number of combinations created is 2 n sub-models, and verify these sub-models in turn; (6) Weighted operation module: Based on the contribution of each round, a weighted operation is performed to obtain the final contribution value of each client in this training.
7. An electronic device, characterized in that: include: one or more processors; a memory for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the dynamic pruning verification method for gradient reconstruction contribution evaluation as described in any one of claims 1 to 5.
8. A computer-readable storage medium having computer instructions stored thereon, characterized in that: When the instruction is executed by the processor, the steps of the dynamic pruning verification method for gradient reconstruction contribution evaluation as described in any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Federal learning excitation method based on cooperation Sharpley value
CN115965092A
Intelligent Parkinson disease assessment method and system based on federal learning model
CN118629632A