Federal learning method and device based on communication network

By using local training, neighbor consensus and global aggregation strategies based on the cumulative number of updates of model parameters on the communication network node side of federated learning, the communication bottlenecks and lack of global optimization in centralized and decentralized federated learning methods are solved. , achieving correct convergence of model parameters and overall performance improvement.

CN119416868APending Publication Date: 2025-02-11BEIJING UNIV OF POSTS & TELECOMM
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411538491.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-31
Publication Date
2025-02-11

AI Technical Summary

Technical Problem

In the existing federated learning methods, centralized methods have communication bottlenecks, while decentralized methods lack the coordination and global optimization perspective of servers, resulting in model parameter updates not approaching the global optimal solution.

Method used

By using different training strategies according to the cumulative number of updates of model parameters on the node side in the communication network: local training, neighbor consensus and global aggregation to ensure that the model parameter update approaches the global optimal solution.

Benefits of technology

The communication bottleneck of centralized federated learning is effectively avoided, and the local optimal problem in decentralized federated learning is avoided through global aggregation, which improves the correct convergence of model parameters, overall accuracy and reliability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119416868A_ABST
    Figure CN119416868A_ABST
Patent Text Reader

Abstract

The invention discloses a federated learning method based on a communication network, and the method comprises the steps: carrying out the training of any round of a to-be-learned neural network model of a node at any node side, when the current cumulative update frequency of the model parameters of the to-be-learned neural network model is not the integral multiple of the first interval frequency and the integral multiple of the second interval frequency, local training is carried out on the node, and when the current cumulative update frequency is the integral multiple of the first interval frequency and is not the integral multiple of the second interval frequency, local training is carried out on the node; and when the current cumulative update frequency is an integral multiple of the second interval frequency, the node obtains an aggregation model parameter, obtains a model parameter for representing global aggregation, carries out next update based on the obtained model parameter and accumulates the update frequency, and finally obtains a neighbor consensus model parameter and a neighbor consensus model parameter when the current cumulative update frequency is an integral multiple of the second interval frequency. And the current accumulative update frequency reaches the update frequency threshold. The performance of the neural network model is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence, and in particular, to a federated learning method based on a communication network. Background Art

[0002] Modern mobile devices can obtain a large amount of data suitable for training neural network models, which greatly improves the user experience. However, since the obtained training data often involves privacy attributes, the neural network model is restricted when training. Federated learning (FL), as a variant of machine learning, provides a communication-efficient way to process large amounts of distributed data and protect privacy.

[0003] In the related technologies of the federated learning method based on the communication network, for example, the centralized federated learning method has a high communication cost between the server and the node devices such as the client devices, and the aggregation of model parameters often leads to a large communication bottleneck. Although the decentralized federated learning method avoids the significant communication burden between the server and the node devices, due to the lack of server coordination and global optimization perspective, the node devices only perform model training locally and between their neighboring nodes, which may cause the local model of the node device to fall into the local optimal solution, thereby affecting the final overall model performance and convergence quality. Summary of the invention

[0004] The present invention provides a communication network-based federated learning method to improve the performance of a neural network model.

[0005] A first aspect of the present invention provides a communication network-based federated learning method, the method comprising:

[0006] At any node in the communication network,

[0007] In any round of training of any neural network model to be learned at this node,

[0008] When the current cumulative update times of the model parameters of the neural network model to be learned is not an integer multiple of the first interval times set to characterize the neighbor consensus interval, and is not an integer multiple of the second interval times set to characterize the global aggregation interval, local training is performed at this node to obtain the model parameters of this update, and the next update is performed based on the model parameters and the update times are accumulated until the current cumulative update times reaches the set update times threshold.

[0009] When the current cumulative update times of the model parameters of the neural network model to be learned is an integer multiple of the first interval times and is not an integer multiple of the second interval times, the node fuses the model parameters of the neural network model to be learned in each neighboring node that directly communicates with it at the current cumulative update times and the model parameters of the neural network model to be learned in the node at the current cumulative update times to obtain the model parameters for characterizing the neighbor consensus, and performs the next update based on the model parameters and accumulates the update times until the current cumulative update times reaches the update times threshold.

