Self-adaptive federated learning method based on differential privacy under resource limited condition
By constructing an adaptive federated learning network in a resource-constrained mobile edge computing system and employing distributed gradient descent and differential privacy algorithms, the problems of resource consumption and privacy leakage are solved, achieving efficient machine learning task execution and privacy protection.
Patent Information
- Application Number
- CN202410997039.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-24
- Publication Date
- 2024-11-19
AI Technical Summary
In resource-constrained mobile edge computing systems, traditional federated learning methods consume a large amount of computing and communication resources and pose a risk of data privacy breaches, making it difficult to effectively perform machine learning tasks.
An adaptive federated learning method under resource-constrained conditions is designed. By constructing a federated learning network, a distributed gradient descent algorithm is used for local gradient updates, and a differential privacy algorithm is introduced to hide client participation, thereby optimizing resource utilization and privacy protection.
While maintaining model performance, we can effectively utilize resources, reduce learning loss, achieve client-level differential privacy protection, and avoid data leakage.
Smart Images

Figure CN118982079A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of information security and federated learning, and specifically relates to an adaptive federated learning method based on differential privacy under resource-constrained conditions. Background Art
[0002] The rapid development of the Internet of Things (IoT) and social network applications has led to an exponential growth in the data generated at the edge of the network. Sending all data to a remote cloud center for processing consumes a large amount of backbone network bandwidth and brings data privacy issues. Mobile Edge Computing (MEC) technology sinks part of the computing power of the central cloud to the edge of the network, providing data processing and services closer to the end user, which not only reduces the pressure on the backbone network, but also has the advantage of low latency. In a network scenario supported by mobile edge computing (MEC) technology, edge nodes are equipped with storage and computing capabilities, and multiple edge nodes can work together with the remote cloud to perform large-scale distributed tasks involving local processing and remote coordination / execution. At present, with the development of artificial intelligence technology and the increasing amount of data generated by new applications, it is usually necessary to apply machine learning technology to analyze a large amount of data to obtain useful information for detecting, classifying and predicting future events. Therefore, a large number of machine learning algorithms need to be deployed on MEC servers to provide services to users. Therefore, machine learning tasks will become the main workload in future distributed MEC systems. However, since the computing resources and storage capacity of edge servers in MEC systems are far less than those of central cloud servers, executing machine learning tasks on distributed MEC systems will face the problem of limited resources. Federated learning is a distributed machine learning architecture in which training data is retained on local devices and only model parameters are shared to central servers for update. This not only protects data privacy and reduces data transmission requirements, but also utilizes distributed computing resources of cloud-edge collaboration to improve the generalization ability of the model. However, in traditional federated learning, frequently uploading local parameters to central servers for update will also consume a lot of computing and communication resources. It is obviously not applicable to deploy traditional federated learning in resource-constrained MEC systems to use distributed computing capabilities. In addition, although traditional federated learning only uploads local model parameters to central servers for update, it will not disclose their data information, thus protecting local data privacy. However, during parameter aggregation and model distribution by central servers, the data information used in the training process may be disclosed through parameters, thereby leaking privacy. Summary of the invention
[0003] In order to solve the problems existing in the above prior art, the present invention proposes an adaptive federated learning method based on differential privacy under resource-constrained conditions, the method comprising: constructing a federated learning network, wherein the federated learning network comprises a client and an aggregator; wherein the process of adaptive federated learning comprises: a system initialization phase, a federated learning network training phase and an aggregation phase;
[0004] The system initialization phase includes: randomly selecting K clients from all clients, initializing aggregator parameters, and setting the aggregation interval iteration number τ * is 1; the aggregator will initialize the parameters and the number of aggregation interval iterations τ * Send to the client;
[0005] The training phase of the federated learning network includes: the client receives the initialization parameters and the number of aggregation interval iterations τ * ; Calculate the Lipschitz coefficient of the client estimation parameter and β-smooth coefficient Use the distributed gradient descent algorithm to perform local gradient updates on the initialization parameters; calculate the consumption of each type of resource in the local iterative update based on the updated parameters Upload the parameters of the training phase to the aggregator, increase the number of aggregation interval iterations by 1, and repeat the above process until the number of aggregation interval iterations reaches the requirement;
[0006] The aggregation phase includes the aggregator aggregating the parameters uploaded by the client and calculating the number of interval iterations between the two aggregation processes in the next round; calculating the total resource consumption based on the aggregated parameters; updating the model based on the total resource consumption, and sending the aggregation results to all participants.
[0007] Beneficial effects of the present invention:
[0008] The present invention overcomes the defects of the above-mentioned prior art in that federated learning performs distributed machine learning under resource-constrained conditions, such as low performance and client privacy exposure, and designs an algorithm to determine the frequency of global aggregation in order to most effectively utilize available resources to minimize the learning loss budget under fixed resources. The algorithm based on differential privacy can achieve client-level differential privacy with little loss in model performance, and can hide the client's participation while maintaining high model performance. BRIEF DESCRIPTION OF THE DRAWINGS
[0009] Figure 1 It is the overall flow chart of the present invention. DETAILED DESCRIPTION
[0010] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0011] An adaptive federated learning method based on differential privacy under resource-constrained conditions, such as Figure 1 As shown, the method includes: constructing a federated learning network, wherein the federated learning network includes a client and an aggregator; wherein the process of adaptive federated learning includes: a system initialization phase, a federated learning network training phase, and an aggregation phase;
[0012] The system initialization phase includes: randomly selecting K clients from all clients, initializing aggregator parameters, and setting the aggregation interval iteration number τ * is 1; the aggregator will initialize the parameters and the number of aggregation interval iterations τ * Send to the client;
[0013] The training phase of the federated learning network includes: the client receives the initialization parameters and the number of aggregation interval iterations τ * ; Calculate the Lipschitz coefficient of the client estimation parameter and β-smooth coefficient Use the distributed gradient descent algorithm to perform local gradient updates on the initialization parameters; calculate the consumption of each type of resource in the local iterative update based on the updated parameters Upload the parameters to the aggregator, increase the number of aggregation interval iterations by 1, and repeat the above process until the number of aggregation interval iterations reaches the requirement;
[0014] The aggregation phase includes the aggregator aggregating the parameters uploaded by the client and calculating the number of interval iterations between the two aggregation processes in the next round; calculating the total resource consumption based on the aggregated parameters; updating the model based on the total resource consumption, and sending the aggregation results to all participants.
[0015] In this embodiment, during the system initialization phase, K clients are randomly selected from all clients, the aggregator randomly initializes the model parameter w(0), and the interval iteration number τ between the two optimal aggregation processes is set to * Set to 1, and then w(0) and τ * Sent to the selected client, the aggregator will finalize the model w f Initialized to w(0).
[0016] Specifically, in a communication round, the aggregator sets all participating clients Z tRandomly select C t client sets, each time a fixed number of K clients is selected, i = 1, 2, ..., K; the aggregator initializes the training model w(0) as a random vector and sends it to all participating clients C t , and the final model w f Initialized to w(0); the aggregator initializes both the time counter t and the resource counter s to 0, and sets the interval iteration number τ between the first optimal two aggregation processes * Initialized to 1.
[0017] In this embodiment, during the model training phase, first, the selected client receives w(t) and τ from the aggregator. * ; Then, the selected client estimates the parameter Lipschitz coefficient and β-smooth coefficient Use the distributed gradient descent algorithm (DGD) to perform local gradient optimization and update of the parameters; again, calculate the consumption of each type of resource in the local iterative update Finally, the parameters are uploaded to the aggregator for aggregation.
[0018] Specifically, when the selected client receives the training model w(t) and the optimal interval iteration number τ between the two aggregation processes from the aggregator, * After that, save the central square model w(t), which is expressed as:
[0019]
[0020] in For the client model, in order to perform the next local iterative gradient descent algorithm, save the number of iterations last transmitted.
[0021] t 0 =t
[0022] Lipschitz coefficient and β-smooth coefficient Parameter estimation is performed according to the following rules; its expression is:
[0023]
[0024] Among them, F i (w i (t)) is the loss function of the model on client i, F i (w(t)) is the loss function of the central square model in this round; is the derivative of the model loss function on client i with respect to t, It is the derivative of the loss function of the central square model of this round with respect to t.
[0025] The client performs distributed gradient descent, and the number of iterations is calculated by the aggregator at the beginning of the communication round. The optimal interval between two aggregation processes is calculated by the aggregator at the beginning of the communication round. * If the number of iterations does not reach τ * In order to smoothly carry out the following gradient descent algorithm, the client saves the last local model, namely:
[0026]
[0027] The gradient descent rule is:
[0028]
[0029] in, is the model of the client in the previous round, η is the learning rate, is the derivative of the loss function of the client model in the previous round with respect to t. When the number of local iterations reaches τ * After that, the iteration is stopped and the difference between the local model and the central model is calculated:
[0030] Δw t+1 =ww t
[0031] The second norm of this difference is:
[0032] ζ=||Δw t+1 || 2
[0033] The consumption of M types of resources for the selected clients participating in the local iteration in this round The calculation rules for resource consumption are as follows:
[0034]
[0035] Will These parameters are uploaded to the aggregator for relevant operations.
[0036]
[0037] In this embodiment, the model aggregation stage includes: first, the aggregator aggregates the uploaded parameters according to their respective rules; second, calculates the number of interval iterations between the two aggregation processes in the next round; third, calculates the total resource consumption; finally, updates the model, and the aggregator sends the aggregation results to all participants.
[0038] Specifically, when the aggregator receives a series of parameters uploaded by each client, it updates the time counter t. The updating process is:
[0039] t 0 =t
[0040] t=t+τ *
[0041] In order to track the privacy loss pl, this paper introduces Accountant to calculate the privacy loss pl. Accountant will evaluate pl given σ and m. The aggregator will calculate the privacy loss pl based on the number of clients C participating in each round of communication. k and the set of global model variances σ t Calculate the privacy loss δ, where
[0042] pl=Accountant(m k ,σ t )
[0043] Accountant(m,σ)=σ 2 / m
[0044]
[0045] Among them, Δw k Yes, select C k The local model of the client set, m k is the kth participating client, σ t is the global model variance set, VAR is the variance of Δw, Δw is the difference w between the local model and the central model k -w(t), K is the number of participating clients, μ is Δw k The average value of .
[0046] If δ>Q, that is, there is a single user whose contribution value is too high. When the contribution value is too high, the possibility of the customer's contribution being exposed is too high, and there will be a privacy leakage problem. The training should be stopped. The threshold Q is a hyperparameter. If δ≤Q, the aggregator adds noise, and the intensity of the added noise is related to the median S of the norm value ζ of the user gradient update.
[0047]
[0048] Perform global model gradient update:
[0049]
[0050] in, The local model updates of each client are pruned to limit the updated L2 norm to no more than the threshold S, to prevent some update values from being too large and affecting the overall privacy protection effect.
[0051] Noise is added according to a Gaussian distribution.
[0052] If the loss function of the updated model is less than the loss function of the original final model, that is:
[0053] F(w(t 0 ))<F(w f )
[0054] Then update the final model, and the update rules are as follows:
[0055] w f =w(t 0 )
[0056] Then Weighted averaging, the aggregation rules are as follows:
[0057]
[0058] Among them, D i is the data set contained in each node i, is the Lipschitz coefficient after weighted average of the central aggregator, is the β-smooth coefficient after weighted average of the central aggregator, is the weighted average of the central aggregator w(t 0 ) is the gradient of the loss function, w(t 0 ) are the client model parameters.
[0059] This application defines gradient divergence The divergence between the gradient used to capture the local loss function and the gradient of the global loss function is related to how the data is distributed across different nodes.
[0060]
[0061] The aggregator calculates the optimal number of local iterations τ between the next two aggregation processes * , the calculation formula is as follows:
[0062]
[0063] Where τ is the number of local iterations required for each round, and G(τ) is the calculation τ defined in the present invention. * The function of c m The resources consumed for local iterative updates, b m is the resource consumed by the central party aggregation process, R′ m is the total budget for each resource m, η is the learning rate, is the control parameter, ρ is the Lipschitz coefficient, h(τ) is the function defined in the present invention, δ is the gradient divergence, or the difference between gradients, and β is the β-smooth coefficient. The search range of τ is [1,τ m ],Right now:
[0064] τ m =min{γτ * ; τ max}
[0065] in, It is a control parameter that can be manually adjusted, a hyperparameter, η is the learning rate, R is the total resource budget, bm is the resource consumed by the central party aggregation process, and Cm is the resource consumed by the local iterative update. ρ is the Lipschitz coefficient, and β is the β-smooth coefficient. γ is a search range hyperparameter that will be set in advance before federated learning.
[0066] The aggregator calculates the resources consumed by local iterations c m and the resources consumed by the central party aggregation process b m
[0067]
[0068] Where S is the sum of the resource consumption of the client and the aggregator. If the calculated resource consumption is greater than the total resource budget, that is:
[0069]
[0070] The aggregator sets the STOP flag and sends it to all clients Z k , send the last model update to all clients Z k , otherwise the model is updated directly.
[0071] The above embodiments further illustrate the purpose, technical solutions and advantages of the present invention in detail. It should be understood that the above embodiments are only preferred implementation modes of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made to the present invention within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. An adaptive federated learning method based on differential privacy under resource-constrained conditions, characterized in that: include: Build a federated learning network, where the federated learning network includes clients and aggregators; The process of adaptive federated learning includes: system initialization phase, federated learning network training phase and aggregation phase; The system initialization phase includes: randomly selecting K clients from all clients, initializing aggregator parameters, and setting the aggregation interval iteration number τ * is 1; the aggregator will initialize the parameters and the number of aggregation interval iterations τ * Send to the client; The training phase of the federated learning network includes: the client receives the initialization parameters and the number of aggregation interval iterations τ * ; Calculate the Lipschitz coefficient of the client estimation parameter and β-smooth coefficient Use the distributed gradient descent algorithm to perform local gradient updates on the initialization parameters; calculate the consumption of each type of resource in the local iterative update based on the updated parameters Upload the parameters of the training phase to the aggregator, increase the number of aggregation interval iterations by 1, and repeat the above process until the number of aggregation interval iterations reaches the requirement; The aggregation phase includes the aggregator aggregating the parameters uploaded by the client and calculating the number of interval iterations between the two aggregation processes in the next round; calculating the total resource consumption based on the aggregated parameters; updating the model based on the total resource consumption, and sending the aggregation results to all participants.
2. According to claim 1, the adaptive federated learning method based on differential privacy under resource-constrained conditions is characterized in that: Calculate the Lipschitz coefficient of the client estimation parameter and β-smooth coefficient The formula is: Among them, F i (w i (t)) is the loss function of the model on client i, F i (w(t)) is the loss function of the central square model in this round; is the derivative of the model loss function on client i with respect to t, It is the derivative of the loss function of the central square model of this round with respect to t.
3. According to claim 1, the adaptive federated learning method based on differential privacy under resource-constrained conditions is characterized in that: The distributed gradient descent algorithm is used to perform local gradient updates on the initialization parameters, including: Step 1: In a communication round, the aggregator collects all participating clients Z t Randomly select C t Client set, each time select a fixed number of K clients, i = 1, 2, ..., K, set the global model parameter w f , and the model parameters w of each node i (0) and Initialize to the same value; Step 2: For each selected node i, the local model parameters are updated using the gradient descent rule; the number of iterations increases by 1; Step 3: When the number of iterations reaches the interval iteration number τ between two aggregation processes, the iteration is stopped and the difference between the local model and the central model is calculated. The formula for calculating the difference between the local model and the central model is: Δw t+1 =ww t Step 4: Take the second norm of the difference value, that is: ζ=||Δw t+1 ||2 Step 5: After the local gradient update is completed, the difference value Δw t+1 The second norm ζ of the difference value is uploaded to the aggregator for central gradient update.
4. According to claim 3, the adaptive federated learning method based on differential privacy under resource-constrained conditions is characterized in that: The gradient descent rule is: in, is the model of the client in the previous round, η is the learning rate, It is the derivative of the loss function of the client model in the previous round with respect to t.
5. The adaptive federated learning method based on differential privacy under resource-constrained conditions according to claim 1, characterized in that: Calculate the consumption of each type of resource in local iterative update for: Where M is the total number of resources, c m,i is the consumption of the mth resource of the i-th node, m is the mth resource, and i is the i-th node.
6. The adaptive federated learning method based on differential privacy under resource-constrained conditions according to claim 1, characterized in that: The aggregator aggregates the client-uploaded parameters including: Step 1: The aggregator receives the parameters uploaded by the client; Step 2: Use Accountant to calculate the privacy loss based on the parameters; Step 3: Set a threshold Q and compare the privacy loss with the set threshold Q. If the privacy loss is greater than the set threshold, the training phase of the federated learning network ends. Otherwise, the aggregator adds noise. Step 4: Update the global model gradient according to the added noise, and calculate the loss function of the updated model; Step 5: Determine whether the updated model loss function is less than the original model loss function. If so, update the final model and aggregate the parameters; otherwise, do not update the model.
7. The adaptive federated learning method based on differential privacy under resource-constrained conditions according to claim 6, characterized in that: The privacy loss expression is: pl=Accountant(m) k ,s t ) Accountant(m,σ)=σ 2 / m Among them, Δw k Yes, select C k The local model of the client set, m k is the kth participating client, σ t is the global model variance set, VAR is the variance of Δw, Δw is the difference w between the local model and the central model k -w(t), K is the number of participating clients, μ is Δw k The average value of .
8. The adaptive federated learning method based on differential privacy under resource-constrained conditions according to claim 6, characterized in that: The formula for aggregating the parameters is: Among them, D i is the data set contained in each node i, is the Lipschitz coefficient after weighted average of the central aggregator, is the β-smooth coefficient after weighted average of the central aggregator, is the gradient of the loss function of w(t0) after weighted averaging by the central aggregator, where w(t0) is the model parameter of the client.
9. The adaptive federated learning method based on differential privacy under resource-constrained conditions according to claim 1, characterized in that: Calculate the number of iterations between the two aggregation processes in the next round: Where τ is the number of local iterations required in each round, and G(τ) is the calculation τ defined in the present invention. * The function of c m The resources consumed for local iterative updates, b m is the resource consumed by the central party aggregation process, R′ m is the total budget for each resource m, η is the learning rate, is the control parameter, ρ is the Lipschitz coefficient, h(τ) is the function defined in the present invention, δ is the gradient divergence, or the difference between gradients, and β is the β-smooth coefficient.
Citation Information
Patent Citations
Federal learning adaptive gradient quantification method
CN113315604A
Asynchronous aggregation and privacy protection method in resource limited federated edge learning
CN116911382A
Horizontal and vertical federated learning combined algorithm
WO2024060410A1
Cited By
Financial big data distributed machine learning optimization model construction method based on resource-constrained network
CN120597994A
A method for constructing a distributed machine learning optimization model based on financial big data under a resource-constrained network
CN120597994B
