Interruption risk-oriented federated learning method and system, product and medium

By optimizing bandwidth allocation, transmission power, and quantization bit depth, and combining reinforcement learning and similarity evaluation, the challenges of communication reliability and model accuracy in edge federated learning are addressed, achieving efficient resource allocation and model training.

CN121365751AActive Publication Date: 2026-01-20北京泰尔英福科技有限公司 +1
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202511854951.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-10
Publication Date
2026-01-20
Estimated Expiration
2045-12-10

AI Technical Summary

Technical Problem

In wireless systems, edge federated learning faces the dual challenges of communication reliability and model accuracy, including the threat of non-ideal channels to model convergence, the trade-off between resource allocation and model accuracy, and rigid parameter retransmission and discarding mechanisms, which lead to decreased training efficiency and wasted resources.

Method used

By optimizing bandwidth allocation, transmission power, and quantization bit depth, a similarity-based evaluation strategy is designed. A reinforcement learning algorithm is used to dynamically adjust resource allocation, and a model offload matrix is ​​introduced to handle transmission interruptions, thereby optimizing quantization error and training latency.

Benefits of technology

It significantly reduces quantization error and training latency, improves system robustness and resource utilization, adapts to dynamic network environments, and enhances model convergence performance and training efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121365751A_ABST
    Figure CN121365751A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of edge computing, and particularly discloses an interruption risk-oriented federated learning method and system, a product and a medium, and the method comprises the steps: S1, building a federated learning architecture which comprises a server and a plurality of clients; s2, the server synchronously initializes the global model to all clients in the coverage range; each client updates the local model through stochastic gradient descent; s3, each client quantifies local model parameters through a random quantization method and uploads the local model parameters to the server, and the server generates a new global model; and S4, repeating the steps S2-S3 until federal learning is completed, and generating a final model by the server. According to the method, the quantization error and the training time delay are minimized by optimizing bandwidth allocation, sending power and quantization bit digits; in addition, a strategy based on similarity evaluation is designed for model parameters which are not completely uploaded after interruption, whether updating or retransmission is ignored or not is determined, and therefore the robustness and efficiency of the system are improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of edge computing, and particularly relates to a federated learning method for interruption risk, a system, a product and a medium. BACKGROUND

[0002] With the rapid development of mobile communication and edge computing technology, edge federated learning, as a distributed machine learning paradigm, has shown significant advantages in wireless networks. This method coordinates a large number of mobile devices to collaboratively train shared models on local data, without sharing raw data, and can fully utilize edge computing resources to improve model training efficiency while protecting user privacy. However, in actual wireless systems, due to factors such as dynamic changes in channel conditions, limited communication resources, and device heterogeneity, the deployment of edge federated learning faces the dual challenges of communication reliability and model accuracy. Specifically, it mainly reflects in the following three aspects: (1) Threat of non-ideal channel to model convergence: In a wireless environment with limited transmission delay and bandwidth, efficient transmission of model parameters is inevitably constrained by quantization error and transmission interruption. For example, non-uniform interruption probability not only causes global model bias, but also amplifies the negative effects of quantization error and data heterogeneity.

[0003] (2) Trade-off between resource allocation and model accuracy: High quantization precision requires more transmission bits, which may exacerbate the risk of transmission interruption and introduce more training costs, such as training latency and energy consumption; low quantization precision, on the other hand, reduces the number of bits but introduces more quantization error. Existing solutions, such as fixed quantization levels or uniform bandwidth allocation, cannot dynamically balance this contradiction, resulting in decreased training efficiency or compromised model performance.

[0004] (3) Stale parameter retransmission and discard mechanism: Existing solutions usually use retransmission or random discard strategies after interruption occurs, which cannot distinguish the importance of updates. In the non-independent and identically distributed scenario, updates from some clients may have a negative impact on the global model due to large differences in data distribution, while traditional methods still consume resources to transmit such inefficient updates. In addition, some clients with good channel conditions and strong transmission capabilities are not well utilized to alleviate the data loss caused by interruption. SUMMARY

[0005] The present application aims to solve the above problems. To this end, the present application provides a federated learning method for interruption risk, a system, a product and a medium, which realizes resource optimization in edge federated learning under non-ideal channels. The present application optimizes bandwidth allocation, transmission power and quantization bit number to minimize quantization error and training latency; and for model parameters that have not been uploaded after interruption, a similarity evaluation-based strategy is designed to determine whether to ignore the update or retransmit, thereby improving the robustness and efficiency of the system.

[0006] The application provides a federated learning method for interruption risk, which adopts the technical scheme as follows: comprising the following steps: S1: building a federated learning architecture, including a server and multiple clients; S2: the server synchronously initializes a global model to all clients within the coverage range; each client updates a local model through stochastic gradient descent; S3: jointly allocating the number of quantization bits, bandwidth and transmission power, each client minimizes the quantization error and training delay under the constraints of its own energy and unified interruption probability; then each client quantizes the local model parameters through a random quantization method and uploads them to the server, and the server generates a new global model; During the uploading to the server, when transmission interruption occurs and the model parameters are re-uploaded, based on the offloading matrix, the interrupted client offloads its model parameters to other clients, the other clients aggregate the model parameters of the interrupted client with their own model parameters, and upload the aggregation result to the server; The offloading matrix is used to describe the corresponding relationship and proportion of model offloading between clients; S4: repeating S2-S3 until the federated learning is completed, and the server generates a final model.

[0007] Further, the resource allocation problem of the number of quantization bits, allocated bandwidth and transmission power is expressed as follows: ; Wherein, min represents the minimum value, is the bandwidth allocated to the client , is the transmission power of the client , is the number of quantization bits of the client , is the transmission rate of the client , is the quantization error weight coefficient, is the number of data owned by the client, is the total of the image data set of the client, is the total number of clients, is the quantization range, This is the time delay weighting coefficient. To obtain the maximum value, A collection of clients, This represents the total number of local iterations. The time required to perform one iteration, This represents the total number of bits after quantization in the local model. As constraints, Energy consumption for performing one iteration For the dimensions of the model, For the sign bit and upper and lower limits Number of bits, Energy threshold For bandwidth threshold, For the transmit power threshold, Let be the interruption probability of the i-th client. It is a preset uniform interruption probability. It is a positive integer; question The solution process is as follows: Will relaxation , ; Optimal transmission rate satisfy , where the first intermediate parameter for , It is the shadow variance. ( ) represents the Q function of the standard normal distribution. It is a constant that depends on antenna characteristics and channel attenuation. It is the path loss index. It is a client Distance between the server and the server This indicates conversion to a representation in decibels. The power spectral density of additive noise; Initialize a set , Satisfy constraints (2) and (3); then fix , Without changing the optimal quantization bit depth, the optimal number of bits is determined using a convex optimization solver. Then fix Without changing the approach, the bandwidth allocation is expressed as the allocation of resource blocks, and the optimal bandwidth allocation is obtained through a reinforcement learning-based algorithm.

[0008] Furthermore, the optimal bandwidth allocation is determined by the reinforcement learning-based algorithm: Will Replace with wherein, represents the number of resource blocks allocated to the client , is the bandwidth size corresponding to the resource block; design state space, action space and reward function, and solve the integer programming problem dynamically in each round by using reinforcement learning; wherein, state space: the number of resource blocks currently allocated to all clients, the remaining energy of all clients under the energy constraint ; action space: all clients select how many resource blocks to allocate; The reward function includes three: the negative value of the time of each round of training; the remaining energy of the client under the energy constraint is less than 0, then give a negative reward; if the allocated bandwidth exceeds the total bandwidth limit, give a negative reward; Action update strategy: select the action with the maximum Q value.

[0009] Further, in S3, during uploading to the server, if transmission interruption occurs, the similarity between the local model of the interrupted client and the global model is calculated, and whether to re-upload is judged according to the comparison result with the threshold.

[0010] Further, when , do not upload the model parameters; when , do not upload the model parameters; when , re-upload the model parameters; wherein, is the CKA similarity between the local model of the th iteration and the global model, is the upper limit of the model similarity, is the lower limit of the model similarity.

[0011] Further, the client quantizes the local model parameters by using the random quantization method on the image data set owned by the client.

[0012] Further, when the client does not receive a new global model, the client suspends the corresponding model update operation.

[0013] The application also provides a federated learning system for interruption risk, which adopts the technical scheme as follows: comprising: a server and a client; A server and multiple clients are constructed as a federated learning architecture; The server is configured to initialize a global model to all clients within a coverage range, generate a new global model based on model parameters uploaded by the clients, and generate a final model when the federated learning is completed. The client is configured to jointly allocate the number of quantization bits, bandwidth, and transmit power, minimize quantization error and training time delay under the constraints of self-energy and uniform interruption probability, update the local model through stochastic gradient descent, quantize the local model parameters through a random quantization method and upload them to the server, and unload the model parameters to other clients based on an unloading matrix when the model parameters are interrupted during uploading to the server or re-uploaded.

[0014] The application also provides a computer readable storage medium having a computer program stored thereon, wherein the computer program is executed by a processor to implement the federated learning method for interruption risk.

[0015] The application also provides a computer program product comprising a computer program, wherein the computer program is executed by a processor to implement the federated learning method for interruption risk.

[0016] The one or more technical solutions described above in the embodiments of the application have at least one of the following technical effects: 1. The application optimizes bandwidth allocation, transmission power, and quantization bit number to minimize communication delay and quantization error. Specifically, the application dynamically adjusts these parameters according to the energy constraints and interruption probability of each client to ensure the training efficiency of the global model. By optimizing the number of quantization bits, the quantization error can be significantly reduced, thereby improving the model convergence performance, and reasonable allocation of bandwidth and power can effectively reduce the communication bottleneck.

[0017] 2. The application introduces a reinforcement learning (DRL) algorithm to solve the complex resource (bandwidth) allocation problem. DRL optimizes the resource block allocation scheme of the client by designing the state space, action space, and reward function. This method can maximize resource utilization and minimize training time under the constraints of energy and bandwidth, thereby adapting to dynamic network environments and providing stable communication support for federated learning.

[0018] 3. The present application proposes a method based on CKA similarity evaluation for model parameter processing after communication interruption. This method measures the similarity between the local model and the global model to determine whether to ignore the unfinished update or retransmit. Compared with the traditional cosine similarity method, CKA can more accurately capture the correspondence between the hidden layers of the neural network, thereby helping the system make more reasonable decisions and avoid unnecessary resource waste.

[0019] 4. The present application designs a model offloading matrix to describe the offloading proportion and relationship of model parameters between clients. When a client is interrupted, the system can choose to offload part of the model parameters to other clients that are still working normally for aggregation and uploading, thereby reducing the impact on the global model. This mechanism not only reduces the communication cost, but also improves the robustness of the system, ensuring efficient model updating even in the case of interruption.

[0020] Additional aspects and advantages of the present application will be in part apparent and in part pointed out hereinafter. BRIEF DESCRIPTION OF DRAWINGS

[0021] In order to more clearly illustrate the technical solutions in the present application or in the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or prior art description. Obviously, the drawings in the following description are some embodiments of the present application, and for those skilled in the art, other drawings can also be obtained without creative labor on the basis of these drawings.

[0022] Figure 1 is a flowchart of the method provided by the present application.

[0023] Figure 2 is a test accuracy comparison result graph of the method and WidthAllocOnly on the MNIST dataset provided by the present application.

[0024] Figure 3 is a test accuracy comparison result graph of the method and QuantizLvlOnly on the MNIST dataset provided by the present application.

[0025] Figure 4 is a training delay, energy consumption and system cost comparison graph of different gradient offloading strategies provided by the present application.

[0026] Figure 5 is a performance comparison graph of FedMRO, RAOnly and GOOnly on CIFAR-10 provided by the present application. DETAILED DESCRIPTION

[0027] In order to make the objectives, technical solutions and advantages of the present application clearer, the following will be combined with the drawings in the present application to clearly and completely describe the technical solutions in the present application. Obviously, the described embodiments are a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the protection scope of the present application. The following embodiments are used to illustrate the present application, but cannot be used to limit the scope of the present application.

[0028] In the description of the present application, the description of the terms "one embodiment", "some embodiments", "an example", "a specific example" or "some examples" means that the specific features, structures or characteristics described in combination with the embodiment or example are contained in at least one embodiment or example of the embodiments of the present application. In the present application, the illustrative description of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures or characteristics described can be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art can combine and combine the different embodiments or examples described in the present application and the features of the different embodiments or examples without contradiction.

[0029] The following will be combined Figures 1 to 5 The present application is further described, and a federated learning method, system, product and medium facing interruption risk are described: The present application proposes a non-convex problem of joint allocation of quantization bit number, bandwidth allocation and transmission power based on the negative impact of non-uniform interruption probability on convergence, jointly minimizes the quantization error and training delay under the constraint of uniform interruption probability and energy consumption, and obtains a high-quality approximate solution through a method of joint iterative optimization based on convex optimization solver and Q-Learning. The present application realizes more accurate model similarity evaluation through CKA function, effectively handles the problem of parameter update after interruption, and avoids the misjudgment caused by initialization or structural difference in traditional methods. After the transmission interruption occurs, the present application proposes a series of mechanisms including model parameter screening and dispersion, which are used to cope with the transmission interruption risk and optimize resource allocation. Combined with the model unloading and time adjustment mechanism, the communication cost is significantly reduced and the system robustness is improved, which adapts to complex heterogeneous environment and optimizes the global model convergence efficiency. Simulation results show that the present application performs outstandingly in reducing quantization error and training delay, improving model precision and convergence.

[0030] In the present embodiment, as Figure 1 shown, a federated learning method facing interruption risk is provided, comprising the following steps: S1: building a federated learning architecture, including a server and multiple clients.

[0031] This embodiment establishes a federated learning architecture under the threat of transmission interruption and quantization error, including one edge server and multiple clients. The fixed-location edge server acts as a central aggregator, such as a ground-based small base station or roadside unit. A collection of smart mobile devices , Smart mobile devices, such as smartphones and vehicles, act as clients participating in the training. This represents the i-th client. This represents the total number of clients. Assume each client has one containing... Image dataset of data , ,in, For the input of the k-th data, This is the output for the k-th data point.

[0032] make For the client in the first The first round of global iteration Sublocal gradient descent model. Initialized synchronously with the global model. Once completed, each client obtains the result through local gradient descent (SGD). Specifically , ,in, For the first The local gradient descent of the second time, For learning rate, This represents the total number of local iterations. For global models, For the initialized local model, Initialization is not yet complete. (Client) loss function Defined as ,in, For the first The local loss function for each data sample. After each round of SGD, each client quantizes its local model parameters using a random quantization method. They then upload their parameter updates. There is no interference between data uploaded by different clients.

[0033] Assumption for Dimensional model parameters, Each component The upper and lower limits are Quantization knob Represented as ,in, For the client quantization bit number, for the first coefficient, At this time, the quantization result of the model parameter component falling into the interval is where w.p. means with probability. Therefore, the total bit number of the quantized local model is where is the bit number of the sign bit and the upper and lower limits.

[0034] The computation and communication model of the federated learning architecture is as follows: Let the time for performing one iteration be and the energy consumption for performing one iteration be , then , where is the computation resource (e.g. CPU cycle number) required for processing one data, is the proportion of the local data set used for the SGD mini-batch data, is the CPU frequency, is the medium coefficient. Under imperfect channel state information (CSI), the actual CSI from the client to the edge server is expressed as Based on the classic path loss shadow model, the channel gain from the client to the edge server can be obtained as , where is a constant depending on the antenna characteristics and channel attenuation, is the path loss exponent, is the distance between the client and the server, is the shadow, and the shadow variance is , represents the conversion into the representation in decibels.

[0035] The channel capacity from the client to the edge server can be expressed as: where is the bandwidth allocated to the client , is the client​​​​​​ The transmission power, Let be the power spectral density of additive noise. Assume the client... The transmission delay budget is Then the client transmission rate for ,when When a transmission interruption (TO) occurs, the edge server is unable to correctly decode the received quantization model. At this point, the client can be considered... The probability of an interruption occurring for Where Pr represents probability operation. ( ) represents the Q function of the standard normal distribution. This is the interruption threshold. The system training latency when no interruption occurs. for , To obtain the maximum value; system energy consumption for .

[0036] S2: The server synchronously initializes the global model to all clients within its coverage area; each client updates its local model via stochastic gradient descent.

[0037] S3: Each client quantizes the local model parameters using a random quantization method and uploads them to the server. The server then generates a new global model based on preset aggregation rules.

[0038] Before each round of global aggregation begins, the number of quantization bits, bandwidth, and transmission power are jointly allocated according to the optimization strategy to jointly minimize quantization error and training latency. When the client sends model parameters to the server, data may fail to be reliably transmitted or received due to poor channel conditions or resource limitations; if the actual transmission rate exceeds the current channel capacity, transmission will fail, and the server will be unable to correctly decode the received data, resulting in a transmission interruption.

[0039] In S3, the number of quantization bits, bandwidth, and transmit power are first jointly allocated to minimize quantization error and training latency. Then, the client quantizes the local model parameters using a random quantization method.

[0040] The convergence of federated learning algorithms is affected by quantization error and the probability of interruption. Maintaining a uniform interruption probability across clients effectively improves convergence. This embodiment applies to all... Forced constraints ,in, the outage probability for the i-th client, is a pre-set uniform outage probability, . For quantization error, its upper bound is affected by the number of quantization bits, i.e., the larger the number of quantization bits, the smaller the quantization error. Therefore, in order to improve the learning performance and reduce the required training latency, the training latency includes the computation and communication latency. The embodiment selects to minimize the cumulative quantization error (upper bound) and the training latency in each global round under the constraints of the client's own energy constraint and the uniform outage probability constraint. The resource allocation problem is expressed as follows: .