[0010] When the current cumulative update times of the model parameters of the neural network model to be learned is an integer multiple of the second interval times, the node obtains the aggregated model parameters of the model parameters of the neural network model to be learned at the current cumulative update times of at least one or more nodes in its communication network, obtains the model parameters used to characterize the global aggregation, performs the next update based on the model parameters and accumulates the update times until the current cumulative update times reaches the update times threshold.

[0011] As a possible implementation, the performing local training at the local node includes:

[0012] Extract batch data from the training data set of this node, input the extracted batch data into the neural network model to be learned one by one, and obtain the output results one by one.

[0013] The output results are used to obtain the stochastic gradient information of the gradient values ​​of the model parameters of the neural network model to be learned at the current cumulative update number.

[0014] According to the stochastic gradient information and the set stochastic gradient step size, the current model parameters of the neural network model to be learned are adjusted.

[0015] As a possible implementation, the method of using each output result to obtain the stochastic gradient information of the gradient value of the model parameter of the neural network model to be learned at the current cumulative update number includes:

[0016] Based on each output result, calculate the gradient value of the loss function value of each output result,

[0017] Calculate the ratio of the accumulated value of the calculated gradient value to the input batch data size to obtain the stochastic gradient information of the current model parameters;

[0018] The step of adjusting the current model parameters of the neural network model to be learned according to the stochastic gradient information and the set stochastic gradient change step size includes:

[0019] Based on the current model parameters, the model parameter values ​​are reduced, and the reduced model parameter values ​​are the product of the stochastic gradient change step size and the stochastic gradient information.

[0020] As a possible implementation mode, the node fuses the model parameters of the neural network model to be learned in each neighboring node that directly communicates with it at the current cumulative update number, and the model parameters of the neural network model to be learned in the node at the current cumulative update number, including:

[0021] The node obtains the model parameters of the neural network model to be learned in each of its neighboring nodes at the current cumulative update times.

[0022] The obtained model parameters and the model parameters of the neural network model to be learned in the node at the current cumulative update times are weighted averaged, and the weights used make the model parameters of the neural network model to be learned converge.

[0023] As a possible implementation, after obtaining the model parameters for characterizing the neighbor consensus, the method further includes:

[0024] The node sends the weighted average model parameters to each neighboring node of the node, so that the model parameters of the neural network model to be learned in each neighboring node are updated;

[0025] The step of performing weighted averaging on the obtained model parameters and the model parameters of the neural network model to be learned in the node at the current cumulative update times includes:

[0026] Construct a weight matrix, the number of rows and columns of the weight matrix are the total number of nodes in the communication network, each row corresponds to a node, each column corresponds to a node, any element in the weight matrix is ​​used to represent the weight between the node corresponding to the row of the element and the node corresponding to the column of the element, wherein the element with a value of 0 is used to represent that the node corresponding to the row of the element and the node corresponding to the column of the element are non-neighbor nodes, the sum of the weights of each row in the weight matrix is ​​equal to 1, and the sum of the weights of each column is equal to 1,

[0027] For each non-zero weight in the row corresponding to the node, calculate the product of the weight and the model parameter of the neural network model to be learned in the node corresponding to the column where the weight is located at the current cumulative update number,

[0028] Accumulate the calculated products.

[0029] As a possible implementation mode, the node obtains the aggregate model parameters of the model parameters of the neural network model to be learned at the current cumulative update times of at least one node in the communication network where the node is located, including:

[0030] The node reports the model parameters of the neural network model to be learned at the current cumulative update number to the designated node, and receives the aggregated model parameters of the model parameters of the neural network model to be learned at the current cumulative update number sent by the designated node.

[0031] in,

[0032] The designated node performs weighted averaging based on the model parameters of the neural network model to be learned at the current cumulative update times reported by each node in the communication network, and the weights used are determined in the following manner:

[0033] For any reporting node that reports the model parameters of the neural network model to be learned at the current cumulative update times,

[0034] The ratio of the training data set size of the node to the sum of the training data set sizes of all reporting nodes is calculated to obtain the weight of the reporting node.

[0035] As a possible implementation manner, the designated node is a server with which each node in the communication network communicates, the node is a communication device, and the second interval number is greater than the first interval number.

[0036] A second aspect of the present application provides a communication network-based federated learning device, the device comprising:

[0037] The local training module is used to perform local training at the node when the current cumulative update number of the model parameters of the neural network model to be learned is not an integer multiple of the first interval number set for characterizing the neighbor consensus interval and is not an integer multiple of the second interval number set for characterizing the global aggregation interval, to obtain the model parameters updated this time, and to perform the next update based on the model parameters and accumulate the update number until the current cumulative update number reaches the set update number threshold.

[0038] A neighbor consensus module is used for fusing the model parameters of the neural network model to be learned in each neighbor node directly communicating with it at the current cumulative update number and the model parameters of the neural network model to be learned in the node at the current cumulative update number when the current cumulative update number of the model parameters of the neural network model to be learned is an integer multiple of the first interval number and not an integer multiple of the second interval number, to obtain the model parameters for characterizing the neighbor consensus, and to perform the next update based on the model parameters and accumulate the update number until the current cumulative update number reaches the update number threshold.

[0039] A global aggregation module is used for obtaining the aggregated model parameters of the model parameters of the neural network model to be learned at the current cumulative update times of at least one node in the communication network where the node is located when the current cumulative update times of the model parameters of the neural network model to be learned is an integer multiple of the second interval times, and obtaining the model parameters used to characterize the global aggregation, and performing the next update based on the model parameters and accumulating the update times until the current cumulative update times reaches the update times threshold.

[0040] A third aspect of the present application provides a communication network-based federated learning system, which includes two or more of the above-mentioned federated learning devices.

[0041] A fourth aspect of the present application provides a computer storage medium, which stores a computer program, and the computer program is executed by a processor to implement the steps of the communication network-based federated learning method.

[0042] The present application provides a communication network-based federated learning method, which adopts different training strategies according to the current cumulative update times of the model parameters of the neural network model to be learned, so that local model parameter updates, neighbor model parameter fusion, and global model parameter aggregation are adopted in one round of training. This avoids the communication bottleneck defects of the centralized federated learning method and the lack of server coordination and global optimization perspective in the decentralized federated learning method, so that the update of the model parameters can also approach the global optimal solution, which is conducive to the correct convergence of the model parameters and improves the overall accuracy and reliability. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] Figure 1 A flowchart of a federated learning method based on a communication network according to an embodiment of the present application.

[0044] Figure 2 A schematic diagram of the change in training strategy of a node during a training phase as the current cumulative number of updates increases.

[0045] Figure 3 A schematic diagram of the communication network of this embodiment.

[0046] Figure 4 A flowchart of a federated learning method based on a communication network in this embodiment.

[0047] Figure 5 This is a schematic diagram of the effect of the first interval number on the performance of the neural network model in this embodiment.

[0048] Figure 6 A schematic diagram of the effect of the second interval number on the performance of the neural network model in this embodiment.

[0049] Figure 7 A schematic diagram of a federated learning device based on a communication network according to an embodiment of the present application.

[0050] Figure 8 Another schematic diagram of a federated learning device based on a communication network according to an embodiment of the present application. DETAILED DESCRIPTION

[0051] In order to make the objectives, technical means and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings.

[0052] The applicant has found that the centralized federated learning method and the decentralized federated learning method included in the federated learning method have their own advantages. The present application provides a federated learning method based on a communication network to integrate the advantages of the centralized federated learning method and the decentralized federated learning method.

[0053] See also Figure 1 As shown, Figure 1 The following is a flow chart of a method for federated learning based on a communication network according to an embodiment of the present application. The method includes:

[0054] At any node in the communication network,

[0055] In any round of training of any neural network model to be learned at this node,

