A federated learning method, system and device based on forward gradient

By introducing the forward gradient method into federated learning and leveraging the parallel computing capabilities of edge devices, the problem of high computational and storage overhead on edge devices is solved, thereby improving the training efficiency and scalability of neural network models.

CN116702884BActive Publication Date: 2026-01-23BEIJING UNIV OF POSTS & TELECOMM
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202310737218.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-06-21
Publication Date
2026-01-23
Estimated Expiration
2043-06-21

AI Technical Summary

Technical Problem

In existing federated learning methods, the computational and storage overhead of edge devices is high, resulting in poor scalability and slow training speed, making it difficult to effectively utilize a large number of edge devices for training neural network models.

Method used

The federated learning method using forward gradient is adopted. In each training round, the server selects multiple edge devices, sends model parameters and random seeds, the edge devices generate random direction vectors to calculate the derivative of the objective function, and the server calculates the forward gradient and performs a weighted average to optimize the model parameters.

Benefits of technology

It improves the scalability of federated learning, reduces the computational and storage overhead of edge devices, accelerates the convergence speed of neural network models, and is suitable for edge devices with limited computing power and memory.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116702884B_ABST
    Figure CN116702884B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a federated learning method, system and device based on forward gradient: in each training round of a neural network model, a server selects a plurality of edge devices, sends model parameters of the neural network model to the selected edge devices, and sends different random seeds to different selected edge devices; the selected edge devices generate random direction vectors using the random seeds, calculate the derivative of a target function in the neural network model in the direction of the random direction vectors based on local data, and send the derivative to the server; the server calculates the forward gradient of the neural network model at the edge devices according to the derivative and the corresponding random seed; and based on the forward gradient of all edge devices, the gradient of the neural network model in the current training round is calculated to optimize the model parameters of the neural network model. In this way, the scalability of federated learning is greatly improved while ensuring the training accuracy of the neural network model.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of artificial neural networks, in particular to a federated learning method, system and device based on forward gradient. BACKGROUND

[0002] The federated learning method is a general paradigm for solving large-scale distributed training of neural network models under the premise of ensuring personal data privacy. At present, the edge devices involved in the federated learning method calculate the gradient of the neural network model through the backpropagation algorithm during the training of the neural network model, update the model parameters such as the weights of the neural network model based on the gradient, and then perform subsequent training of the updated neural network model until the neural network model converges. The backpropagation algorithm is a commonly used method for training neural network models, which is used to calculate the gradient of the loss function in the neural network model with respect to each weight, and these gradients can be used to update the weights during the training of the neural network model to minimize the loss function in the neural network model.

[0003] The process of implementing the backpropagation algorithm is as follows: first, input data into the neural network model to run and output actual results; second, calculate the error value between the actual results and the expected results; third, use the chain rule to propagate the error value back to the neural network model running to calculate the gradient of each weight of the neural network model; and finally, update the weights based on the gradient value of each weight, and train the updated neural network model in the next training round to gradually minimize the loss function of the neural network.

[0004] The clients involved in the federated learning are usually edge devices with weak computing power and limited memory on the network terminal side. Executing the backpropagation algorithm of the neural network model on these edge devices will result in a large amount of computing and storage overhead. Therefore, the backpropagation algorithm has poor scalability, and even if the number of edge devices participating in each training round is increased, it will not have any positive effect on the convergence of the neural network model. Therefore, only a small number of edge devices participate in each training round of the federated learning, and a large number of available edge devices are idle.

[0005] Therefore, how to greatly reduce the computing and storage overhead of the edge devices involved in the federated learning while ensuring the training accuracy of the neural network model, speed up the convergence of the neural network model, and improve the scalability of the federated learning is a problem to be solved. SUMMARY

[0006] Therefore, the embodiments of the present application provide a federated learning method based on forward gradient, which can improve the scalability of the federated learning while ensuring the training accuracy of the neural network model.

[0007] The embodiment of the application also provides a federated learning system based on a forward gradient, which can improve the scalability of federated learning while ensuring the training accuracy of a neural network model.

[0008] The embodiment of the application also provides a federated learning device based on a forward gradient, which can improve the scalability of federated learning while ensuring the training accuracy of a neural network model.

[0009] In one embodiment of the embodiment of the application, a federated learning method based on a forward gradient is provided, comprising:

[0010] In the current training round of the neural network model, a plurality of edge devices are selected;

[0011] The model parameters of the neural network model are sent to the selected edge devices, and different random seeds are sent to different edge devices, so that the edge devices generate a random direction vector based on the received random seed, and send the derivative of the objective function in the neural network model in the direction of the random direction vector after being calculated based on the local data;

[0012] For each edge device, the derivative of the objective function in the neural network model in the direction of the random direction vector received and the random seed sent to the edge device are calculated to obtain the forward gradient of the neural network model at the edge device;

[0013] Based on the calculated forward gradient of all the edge devices, the gradient of the neural network model is calculated to adjust the model parameters of the neural network model in the next training round.

[0014] In the above method, the calculation of the forward gradient of the neural network model at the edge device comprises:

[0015] g f = (g * v) * v,

[0016] wherein g f represents the forward gradient of the neural network model at the edge device, g is the true forward gradient of the neural network model at the edge device, and v is a random direction vector, which has the same dimension as the model parameters of the neural network model, and each value range in v conforms to a standard normal distribution range;

[0017] (g * v) represents the derivative of the objective function in the neural network model in the direction of the random direction vector.

[0018] In the above method, the calculation of the derivative of the objective function in the neural network model in the direction of the random direction vector comprises:

[0019]

[0020] wherein f(x) is a target function value, f(x+h*v) is a target function value after the neural network model parameter is disturbed in the direction of the random direction vector v, h takes a value of 0.01, and represents a value of the neural network model parameter disturbed in the direction of the random direction vector v.

[0021] In the above method, the calculating the gradient of the neural network comprises:

[0022] After the forward gradients of all the edge devices are weighted and averaged, the gradient of the current training round of the neural network model is obtained.

[0023] In another embodiment of the present application, a federated learning system based on forward gradient is provided, the system comprises a server located in a network cloud and a plurality of edge devices located at a network terminal side, wherein,

[0024] The server is configured to, in a current training round of a neural network model, select a plurality of edge devices, send model parameters of the neural network model to the selected edge devices, send different random seeds to different edge devices, for each edge device, calculate a forward gradient of the neural network model at the edge device according to a derivative of a target function in the neural network model in the direction of a random direction vector and a random seed sent to the edge device, and calculate a gradient of the neural network model based on the calculated forward gradients of all the edge devices to adjust model parameters of the neural network model in a next training round.

[0025] The edge device is configured to generate a random direction vector based on the received random seed, and send the derivative of the target function in the neural network model in the direction of the random direction vector to the server after the derivative is calculated based on local data.

[0026] In still another embodiment of the present application, a federated learning device based on forward gradient is provided, the device is a server located in a network cloud, and comprises a selection unit, a distribution unit and a first calculation unit, wherein,

[0027] The selection unit is configured to, in a current training round of a neural network model, select a plurality of edge devices.

[0028] The distribution unit is configured to send model parameters of the neural network model to the selected edge devices, and send different random seeds to different edge devices.

[0029] The first calculation unit is configured to, for each edge device, calculate the forward gradient of the neural network model at the edge device according to the derivative of the objective function in the neural network model in the direction of the random direction vector and the random seed sent to the edge device; and calculate the gradient of the neural network model based on the calculated forward gradients of all the edge devices, so as to adjust the model parameters of the neural network model in the next training round.

[0030] In another embodiment of the present application, a forward gradient-based federated learning device is provided, which is an edge device located at a network terminal side, and is an edge device selected by a network cloud end, and comprises a receiving unit, a second calculation unit and a sending unit, wherein,

[0031] The receiving unit is configured to receive the random seed generated random direction vector sent by the server.

[0032] The second calculation unit is configured to generate a random direction vector based on the received random seed, and calculate the derivative of the objective function in the neural network model in the direction of the random direction vector based on local data.

[0033] The sending unit is configured to send the derivative of the objective function in the neural network model in the direction of the random direction vector to the server.

[0034] In another embodiment of the present application, an electronic device is provided, comprising:

[0035] A processor;

[0036] A memory storing a program configured to implement any one of the above-described forward gradient-based federated learning methods when executed by the processor.

[0037] In another embodiment of the present application, a non-transitory computer readable storage medium is provided, which stores instructions that, when executed by a processor, cause the processor to perform any one of the above-described forward gradient-based federated learning methods.

[0038] In another embodiment of the present application, a computer program product is provided, comprising a computer program or instructions, characterized in that the computer program or instructions, when executed by a processor, implement the steps of any one of the above-described forward gradient-based federated learning methods.

[0039] As seen above, in the process of training a neural network model based on federated learning, the embodiments of the present application use a forward propagation algorithm on edge devices, that is, at each training round of the neural network model, the server selects multiple edge devices, sends the model parameters of the neural network model to the selected edge devices, and sends different random seeds to different selected edge devices; after the selected edge devices generate a random direction vector using the received random seed, they calculate the derivative of the objective function in the neural network model in the direction of the random direction vector based on local data and send it to the server; the server calculates the forward gradient of the neural network model on the edge device according to the received derivative of the objective function in the neural network model in the random direction vector and the corresponding random seed; based on the forward gradients of all the edge devices, the gradient of the neural network model in the current training round is calculated to optimize the model parameters of the neural network model. In this way, the embodiments of the present application use a large number of edge devices and implement the forward propagation algorithm of the neural network model in parallel using different random seeds, which improves the scalability of federated learning while ensuring the training accuracy of the neural network model, and can greatly reduce the computational and storage overhead of the edge devices involved in federated learning. BRIEF DESCRIPTION OF DRAWINGS

[0040] Figure 1 A flowchart of a federated learning method based on forward gradient provided for the embodiments of the present application;

[0041] Figure 2 A structural schematic diagram of a federated learning system based on forward gradient provided for the embodiments of the present application;

[0042] Figure 3 A structural schematic diagram of a federated learning device based on forward gradient provided for the embodiments of the present application;

[0043] Figure 4 A structural schematic diagram of a federated learning device based on forward gradient provided for the embodiments of the present application;

[0044] Figure 5 A schematic diagram of an electronic device provided for another embodiment of the present application. DETAILED DESCRIPTION

[0045] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative labor fall within the scope of protection of the present application.

[0046] The terms "first", "second", "third", "fourth" and the like in the description and in the claims of the present application, if any, are used for distinguishing between similar objects and not necessarily for describing a specific sequential or chronological order. It is to be understood that the use of these terms herein is to be construed as interchangeable in order to describe the embodiments of the present application as outlined herein in any sequence or order. Furthermore, the terms "comprising", "having", "including" and "containing" and any variations thereof are intended to cover a non-exclusive inclusion such that a process, method, system, article, or apparatus that comprises, has, includes or contains a list of elements is not required to comprise, have, include or contain only those elements recited.

[0047] The technical solutions of the present application will be described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.

[0048] In the process of training a neural network model based on federated learning, the implementation of the back propagation algorithm on the edge device will cause the calculation and storage overhead of the edge device involved in federated learning to increase, and the convergence speed of the neural network model to slow down. In order to solve the above problems, a zero-order optimization method can be used, that is, in the federated learning process, the forward propagation algorithm is used instead of the back propagation algorithm to estimate the gradient of the neural network model.

[0049] Specifically, in each training round of federated learning, the edge device obtains the latest model parameters of the neural network model and a random seed from the server of the network cloud. Generating random numbers is a common method used in the training process of a neural network model, and a pseudo-random number generator is provided on the edge device to generate a random number sequence based on the random seed. For a pseudo-random number generator, the same random seed can obtain the same random number sequence. The edge device uses the random number sequence to locally generate a plurality of direction vectors v of the same dimension as the model parameters w of the neural network model, and each value in the direction vector v is subject to a standard normal distribution range. The standard normal distribution range is a normal distribution with a mean of 0 and a variance of 1.

[0050] For each direction vector v, the edge device uses the local data to calculate the directional derivative of the neural network model using formula (1):

[0051]

[0052] Wherein, f(x) is the objective function value, f(x+h·v) is the objective function value after the slight perturbation of the neural network model parameter w in the direction of the random direction vector v, h takes a very small positive number, such as 0.01, indicating the value of the slight perturbation of the neural network model parameter in the direction of the random direction vector v.

[0053] The edge device sends the directional derivative g v to the server. The server generates the same directional vector v using the same random seed as the edge device, and uses the directional derivative g v *v as the gradient to optimize the model parameters w of the neural network model, and then distributes the updated neural network model to the edge device for training in the next training round. The above method is used to train the neural network model for multiple training rounds until the neural network model converges.