[0041] wherein min denotes taking the minimum value, is a quantization error weight coefficient, is a latency weight coefficient, is the sum of the client image data sets, is a quantization range, is a transmission power threshold value, is a positive integer, is a constraint condition.

[0042] The constraint condition (1) stipulates that the client's own energy is constrained in the energy threshold . The constraint condition (2) indicates that the total bandwidth used for uploading the model parameters does not exceed the bandwidth threshold . The constraint condition (3) stipulates the variation range of the client's transmission power. The constraint condition (4) embodies the uniformity of the outage probability. The constraint condition (5) indicates the positive integer characteristic of the number of quantization bits, i.e., the problem is a mixed integer programming problem.

[0043] In order to solve this problem, the embodiment relaxes to , . For the optimal condition of the problem , the following relationship is satisfied: the optimal transmission rate satisfies , wherein the first intermediate parameter is .

[0044] then can be re-expressed as : .

[0045] Since there are three decision variables to be optimized, the problem is still highly complex. This embodiment considers using iterative optimization to obtain an approximately optimal solution to the problem. A set of , satisfying constraint (2) and constraint (3) are initialized, and the following two steps are considered: Sub-problem 1: Fixing and unchanged, the problem becomes an optimization problem only related to : .

[0046] Problem is a convex optimization problem. The proof is as follows: consider letting the second intermediate parameter be , then problem can be rewritten as problem : It is easy to prove that and are both convex functions (the second derivative is non-negative within the domain of definition), therefore, problem is a convex optimization problem, that is, problem is a convex optimization problem. The optimal second intermediate parameter is solved using a convex optimization solver, at this time the optimal number of quantization bits can also be obtained.

[0047] Sub-problem 2: Fixing unchanged, the problem becomes an optimization problem only related to : ​ When , the energy consumption of the client is: .

[0048] Since , therefore, is an increasing function of . The model uploading time of the client is , is a decreasing function of . Therefore, the optimal solution in the problem is , where is the transmission power of the client when the energy threshold is , and satisfies . At this time is converted into an equation only related to .

[0049] Based on the above derivation, the problem can be easily transformed into an equation only related to , expressed as problem : .

[0050] Since the optimization parameter in the problem is a high-dimensional floating-point variable, and the constraint condition (1) is not affine, the problem is non-convex. In order to simplify the problem and try to find a solution with adaptability and foresight, this embodiment considers re-expressing the allocation of bandwidth as the allocation of resource blocks, converting the above problem into an integer programming problem , and solving the optimal allocation bandwidth through an algorithm based on reinforcement learning (DRL).

[0051] ​ In the problem , the embodiment replaces the problem in to , wherein, denotes the number of resource blocks allocated to the client , is the bandwidth size corresponding to the resource block, denotes the total number of resource blocks.

[0052] The embodiment can solve this problem by reinforcement learning (DRL), gradually design the state space, action space and reward function, and use DRL to dynamically solve the integer programming problem in each round.

[0053] State space : , wherein, denotes the number of resource blocks currently allocated to all clients, , denotes the number of resource blocks currently allocated to the client , and , ; denotes the remaining energy of all clients under the energy constraint , , denotes the remaining energy of the client under the energy constraint , that is .

[0054] Action space : , wherein, denotes the number of resource blocks selected for allocation by all clients, , denotes the number of resource blocks selected for allocation by the client .

[0055] Reward function: The embodiment will consider the design of the reward function from the following three aspects: The negative of the objective function: the goal is to minimize the training time, so the reward can be the negative of the time completed for each round of training. The longer the training time, the smaller the reward. The target reward function : .

[0056] Energy constraint satisfaction: If a client's energy constraint is exceeded, a penalty can be given. For example, if a client's remaining energy under the energy constraint is less than 0, a negative reward is given, and the energy constraint reward function : where is the energy violation penalty coefficient.

[0057] Total resource block constraint: If the total number of resource blocks exceeds the available number of resource blocks, i.e., the bandwidth allocation exceeds the total bandwidth limit, a negative reward is given, and the resource block reward function : where is the penalty coefficient for violating the total resource block constraint.

[0058] In summary, the total reward function can be represented as: .

[0059] Action update policy: Q-value based method (DQN): Select the action with the maximum Q-value, i.e., the optimal action. For example: where is the maximum value, is the learned state-action value function.

[0060] In Q-learning, this embodiment evaluates the value of each action by learning a state-action value function. The Q-value represents the expected cumulative reward obtained after selecting a certain action in a given state. The Q-value update formula is as follows: where: is the current state, including allocated resource blocks, client remaining energy, etc. is the currently selected resource block allocation action, , is the currently selected first resource block allocation action. is the reward after executing the action, represented as the weighted sum of negative training time, energy, and resource block constraint violation penalties. is the discount factor, representing the weight of future rewards. is the Q function learning rate, determining the step size of Q value update.

[0061] Overall, the joint allocation of quantization bit number, bandwidth and transmit power, the client minimizes the quantization error and training delay under its own energy constraint and uniform outage probability constraint: (1) Fix , the problem becomes an optimization problem only related to . Based on variable substitution , the problem is converted into a convex problem, and the optimal solution is obtained by using a convex optimization solver , and .

[0062] (2) Fix , the problem becomes a non-convex optimization problem only related to . By expressing the bandwidth allocation of floating-point numbers as the allocation of an integer number of resource blocks , the problem is converted into an integer programming problem, and the optimal solution is obtained by using the reinforcement learning algorithm of Q-Learning, and the optimal solution is obtained.

[0063] Finally, the transmit power and transmission rate of the optimal allocation bandwidth solution are calculated. Then, based on the above calculation results, the client quantizes the local model parameters using the image data set it owns through the random quantization method, and uploads the quantization results to the server.

[0064] During the uploading to the server, if a transmission interruption occurs, the similarity between the local model of the interrupted client and the global model is calculated, and whether to re-upload is determined according to the comparison result with the threshold.

[0065] In the federated learning scenario, communication interruption may cause the local model update to be unable to be uploaded to the edge server in time. If the model update of the interrupted client is completely discarded, the differentiated information generated by the local training of the client will be lost, which will weaken the utilization of data diversity and affect the convergence speed and accuracy of the model. On the contrary, if the system continues to wait for the retransmission of the interrupted client, the training process will be stalled due to the differences in computing resources among devices and network fluctuations, significantly prolonging the overall training time. Therefore, the present embodiment designs a dynamic adaptive strategy to achieve an effective balance between communication efficiency and model performance. The following three cases are mainly considered: When the update of the local model is small and will not significantly affect the global model, the update is directly ignored. At this time, it is more appropriate to ignore the model update than to take other processing methods, because in some cases, the unuploaded update may cause a large deviation of the global model, thereby affecting the global convergence.

[0066] To this end, the embodiment introduces the measurement method of the CKA (Centered Kernel Alignment) function proposed in the prior art to evaluate the similarity between the local model and the global model. It is defined that is the feature map of the last fully connected layer of the local model in the gth iteration, is the feature map of the last fully connected layer of the global model in the gth iteration.

[0067] The CKA function is defined as follows: wherein, is the CKA similarity between the local model and the global model in the gth iteration, is the eigenvalue of the uth dimension in the local model in the gth iteration, and U is the number of dimensions of the local model, is the eigenvalue of the vth dimension in the global model in the gth iteration, and V is the number of dimensions of the global model, is the eigenvector corresponding to the eigenvalue of the uth dimension in the local model in the gth iteration, is the eigenvector corresponding to the eigenvalue of the vth dimension in the global model in the gth iteration. Compared with the cosine dot product operation, the CKA can determine the correspondence between the hidden layers of the neural network trained based on different random initialization and different width, so that the similarity calculation is more accurate.

[0068] Different CKA values indicate the importance of different model updates: When , it indicates that the update of the local model is quite different from the global model, which is usually caused by the non-iid characteristics of the client data distribution, so the model parameters are not uploaded; is the upper limit of the model similarity.

[0069] When , it indicates that the local model has approached convergence, and further uploading the update may not bring significant performance improvement, so there is no need to consume resources for uploading. is the lower limit of the model similarity.

[0070] When , it is considered that the update may have a positive optimization effect on the global model, so the update should participate in the global aggregation process, and the model parameters are re-uploaded.

[0071] Through the above three judgment mechanisms, the embodiment can reasonably decide whether to upload parameters according to the similarity between the local model and the global model, thereby improving the resource utilization efficiency and optimizing the training process of the global model. The two thresholds are determined according to the actual use scenario.

[0072] When a model update needs to be re-uploaded, the model parameter offloading problem needs to be considered, i.e., offloading and sending the local model update to other clients. Specifically, in order to reduce the communication cost caused by the uplink transmission of multiple model parameters, when a device receives the model parameters sent by other devices, it aggregates the model parameters locally, i.e., adds the received model parameters to its local parameters, and only sends the resulting vector to the edge server. That is, when re-uploading the model parameters, gradient offloading is performed based on the offloading matrix, the interrupting client offloads its model parameters to other clients, and after the other clients receive the model parameters of the interrupting client, they aggregate the model parameters of the interrupting client with their local model parameters, and upload the aggregation result to the server.

[0073] This process involves the selection of clients and the cutting of model parameters. For this purpose, the present embodiment introduces an offloading matrix , which is used to describe the correspondence and proportion of model offloading between clients.

[0074] Specifically, the element in represents the proportion of model offloading between client and client . For client , its model update can be handled in the following two cases: Client holds model parameters: when client retains its model update, at this time is set to 1, indicating that client holds the model parameter alone and does not offload it.

[0075] Client offloads model parameters: when client offloads its model update to other clients, at this time is set to 0. That is, client does not hold the model parameter, but offloads it to other clients . In this case, it is required that the proportion of all offloaded to client is 1, i.e.: where represents the set of other clients except client .

[0076] Through the above definition, the offloading matrix describes how each client offloads its model parameters to other clients and the proportion of offloading. The allocation of model updates is determined by each element in the matrix, which provides a basis for further model merging and parameter synchronization.

[0077] In the model updating process, the embodiment introduces time factors into each stage of the model. For the client , including: The model upload time of the client : the time required by the client to upload the model parameters to the server. Since each client either fully disperses its gradient or fully holds all local gradient parameters, the model upload time of the client can be expressed as: where is the transmission rate of the model upload, and is the channel gain between the client and the server. The model offloading time of the client : the time required by the client to offload its complete model parameters to the client . The transmission rate of the model offloading is defined as

[0078] where is the uniform bandwidth for the model offloading between clients, and is the channel gain between the client and the client . .

[0079] To further understand the impact of these time consumptions, the entire model offloading process mainly includes: after all clients complete local computation, it is evaluated whether a transmission interruption is encountered; if reuploading is required, the model parameters of the client encountering the interruption are dispersed to the client with good channel conditions; the aggregation of the local model is completed by the client with good channel conditions, and finally uploaded.

[0080] Considering the impact of the offloading matrix, the time consumption of the client is expressed as: .

[0081] Similarly, the energy consumption of the client is: where , . At this time, the total time consumption of the system

[0082] and the total energy consumption of the system after the interruption are: .​​​​

[0083] The problem of minimizing the weighted sum of total time consumption and total energy consumption after interruption generation is expressed as follows: where, is the time consumption weight coefficient, is the energy consumption weight coefficient.

[0084] In order to unify the mathematical expression form of the optimization problem and facilitate the condition judgment and constraint check in the optimization algorithm (such as Lagrange multiplier method, convex optimization solver, etc.), the embodiment usually converts the constraint condition into a standard form . At this time, the problem is converted to the problem .

[0085] .

[0086] In order to solve the above non-convex problem, the embodiment hopes to convert the problem into a geometric programming problem in order to use CVX solver and other tools for solution. Although a standard form of geometric programming problem is still non-convex, it can be converted into a convex optimization problem after some logarithmic transformation.

[0087] In order to be able to meet the requirements of geometric programming, the embodiment relies on strict positive optimization variables and replaces the constraint condition (8d) with , . Therefore, the inequality constraint condition in the form of , such as constraint condition (8b) and constraint condition (8c), is replaced with , where, is the optimization variable, . In order to ensure that in the final solution, the embodiment adds to the objective function and introduces a penalty term. In addition, the embodiment makes , the maximum total time consumption, and optimizes , so as to reform the problem into a more tractable geometric programming (GP) problem .

[0088] The standard form of GP allows a positive polynomial objective function subject to inequality constraints of positive polynomials and equality constraints of monomials. By taking the logarithm of the variables, its standard form can be converted into a convex optimization, which can be solved efficiently using CVX and the like. However, the current problem does not satisfy the standard format of GP. It can be seen that the constraint (9a) is an equality constraint of a positive polynomial, which is not recognized by GP. Next, this embodiment employs an approximation theory based on the arithmetic-geometric mean inequality to transform this equality constraint to comply with GP.

[0089] This embodiment transforms the equality constraint into two inequality constraints: (1) , (2) . Here, A is an auxiliary variable, , in order to make A as close to 1 as possible, a penalty term is added to the objective function to force the optimization process to make , tend to 1.

[0090] Although inequality (1) is an inequality of a positive polynomial, GP recognizes this. However, inequality (2) is an inequality of a non-positive polynomial (monomial or positive polynomial divided by a positive polynomial is not a positive polynomial). In order to handle this case, the denominator needs to be approximated or transformed into a monomial, so that the problem complies with the requirements of GP. Here, the approach taken is to approximate the positive polynomial by a larger monomial or obtain a lower bound of the positive polynomial , which is done as follows: Consider a positive polynomial , where is a monomial, is the number of monomials. Choose a fixed point , and calculate the weight , . Construct a monomial as a positive monomial or its lower bound, i.e. , is the definition symbol, is the multiplication symbol.

[0091] In the iterative optimization process, the fixed point is constantly updated, thus improving the accuracy of the approximation.

[0092] With the above theoretical support, the constraint conditions (9a)-(9c) are rewritten again: Assuming the current approximation iteration optimization round is , for the constraint condition (9a), it can be equivalent to the following three constraints: where, is the penalty term related to the constraint condition (9a), is the first monomial, a large related penalty term is added in the objective function to force the optimal point .

[0093] , , , is the first positive monomial.

[0094] For the constraint condition (9b), it can be equivalent to the following two constraints: where, is the penalty term related to the constraint condition (9b), is the second monomial, a large related penalty term is added in the objective function to force the optimal point .

[0095] For the constraint condition (9c), the following steps are performed: where, is the penalty term related to the constraint condition (9c), a large a related penalty term to force convergence at the optimal point .

[0096] Next, the denominator of the above equation is approximated by a monomial using the arithmetic-geometric mean inequality as follows: , is a second monomial, is a second positive monomial.

[0097] At this point, the constraint (9c) can be equivalently written as the following two constraints: .

[0098] At this point the problem becomes the problem : where, is the first constraint weight, is the second constraint weight, is the third constraint weight.

[0099] It is easy to verify that as the optimization variable changes logarithmically, the problem becomes a convex optimization, which can be easily solved using existing software.

[0100] In addition, in some cases, the client may fail to receive the global model or the new global model sent by the server due to interruption or other factors. In this case, the client will pause the update process of the current round and enter a waiting state until the next global round starts. S2 and S3 repeat once for a round. Specifically, when the client does not receive the global model update (new global model) of the current round, its behavior can be summarized as follows: Wait for the next global round: After not receiving the model update of the current global round, the client will pause the corresponding model update operation and keep its model update until the next global aggregation round. At this time, the client's model parameters will remain unchanged until the next global round starts, and the client will participate in the upload and aggregation process of the model again.

[0101] Time adjustment and synchronization: During the waiting process, the client will not upload the local model, but will continue the calculation process to the next round. At this time, the upload time and uninstallation time of the client will be appropriately delayed to synchronize in time at the start of the next round.

[0102] Synchronization and adjustment of global model: When the next global round comes, the client participates in the global aggregation process again and uploads its latest local model update. At this time, the global model will be adjusted and optimized according to the updates of all clients to ensure the effectiveness of the training process.

[0103] The purpose of this mechanism is to ensure that in the case of a client failing to receive the global model in time due to some reasons, the system can maximize resource utilization through the waiting mechanism and delayed synchronization, while ensuring the collaborative update and convergence of the global model.

[0104] S4: Repeat S2-S3 until the preset aggregation round is reached, complete federated learning, and the server generates the final model.

[0105] This embodiment uses a target area of 500m x 500m, with an edge server at the center and 100 randomly distributed clients, and numbers each client from small to large according to the distance from the edge server. FedAvg is used as the learning algorithm in FL, and two image data sets and their respective training models are used: (1) MNIST data set, using a DNN model with 23,860 parameters for classification; (2) CIFAR-10 data set, using a ResNet-20 model with 271,098 parameters for classification. In addition, for both models, the number of bits required by the sign function is equal to the number of model parameters, and the upper and lower limits are 4 and 97, respectively.

[0106] Two data distribution scenarios are considered: (1) IID (independent and identically distributed) scenario, where the data of the training set is shuffled and randomly and uniformly allocated to all clients; (2) non-IID (non-independent and identically distributed) scenario, where the data of the training set is sorted by label and divided into 200 groups, and each client holds at most 3 groups. Since the number of clients accessing the edge server in the real world is often limited, and each client does not necessarily participate in each round of global learning, 10 clients are randomly selected from the client set to participate in training before each round of global learning. In order to not lose generality, all experiments are performed 10 times and the average value is taken. The detailed parameter settings are shown in Table 1.

[0107] Table 1 Firstly, this embodiment verifies that the method of jointly allocating the number of quantization bits, allocating bandwidth and transmitting power before the interruption occurs to reduce the influence of quantization error and transmission interruption on the training result and reduce the training delay is real and effective. Two baseline methods and an ideal scheme are considered.