[0056] When the current cumulative update times of the model parameters of the neural network model to be learned is not an integer multiple of the set first interval times and is not an integer multiple of the set second interval times, local training is performed at this node to obtain the model parameters of this update, and the next update is performed based on the model parameters and the update times are accumulated until the current cumulative update times reaches the set update times threshold.

[0057] When the current cumulative update times of the model parameters of the neural network model to be learned is an integer multiple of the first interval times and is not an integer multiple of the second interval times, the node will fuse the model parameters of the neural network model to be learned in each neighboring node that directly communicates with it at the current cumulative update times and the model parameters of the neural network model to be learned in the node at the current cumulative update times, that is, perform neighbor consensus, and obtain model parameters for characterizing neighbor consensus; perform the next update based on the model parameters and accumulate the update times until the current cumulative update times reaches the set update times threshold,

[0058] When the current cumulative update times of the model parameters of the neural network model to be learned is an integer multiple of the second interval times, the node obtains the aggregated model parameters of the model parameters of the neural network model to be learned at the current cumulative update times of at least one node in the communication network where it is located, and obtains the model parameters used to characterize the global aggregation, that is, performs global aggregation; the next update is performed based on the model parameters and the update times are accumulated until the current cumulative update times reaches the update times threshold.

[0059] See the following Table 1, which is an illustration of different training strategies adopted according to the current cumulative number of updates in a round of training.

[0060] Table 1

[0061]

[0062] See also Figure 2 As shown, Figure 2 This is a schematic diagram of the changes in the training strategy of a node in a round of training as the current cumulative update number increases. The horizontal axis in the figure represents the current cumulative update number, the vertical axis represents the model parameters of a neural network model to be learned, the yellow box represents local training, the triangle represents neighbor consensus, and the five stars represent global aggregation. As the current cumulative update number increases, the model parameters are constantly updated, neighbors are integrated, and global aggregation is performed.

[0063] It should be understood that in the embodiment of the present application, the first number of intervals in the same round of training stage can be a fixed value or a non-fixed value, and can be the same or different in different rounds of training stages. Similarly, the second number of intervals in the same round of training stage can be a fixed value or a non-fixed value, and can be the same or different in different rounds of training stages; in the same round of training stage, when any node conducts neighbor consensus, the neighbor nodes of the node can remain unchanged or change each time the neighbor consensus is conducted, and the nodes participating in the global aggregation each time can be the same or different; the neural network model to be learned can support any business tasks, including but not limited to target detection, target classification, target recognition, etc., and the targets include but are not limited to images, text, audio and other forms.

[0064] In the embodiment of the present application, each node not only performs local training and neighbor consensus updates, but also participates in the global aggregation process, which effectively reduces the frequency of global aggregation. Compared with traditional centralized federated learning, the communication cost is greatly reduced when the neighbor consensus is used to achieve the same training effect. In addition, the global aggregation process not only avoids the local optimal problem that may occur when the node relies only on local and neighboring device information, but also enables the update of model parameters to approach the global optimal solution, which is conducive to the correct convergence of model parameters and improves overall accuracy and reliability.

[0065] To facilitate understanding of the present application, a communication network is used as an example for explanation below. It should be understood that the present application is not limited to the communication network itself, and any communication network with any network topology structure can be used.

[0066] See also Figure 3 As shown, Figure 3 It is a schematic diagram of the communication network of this embodiment. The communication network includes at least one server and at least one node device. Each node device can communicate with the server, and the node devices can communicate with each other. The node devices that communicate with each other constitute the network topology structure of the communication network. Among them, the dotted two-way arrow represents the communication between the node and the server, and the solid two-way arrow represents the communication between the node devices. The node devices include but are not limited to clients, terminal devices, service devices, etc. For each node in the communication network, the node has its training data set for training the neural network model. For example, in the figure, terminal 1 has training data set 1, terminal 2 has training data set 2...

[0067] See also Figure 4 As shown, Figure 4 The following is a flow chart of the federated learning method based on the communication network in this embodiment. It includes: on any node side,

[0068] Step 401, determining whether the current cumulative update number can be divided by the second interval number that can be used to represent the global aggregation interval.

[0069] If yes, perform global aggregation;

[0070] Otherwise, it is determined whether the current cumulative update times can be used to represent the first interval times of the neighbor consensus interval. If so, a neighbor consensus is performed. Otherwise, the neural network model to be learned in the node is trained locally.

[0071] in,

[0072] Local training is performed using stochastic gradient descent, specifically:

[0073] For any node i,

[0074] This node extracts batches of data from its training data set, inputs the extracted batches of data into the neural network model to be learned, and obtains the output results of the input data.

[0075] According to the output results of each input data, the loss function value of each output result is calculated.

[0076] Based on the loss function value of each output result, the average value of the gradient value of each loss function value is calculated to obtain the stochastic gradient information used to characterize the model parameter gradient value of the neural network model to be learned at the current cumulative update number, which is expressed in mathematical formula as follows:

[0077]

[0078] in, is the batch data of node i at the current cumulative update number t, For batch data The number of data included, that is, the batch data The total number of samples in is the model parameter of node i at the current cumulative update number t, x represents the input data of the neural network model to be learned, y represents the label data in the input data, Indicates that the neural network model to be learned is in batch data Input, model parameters at the current cumulative update times t The stochastic gradient information of For the model parameters In the case of, the loss function value when the input data x with label data y is input to the neural network model to be learned, is the loss function value The gradient value of .

[0079] It should be understood that during each local training, the extracted batch data may be the same or different.

[0080] According to the set stochastic gradient change step size, such as the stochastic gradient descent step size, and the stochastic gradient information of the current model parameters, the current model parameters are adjusted. For example, based on the current model parameter values, the model parameter values ​​are reduced. The degree of reduction depends on the product of the stochastic gradient descent step size and the stochastic gradient information. It can be expressed as:

[0081]

[0082] in, represents the adjusted model parameters of the neural network model to be learned of node i, for use in the next update, η is the stochastic gradient descent step size, and it should be understood that each time the model parameters are adjusted, the stochastic gradient descent step size can be the same or different.

[0083] Neighbor consensus is used to fuse model parameters between nodes. For any node i, its model parameters are fused as follows:

[0084] Determine the neighbor nodes of the node, wherein the neighbor nodes are nodes that directly communicate with the node,

[0085] According to the determined neighbor nodes, a weight matrix is ​​constructed. The number of rows and columns of the weight matrix are the total number of nodes in the communication network. Each row corresponds to a node, and each column corresponds to a node. Any element in the weight matrix is ​​used to characterize the weight between the node corresponding to the row where the element is located and the node corresponding to the column where the element is located. Among them, the weight with a value of 0 is used to characterize that the node corresponding to the row where the weight is located and the node corresponding to the column where the weight is located are non-neighbor nodes, that is, it is used to characterize that there is no direct connection between the two nodes. The sum of the weights of each row in the weight matrix is ​​equal to 1, and the sum of the weights of each column is equal to 1, that is, the weight matrix satisfies:

[0086] V·1=1 and V T =V

[0087] Among them, V represents the weight matrix, 1 represents the unit column vector, V T Represents the transposed matrix of the weight matrix V.

[0088] by Figure 3 As an example of the network topology structure, the following Table 2 is a schematic diagram of the weight matrix. ij is a weight whose value makes the model parameters of the neural network model to be learned converge. Preferably, the weight matrix remains unchanged each time a neighbor consensus is performed.

[0089]

[0090] The model parameters of the neural network model to be learned in the determined neighboring nodes at the current cumulative update times and the model parameters of the neural network model to be learned in the node at the current cumulative update times are weighted averaged to obtain the model parameters of the node used to characterize the neighbor consensus.

[0091] As an example, for each weight in the row corresponding to any node i, the product of the weight and the model parameter of the neural network model to be learned in the node corresponding to the column where the weight is located at the current cumulative update number is calculated, and the calculated product results are accumulated to obtain the model parameters of the node used to characterize the neighbor consensus.