[0054] It can be seen that, in the process of training the neural network model based on federated learning, when the back propagation algorithm is used on the edge device, all intermediate values involved in the training process of the neural network model need to be saved in the edge device, so that the gradients of each model parameter in the neural network model can be calculated when the back propagation algorithm is implemented on the edge device. When the forward propagation algorithm is used on the edge device in the process of training the neural network model based on federated learning, it is not necessary to save all intermediate values involved in the training process of the neural network model in the edge device, which saves the storage resources of the edge device and makes the memory of the edge device efficient. In the process of training the neural network model based on federated learning, when the back propagation algorithm is used on the edge device, the edge device needs to send the calculation results of the locally trained neural network model to the server, which has a large amount of data; while in the process of training the neural network model based on federated learning, when the forward propagation algorithm is used on the edge device, only the directional derivative g v of the neural network model on the directional vector v needs to be sent to the server, which is only a scalar and has a small amount of data, which is more friendly to the edge device with limited uplink bandwidth.

[0055] However, in the process of training the neural network model based on federated learning, the computational complexity is very large when the back propagation algorithm is used on an edge device. This is because the mathematical expectation of the directional derivative g v *v of the neural network model is the gradient of the neural network model, and the variance value is proportional to the number of parameters of the model. In order to reduce the influence of the variance value on the training of the neural network model, multiple directional vectors v are used on each piece of data of the edge device to calculate the directional derivative g v , i.e. the gradient Wherein, k is multiple, indicating that k groups of forward gradients g v* v, and then take the average. This requires performing the forward propagation algorithm of the neural network model multiple times on each piece of data at each edge device, such as up to 1000 times of forward propagation algorithm to replace one backward propagation algorithm at one edge device, which greatly increases the computational overhead of the edge device, slows down the process of training the neural network model based on federated learning, and is not conducive to the expansion of federated learning.

[0056] To overcome the above problems, the embodiments of the present application still use the forward propagation algorithm on the edge device in the process of training the neural network model based on federated learning, that is, in each training round of the neural network model, the server selects multiple edge devices, sends the model parameters of the neural network model to the selected edge devices, and sends different random seeds to different selected edge devices; after the selected edge devices generate a random direction vector using the received random seed, the edge devices calculate the derivative of the objective function in the neural network model in the direction of the random direction vector based on the local data, and send it to the server; the server calculates the forward gradient of the neural network model at the edge device according to the received derivative of the objective function in the neural network model in the random direction vector and the corresponding random seed; based on the forward gradient of all the edge devices, the gradient of the neural network model in the current training round is calculated to optimize the model parameters of the neural network model. In this way, the embodiments of the present application use a large number of edge devices, and use different random seeds in parallel to implement the forward propagation algorithm of the neural network model, improve the scalability of federated learning, avoid the computational overhead of each edge device and the high delay of the forward propagation algorithm at one edge device, and speed up the process of training the neural network model based on federated learning.

[0057] Further, when implementing the forward propagation algorithm, the specific algorithm used in the embodiments of the present application is also different from the specific algorithm used in the method of zero-order optimization, which is more simple and easy to implement.

[0058] Using the embodiments of the present application can greatly improve the scalability of federated learning and the convergence speed of the neural network model, and reduce the computational and storage overhead of the edge devices involved in federated learning.

[0059] The embodiments of the present application are described in detail below.

[0060] Figure 1 A flowchart of a federated learning method based on forward gradient is provided for the embodiments of the present application, and the specific steps include:

[0061] Step 101, in the current training round of the neural network model, select multiple edge devices;

[0062] Step 102, sending the model parameters of the neural network model to the selected edge device, sending different random seeds to different edge devices, so that the edge device generates a random direction vector based on the received random seed, and sends the derivative of the objective function in the neural network model in the direction of the random direction vector after calculating the derivative based on local data;

[0063] Step 103, for each edge device, according to the received derivative of the objective function in the neural network model in the direction of the random direction vector, and the random seed sent to the edge device, calculate the forward gradient of the neural network model at the edge device;

[0064] Step 104, based on the calculated forward gradient of all edge devices, the gradient of the neural network model is calculated to adjust the model parameters of the neural network model in the next training round.

[0065] The above method is completed by a server deployed in the cloud, referred to as a cloud server. The edge device involved in the above method is a device that provides an entry point to the core network of an enterprise or service provider, such as a smartphone, an Internet of Things access device, a wearable device, a terminal device, and an access device for an autonomous vehicle, etc. Herein, no limitation is made.

[0066] In the above method, the forward gradient of the neural network model at the edge device is calculated using formula (2):

