CN115618965A - Federal learning method, device, equipment and medium based on edge calculation - Google Patents

Federal learning method, device, equipment and medium based on edge calculation Download PDF

Info

Publication number
CN115618965A
CN115618965A CN202211336600.6A CN202211336600A CN115618965A CN 115618965 A CN115618965 A CN 115618965A CN 202211336600 A CN202211336600 A CN 202211336600A CN 115618965 A CN115618965 A CN 115618965A
Authority
CN
China
Prior art keywords
model
edge computing
computing server
clients
global model
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211336600.6A
Other languages
Chinese (zh)
Inventor
史国梅
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Agricultural Bank of China
Original Assignee
Agricultural Bank of China
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Agricultural Bank of China filed Critical Agricultural Bank of China
Priority to CN202211336600.6A priority Critical patent/CN115618965A/en
Publication of CN115618965A publication Critical patent/CN115618965A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N20/00Machine learning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5061Partitioning or combining of resources
    • G06F9/5072Grid computing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • G06N3/084Backpropagation, e.g. using gradient descent
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/50Indexing scheme relating to G06F9/50
    • G06F2209/5011Pool

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Artificial Intelligence (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Computation (AREA)
  • Computing Systems (AREA)
  • Biomedical Technology (AREA)
  • Health & Medical Sciences (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Biophysics (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Molecular Biology (AREA)
  • Medical Informatics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the invention discloses a federal learning method, a federal learning device, federal learning equipment and a federal learning medium based on edge calculation. Wherein, the method comprises the following steps: the central server sends the original global model to an edge computing server; the edge computing server splits the original global model to obtain a plurality of sub models; at least part of the submodels are sent to a plurality of clients for deployment, and the rest submodels are deployed in the edge computing server; performing joint training on the original global model through data interaction between the plurality of clients and the edge computing server to obtain a new intermediate model; and the central server fuses the new intermediate model and the original global model to obtain a target global model. According to the technical scheme, the Federal learning system is deployed by utilizing edge computing power, so that the training pressure of the client is relieved, and the communication efficiency of the client and the server is improved.

Description

Federal learning method, device, equipment and medium based on edge calculation
Technical Field
The invention relates to the technical field of data processing, in particular to a federal learning method, a federal learning device, federal learning equipment and a federal learning medium based on edge calculation.
Background
With the wide application of artificial intelligence technology in the fields of unmanned driving, medical treatment, finance and the like, massive intelligent mobile devices are connected to a network, and the devices can generate large-scale and valuable data in the operation process. Federal learning is a distributed machine learning method, and can be used for scheduling mobile equipment to train a model locally and independently by using data of the mobile equipment, and uploading trained model parameters to a server to form a new model.
The existing scheme can focus on synchronous training or combine an asynchronous training mode for training through FedAvg, but the existing scheme has the computational pressure of training a neural network by a client. While these client devices concurrently communicate with the central server, they face a communication load bottleneck problem.
Disclosure of Invention
The invention provides a federated learning method, a federated learning device, federated learning equipment and a federated learning medium based on edge computing, wherein a federated learning system is deployed by utilizing edge computing power, so that the training pressure of a client is relieved, and the communication efficiency of the client and a server is improved.
According to an aspect of the invention, a federated learning method based on edge calculation is provided, which includes:
the central server sends the original global model to an edge computing server;
the edge computing server splits the original global model to obtain a plurality of sub models; at least part of the submodels are sent to a plurality of clients for deployment, and the rest submodels are deployed in the edge computing server;
performing joint training on the original global model through data interaction between the plurality of clients and the edge computing server to obtain a new intermediate model;
and the central server fuses the new intermediate model and the original global model to obtain a target global model.
Optionally, performing joint training on the original global model through data interaction between the multiple clients and the edge computing server to obtain a new intermediate model, including:
creating thread pools with the same number as the clients at the edge computing server;
and performing data interaction with the plurality of clients through the thread pool so as to perform joint training on the original global model.
Optionally, the plurality of submodels includes a first submodel, a second submodel, and a third submodel; the first sub-model is composed of an input network layer, the second sub-model is composed of an intermediate network layer, and the third sub-model is composed of an output network layer; at least part of the submodels are sent to a plurality of clients for deployment, and the rest submodels are deployed in the edge computing server, wherein the method comprises the following steps:
sending the first sub-model and the third sub-model to a plurality of clients for deployment; deploying the second sub-model to the edge computing server.
Optionally, performing joint training on the original global model through data interaction between the multiple clients and the edge computing server to obtain a new intermediate model, including:
the client inputs the sample data into the first submodel, outputs first intermediate data and sends the first intermediate data to the edge computing server;
the edge computing server inputs the second intermediate output data into the second submodel, outputs second intermediate data and sends the second intermediate data to the client;
the client inputs the second intermediate data into the third submodel and outputs gradient data;
and performing joint training on the original global model based on the gradient data to obtain a new intermediate model.
Optionally, performing joint training on the original global model based on the gradient data to obtain a new intermediate model, including:
carrying out back propagation on the gradient data in the original global model to obtain a training result; wherein the training result comprises a first parameter of the first submodel, a second parameter of the second submodel and a third parameter of the third submodel.
The client sends the first parameter and the third parameter to the edge computing server;
the edge computing server averages first parameters of a plurality of clients, averages third parameters of the clients, and averages second parameters corresponding to the clients respectively to obtain an intermediate model.
Optionally, the fusing, by the central server, the new intermediate model and the original global model to obtain a target global model, including:
the central server receives the new intermediate model and the iteration times sent by the edge computing server;
determining a penalty factor according to the iteration times;
and performing weighted calculation on the new intermediate model and the original global model according to the penalty factor to obtain a target global model.
Optionally, determining a penalty factor according to the iteration number includes:
carrying out subtraction operation on the iteration times of the original model and the iteration times of the new intermediate model to obtain a difference value;
and performing index setting operation on the difference value to obtain a penalty factor.
According to another aspect of the present invention, there is provided a federated learning apparatus based on edge calculation, including:
the model sending module is used for sending the original global model to the edge computing server by the central server;
the model splitting module is used for splitting the original global model by the edge computing server to obtain a plurality of sub models; at least part of the submodels are sent to a plurality of clients for deployment, and the rest submodels are deployed in the edge computing server;
the joint training module is used for performing joint training on the original global model through data interaction between the plurality of clients and the edge computing server to obtain a new intermediate model;
and the target global model obtaining module is used for fusing the new intermediate model and the original global model by the central server to obtain a target global model.
According to another aspect of the present invention, there is provided an electronic apparatus including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the edge computing-based federated learning method of any embodiment of the present invention.
According to another aspect of the present invention, there is provided a computer-readable storage medium storing computer instructions for causing a processor to implement the edge-computing-based federated learning method according to any one of the embodiments of the present invention when the computer instructions are executed.
According to the technical scheme of the embodiment of the invention, the original global model is sent to the edge computing server through the central server; the edge computing server splits the original global model to obtain a plurality of sub models; at least part of the submodels are sent to a plurality of clients for deployment, and the rest submodels are deployed in the edge computing server; performing joint training on the original global model through data interaction between the plurality of clients and the edge computing server to obtain a new intermediate model; and the central server fuses the new intermediate model and the original global model to obtain a target global model. According to the technical scheme, the Federal learning system is deployed by utilizing edge computing power, so that the training pressure of the client is relieved, and the communication efficiency of the client and the server is improved.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present invention, nor do they necessarily limit the scope of the invention. Other features of the present invention will become apparent from the following description.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the description below are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a flowchart of a federated learning method based on edge calculation according to an embodiment of the present invention;
fig. 2 is an exemplary diagram of a splitting model of a federal learning method based on edge calculation according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of a federal learning device based on edge calculation according to a second embodiment of the present invention;
fig. 4 is a schematic structural diagram of an electronic device according to a third embodiment of the present invention.
Detailed Description
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Example one
Fig. 1 is a flowchart of an edge-computation-based federated learning method according to an embodiment of the present invention, where the embodiment is applicable to a case of performing joint learning on a model, and the method may be executed by an edge-computation-based federated learning apparatus, which may be implemented in a form of hardware and/or software, and may be configured in an electronic device with data processing capability. As shown in fig. 1, the method includes:
and S110, the central server sends the original global model to the edge computing server.
Wherein, the central server can be understood as a server mainly controlled by the joint learning. The original global model can be any machine model needing training, such as a neural network model, which is a mathematical model and is divided into a plurality of layers, each layer is provided with parameters and calculation rules, the model is divided into a fully-connected layer, a convolutional layer, a pooling layer and the like according to different calculation rules, and the calculated amount, namely the product times, of the general convolutional layer is larger than that of the fully-connected layer; then an output result is obtained, and the result is transmitted to the next layer for calculation. The edge computing server can be an open platform integrating network, computing, storage and application core capabilities at one side close to an object or a data source to provide nearest-end service nearby. In the embodiment, when the central server sends the original global model to the edge computing server, the central server also sends related task configuration; the task configuration may include information such as the number of clients to be selected and the number of local training times of the clients.
In this embodiment, the central server sends the original global model to the edge calculation server.
S120, the edge computing server splits the original global model to obtain a plurality of submodels; and sending at least part of the submodels to a plurality of clients for deployment, and deploying the rest of the submodels in the edge computing server.
The multiple sub-models may be obtained by splitting the original global model. In this embodiment, the edge computing server may be split according to the calculated amount of the model, the submodel with a large calculated amount may be left in the edge computing server for deployment, and the submodel with a small calculated amount may be sent to a plurality of clients for deployment. For example, in this embodiment, the full connection layer of the model may be split and sent to the client for training. In this embodiment, the splitting may be performed according to actual requirements. Wherein at least part of the sub-models may determine part of the sub-models from the actually split model. A plurality of clients can be set according to task configuration of the central server, and technical personnel can set according to actual requirements. In this embodiment, the edge computing server may send the split partial sub-model to a plurality of clients for deployment. In this embodiment, a synchronous communication mode is adopted between the edge computing server and the client, and an asynchronous communication mode is adopted between the edge computing server and the central server.
In this embodiment, the edge computing server splits the original global model to obtain a plurality of submodels, and sends at least part of the submodels to a plurality of clients for deployment, and the rest of the submodels are deployed in the edge computing server.
In this embodiment, optionally, the plurality of submodels includes a first submodel, a second submodel, and a third submodel; the first sub-model is composed of an input network layer, the second sub-model is composed of an intermediate network layer, and the third sub-model is composed of an output network layer; at least part of the submodels are sent to a plurality of clients for deployment, and the rest submodels are deployed in the edge computing server, wherein the method comprises the following steps: sending the first sub-model and the third sub-model to a plurality of clients for deployment; deploying the second sub-model to the edge computing server.
Wherein the plurality of submodels may include a first submodel, a second submodel, and a third submodel. The first submodel may be composed of an input network layer, the second submodel may be composed of an intermediate network layer, and the third submodel may be composed of an output network layer; exemplarily, an example of the splitting model is shown in fig. 2, where the first sub-model is a split first part, which is an input network layer, and the second sub-model may be a split second part, which is an intermediate network layer, and may include network layers such as a first layer of convolution, a pooling layer, a second layer of convolution, and a pooling layer, or may be split according to actual requirements; the third sub-model may be a third split part, that is, the output network layer may include network layers such as a full connection layer and a classification layer, and may be split according to actual requirements.
In this embodiment, the split first sub-model and the split third sub-model may be sent to a plurality of clients for deployment; and deploying the second sub-model to the edge computing server. Through the setting, the global model can be split and trained and respectively deployed on the edge computing server and the client, and the pressure of the client computing machine model can be relieved.
In this embodiment, optionally, performing joint training on the original global model through data interaction between the multiple clients and the edge computing server to obtain a new intermediate model, including: the client inputs the sample data into the first submodel, outputs first intermediate data and sends the first intermediate data to the edge computing server; the edge computing server inputs the second intermediate output data into the second submodel, outputs second intermediate data and sends the second intermediate data to the client; the client inputs the second intermediate data into the third submodel and outputs gradient data; and performing joint training on the original global model based on the gradient data to obtain a new intermediate model.
The sample data can be understood as the sample data which needs the sub-model for training. The first intermediate data may be understood as data output by the first submodel training, that is, data output by the client inputting sample data into the first submodel. In this embodiment, the client inputs the sample data into the first submodel, outputs the first intermediate data, and sends the first intermediate data to the edge calculation server. The second intermediate data may be data that is understood to be output by the training of the second submodel, i.e. data that is output by the edge calculation server inputting the second intermediate output data into the second submodel. In this embodiment, the second intermediate output data may be input into the second sub-model through the edge computing server, the second intermediate data is output, and the second intermediate data is sent to the client. The gradient data may characterize the difference information between the real values and the training values. The gradient data may be data obtained by training the third submodel, that is, data output by the client inputting the second intermediate data into the third submodel. The new intermediate model may be obtained by jointly training the original global model based on the gradient data. In this embodiment, joint training may be performed on the original global model based on the gradient data, which may be understood as performing back propagation training according to the gradient data to modify parameters such as constants and obtain a new intermediate model. The implementation can continuously iterate according to the training mode until a satisfactory training result is achieved.
In this embodiment, the client may input the sample data into the first sub-model, output the first intermediate data, and send the first intermediate data to the edge computing server; the edge computing server inputs the second intermediate output data into a second submodel, outputs the second intermediate data and sends the second intermediate data to at least the client; the client inputs the second intermediate data into a third sub-model and outputs gradient data; and performing joint training on the original global model based on the gradient data to obtain a new intermediate model. Through the setting, the communication load between the client and the server can be reduced through split training, and the calculation pressure of the client for training the machine model is relieved.
In this embodiment, optionally, performing joint training on the original global model based on the gradient data to obtain a new intermediate model, including: carrying out back propagation on the gradient data in the original global model to obtain a training result; wherein the training result comprises a first parameter of the first submodel, a second parameter of the second submodel and a third parameter of the third submodel. The client sends the first parameter and the third parameter to the edge computing server; the edge computing server averages first parameters of a plurality of clients, averages third parameters of the clients, and averages second parameters corresponding to the clients respectively to obtain an intermediate model.
Wherein the training result may comprise a first parameter of the first submodel, a second parameter of the second submodel and a third parameter of the third submodel. In this embodiment, the gradient data may be propagated backward in the original global model, or may be understood as adjusting constant parameters backward to obtain a training result. In this embodiment, the first parameter and the third parameter may be sent to the edge computing server through the client; the edge computing server averages first parameters of the plurality of clients, averages third parameters of the plurality of clients, and averages second parameters corresponding to the plurality of clients, respectively, so as to obtain an intermediate model.
In principle, in this embodiment, the edge computing server should also perform interaction with all the clients selected in this round to complete model training, and then calculate a new intermediate model according to an average of the first parameter, the second parameter, and the third parameter, and then send the new intermediate model to the central server. However, in each round, there are some clients that fail training due to other bursty problems. Therefore, according to the configuration file of the server, the edge computing server can compute a new intermediate model and send the new intermediate model to the central server as long as a sufficient number of model training is completed, otherwise, the edge computing server abandons the training of the current round. Specifically, a sufficient number of model trainings may be set by the developer according to actual requirements.
By means of the setting, the parameters can be averaged according to the gradient data, so that an intermediate model is obtained, and a model with high accuracy can be obtained conveniently in the following process.
S130, performing joint training on the original global model through data interaction between the plurality of clients and the edge computing server to obtain a new intermediate model.
The data interaction can be the interaction of data of a plurality of clients and the edge computing server. The new intermediate model can be obtained by jointly training the original global model through data interaction of a plurality of clients and the edge computing server. In this embodiment, a synchronous communication mode may be adopted between the edge computing servers and the clients, so that each edge server sends to the central server a result of integration of multiple client models.
In this embodiment, the original global model may be jointly trained through data interaction between a plurality of clients and the edge computing server to obtain a new intermediate model.
In this embodiment, optionally, the jointly training the original global model through data interaction between the multiple clients and the edge computing server to obtain a new intermediate model includes: creating thread pools with the same number as the clients at the edge computing server; and performing data interaction with the plurality of clients through the thread pool to perform joint training on the original global model.
Wherein, the thread pool is a multi-thread processing form, tasks are added into a queue in the process, and then the tasks are automatically started after the threads are created. The thread pool threads are all background threads. The thread pool can be used for data interaction between the edge computing server and a plurality of clients. In this embodiment, thread pools with the same number as that of the clients can be created in the edge computing server; and performing data interaction with a plurality of clients through the thread pool so as to perform joint training on the original global model.
Illustratively, the client receives the model sent by the edge computing server, then performs computation of the input layer, then sends the value output by the input layer to the edge computing server, the edge computing server starts a thread, and continuously transmits the intermediate values to the following convolutional layer, pooling layer and the like for computation, and finally feeds back the new intermediate values to the client, and the client performs computation of the final output layer to obtain the gradient.
Through the arrangement, the edge computing server can perform data interaction with the client through the thread pool, and joint training is facilitated.
S140, the central server fuses the new intermediate model and the original global model to obtain a target global model.
Wherein fusion is understood as a weighted calculation based on a penalty factor. The target global model can be understood as a model in which the final training result reaches the preset requirements of the developer. The target global model can be understood as a result of the central server fusing the new intermediate model and the original global model. The central server in this embodiment may fuse the new intermediate model and the original global model to obtain the target global model.
In this embodiment, optionally, the fusing, by the central server, the new intermediate model and the original global model to obtain a target global model includes: the central server receives the new intermediate model and the iteration times sent by the edge computing server; determining a penalty factor according to the iteration times; and performing weighted calculation on the new intermediate model and the original global model according to the penalty factor to obtain a target global model.
The new intermediate model can be understood as a model obtained through data interaction after the training of the edge computing server and the training of the client. The number of iterations may be understood as the number of iterations of the new intermediate model sent by the edge calculation server in order to confirm the current version of the model at the time of sending. The penalty factor may be determined based on the number of iterations. In this embodiment, the target global model may be obtained by performing weighted calculation on the new intermediate model and the original global model according to a penalty factor.
In this embodiment, optionally, determining a penalty factor according to the iteration number includes:
carrying out subtraction operation on the iteration times of the original model and the iteration times of the new intermediate model to obtain a difference value;
and performing index setting operation on the difference value to obtain a penalty factor.
The difference can be understood as the difference between the number of iterations of the original model and the number of iterations of the new intermediate model. Illustratively, the number of iterations of the current original model is 10, and the number of iterations of the new intermediate model is 1, the difference is 10-1=9. The set index can be understood as being preset and can be set according to actual requirements. In this embodiment, the iteration number of the original model and the iteration number of the new intermediate model may be subtracted to obtain a difference, and the difference may be subjected to an exponential operation to obtain a penalty factor.
Further, the specific calculation formula of the penalty factor can be shown as follows:
Figure BDA0003914806700000121
wherein l b The function of (t-tau) is understood as the penalty factor h t T may represent the number of iterations of the current original global model; τ can represent the iteration number of the current new intermediate model, and can also be understood as the current version number; b may represent a constant for adjustment. In this embodiment, the penalty factor may be determined according to the timestamp information.
Illustratively, the update thread of the central server receives feedback (e.g., w) from any edge servers t+1 T) is calculated immediately on the basis of the timestamp t and the version of the current new intermediate model, to obtain a weight (t- τ), i.e. a penalty factor h t =l b (t- τ). The formula of the penalty factor is shown in the formula, and then the intermediate model and the global model are subjected to a weighted weight-balancing algorithm according to the weights so as to obtain a new global model.
According to the technical scheme of the embodiment of the invention, the original global model is sent to the edge computing server through the central server; the edge computing server splits the original global model to obtain a plurality of sub models; at least part of the submodels are sent to a plurality of clients for deployment, and the rest submodels are deployed in the edge computing server; performing joint training on the original global model through data interaction between the plurality of clients and the edge computing server to obtain a new intermediate model; and the central server fuses the new intermediate model and the original global model to obtain a target global model. According to the technical scheme, the Federal learning system is deployed by utilizing edge computing power, so that the training pressure of the client is relieved, and the communication efficiency of the client and the server is improved.
Example two
Fig. 3 is a schematic structural diagram of a federal learning device based on edge calculation according to a second embodiment of the present invention. As shown in fig. 3, the apparatus includes:
a model sending module 310, configured to send the original global model to the edge computing server by the central server;
a model splitting module 320, configured to split the original global model by the edge computing server to obtain multiple sub models; at least part of the submodels are sent to a plurality of clients for deployment, and the rest submodels are deployed in the edge computing server;
a joint training module 330, configured to perform joint training on the original global model through data interaction between the multiple clients and the edge computing server, to obtain a new intermediate model;
a target global model obtaining module 340, configured to fuse the new intermediate model and the original global model by the central server, so as to obtain a target global model.
Optionally, the joint training module 330 is configured to:
creating thread pools with the same number as the clients at the edge computing server;
and performing data interaction with the plurality of clients through the thread pool to perform joint training on the original global model.
Optionally, the plurality of submodels includes a first submodel, a second submodel, and a third submodel; the first sub-model is composed of an input network layer, the second sub-model is composed of an intermediate network layer, and the third sub-model is composed of an output network layer; a model splitting module 320 to:
sending the first sub-model and the third sub-model to a plurality of clients for deployment; deploying the second sub-model to the edge computing server.
Optionally, the joint training module 330 includes:
the first intermediate data output unit is used for inputting sample data into the first sub-model by the client, outputting first intermediate data and sending the first intermediate data to the edge computing server;
a second intermediate data output unit, configured to input, by the edge computing server, the second intermediate output data into the second submodel, output second intermediate data, and send the second intermediate data to the client;
a gradient data output unit, configured to input the second intermediate data into the third submodel by the client, and output gradient data;
and the joint training unit is used for performing joint training on the original global model based on the gradient data to obtain a new intermediate model.
Optionally, the joint training unit is configured to:
carrying out back propagation on the gradient data in the original global model to obtain a training result; wherein the training result comprises a first parameter of the first submodel, a second parameter of the second submodel and a third parameter of the third submodel.
The client sends the first parameter and the third parameter to the edge computing server;
the edge computing server averages first parameters of a plurality of clients, averages third parameters of the clients, and averages second parameters corresponding to the clients respectively to obtain an intermediate model.
Optionally, the target global model obtaining module 340 includes:
the data sending unit is used for receiving the new intermediate model and the iteration times sent by the edge computing server by the central server;
a penalty factor determining unit, configured to determine a penalty factor according to the iteration number;
and the target global model obtaining unit is used for carrying out weighting calculation on the new intermediate model and the original global model according to the penalty factors to obtain a target global model.
Optionally, the penalty factor determining unit is configured to:
carrying out subtraction operation on the iteration times of the original model and the iteration times of the new intermediate model to obtain a difference value;
and performing index setting operation on the difference value to obtain a penalty factor.
The edge calculation-based federal learning device provided by the embodiment of the invention can execute the edge calculation-based federal learning method provided by any embodiment of the invention, and has corresponding functional modules and beneficial effects of the execution method.
EXAMPLE III
Fig. 4 is a schematic structural diagram of an electronic device according to a third embodiment of the present invention. The electronic device 10 is intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the inventions described and/or claimed herein.
As shown in fig. 4, the electronic device 10 includes at least one processor 11, and a memory communicatively connected to the at least one processor 11, such as a Read Only Memory (ROM) 12, a Random Access Memory (RAM) 13, and the like, wherein the memory stores a computer program executable by the at least one processor, and the processor 11 can perform various suitable actions and processes according to the computer program stored in the Read Only Memory (ROM) 12 or the computer program loaded from a storage unit 18 into the Random Access Memory (RAM) 13. In the RAM 13, various programs and data necessary for the operation of the electronic apparatus 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other via a bus 14. An input/output (I/O) interface 15 is also connected to bus 14.
A number of components in the electronic device 10 are connected to the I/O interface 15, including: an input unit 16 such as a keyboard, a mouse, or the like; an output unit 17 such as various types of displays, speakers, and the like; a storage unit 18 such as a magnetic disk, an optical disk, or the like; and a communication unit 19 such as a network card, modem, wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information/data with other devices via a computer network such as the internet and/or various telecommunication networks.
The processor 11 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various processors running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, or the like. Processor 11 performs the various methods and processes described above, such as the federal learning method based on edge calculations.
In some embodiments, the edge-computation-based federated learning approach may be implemented as a computer program that is tangibly embodied in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and/or installed onto the electronic device 10 via the ROM 12 and/or the communication unit 19. When loaded into RAM 13 and executed by processor 11, the computer program may perform one or more of the steps of the edge-computation-based federated learning method described above. Alternatively, in other embodiments, the processor 11 may be configured to perform the edge-computation-based federated learning method by any other suitable means (e.g., by way of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), system on a chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
A computer program for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions/acts specified in the flowchart and/or block diagram block or blocks to be performed. A computer program can execute entirely on a machine, partly on a machine, as a stand-alone software package partly on a machine and partly on a remote machine or entirely on a remote machine or server.
In the context of the present invention, a computer-readable storage medium may be a tangible medium that can contain, or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. A computer readable storage medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, the computer readable storage medium may be a machine readable signal medium. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the electronic device. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), blockchain networks, and the internet.
The computing system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical host and VPS service are overcome.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present invention may be executed in parallel, sequentially, or in different orders, and are not limited herein as long as the desired results of the technical solution of the present invention can be achieved.
The above-described embodiments should not be construed as limiting the scope of the invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. An edge calculation-based federated learning method, comprising:
the central server sends the original global model to an edge computing server;
the edge computing server splits the original global model to obtain a plurality of submodels; at least part of the submodels are sent to a plurality of clients for deployment, and the rest submodels are deployed in the edge computing server;
performing joint training on the original global model through data interaction between the plurality of clients and the edge computing server to obtain a new intermediate model;
and the central server fuses the new intermediate model and the original global model to obtain a target global model.
2. The method of claim 1, wherein jointly training the original global model through data interaction between the plurality of clients and the edge computing server to obtain a new intermediate model comprises:
creating thread pools with the same number as the clients at the edge computing server;
and performing data interaction with the plurality of clients through the thread pool to perform joint training on the original global model.
3. The method of claim 1, wherein the plurality of submodels includes a first submodel, a second submodel, and a third submodel; the first sub-model is composed of an input network layer, the second sub-model is composed of an intermediate network layer, and the third sub-model is composed of an output network layer; at least part of the submodels are sent to a plurality of clients for deployment, and the rest submodels are deployed in the edge computing server, wherein the method comprises the following steps:
sending the first sub-model and the third sub-model to a plurality of clients for deployment; deploying the second sub-model to the edge computing server.
4. The method of claim 3, wherein jointly training the original global model through data interaction between the plurality of clients and the edge computing server to obtain a new intermediate model comprises:
the client inputs the sample data into the first submodel, outputs first intermediate data and sends the first intermediate data to the edge computing server;
the edge computing server inputs the second intermediate output data into the second submodel, outputs second intermediate data and sends the second intermediate data to the client;
the client inputs the second intermediate data into the third submodel and outputs gradient data;
and performing joint training on the original global model based on the gradient data to obtain a new intermediate model.
5. The method of claim 4, wherein jointly training the original global model based on the gradient data to obtain a new intermediate model comprises:
carrying out back propagation on the gradient data in the original global model to obtain a training result; wherein the training result comprises a first parameter of the first submodel, a second parameter of the second submodel and a third parameter of the third submodel.
The client sends the first parameter and the third parameter to the edge computing server;
the edge computing server averages first parameters of a plurality of clients, averages third parameters of the clients, and averages second parameters corresponding to the clients respectively to obtain an intermediate model.
6. The method of claim 1, wherein the central server fuses the new intermediate model and the original global model to obtain a target global model, comprising:
the central server receives the new intermediate model and the iteration times sent by the edge computing server;
determining a penalty factor according to the iteration times;
and performing weighted calculation on the new intermediate model and the original global model according to the penalty factor to obtain a target global model.
7. The method of claim 6, wherein determining a penalty factor based on the number of iterations comprises:
carrying out subtraction operation on the iteration times of the original model and the iteration times of the new intermediate model to obtain a difference value;
and performing index setting operation on the difference value to obtain a penalty factor.
8. An edge-computation-based federated learning apparatus, comprising:
the model sending module is used for sending the original global model to the edge computing server by the central server;
the model splitting module is used for splitting the original global model by the edge computing server to obtain a plurality of sub models; at least part of the submodels are sent to a plurality of clients for deployment, and the rest submodels are deployed in the edge computing server;
the joint training module is used for performing joint training on the original global model through data interaction between the plurality of clients and the edge computing server to obtain a new intermediate model;
and the target global model obtaining module is used for fusing the new intermediate model and the original global model by the central server to obtain a target global model.
9. An electronic device, characterized in that the electronic device comprises:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the edge computing-based federated learning method of any one of claims 1-7.
10. A computer readable storage medium having stored thereon computer instructions for causing a processor to implement the edge computing-based federated learning method of any one of claims 1-7 when executed.
CN202211336600.6A 2022-10-28 2022-10-28 Federal learning method, device, equipment and medium based on edge calculation Pending CN115618965A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211336600.6A CN115618965A (en) 2022-10-28 2022-10-28 Federal learning method, device, equipment and medium based on edge calculation

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211336600.6A CN115618965A (en) 2022-10-28 2022-10-28 Federal learning method, device, equipment and medium based on edge calculation

Publications (1)

Publication Number Publication Date
CN115618965A true CN115618965A (en) 2023-01-17

Family

ID=84877000

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211336600.6A Pending CN115618965A (en) 2022-10-28 2022-10-28 Federal learning method, device, equipment and medium based on edge calculation

Country Status (1)

Country Link
CN (1) CN115618965A (en)

Similar Documents

Publication Publication Date Title
CN115147687A (en) Student model training method, device, equipment and storage medium
CN115358411A (en) Data processing method, device, equipment and medium
CN113965313B (en) Model training method, device, equipment and storage medium based on homomorphic encryption
CN114818913A (en) Decision generation method and device
CN113657468A (en) Pre-training model generation method and device, electronic equipment and storage medium
CN113379153A (en) Method for predicting power load, prediction model training method and device
CN117333076A (en) Evaluation method, device, equipment and medium based on mixed expert model
CN115618965A (en) Federal learning method, device, equipment and medium based on edge calculation
JP7314330B2 (en) Training method, apparatus, equipment and storage medium for power grid system dispatching model
CN110322342A (en) Borrow or lend money construction method, system and the debt-credit Risk Forecast Method of risk forecast model
CN113642654B (en) Image feature fusion method and device, electronic equipment and storage medium
CN115759751A (en) Enterprise risk prediction method and device, storage medium, electronic equipment and product
CN115081630A (en) Training method of multi-task model, information recommendation method, device and equipment
CN114819095A (en) Method and device for generating business data processing model and electronic equipment
CN114565961A (en) Face detection model training method and device, electronic equipment and storage medium
CN117251295B (en) Training method, device, equipment and medium of resource prediction model
CN115660034B (en) Distributed model training method, device and system
CN117633184A (en) Model construction and intelligent reply method, device and medium
CN116167464A (en) Method, device, equipment and medium for predicting operation time of federal learning task
CN115598967A (en) Parameter setting model training method, parameter determining method, device, equipment and medium
CN116523249A (en) Production line determining method, device, equipment and storage medium
CN114936429A (en) Resistance prediction network training method, ship resistance prediction method and related device
CN116992150A (en) Research and development component recommendation method, device, equipment and storage medium
CN115293260A (en) Age prediction model training method, device, equipment and storage medium
CN117692487A (en) Remote control method and device of equipment, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination