A federated data valuation method based on influence pruning sampling
By employing the Shapley value approximation algorithm based on influence pruning sampling, client combinations with low influence are pruned, and only combinations with high influence are sampled. This solves the problem of high efficiency and accuracy in data estimation in federated learning and is suitable for large-scale federated scenarios.
Patent Information
- Application Number
- CN202411950043.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-27
- Publication Date
- 2025-12-19
- Estimated Expiration
- 2044-12-27
AI Technical Summary
In existing federated learning, sampling-based data estimation methods cannot simultaneously achieve high efficiency and accuracy, and fail to fully consider the impact of different dataset combinations on the approximate results, resulting in low sampling efficiency and inaccurate evaluation.
A Shapley value approximation algorithm based on influence pruning sampling is adopted. By pruning client combinations with low influence and sampling only combinations with high influence, a hierarchical sampling strategy is designed to calculate the marginal contribution of clients to approximate the Shapley value, thereby reducing the number of samples and improving computational efficiency.
It achieves a significant reduction in time overhead with small approximation errors, ensuring computational efficiency and accuracy, and is suitable for data estimation in large-scale federated scenarios.
Smart Images

Figure CN119886388B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the field of federal data valuation, and relates to a problem of evaluating values of data of multiple data owners in a federal learning scene, in particular to a federal data valuation method based on influence pruning sampling. BACKGROUND
[0002] As a new paradigm of distributed machine learning, federated learning can utilize datasets across multiple data owners without directly accessing the raw data. However, data owners may be reluctant to share high-quality datasets unless the value of their datasets is fairly measured to ensure they receive appropriate compensation. Therefore, how to fairly and efficiently perform data valuation has become a problem to be solved in federated learning.
[0003] Shapley value is a classic concept for measuring the contribution of each party in cooperation, and is considered as a standard data valuation indicator for federated learning in previous work because it uniquely satisfies several basic fairness properties. However, due to the necessity of training and evaluating federated models on an exponential number of dataset combinations, Shapley value-based data valuation is widely considered to be computationally prohibitive. Therefore, researchers have designed a series of approximation algorithms with efficiency as a core issue. Existing solutions mainly fall into two categories: the first category is gradient-based approximation, which utilizes gradients to construct federated models during the training process, thereby avoiding additional training processes. Although these solutions significantly improve computational efficiency, they lack precision guarantees, reducing their practicality. The second category is sampling-based approximation, which selects a small number of combinations from all possible dataset combinations to train and evaluate federated models. Recently, more research has advocated sampling-based methods because they can flexibly trade off between precision and efficiency.
[0004] However, existing sampling-based approximations still fail to achieve both high efficiency and accuracy, with the main limitation being the failure to adequately consider the differential impact of different dataset combinations on approximation results. This oversight not only leads to low sampling efficiency, but also makes it difficult to achieve accurate and reliable evaluation through a small number of high-impact samples. This problem highlights the need to more finely utilize the influence of different dataset combinations on Shapley value when designing sampling strategies to improve the overall performance of sampling.
[0005] In summary, Shapley value has ideal fairness and has therefore been advocated as a standard measurement indicator for federated data valuation. However, due to the high computational overhead of Shapley value, and the failure of existing approximation solutions to achieve both high precision and efficiency, its practical application is difficult to realize. SUMMARY
[0006] To address the problems of existing technologies, this invention focuses on data valuation in federated learning scenarios and proposes a federated data valuation method based on influence pruning sampling. It employs a Shapley value calculation scheme based on marginal contribution and designs an influence pruning sampling-based Shapley value approximation algorithm. This method prunes client combinations with low influence while sampling combinations with high influence, achieving the effect of estimating Shapley values with a "few but high-quality" sample. It has the advantage of significantly reducing time overhead with a small approximation error, enabling fair and efficient data valuation for all participants in federated learning.
[0007] This invention relates to a federal data valuation method based on influence pruning sampling, the specific steps of which are as follows:
[0008] Step 1: The server prepares the test set T, and each client provides the dataset {D1, D2, ..., D}. n The server sets the utility function U(·) to the model accuracy, and determines the total number of sampling rounds γ and the total number of sampling layers k. * +1, will be higher than k * Low-impact combination pruning at +1 level; and in the γ round sampling, empty client combinations at level 0 must be sampled.
[0009] The above Let n be the set of natural numbers; n be the total number of clients; and j be the number of clients in a certain layer combination.
[0010] Step 2: For Layer 0, the server initializes the federated model. And evaluate directly on the test set T, and obtain the accuracy. As an empty client combination The utility
[0011] Step 3: For the kth digit (k=1,2,…,k) * Layer, the server selects all client combinations S k S k The number of samples is |S k |;Previous k * The total number of samples in the layer is
[0012] Step 4: For the k-th * +1 layer, the server randomly selects a subset of client combinations. Will Let p be the sample size, and |p| be the sample size. |p| should not exceed p.
[0013] Step 5: For the first to kth... * +1 layer, i.e., k = 1, 2, ..., k* +1, repeat steps 6 to 7 to perform federated global model training and evaluation on the sampled samples, and calculate the marginal contribution.
[0014] Step 6: For each combination S of the k-th layer sampling k , the server and the clients in S jointly perform federated global model training; then, the server evaluates the model M S on the test set T to obtain the accuracy acc(M S , T), which is taken as the utility U(M S ) of the combination S of clients. S
[0015] Step 7: For each combination S of the k-th layer sampling k , the server calculates the marginal contribution U(M S ) - U(M S\{i} ) of each client i in S to the combination S; S\{i} is the subset obtained by removing client i from the combination S; and U(M S\{i} ) is the utility of the combination S after removing client i.
[0016] Step 8: The server calculates the marginal contribution of each client under different combinations, and then averages the marginal contribution of each layer to obtain the approximate Shapley value
[0017] The present application has the following advantages:
[0018] 1. The federated data valuation method based on influence pruning sampling of the present application ensures that the client combination is reasonably sampled according to its influence by means of the ingenious design of the hierarchical sampling method for approximate Shapley value calculation, so that the sample quantity is small while the influence is high, which not only reduces the approximation error, but also efficiently completes the calculation, and is applicable to large-scale federated scenarios.
[0019] 2. The federated data valuation method based on influence pruning sampling of the present application designs an influence pruning sampling method, which makes the approximate calculation of the Shapley value accurate and efficient.
[0020] 3. Compared with the method of accurately calculating the Shapley value, the federated data valuation method based on influence pruning sampling of the present application greatly reduces the time overhead, making it more practical when dealing with large-scale data or complex federated learning models; at the same time, compared with other existing approximate calculation methods, the method effectively reduces the calculation error on the basis of reducing the calculation complexity, ensuring the reliability and stability of the federated data valuation result. BRIEF DESCRIPTION OF DRAWINGS
[0021] Figure 1 A system framework diagram of a federated data valuation method based on influence pruning sampling of the present application is shown in the figure.
[0022] Figure 2 An approximate Shapley value calculation example diagram in the federated data valuation method based on influence pruning sampling of the present application is shown in the figure. DETAILED DESCRIPTION
[0023] The present application will be further described in detail below with reference to the accompanying drawings.
[0024] The federated data valuation method based on influence pruning sampling of the present application has a whole system framework as shown in the figure. Figure 1 The server is responsible for coordinating each client, including pruning sampling, organizing federated learning, and evaluating data value, while the client mainly cooperates with the server to contribute data for local model training.
[0025] The federated data valuation method based on influence pruning sampling of the present application includes the following steps:
[0026] Step 1: The model user provides a test set T (different from the source of the training data set) to the server, and each client provides a training data set {D1, D2, …, Dn}. n The server sets the utility function U(·) as the accuracy of the federated global model (the global model on the server in federated learning), and determines the total sampling round number γ. The total sampling round number γ can be used to balance the accuracy and efficiency. Generally, the larger the γ, the smaller the approximation error and the larger the time overhead.
[0027] Since calculating the Shapley value needs to evaluate all possible client combinations, the combinations can be layered according to their sizes, as shown in the figure. Figure 2 The size of each layer from small to large is a rhombus, and taking 3 clients as an example, the combination of the 0th layer only has the empty combination; the combination of the 1st layer includes {1}, {2}, and {3}; the combination of the 2nd layer is {1, 2}, {1, 3}, and {2, 3}; and the combination of the 3rd layer is {1, 2, 3}. Among them, the number of clients in each client combination of the kth layer (i.e., the size of the combination) is k, and the kth layer contains combinations of clients, i.e., the number of schemes of selecting k clients from n clients. However, the influence of the single client combination of the upper layer on the Shapley value is smaller, so only the k * +1 layer at the bottom is sampled, and the low-influence combinations higher than the k * +1 layer are pruned. The calculation formula of k * is as follows:
[0028]
[0029] In the above formula, Let be the set of natural numbers; n be the total number of clients; and j be the number of clients in a given layer combination. It is important to note that in the γth round of sampling, the empty client combination at layer 0 must be sampled. Otherwise, the marginal contribution cannot be calculated.
[0030] Step 2: For Layer 0, the server initializes the federated model. The accuracy is obtained by directly evaluating the results on the test set T. Use it as an empty client combination The utility
[0031] In step 3, since the first k * The client combination of the layer has the most significant impact on the Shapley value, so it is necessary to sample all of them.
[0032] Step 3: For the kth digit (k=1,2,…,k) * At the layer, the client combination has the highest influence, therefore the server selects all possible client combinations S. k (i.e., all samples), where S k The number of samples is |S k For the k-th layer, the number of samples is... Then the first k * The total number of samples in the layer is
[0033] Step 4: For the k-th * With a layer of +1, the influence of client combinations weakens, therefore the server randomly selects a subset of client combinations. (i.e., partial sampling), for ease of representation, will be... Let P be the sample size. The sample size of P is |P|, and |P| should not exceed [a certain value].
[0034] To ensure fairness, at the k-th... * In the client combination P selected at layer +1, all clients must appear and appear the same total number of times, i.e. j∈N,∑ S∈P I[i∈S]=∑ S∈P I[j∈S]. Where I is an indicator function that returns 1 if the condition is true, and 0 otherwise; ∑ S∈P I[i∈S] represents the number of times client i appears in the sample set P.
[0035] exist Figure 2 In the embodiment shown, the number of clients n = 4, the total number of sampling rounds γ = 9, therefore k * =1, the number of samples in layer 0 and layer 1 is The number of samples in the second layer is The combination of the 3rd layer and the 4th layer is pruned. The specific sampling results of steps 3 to 4 are: the sample set S1 of the 1st layer = {{1}, {2}, {3}, {4}}, and the sample set S2 of the 2nd layer = {{1, 2}, {1, 4}, {2, 3}, {3, 4}}.
[0036] Step 5: For the 1st to k * +1 layer, i.e. k = 1, 2, …, k * +1, repeat steps 6 to 7 to perform federated global model training and evaluation on the sampled samples, and calculate the marginal contribution.
[0037] Step 6: For each combination S ∈ S of the kth layer sampling k , perform federated global model training together with the server and the clients in S.
[0038] First, the server issues the federated global model to all clients in the kth layer, and each client uses the local data set D i to perform federated global model training, and uploads the updated federated global model back to the server.
[0039] Subsequently, the server performs federated learning on all the federated global models uploaded by the clients using the classic FedAvg algorithm, i.e. weighted average of model parameters of each party according to data volume, to obtain a new federated global model M S , which is again issued to all clients in the kth layer, and the above process is repeatedly repeated until the federated global model converges or reaches a given training round number, and finally the federated global model M S is obtained.
[0040] Then, the server evaluates the model M S on the test set T, obtains the accuracy acc(M S , T), and takes it as the utility U(M S ) = acc(M S , T) of the client combination S.
[0041] Step 7: For each combination S ∈ S of the kth layer sampling k , the server calculates the marginal contribution U(M S ) - U(M S\{i} ) of each client i ∈ S to the combination S. S\{i} is the subset obtained by removing client i from the combination S; U(M S\{i} ) is the utility of the combination S after removing client i.
[0042] Step 8: The server calculates the marginal contribution of each client under different combinations. For client i, the average marginal contribution of the kth layer k ∈ [1, k * +1] is calculated according to the following formula
[0043]
[0044] Where i∈N, k∈[1,k] * +1];U(M S∪{i} )-U(M S Let be the marginal contribution of client i to combination S. The number of samples in the |S| layer that do not include client i is used to calculate the average value.
[0045] The approximate Shapley value for client i can be obtained by averaging the marginal contributions of each layer.
[0046]
[0047] exist Figure 2 In the illustrated embodiment, the utility of all samples after federated model evaluation has been given. The approximate Shapley value is calculated below using client 1 as an example: For layer 1, the average marginal contribution of client 1 is... For Layer 2, the average marginal contribution of Client 1 is Therefore, the approximate Shapley value for client 1 is Similarly, the data values of other clients can be obtained as follows:
[0048] In summary, this invention presents a federal data valuation method based on influence pruning sampling, which uses a precise calculation formula based on the Shapley value of marginal contribution.
[0049]
[0050] It can be seen that different client combinations S affect the Shapley value φ i The impact differs, primarily in two aspects: First, the marginal contribution of the federated model decreases as the amount of data increases, i.e., when |D S When | is large enough, the marginal contribution U(M) S∪{i} )-U(M S The value is usually very small. This is because once sufficient data is available for training, adding new data only improves utility to a limited extent. Second, when the size of the client combination |S| is close to (n-1) / 2, the corresponding coefficients... This will reach a minimum, thus weakening the influence of combination S. The above analysis shows that when the size of the client combination is close to or exceeds (n-1) / 2, its impact on the final result decreases. Therefore, the data value of clients in federated learning is mainly affected by a few combinations, especially those containing fewer clients.
[0051] Based on the above analysis, the influence pruning sampling method is designed, which makes the approximation calculation of Shapley value accurate and efficient. Given the number of clients n and the total number of sampling rounds γ, the method prunes the combinations involving a large number of federal clients, and only focuses on those combinations with high impact on the final result, i.e., combinations with size not exceeding k * +1. Assuming that the average time for one federal learning is τ, the time complexity of accurately calculating the Shapley value is O(2 n τ), while the time complexity of the method is O(γτ), which can effectively reduce the time overhead. Assuming that the average data amount of the client in the federal learning is t, the approximate error bound of the method is In general federal scenarios, the data amount t of the client is usually large, so even in the case of small k * , the method of the application can achieve a small approximation error.
Claims
1. A federated data valuation method based on influence pruning sampling, characterized in that: The specific steps are: Step 1: Server prepares test set T, each client provides data set {D1, D2, …, D n} Server sets utility function U(·) as model accuracy, determines total sampling rounds γ and total sampling layers k * +1, prunes low-impact combinations above k * +1 layer; and in γ rounds of sampling, the 0th layer of empty client combinations must be sampled The above is the set of natural numbers; n is the total number of clients; j is the number of clients in a certain layer combination; Step 2: For layer 0, the server initializes the federated model and directly on the test set T, the resulting accuracy as a client combination of utility Step 3: For k = 1, 2,..., k * The server selects all client combinations S k where S k is the sample size of S k |; the total sample size of the first k * layers is Step 4: For the k * +1 layer, the server randomly selects part of the client combination Let denote P, the sample size of P is |P|, |P| should not exceed Step 5: For the 1st to k * +1 layer, i.e., k = 1, 2, …, k * +1, repeat steps 6 to 7, federated global model training and evaluation are performed on the sampled samples, and the marginal contribution is calculated; Step 6: For each combination S ∈ S of the k-th layer sampled k , the server and the clients in S jointly conduct federated global model training; then, the server evaluates the model M S on the test set T to obtain the accuracy acc(M S , T), which is taken as the utility U(M S ) = acc(M S , T) of the client combination S. Step 7: For each combination S ∈ S of samples of the k-th layer k , the server computes the marginal contribution of each client i ∈ S to the combination S, U(M S ) - U(M S\{i} ); S \ {i} is the subset of S minus client i; U(M S\{i} ) is the utility of S minus client i. Step 8: The server calculates the marginal contribution of each client under different combinations; then takes the average of the marginal contribution of each layer to obtain the approximate Shapley value of client i 2. The federated data estimation method based on influence pruning sampling according to claim 1, wherein: The client combination hierarchy is arranged according to the size of the combination, the combination of the 0th layer is a null combination; the number of clients in each client combination of the kth layer is k, and the kth layer includes The number of combinations of selecting k clients from n clients.
3. The federated data estimation method based on influence pruning sampling of claim 1, wherein: In step 4, the k * In step 4, the k Where, I is an indicator function, returning 1 when the condition is true, otherwise returning 0; ∑ S∈P I[i∈S] represents the number of times that client i appears in the sample set P.
4. The federated data estimation method based on influence pruning sampling of claim 1, wherein: In step 6, the federal global model training method is: First, the server issues a federal global model to all clients in the kth layer, and each client uses the local data set D i The updated federal global model is uploaded back to the server for federal global model training. Subsequently, the server adopts the classic FedAvg algorithm for federated learning on all the client uploaded federated global models, to obtain a new federated global model M S , and repeatedly repeat the above process to obtain the federated global model M S .
5. The federated data estimation method based on influence pruning sampling of claim 1, wherein: In step 8, for client i, the average marginal contribution of the kth∈[1, k * +1] tier is: +1] tier is: where i ∈ N, k ∈ [1, k * +1] ; U(M S∪{i} )-U(M S ) is the marginal contribution of client i to the combination S, is the number of samples in the |S|th layer that do not contain client i, used to calculate the average. approximate shapley value for a client i is:
Citation Information
Patent Citations
Federal learning participant contribution measurement method, device, storage medium and equipment
CN113947213A
Traffic prediction model training method and device based on federated learning, and traffic prediction method and device based on federated learning
CN115580891A