[0067] g f = (g * v) * v formula (2),

[0068] wherein g is the true forward gradient of the neural network model at the edge device, v is a random direction vector, which has the same dimension as the model parameters of the neural network model, and each value in v is in the range of a standard normal distribution, which is a normal distribution with a mean of 0 and a variance of 1. (g * v) is a scalar, i.e. the derivative of the objective function in the neural network model in the direction of the random direction vector.

[0069] Further, the derivative of the objective function in the neural network model in the direction of the random direction vector is calculated using formula (3):

[0070]

[0071] Wherein, f(x) is a target function value, f(x+h*v) is a target function after slight perturbation of the neural network model parameters in the direction of a random direction vector v, and h takes a very small positive number, such as 0.01, indicating the value of the slight perturbation of the neural network model parameters in the direction of the random direction vector v.

[0072] The formula (3) can be calculated by twice forward propagation, that is, once forward propagation calculates the target function value f(x), the model parameters are slightly perturbed using a random direction vector v, and the perturbed target function value f(x+h*v) is calculated in the second forward propagation, and finally the derivative of the target function in the neural network model in the direction of the random direction vector is calculated by using the formula (3).

[0073] In the above method, the calculating the gradient of the neural network comprises:

[0074] After the forward gradients of all the edge devices are weighted and averaged, the gradient of the current training round of the neural network model is obtained.

[0075] Figure 2 A federated learning system structure schematic diagram based on a forward gradient is provided for an embodiment of the application, the system comprises a server located in a network cloud and a plurality of edge devices located at a network terminal side, wherein,

[0076] The server is configured to, in a current training round of a neural network model, select a plurality of edge devices, send model parameters of the neural network model to the selected edge devices, send different random seeds to different edge devices, for each edge device, calculate a forward gradient of the neural network model at the edge device based on the derivative of the target function in the neural network model in the direction of the random direction vector and the random seed sent to the edge device, and calculate a gradient of the neural network model based on the calculated forward gradients of all the edge devices to adjust model parameters of the neural network model in the next training round.

[0077] The edge device is configured to generate a random direction vector based on the received random seed, and send the derivative of the target function in the neural network model in the direction of the random direction vector calculated based on local data to the server.

[0078] Figure 3 A federated learning device structure schematic diagram based on a forward gradient is provided for an embodiment of the application, the device one is a server located in a network cloud, comprising: a selection unit, a distribution unit and a first calculation unit, wherein,

[0079] The selection unit is configured to select a plurality of edge devices in a current training round of the neural network model;

[0080] The distribution unit is configured to distribute model parameters of the neural network model to the selected edge devices and different random seeds to different edge devices.

[0081] The first calculation unit is configured to, for each edge device, calculate a forward gradient of the neural network model at the edge device according to a derivative of an objective function in the neural network model in a direction of the random direction vector and a random seed sent to the edge device, and calculate a gradient of the neural network model based on the calculated forward gradients of all the edge devices to adjust model parameters of the neural network model in a next training round.

[0082] Figure 4 A second device based on a forward gradient for federated learning provided by an embodiment of the present application is a structure schematic diagram of an edge device located at a network terminal side, the edge device is an edge device selected by a network side cloud, and the edge device comprises a receiving unit, a second calculation unit and a sending unit, wherein,

[0083] The receiving unit is configured to receive the random seed sent by the server to generate a random direction vector.

[0084] The second calculation unit is configured to generate a random direction vector based on the received random seed and calculate a derivative of an objective function in the neural network model in a direction of the random direction vector based on local data.

[0085] The sending unit is configured to send the derivative of the objective function in the neural network model in the direction of the random direction vector to the server.

[0086] It can be seen that the embodiment of the present application has the following advantages:

[0087] First, the scalability of federated learning is improved

[0088] The introduction of the forward gradient technique into federated learning allows more edge devices to participate in the training of the neural network model in each training round, so as to obtain a more accurate gradient of the neural network model and improve the scalability of large-scale federated learning.

[0089] Second, the convergence speed of federated learning is accelerated

[0090] The forward gradient is generated using only the forward calculation of the neural network model, and the calculation speed is fast. And the edge device usually has inference acceleration hardware such as embedded neural network processor (NPU) or digital signal processor (DSP), and the back propagation algorithm cannot use these hardware to obtain acceleration, and the calculation of the forward gradient uses the forward propagation algorithm, which can use these hardware, greatly accelerating the overall convergence speed of the federated learning.