[0092] Mathematically expressed as:

[0093]

[0094] in, is the model parameter used by node i to characterize the neighbor consensus, which will be used in the next update. is the model parameter of node j at the current cumulative update number t, N is the total number of nodes, v ij is the weight of the model parameters between node i and its neighbor node j.

[0095] Global aggregation is used to aggregate the model parameters of each node. As an example, each node reports its model parameters at the same cumulative update number, that is, the current cumulative update number, to the server, and the server performs weighted averaging to obtain the model parameters of the neural network model to be learned that are used to characterize the global aggregation.

[0096] Mathematically expressed as:

[0097]

[0098] Among them, ρ i is the model parameter weight of node i, M is the total number of nodes reporting the model parameters at the same cumulative update times, and in this embodiment, M=N.

[0099] The model parameter weight of node i is determined in the following manner: the ratio of the size of the training data set of node i to the sum of the sizes of the training data sets of all nodes that report model parameters is calculated.

[0100] Mathematically expressed as:

[0101]

[0102] Among them, D i is the size of the training data set for node i, that is, the total number of samples in the training data set.

[0103] Preferably, each time global aggregation is performed, the training data set of node i is the same.

[0104] Step 402, accumulating the current update times,

[0105] Step 403, determine whether the current cumulative update times reaches the set update times threshold,

[0106] If yes, then one round of training is completed.

[0107] Otherwise, return to step 401.

[0108] See also Figure 5 As shown, Figure 5 is the first interval number τ in this embodiment 1 A schematic diagram of the impact on model performance. As the number of training steps increases, the four curves tend to be flat and unchanged, which indicates that the model gradually converges. The final test accuracy of the three curves (IFL) of the federated learning of this embodiment is higher than the traditional centralized federated learning (CFL) curve, and the convergence speed of this embodiment is faster than the traditional centralized federated learning, which indicates that neighbor consensus has a positive effect on model training. As the number of first intervals increases, the model accuracy gradually decreases, and the convergence speed of the model gradually slows down.

[0109] See also Figure 6 As shown, Figure 6 is the second interval number τ in this embodiment 2 A schematic diagram of the impact on model performance. As the number of training steps increases, the four curves tend to be flat and unchanged, which indicates that the model gradually converges. The final test accuracy of the three curves represented by this embodiment is higher than that of the distributed federated learning (DFL) curve, and the convergence speed is faster than that of distributed federated learning (CFL), which indicates that global aggregation has a positive effect on model training. As the number of second intervals increases, the model accuracy gradually decreases, and the convergence speed of the model gradually slows down.

[0110] This embodiment reduces communication costs by periodically performing global aggregation and neighbor consensus during the training process, avoids interruptions in model training due to server disconnection or failure, maintains the continuity of model training, and helps the model converge through neighbor consensus. Compared with traditional CFL, when a server fails, the system immediately becomes distributed and continues training until the server re-participates, avoiding the problem of training interruption, increasing the stability and reliability of the training process, and in the case of neighbor consensus, effectively reducing the number of global aggregations and communication costs. In addition, compared with DFL, this embodiment effectively corrects the local optimal problem that may be caused by relying only on local information through regular global aggregation, and promotes the model to iterate towards the global optimal solution.

[0111] See also Figure 7 As shown, Figure 7 This is a schematic diagram of a federated learning device based on a communication network in an embodiment of the present application, and the device includes:

[0112] The local training module is used to perform local training at this node when the current cumulative update number of the model parameters of the neural network model to be learned is not an integer multiple of the set first interval number and is not an integer multiple of the set second interval number, to obtain the model parameters updated this time, and to perform the next update based on the model parameters and accumulate the update number until the current cumulative update number reaches the set update number threshold.