[0108] (1) Only optimize the allocated bandwidth: all clients use the maximum transmission power within the energy consumption constraint range, the same number of quantization bits, and only optimize the allocated bandwidth.

[0109] (2) Only optimize the number of quantization bits: all clients use the maximum transmission power within the energy consumption constraint range and uniform bandwidth, and only optimize the number of quantization bits.

[0110] (3) Ideal model: the training process is neither affected by transmission interruption nor by quantization error, which serves as the performance upper limit in all experiments.

[0111] This embodiment selects a transmission delay budget of 10 ms to compare the test accuracy of the MNIST dataset under IID and non-IID conditions. From Figure 2 (a), it can be seen that under the IID condition, the test accuracy of WidthAllocOnly (only optimizing the allocated bandwidth) with a small number of quantization bits ( = 2 or = 5) and this embodiment is close to the ideal scheme. This is mainly because under the IID condition, the data variance is about 0, and even if there is transmission interruption, the model learned by WidthAllocOnly can still converge in the correct direction. Since the interruption probability will affect the effective number of clients, when the number of quantization bits is high ( =10), WidthAllocOnly suffers from higher interruption probability and more retransmission rounds. Under non-IID condition, the test accuracy of all methods is reduced to different degrees, but the performance of the present method is still close to the ideal scheme and is superior to WidthAllocOnly. Specifically, it can be observed from Figure 2 that when the number of quantization bits is small ( =2 or =5), the heterogeneity of data amplifies the impact of quantization error, and the test accuracy is significantly reduced. At this time, unlike WidthAllocOnly, the present method can adaptively adjust the number of quantization bits to ensure uniform transmission interruption probability while ensuring that the model update can be correctly represented, thereby achieving better performance. While WidthAllocOnly ( =10) suffers from the double effects of transmission interruption and quantization error, the training effect is minimal.

[0112] Secondly, the present embodiment verifies the necessity of optimizing the allocation of bandwidth in a non-ideal wireless channel. Figure 3 The test accuracy of the present method and QuantizLvlOnly (only optimizing the number of quantization bits) is compared under the conditions of model upload time of 6ms, 10ms and 15ms at the client, and IID and non-IID conditions are discussed. As shown in Figure 3 (a), under IID condition, for the case of model upload time of 6ms, the present method performs better than QuantizLvlOnly, because the present method tends to allocate more bandwidth to the clients far from the server and less bandwidth to the clients close to the server, thereby allowing more uniform allocation of quantization bits; in contrast, QuantizLvlOnly allocates larger quantization bits to the clients close to the server because they have larger channel capacity, and must allocate smaller quantization bits to the clients far away, which will lead to significant quantization error. Similarly, as shown in Figure 3 (b), this error is further amplified under non-IID condition. For example, when the model upload time is 6ms, the final test accuracy of the present method is 24.7% higher than that of QuantizLvlOnly.

[0113] Thirdly, the present embodiment verifies that the present method can obtain a suitable gradient offloading strategy and effectively control the system cost. Two baseline methods and the case of no gradient offloading are considered.

[0114] (1) Random gradient offloading (RandomOffload): the clients that have been interrupted randomly generate a gradient offloading matrix after interruption, and randomly offload the gradient to the clients that have not been interrupted.

[0115] (2) Nearest client gradient offload: After an interruption, the client will offload all gradients to the nearest client that has not been interrupted.

[0116] (3) No gradient offload: After an interruption, the gradient is selectively ignored by comparing model similarity without being offloaded. If no update is received, it waits for retransmission.