[0091] Third, reduce the system overhead on the edge device

[0092] In the federated learning process of the present application, the edge device only performs the calculation of the forward propagation algorithm of the neural network model, compared with the calculation of the edge device using the back propagation algorithm, it does not need to save all the intermediate values involved in the training process of the neural network model, which can greatly reduce the memory overhead of the edge device; the edge device only sends the derivative of the objective function in the neural network model in the direction of the random direction vector to the server, which is more friendly to the edge device with limited uplink bandwidth.

[0093] In summary, compared with the federated learning scheme based on the back propagation algorithm of the gradient, the embodiment of the present application has higher scalability for large-scale federated learning, is more friendly to the edge device participating in the federated learning with limited computation and memory, has low communication overhead of the whole system, and can effectively improve the convergence speed of the neural network model.

[0094] In another embodiment of the present application, a non-transitory computer readable storage medium is provided, which stores instructions that, when executed by a processor, cause the processor to perform the federated learning based on the forward gradient in one of the aforementioned embodiments.

[0095] Figure 5 A schematic diagram of an electronic device provided for another embodiment of the present application is shown. As Figure 5 shown, another embodiment of the present application also provides an electronic device, which can include a processor 501, wherein the processor 501 is configured to perform the steps of the federated learning based on the forward gradient described above. It can also be seen from Figure 5 that the electronic device provided by the above embodiment further includes a non-transitory computer readable storage medium 502, and the non-transitory computer readable storage medium 502 stores a computer program, and the computer program is run by the processor 501 to perform the steps of the federated learning based on the forward gradient described above.

[0096] In particular, the non-transitory computer-readable storage medium 502 can be a storage medium of a general purpose storage medium, such as a mobile disk, a hard disk, a FLASH, a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), or a portable compact disk read-only memory (CD-ROM), and the like. When the computer program on the non-transitory computer-readable storage medium 502 is executed by the processor 501, the processor 501 can be caused to perform each step of the above-described federated learning method based on the forward gradient.

[0097] In actual applications, the non-transitory computer-readable storage medium 502 can be included in the device / apparatus / system described in the above embodiments, or can exist separately without being assembled into the device / apparatus / system. The above computer-readable storage medium carries one or more programs, which, when executed, can perform each step of the above-described federated learning method based on the forward gradient.

[0098] Still another embodiment of the present application further provides a computer program product, which includes a computer program or instructions, which, when executed by a processor, implements each step of the above-described federated learning method based on the forward gradient.

[0099] The flowcharts and block diagrams in the drawings of the present application show the possible implementation architecture, function and operation of the systems, methods and computer program products according to various embodiments disclosed in the present application. In this regard, each block in the flowchart or block diagram can represent a module, a program segment, or a part of code, which contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions noted in the blocks can occur in different orders in different diagrams. For example, two blocks connected by a connecting line can actually be executed substantially in parallel, and sometimes they can be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagram or flowchart, and the combination of blocks in the block diagram or flowchart, can be implemented by a dedicated hardware-based system that performs the specified functions or operations, or can be implemented by a combination of dedicated hardware and computer instructions.

[0100] Those skilled in the art can understand that the features described in various embodiments and / or claims of the present disclosure can be combined and / or integrated in various combinations, even if such combinations are not explicitly described in the present application. In particular, the features described in various embodiments and / or claims of the present application can be combined and / or integrated in various combinations without departing from the spirit and teachings of the present application, and all such combinations fall within the scope of the present disclosure.

[0101] The principles and implementation manners of the present application are described by using specific examples in the present article, and the above examples are only used to help understand the method of the present application and its core idea, and are not used to limit the present application. For those skilled in the art, according to the idea, spirit and principle of the present application, the specific implementation manner and application range can be changed, and any modification, equivalent replacement, improvement, etc. made by them shall be included in the protection scope of the present application.

Claims

1. A federated learning method based on forward gradients, characterized in that, include: In the current training round of the neural network model, select multiple edge devices; The model parameters of the neural network model are sent to the selected edge device, and different random seeds are sent to different edge devices so that the edge device generates a random direction vector based on the received random seed. After calculating the derivative of the objective function in the neural network model in the direction of the random direction vector based on local data, the vector is sent. For each edge device, the forward gradient of the neural network model on the edge device is calculated based on the derivative of the objective function in the received neural network model in the direction of the random direction vector and the random seed sent to the edge device. Based on the calculated forward gradients of all the edge devices, the gradient of the neural network model is calculated to adjust the model parameters of the neural network model in the next training round.