[0113] A neighbor consensus module is used for, when the current cumulative update number of the model parameters of the neural network model to be learned is an integer multiple of the first interval number and not an integer multiple of the second interval number, the node will directly communicate with the model parameters of the neural network model to be learned at the current cumulative update number of each neighbor node, and the model parameters of the neural network model to be learned in the node at the current cumulative update number, to obtain the model parameters used to characterize the neighbor consensus, and perform the next update based on the model parameters and accumulate the update number until the current cumulative update number reaches the set update number threshold,

[0114] A global aggregation module is used for obtaining the aggregated model parameters of the model parameters of the neural network model to be learned at the current cumulative update times of at least one node in the communication network where the node is located when the current cumulative update times of the model parameters of the neural network model to be learned is an integer multiple of the second interval times, and obtaining the model parameters used to characterize the global aggregation, and performing the next update based on the model parameters and accumulating the update times until the current cumulative update times reaches the update times threshold.

[0115] See also Figure 8 As shown, Figure 8 This is another schematic diagram of a federated learning device based on a communication network according to an embodiment of the present application. The device includes: a memory and a processor, the memory stores a computer program, and the processor is configured to execute the computer program to implement the steps of the federated learning method based on a communication network according to the embodiment of the present application.

[0116] The memory may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.

[0117] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0118] An embodiment of the present invention also provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the steps of the communication network-based federated learning method described in the embodiment of the present application are implemented.

[0119] As for the apparatus / network-side device / storage medium embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0120] In this article, relational terms such as first and second, etc. are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0121] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. A federated learning method based on a communication network, characterized in that: The method includes: At any node in the communication network, In any round of training of any neural network model to be learned at this node, When the current cumulative update times of the model parameters of the neural network model to be learned is not an integer multiple of the first interval times set for representing the neighbor consensus interval, and is not an integer multiple of the second interval times set for representing the global aggregation interval, local training is performed on this node to obtain the model parameters of this update, and the next update is performed based on the model parameters and the update times are accumulated until the current cumulative update times reaches the set update times threshold. When the current cumulative update number of the model parameters of the neural network model to be learned is an integer multiple of the first interval number and is not an integer multiple of the second interval number, the node fuses the model parameters of the neural network model to be learned in each neighboring node with which it directly communicates at the current cumulative update number and the model parameters of the neural network model to be learned in the node at the current cumulative update number to obtain the model parameters for characterizing the neighbor consensus, and performs the next update based on the model parameters and accumulates the update number until the current cumulative update number reaches the update number threshold. When the current cumulative number of updates of the model parameters of the neural network model to be learned is an integer multiple of the second interval number, the node obtains the aggregated model parameters of the model parameters of the neural network model to be learned at the current cumulative number of updates of at least one node in the communication network where it is located, obtains the model parameters used to characterize the global aggregation, and performs the next update based on the model parameters and accumulates the number of updates until the current cumulative number of updates reaches the update number threshold.

2. The federated learning method according to claim 1, wherein: The local training at the current node includes: Extract batch data from the training data set of this node, input the extracted batch data into the neural network model to be learned one by one, and obtain the output results one by one. The output results are used to obtain the stochastic gradient information of the gradient value of the model parameters of the neural network model to be learned at the current cumulative update number. Adjust the current model parameters of the neural network model to be learned based on the stochastic gradient information and the set stochastic gradient step size.

3. The federated learning method according to claim 2, wherein: The method of using each output result to obtain stochastic gradient information for characterizing the gradient value of the model parameter of the neural network model to be learned at the current cumulative update number includes: Based on each output result, calculate the gradient value of the loss function value of each output result, Calculate the ratio of the accumulated gradient value to the input batch size to obtain the stochastic gradient information of the current model parameters; The step of adjusting the current model parameters of the neural network model to be learned according to the stochastic gradient information and the set stochastic gradient change step size includes: Based on the current model parameters, the model parameter values ​​are reduced. The reduced model parameter values ​​are the product of the stochastic gradient change step size and the stochastic gradient information.