[0117] The client that interrupts the global iteration in each method (i.e., the client that needs to unload the gradient) is set to be the same, with the goal of achieving 85% accuracy on MNIST, from the training latency ( =1, =0), energy loss ( =0, =1) and system cost ( + =1, , Compare from three angles: ∈(0,1), such as Figure 4 As shown in (a)-(c). This method is used as the baseline (100%). Figure 4 The method performed better than the baseline method in terms of training latency, energy consumption, and system cost. Furthermore, due to gradient unloading, necessary model updates were correctly preserved, allowing all three methods to reach the target accuracy faster than methods without gradient unloading, thus consuming less training overhead.

[0118] Finally, this embodiment verifies that the pre-interruption and post-interruption processing methods are complementary and indispensable. First, performing resource allocation only before the interruption without gradient unloading will lead to the loss of necessary model updates, thus affecting the convergence speed. Second, performing gradient unloading only without unifying the interruption probability and optimizing resource allocation before the interruption will amplify the negative impact of the interruption on model accuracy and convergence speed. To ensure the model can converge correctly, gradient unloading must be performed frequently, which will consume more system costs to achieve the target accuracy.

[0119] like Figure 5 As shown, this embodiment compares the accuracy of the pre-and-post-interruption joint optimization method (FedMRO), the pre-interruption resource allocation method (RAOnly), and the post-interruption gradient offloading method (GOOnly) on CIFAR-10 non-IID, and the system cost required to achieve 55% accuracy. Figure 5 As can be seen in (a), FedMRO's test accuracy is better than RAOnly and close to GOOnly, which receives all gradient parameters, and is further improved by...Figure 5 The method (b) has a significant advantage in system cost control compared with the other two methods.

[0120] The embodiment also provides a federated learning system for interruption risk, and the technical scheme is as follows: comprising a server and a plurality of clients. The server and the plurality of clients are constructed as a federated learning architecture. The server is configured to synchronize and initialize a global model to all clients within a coverage range, generate a new global model based on model parameters uploaded by the clients, and generate a final model when the federated learning is completed. The client is configured to jointly allocate a number of quantization bits, bandwidth, and transmit power, minimize quantization error and training delay under the constraints of self energy and unified interruption probability, update a local model through a stochastic gradient descent, quantize the local model parameters through a stochastic quantization method, and upload the local model parameters to the server; when transmission interruption occurs during uploading to the server, the model parameters of the interrupted client are offloaded to other clients, the model parameters of the interrupted client are aggregated with the model parameters of the other clients, and the aggregation result is uploaded to the server; and the offloading matrix is used to describe the corresponding relationship and proportion of model offloading between the clients.

[0121] The embodiment also provides a computer readable storage medium having a computer program stored thereon, and the computer program is executed by a processor to implement the federated learning method for interruption risk.

[0122] The embodiment also provides a computer program product comprising a computer program, and the computer program is executed by a processor to implement the federated learning method for interruption risk.

[0123] Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: it can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacement for part of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A federated learning method for interruption risk, characterized in that, Comprise: S1: build a federated learning architecture, including a server and multiple clients; S2: the server synchronously initializes a global model to all clients within the coverage range; each client updates a local model through stochastic gradient descent; S3: jointly allocate the number of quantization bits, bandwidth and transmit power, each client minimizes the quantization error and training delay under its own energy constraint and unified outage probability constraint; then each client quantizes the local model parameters through a random quantization method and uploads them to the server, and the server generates a new global model; During the uploading to the server, when transmission interruption occurs and the model parameters are re-uploaded, based on the offloading matrix, the interrupted client offloads its model parameters to other clients, and the other clients aggregate the model parameters of the interrupted client with their own model parameters and upload the aggregation results to the server; The offloading matrix is used to describe the corresponding relationship and proportion of model offloading between clients; S4: repeat S2-S3 until the federated learning is completed, and the server generates a final model.

2. The federated learning method for interruption risk according to claim 1, wherein, Resource allocation problem of quantization bit number, allocation bandwidth and transmission power Is expressed as follows: ; Where min represents taking the minimum value. For the client allocated bandwidth For the client The transmission power, For the client Quantization bit depth For the client transmission rate For quantization error weighting coefficients, The amount of data the client possesses. The sum of the client's image dataset, For the total number of clients, To quantify the range, This is the time delay weighting coefficient. To obtain the maximum value, A collection of clients, This represents the total number of local iterations. The time required to perform one iteration, This represents the total number of bits after quantization in the local model. As constraints, Energy consumption for performing one iteration For the dimensions of the model, For the sign bit and upper and lower limits Number of bits, Energy threshold For bandwidth threshold, For the transmit power threshold, Let be the interruption probability of the i-th client. It is a preset uniform interruption probability. It is a positive integer; Problem The solution process is: Will relax to , ; Optimal transmission rate Satisfies wherein the first intermediate parameter is , is the shadowing variance, () denotes the Q-function of the standard normal distribution, is a constant depending on the antenna characteristics and the channel attenuation, is the path loss exponent, is the distance between the client and the server, denotes the conversion into a representation in decibel, is the power spectral density of the additive noise; Initialize a set of , Satisfy constraint (2) and constraint (3); then fix , Invariable, use convex optimization solver to solve the optimal number of quantization bits , fix Invariable, express the allocation of bandwidth as the allocation of resource blocks, and solve the optimal allocation bandwidth through an algorithm based on reinforcement learning.

3. The federated learning method for interruption risk according to claim 2, wherein, The optimal allocation bandwidth is obtained based on a reinforcement learning algorithm: Replace with wherein, represents the number of resource blocks allocated to the client , and is the bandwidth size corresponding to the resource blocks; design state space, action space and reward function, and solve the integer programming problem dynamically in each round by using reinforcement learning; wherein the state space: the number of resource blocks currently allocated to all clients, the remaining energy of all clients under energy constraints ; Action space: all clients select how many resource blocks to allocate; The reward function includes three: the negative value of the time of each round of training completion; the client The remaining energy under the energy constraint is less than 0, a negative reward is given; if the allocated bandwidth exceeds the total bandwidth limit, a negative reward is given; Action update strategy: select the action with the maximum Q value.

4. The federated learning method for interruption risk of claim 1, wherein, In S3, during the uploading to the server, if transmission interruption occurs, the similarity between the local model of the interrupted client and the global model is calculated, and whether to re-upload is determined according to the comparison result with the threshold value.

5. The federated learning method for interruption risk orientation of claim 4, wherein, When model parameters are not uploaded; When model parameters are not uploaded; When , re-upload model parameters; wherein, is the number of iterations, is the CKA similarity of the local model and the global model for the current iteration, is the upper bound of the model similarity, is the lower bound of the model similarity.

6. The federated learning method for interruption risk orientation of claim 1, wherein, The client quantizes the local model parameters through a random quantization method using the image dataset it possesses.

7. The federated learning method for interruption risk orientation of claim 1, wherein, When a client does not receive a new global model, the client suspends the corresponding model update operation.

8. A federated learning system for interruption risk, the system comprising: A computer program for executing a federated learning method for interruption risk as claimed in any one of claims 1 to 7, comprising: a server and a client; A server and multiple clients are constructed as a federated learning architecture; The server is configured to synchronously initialize a global model to all clients within the coverage range; generate a new global model based on the model parameters uploaded by the clients; and generate a final model when the federated learning is completed; The client is configured to jointly allocate the number of quantization bits, bandwidth and transmit power, minimize the quantization error and training delay under its own energy constraint and unified outage probability constraint; update a local model through stochastic gradient descent; quantize the local model parameters through a random quantization method and upload them to the server; when uploading to the server, when transmission interruption occurs and the model parameters are re-uploaded, based on the offloading matrix, the interrupted client offloads its model parameters to other clients, and the other clients aggregate the model parameters of the interrupted client with their own model parameters and upload the aggregation results to the server; and the offloading matrix is used to describe the corresponding relationship and proportion of model offloading between clients.

9. A computer readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by a processor to implement the federated learning method for interruption risk as claimed in any one of claims 1 to 7.

10. A computer program product comprising a computer program, characterized in that, The computer program is executed by a processor to implement the federated learning method for interruption risk as claimed in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Federal learning task trusted unloading system and method in end-edge collaborative environment

    CN115633062A

  • Federal learning resource allocation optimization system and method for deep reinforcement learning

    CN115915147A

  • Abnormal client detection method and device, electronic equipment and storage medium

    CN117194145A

  • Limited-memory dual-time-scale multi-slice resource allocation method

    CN118338448A

  • Federal learning resource allocation optimization method and system for edge intelligent network

    CN120066765A