2. The method as described in claim 1, characterized in that, The calculation of the forward gradient of the neural network model on the edge device includes: , in, This represents the forward gradient of the neural network model on the edge device. It is the true forward gradient of the neural network model on the edge device. It is a random direction vector with the same dimension as the model parameters of the neural network model. Each value range in the range follows a standard normal distribution. This represents the derivative of the objective function in the neural network model along the direction of the random direction vector.

3. The method as described in claim 2, characterized in that, The calculation of the derivative of the objective function in the neural network model along the direction of the random direction vector includes: Where f(x) is the objective function value, The objective function value is the neural network model parameter after perturbation in the direction of the random direction vector v, and the value of h is 0.01, which represents the value of the perturbation of the neural network model parameter in the direction of the random direction vector v.

4. The method as described in claim 1, characterized in that, The calculation of the gradient of the neural network includes: The gradient of the neural network model in the current training round is obtained by weighted averaging of the forward gradients of all the edge devices.

5. A federated learning system based on forward gradients, characterized in that, The system includes a server located in the cloud and multiple edge devices located on the network terminal side, wherein, The server is configured to select multiple edge devices in the current training round of the neural network model; send the model parameters of the neural network model to the selected edge devices, and send different random seeds to different edge devices; for each edge device, calculate the forward gradient of the neural network model at that edge device based on the derivative of the objective function in the received neural network model in the direction of the random direction vector and the random seed sent to the edge device; and calculate the gradient of the neural network model based on the calculated forward gradients of all edge devices to adjust the model parameters of the neural network model in the next training round. The edge device is used to generate a random direction vector based on the received random seed, calculate the derivative of the objective function in the neural network model in the direction of the random direction vector based on local data, and then send it to the server.

6. A federated learning device based on forward gradients, characterized in that, The device is a server located in the cloud, comprising: a selection unit, a distribution unit, and a first calculation unit, wherein... The selection unit is used to select multiple edge devices in the current training round of the neural network model; The distributing unit is used to send the model parameters of the neural network model to the selected edge device, and send different random seeds to different edge devices, so that the edge device generates a random direction vector based on the received random seed, calculates the derivative of the objective function in the neural network model in the direction of the random direction vector based on local data, and sends it to the server. The first computing unit is configured to, for each edge device, calculate the forward gradient of the neural network model on the edge device based on the derivative of the objective function in the received neural network model in the direction of the random direction vector and the random seed sent to the edge device; and calculate the gradient of the neural network model based on the calculated forward gradients of all the edge devices, so as to adjust the model parameters of the neural network model in the next training round.

7. A federated learning device based on forward gradients, characterized in that, The device is an edge device located on the network terminal side, and the edge device is an edge device selected by the network cloud. It includes: a receiving unit, a second computing unit, and a transmitting unit. The receiving unit is used to receive random seeds and model parameters of the neural network model sent from the network cloud. The second computing unit is used to generate a random direction vector based on the received random seed, and to calculate the derivative of the objective function in the neural network model in the direction of the random direction vector based on local data. The sending unit is configured to send the derivative of the objective function in the neural network model along the random direction vector to the network cloud, such that: for each edge device, the network cloud calculates the forward gradient of the neural network model on the edge device based on the received derivative of the objective function in the neural network model along the random direction vector and the random seed sent to the edge device; based on the calculated forward gradients of all edge devices, the gradient of the neural network model is calculated to adjust the model parameters of the neural network model in the next training round.

8. An electronic device, characterized in that, include: processor; A memory storing a program configured to implement, when executed by the processor, a forward gradient-based federated learning method as described in any one of claims 1 to 4.

9. A non-transitory computer-readable storage medium, wherein the non-transitory computer-readable storage medium stores instructions, characterized in that, When executed by a processor, the instructions cause the processor to perform a federated learning method based on forward gradients as described in any one of claims 1 to 4.

10. A computer program product, comprising a computer program or instructions, characterized in that, When the computer program or instructions are executed by a processor, they implement the steps of a federated learning method based on forward gradients as described in any one of claims 1 to 4.

Citation Information

Patent Citations

  • System for secure and efficient federated learning

    US20240144029A1