4. The federated learning method according to claim 1, wherein: The node fuses the model parameters of the neural network model to be learned in each neighboring node with which it directly communicates at the current cumulative update number, and the model parameters of the neural network model to be learned in the node at the current cumulative update number, including: The node obtains the model parameters of the neural network model to be learned in each of its neighboring nodes at the current cumulative update times. A weighted average is performed on the obtained model parameters and the model parameters of the neural network model to be learned in the node at the current cumulative update number, and the weights used make the model parameters of the neural network model to be learned converge.

5. The federated learning method according to claim 4, wherein: After obtaining the model parameters for characterizing the neighbor consensus, the method further includes: The node sends the weighted average model parameters to each neighboring node of the node, so that the model parameters of the neural network model to be learned in each neighboring node are updated; The weighted averaging of the obtained model parameters and the model parameters of the neural network model to be learned in the node at the current cumulative update number includes: Construct a weight matrix, the number of rows and columns of the weight matrix are the total number of nodes in the communication network, each row corresponds to a node, each column corresponds to a node, any element in the weight matrix is ​​used to represent the weight between the node corresponding to the row of the element and the node corresponding to the column of the element, wherein the element with a value of 0 is used to represent that the node corresponding to the row of the element and the node corresponding to the column of the element are non-neighbor nodes, the sum of the weights of each row in the weight matrix is ​​equal to 1, and the sum of the weights of each column is equal to 1, For each non-zero weight in the row corresponding to the node, calculate the product of the weight and the model parameter of the neural network model to be learned in the node corresponding to the column where the weight is located at the current cumulative number of updates, Accumulate the calculated product results.

6. The federated learning method according to claim 1, wherein: The node obtains aggregate model parameters of the model parameters of the neural network model to be learned at the current cumulative update number of at least one node in the communication network where the node is located, including: The node reports the model parameters of the neural network model to be learned at the current cumulative update number to the designated node, and receives the aggregated model parameters of the model parameters of the neural network model to be learned at the current cumulative update number sent by the designated node. in, The designated node performs weighted averaging based on the model parameters of the neural network model to be learned at the current cumulative update times reported by each node in the communication network. The weights used are determined as follows: For any reporting node that reports the model parameters of the neural network model to be learned at the current cumulative update times, The ratio of the training data set size of the node to the sum of the training data set sizes of all reporting nodes is calculated to obtain the weight of the reporting node.

7. The federated learning method according to claim 5, wherein: The designated node is a server with which each node in the communication network communicates, the node is a communication device, and the second interval number is greater than the first interval number.

8. A federated learning device based on a communication network, characterized in that: The device includes: The local training module is used to perform local training on the node when the current cumulative number of updates of the model parameters of the neural network model to be learned is not an integer multiple of the first interval number set for representing the neighbor consensus interval and is not an integer multiple of the second interval number set for representing the global aggregation interval, to obtain the model parameters of this update, and to perform the next update based on the model parameters and accumulate the number of updates until the current cumulative number of updates reaches the set update number threshold. A neighbor consensus module is configured to, when the current cumulative number of updates of the model parameters of the neural network model to be learned is an integer multiple of the first interval number and not an integer multiple of the second interval number, fuse the model parameters of the neural network model to be learned in each neighboring node with which it directly communicates at the current cumulative number of updates, and the model parameters of the neural network model to be learned in the node at the current cumulative number of updates, to obtain model parameters for representing the neighbor consensus, perform the next update based on the model parameters, and accumulate the number of updates until the current cumulative number of updates reaches the update number threshold, A global aggregation module is used to obtain the aggregated model parameters of the model parameters of the neural network model to be learned at the current cumulative update number of at least one node in the communication network where it is located when the current cumulative update number of the model parameters of the neural network model to be learned is an integer multiple of the second interval number, obtain the model parameters used to characterize the global aggregation, perform the next update based on the model parameters and accumulate the update number until the current cumulative update number reaches the update number threshold.

9. A federated learning system based on a communication network, characterized in that: The system includes two or more federated learning devices as described in claim 8.

10. A computer storage medium, characterized in that The computer storage medium stores a computer program, and the computer program is executed by a processor to implement the steps of the communication network-based federated learning method as claimed in claim 8.