A federated learning method, system, product and medium for interruption risk

CN121365751BActive Publication Date: 2026-08-11北京泰尔英福科技有限公司 +1
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-12-10
Publication Date
2026-08-11

AI Technical Summary

Technical Problem

例如,非均匀的中断概率不仅导致全局模型偏差,还会放大量化误差和数据异构性的负面影响

Benefits of technology

[0016]本发明实施例中的上述一个或多个技术方案,至少具有如下技术效果之一:

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121365751B_ABST
    Figure CN121365751B_ABST
Patent Text Reader

Abstract

This invention relates to the field of edge computing technology, specifically disclosing a federated learning method, system, product, and medium for addressing the risk of interruption. The method includes: S1: establishing a federated learning architecture, including a server and multiple clients; S2: the server synchronously initializes the global model to all clients within its coverage area; each client updates its local model using stochastic gradient descent; S3: each client quantizes its local model parameters using a stochastic quantization method and uploads them to the server, which generates a new global model; S4: repeating S2-S3 until federated learning is complete, and the server generates the final model. This invention minimizes quantization error and training latency by optimizing bandwidth allocation, transmission power, and the number of quantization bits; it also designs a similarity-based evaluation strategy for model parameters that are not fully uploaded after an interruption, determining whether to ignore updates or retransmit, thereby improving the robustness and efficiency of the system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of edge computing technology, and in particular to a federated learning method, system, product, and medium for addressing the risk of disruption. Background Technology

[0002] With the rapid development of mobile communication and edge computing technologies, edge federated learning, as a distributed machine learning paradigm, has demonstrated significant advantages in wireless networks. This method coordinates a large number of mobile devices to collaboratively train a shared model on local data, without sharing the original data. This allows for the full utilization of edge computing resources to improve model training efficiency while protecting user privacy. However, in practical wireless systems, due to factors such as dynamically changing 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, these challenges manifest in the following three aspects: (1) Threat of non-ideal channels to model convergence: In wireless environments with limited transmission delay and bandwidth, the efficient transmission of model parameters is inevitably constrained by quantization errors and transmission interruptions. For example, non-uniform interruption probabilities not only lead to global model bias, but also amplify the negative impact of quantization errors and data heterogeneity.

[0003] (2) The trade-off between resource allocation and model accuracy: High quantization accuracy requires more transmission bits, which may increase the risk of transmission interruption and introduce more training costs, such as training latency and energy consumption; low quantization accuracy reduces the number of bits, but introduces greater quantization error. Existing solutions, such as fixed quantization level or uniform bandwidth allocation, are difficult to dynamically balance this contradiction, resulting in decreased training efficiency or impaired model performance.

[0004] (3) Rigid parameter retransmission and discarding mechanisms: Existing solutions typically employ retransmission or random discarding strategies after an interruption, failing to distinguish the importance of updates. In non-independent and identically distributed scenarios, updates from some clients may negatively impact the global model due to significant differences in data distribution, while traditional methods still consume resources to transmit such inefficient updates. Furthermore, some clients with good channel conditions and strong transmission capabilities are not well utilized to mitigate data loss caused by interruptions. Summary of the Invention

[0005] This invention aims to solve the aforementioned problems. To this end, this invention provides a federated learning method, system, product, and medium oriented towards interruption risk, achieving resource optimization in edge federated learning under non-ideal channel conditions. This invention minimizes quantization error and training latency by optimizing bandwidth allocation, transmission power, and quantization bit depth; furthermore, for model parameters not fully uploaded after an interruption, it designs a similarity-based evaluation strategy to determine whether to ignore updates or retransmit, thereby improving the robustness and efficiency of the system.

[0006] This invention provides a federated learning method for addressing disruption risks, employing the following technical solution: including the following steps: S1: Build a federated learning architecture, including one server and multiple clients; 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. S3: Jointly allocate the number of quantization bits, bandwidth, and transmit power. Each client minimizes quantization error and training latency under its own energy constraints and unified interruption probability constraints. Then, each client quantizes its local model parameters using a random quantization method and uploads them to the server, which generates a new global model. If a transmission interruption occurs during the upload to the server and the model parameters are re-uploaded, the interrupting client unloads its model parameters to other clients based on the unloading matrix. The other clients then aggregate the interrupting client's model parameters with their own model parameters and upload the aggregated result to the server. The unloading matrix is ​​used to describe the correspondence and proportion of model unloading between clients; S4: Repeat S2-S3 until federated learning is complete, and the server generates the final model.

[0007] Furthermore, there are resource allocation issues related to quantization bit depth, bandwidth allocation, and transmit power. The statement is 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, The 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 ,in, Indicates assignment to the client The number of resource blocks, Given the bandwidth size corresponding to the resource block; design the state space, action space, and reward function, and use reinforcement learning to dynamically solve the integer programming problem in each round; Wherein, the state space represents the number of resource blocks currently allocated to all clients, and the energy constraints for all clients. The remaining battery power; Action space: How many resource blocks each client chooses to allocate; The reward function includes three components: the negative of the time taken to complete each training round; and the client-side reward function. Under energy constraints If the remaining energy is less than 0, a negative reward will be given; if the allocated bandwidth exceeds the total bandwidth limit, a negative reward will be given. Action update strategy: Select the action with the maximum Q value.

[0009] Furthermore, in S3, if a transmission interruption occurs during the upload to the server, the similarity between the local model and the global model of the interrupted client is calculated, and a decision is made on whether to re-upload based on the comparison result with a threshold.

[0010] Furthermore, when At that time, do not upload model parameters; when At that time, do not upload model parameters; when Re-upload the model parameters; in, For the first The CKA similarity between the local model and the global model in each iteration. This represents the upper limit of model similarity. This represents the lower bound of model similarity.

[0011] Furthermore, the client uses its image dataset to quantize the local model parameters using a random quantization method.

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

[0013] This invention also provides a federated learning system for dealing with disruption risks, which adopts the following technical solution: including a server and a client; A server and multiple clients are configured as a federated learning architecture; The server is used to synchronize and initialize the global model to all clients within the coverage area; generate a new global model based on the model parameters uploaded by the clients; and generate the final model upon completion of federated learning. The client is used to jointly allocate the number of quantization bits, bandwidth, and transmission power, minimizing quantization error and training latency under its own energy constraints and unified interruption probability constraints; update the local model through stochastic gradient descent; quantize the local model parameters through a stochastic quantization method and upload them to the server; if a transmission interruption occurs during the upload to the server and the model parameters are re-uploaded, the interrupting client unloads its model parameters to other clients based on the unloading matrix, and the other clients aggregate the interrupting client's model parameters with their own model parameters and upload the aggregated result to the server; the unloading matrix is ​​used to describe the correspondence and proportion of model unloading among clients.

[0014] The present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the above-described federated learning method oriented towards interruption risk.

[0015] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described federated learning method for interruption risk.

[0016] The above-described one or more technical solutions in the embodiments of the present invention have at least one of the following technical effects: 1. This invention minimizes communication latency and quantization error by optimizing bandwidth allocation, transmission power, and quantization bit depth. Specifically, this invention dynamically adjusts these parameters based on the energy constraints and interruption probability limits of each client to ensure the training efficiency of the global model. By optimizing the quantization bit depth, quantization error can be significantly reduced, thereby improving model convergence performance. Simultaneously, reasonable allocation of bandwidth and power can effectively reduce communication bottlenecks.

[0017] 2. This invention introduces a reinforcement learning (DRL) algorithm to solve complex resource (bandwidth) allocation problems. DRL optimizes the client's resource block allocation scheme by designing a state space, action space, and reward function. This method maximizes resource utilization and minimizes training time while meeting energy and bandwidth constraints, thus adapting to dynamically changing network environments and providing stable communication guarantees for federated learning.

[0018] 3. This invention 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 incomplete updates or retransmit them. Compared to the traditional cosine similarity method, CKA can more accurately capture the correspondence between hidden layers of the neural network, thereby helping the system make more reasonable decisions and avoiding unnecessary resource waste.

[0019] 4. This invention designs a model offloading matrix to describe the offloading ratio and relationship of model parameters among clients. When a client is interrupted, the system can choose to offload some 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 communication costs but also improves the robustness of the system, ensuring efficient model updates even in the event of an interruption.

[0020] Additional aspects and advantages of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. Attached Figure Description

[0021] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

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

[0023] Figure 2 This is a comparison of the test accuracy results of the method provided by this invention and WidthAllocOnly on the MNIST dataset.

[0024] Figure 3 This is a comparison of the test accuracy results of the method provided by this invention and QuantizLvlOnly on the MNIST dataset.

[0025] Figure 4 This is a comparison chart of training latency, energy consumption, and system cost for different gradient unloading strategies provided by this invention.

[0026] Figure 5 This is a performance comparison chart of FedMRO, RAOnly, and GOOnly on CIFAR-10 provided by this invention. Detailed Implementation

[0027] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention. The following embodiments are used to illustrate this invention but should not be used to limit the scope of this invention.

[0028] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., refer to specific features, structures, or characteristics described in connection with that embodiment or example, which are included in at least one embodiment or example of the present invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.

[0029] The following is combined Figures 1 to 5 The present invention will be further described in detail below, including a federated learning method, system, product, and medium for addressing disruption risks: This invention addresses the negative impact of non-uniform interruption probability on convergence by proposing a non-convex problem involving the joint allocation of quantization bit depth, bandwidth, and transmit power. It jointly minimizes quantization error and training latency under unified interruption probability and energy consumption constraints, and obtains a high-quality approximate solution through a joint iterative optimization method based on a convex optimization solver and Q-Learning. This invention achieves more accurate model similarity evaluation through the CKA function, effectively handling parameter update problems after interruption and avoiding misjudgments caused by initialization or structural differences in traditional methods. After a transmission interruption, this invention proposes a series of mechanisms, including model parameter screening and distribution, to address the risk of transmission interruption and optimize resource allocation. Combined with model offloading and time adjustment mechanisms, it significantly reduces communication costs and improves system robustness, adapts to complex heterogeneous environments, and optimizes global model convergence efficiency. Simulation results demonstrate that this invention excels in reducing quantization error and training latency, and improving model accuracy and convergence.

[0030] In this embodiment, as Figure 1 As shown, a federated learning method for addressing disruption risk is provided, comprising the following steps: S1: Build a federated learning architecture, including one 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 depth As the first coefficient, At this point, it falls into the interval. Model parameter components Quantification results for Here, wp represents probability. Therefore, the local model Total number of bits after quantization for ,in, For the sign bit and upper and lower limits The number of bits.

[0034] The computational and communication model of the federated learning architecture is as follows: Let the time to perform one iteration be... The energy consumption for one iteration is ,but , .in, The computing resources (e.g., number of CPU cycles) required to process a piece of data. This refers to the proportion of SGD mini-batch data to the local dataset. CPU frequency, For medium coefficients. Under imperfect channel state information (CSI), the client The actual CSI representation to the edge server is as follows Based on the classic road loss shadow model, the client can obtain... Channel gain to edge server for: , in, 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 It is a shadow, and the shadow variance is , This indicates conversion to a representation in decibels.

[0035] Client Channel capacity to edge server This can be expressed as: in, For the client allocated bandwidth For 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, Let be the interruption probability of the i-th client. It is a preset uniform interruption probability. The upper bound of quantization error is influenced by the number of quantization bits; that is, the larger the number of quantization bits, the smaller the quantization error. Therefore, to improve learning performance and reduce the required training latency, which includes computation and communication latency, this embodiment chooses to minimize the cumulative quantization error (upper bound) and training latency in each global round under client-side energy constraints and a unified interruption probability constraint. This resource allocation problem... The statement is as follows: .

[0041] Where min represents taking the minimum value. For quantization error weighting coefficients, This is the time delay weighting coefficient. The sum of the client's image dataset, To quantify the range, For the transmit power threshold, It is a positive integer. These are constraints.

[0042] Constraint (1) specifies that the client's own energy is constrained to an energy threshold. The following constraint (2) states that the total bandwidth used for uploading model parameters does not exceed the bandwidth threshold. Constraint (3) specifies the range of variation of the client's transmit power. Constraint (4) reflects the uniformity of the interruption probability. Constraint (5) indicates the positive integer characteristic of the number of quantization bits, that is, this problem is a mixed integer programming problem.

[0043] To solve this problem, this embodiment will relaxation , Regarding the question The optimal condition satisfies the following relationship: optimal transmission rate satisfy , Among them, the first intermediate parameter for .

[0044] but It can be restated as : .

[0045] Since there are three decision variables to be optimized, the problem remains highly complex. This embodiment considers using iterative optimization to obtain an approximate optimal solution to the problem. A set of variables is initialized separately. , Satisfy constraints (2) and (3), and consider the following two steps: Subproblem 1: Fixed and The problem remains unchanged, and now it only involves... Related optimization issues : .

[0046] question This is a convex optimization problem. The proof is as follows: Consider letting the second intermediate parameter... for Then the problem Can be rewritten as a problem : Easy to prove and Both are convex functions (the second derivative is non-negative in the domain), therefore, the problem This is a convex optimization problem, also known as the problem This is a convex optimization problem. The optimal second intermediate parameter is obtained using a convex optimization solver. At this point, the optimal number of quantization bits is... It can also be obtained.

[0047] Subproblem 2: Fixed The problem remains unchanged, and now it only involves... what Related optimization issues : when At that time, the client energy consumption for: .

[0048] because ,therefore, It is about An incrementing function. (Client) Model upload time for , It is about The function is decreasing. Therefore, the problem... middle optimal solution for ,in, Client at energy threshold The transmission power, satisfy .at this time Converted to only with The relevant formulas.

[0049] Based on the above derivation, the problem It can be easily converted to only with The relevant formulas are expressed as problems. : .

[0050] Due to the problem Optimization parameters Given that the variables are high-dimensional floating-point numbers and constraint (1) is not affine, the problem is non-convex. To simplify the problem and seek an adaptive and forward-looking solution, this embodiment considers reformulating the bandwidth allocation as the allocation of resource blocks, transforming the problem into an integer programming problem. The problem is solved by using a reinforcement learning (DRL) based algorithm to find the optimal bandwidth allocation.

[0051] In the question In this embodiment, the problem will be... In Replace with ,in, Indicates assignment to the client The number of resource blocks, The bandwidth size corresponding to the resource block. This indicates the total number of resource blocks.

[0052] This embodiment can solve this problem through reinforcement learning (DRL), by progressively designing the state space, action space, and reward function, and dynamically solving the integer programming problem in each round using DRL.

[0053] state space : ,in, This indicates the number of resource blocks currently allocated to all clients. , Indicates the client The number of resource blocks currently allocated, and , ; This indicates that all clients are under energy constraints. The remaining battery power , Indicates the client Under energy constraints The remaining power, i.e. .

[0054] Action space : ,in, This indicates the number of resource blocks allocated to all clients. , Indicates the client Select the number of resource blocks to allocate.

[0055] Reward function: This embodiment will consider the design of the reward function from the following three aspects: Negative objective function: The goal is to minimize training time, therefore the reward can be the negative of the time taken to complete each training epoch. The longer the training time, the smaller the reward. Objective reward function. : .

[0056] Energy constraint satisfaction: If a client's energy constraint is exceeded, a penalty can be imposed. For example, if a client... Under energy constraints Remaining energy If the value is less than 0, a negative reward is given; energy-constrained reward function. : in, It is the energy default penalty coefficient.

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

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

[0059] Action update strategy: Q-value based method (DQN): Select the action with the maximum Q value, i.e., the optimal action. For example: ,in, To find the maximum value, This is a learning 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 after choosing an action in a given state. The Q-value update formula is as follows: in: It represents the current state, including information such as allocated resource blocks and remaining energy on the client side. This is the currently selected resource block allocation action. , This is the first resource block allocation action currently selected. It is the reward after performing an action, represented as a weighted average of negative training time, energy, and resource block constraints for violation of penalties. It is a discount factor, representing the weight of future rewards. The learning rate of the Q function determines the step size for updating the Q value.

[0061] In general, the process of minimizing quantization error and training latency by jointly allocating the number of quantization bits, bandwidth, and transmit power, under the constraints of its own energy and a unified interruption probability, is as follows: (1) Fixed The problem remains unchanged, and now it only involves... The relevant optimization problem. Based on variable substitution. The problem is transformed into a convex problem, and then solved using a convex optimization solver. optimal solution At the same time, .

[0062] (2) Fixed The problem remains unchanged, and now it only involves... The related non-convex optimization problem is addressed by representing the bandwidth allocation of floating-point numbers as the allocation of an integer number of resource blocks. The problem is transformed into an integer programming problem, and the reinforcement learning algorithm of Q-Learning is used to obtain... The optimal solution is obtained simultaneously. The optimal solution.

[0063] Finally, the transmit power and transmission rate for the optimal bandwidth allocation are calculated. Based on these calculations, the client uses its image dataset to quantize the local model parameters using a random quantization method and uploads the quantization results to the server.

[0064] If a transmission interruption occurs during the upload to the server, the similarity between the local model of the interrupted client and the global model is calculated, and a decision is made on whether to re-upload based on the comparison result with a threshold.

[0065] In federated learning scenarios, communication interruptions may prevent local model updates from being uploaded to the edge server in a timely manner. Completely abandoning model updates from interrupted clients would result in the loss of differentiated information generated during local training, weakening the utilization of data diversity and consequently affecting the model's convergence speed and accuracy. Conversely, if the system continuously waits for retransmissions from interrupted clients, training processes will stall due to differences in computing resources between devices and network fluctuations, significantly extending the overall training time. Therefore, this implementation designs a dynamic adaptive strategy to achieve an effective balance between communication efficiency and model performance. The following three scenarios are mainly considered: When the update to the local model is small and will not significantly affect the global model, the update should be ignored. In this case, ignoring the model update is more appropriate than other methods because, in some situations, unuploaded updates may cause significant deviations in the global model, thus affecting global convergence.

[0066] Therefore, this embodiment introduces the CKA (Centered Kernel Alignment) function proposed in [reference needed] to evaluate the similarity between the local model and the global model. Definition This is the feature map of the last fully connected layer of the local model in the g-th iteration. This is the feature map of the last fully connected layer of the global model in the g-th iteration.

[0067] The CKA function is defined as follows: in, Let be the CKA similarity between the local model and the global model in the g-th iteration. Let be the feature value of the u-th dimension in the local model during the g-th iteration, where U is the number of dimensions in the local model. Let V be the feature value of the v-th dimension in the global model of the g-th iteration, where V is the number of dimensions in the global model. Let be the eigenvector corresponding to the eigenvalue of dimension u in the local model during the g-th iteration. Let be the feature vector corresponding to the feature value of dimension v in the global model during the g-th iteration. Compared with dot product operations such as cosine, CKA can determine the correspondence between hidden layers of neural networks trained with different random initializations and widths, making similarity calculation more accurate.

[0068] Different CKA values ​​indicate the importance of different model updates: when When the local model update differs significantly from the global model, it is usually due to the non-independent and identically distributed (non-iid) nature of the client data distribution. In this case, it is recommended not to upload model parameters. This represents the upper limit of model similarity.

[0069] when When the local model is close to convergence, continuing to upload and update may not bring significant performance improvement, so there is no need to consume further resources to upload, i.e., do not upload model parameters. This represents the lower bound of model similarity.

[0070] when If the update is deemed to have a positive optimization effect on the global model, then the update should participate in the global aggregation process, and the model parameters should be re-uploaded.

[0071] This implementation, through the judgment mechanism of the above three scenarios, can rationally decide whether to upload parameters based on the similarity between the local model and the global model, thereby improving resource utilization efficiency and optimizing the training process of the global model. The two thresholds are determined based on the actual use case.

[0072] When model updates need to be re-uploaded, the issue of model parameter unloading needs to be considered, i.e., unloading the local model update and sending it to other clients. Specifically, to reduce the communication cost caused by uplink transmission of multiple model parameters, when a device receives model parameters sent by other devices, it aggregates the model parameters locally, adding the received model parameters to its local parameters, and only sends the resulting vector to the edge server. That is, when re-uploading model parameters, gradient unloading is performed based on the unloading matrix. The interrupted client unloads its model parameters to other clients, and after receiving the interrupted client's model parameters, the other clients aggregate the interrupted client's model parameters with their local model parameters and upload the aggregated result to the server.

[0073] This process involves client selection and model parameter segmentation. Therefore, this embodiment introduces an unloading matrix. This matrix is ​​used to describe the correspondence and proportion of model unloading between clients.

[0074] Specifically elements in , indicating the client With the client The model unloading ratio between [various parameters]. For the client... The model update can be handled in the following two ways: The client holds model parameters: when the client When preserving its model updates, this setting is used. , indicating the client It holds the model parameters independently and does not unload them.

[0075] Client-side unload model parameters: When the client When updating and uninstalling its model to other clients, this setting... That is, the client. Instead of holding the model parameters, it is unloaded to other clients. In this case, all uninstallation to the client is required. The ratio is 1, that is: in, In addition to the client A collection of other clients besides [the main client].

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

[0077] In the model update process, this embodiment incorporates the time factor into each stage of the model, for the client. ,include: Client Model unloading time Client Unload its complete model parameters to the client The required time. Define the transfer rate for model offloading. for , This represents the unified bandwidth for model unloading among clients. For the client and client The channel gain between them, .

[0078] Client Model upload time Client The time required to upload model parameters to the server. Since each client either completely distributes its gradients or holds all local gradient parameters, therefore... This can be expressed as: .

[0079] To further understand the impact of these time consumptions, the entire model unloading process is as follows: after all clients have completed their local computations, an assessment is made as to whether a transmission interruption has occurred; if a re-upload is required, the interrupted clients distribute the model parameters to clients with good channel conditions; the clients with good channel conditions then aggregate the local models and finally upload them.

[0080] Considering the impact of the unloading matrix, without loss of generality, the client... Time consumption Represented as: .

[0081] Similarly, the client Energy consumption for: in, , .

[0082] At this point, after the interruption occurs, the total system time consumption and the system's total energy consumption for: .

[0083] The problem of minimizing the weighted sum of total time and total energy consumption after an interruption occurs is specifically represented as follows: in, This is a weighting factor for time consumption. This is the energy consumption weighting coefficient.

[0084] To standardize the mathematical expression of optimization problems and facilitate the handling of condition judgments and constraint checks in optimization algorithms (such as the Lagrange multiplier method and convex optimization solvers), this embodiment typically transforms constraints into a standard form. The problem at this point Transform into a problem .

[0085] .

[0086] To address the aforementioned non-convex problem, this embodiment aims to transform it into a geometric programming problem, making it easier to solve using tools such as the CVX solver. Although a standard form of geometric programming problem is still non-convex, it can be transformed into a convex optimization problem after some logarithmic transformations.

[0087] To meet the requirements of geometric programming, this embodiment relies on strict positive optimization variables and replaces the constraint (8d) with... , Therefore, the form is The inequality constraints, such as constraints (8b) and (8c), are replaced with ,in, It is an optimization variable. To ensure that in the final solution... This embodiment will Add it to the objective function and introduce a penalty term. In addition, this embodiment makes... , To maximize the total time consumption, optimize in the objective function. In order to transform the problem into a more manageable geometric programming (GP) problem. .

[0088] The standard form of Generalized Approach (GP) allows a positive term objective function to be subject to positive term inequality constraints and monomial equality constraints. By performing a logarithmic transformation of the variables, the standard form of GP can be converted into a convex optimization problem, which can then be solved efficiently using algorithms such as CVX. However, the current problem... It still does not meet the standard format of GP. As can be seen, constraint (9a) is an equality constraint with positive terms, which GP does not recognize. Next, this embodiment uses an approximation theory based on the arithmetic-geometric mean inequality to transform this equality constraint to conform to GP.

[0089] This embodiment uses equality constraints. This can be transformed into two inequality constraints: (1) (2) In this case, A is an auxiliary variable. To make A as close to 1 as possible, a penalty term is added to the objective function, forcing the optimization process to... , To approach.

[0090] Although inequality (1) is a positive term inequality, GP acknowledges this. However, inequality (2) is a non-positive term inequality (a monomial or positive term divided by a positive term is not a positive term). To handle this case, it is necessary to approximate or transform the denominator into a monomial, thus making the problem conform to GP's requirements. The approach taken here is to use the arithmetic-geometric mean inequality (AGM inequality) with a larger monomial. To approximate the positive term Or obtain the positive term The lower bound is determined as follows: Consider a positive term ,in, It is a monomial. This represents the number of monomials. Choose a fixed point. Calculate the weight of each item. , Construct a monomial As a positive term An approximation of or a lower bound of, i.e. , To define symbols, This is the multiplication symbol.

[0091] During the iterative optimization process, the fixed points are continuously updated. This improves the accuracy of the approximation.

[0092] With the above theoretical support, the constraints (9a)-(9c) are rewritten once again: Suppose the current round of approximate iterative optimization is For constraint (9a), it can be equivalent to the following three constraints: in, For the penalty term related to constraint (9a), For the first monomial, a large [variable] was added to the objective function. The relevant penalties are designed to compel [them] to [do something] at the best possible point. .

[0093] , , , It is the first positive term.

[0094] For constraint (9b), it can be equivalent to the following two constraints: in, For the penalty terms related to constraint (9b), To achieve this, a large variable was added to the objective function. The relevant penalties are designed to compel [them] to [do something] at the best possible point. .

[0095] For constraint (9c), perform the following steps: in, To penalize the constraint (9c), a large penalty term was added to the objective function. The relevant penalties are designed to compel [them] to [do something] at the best possible point. .

[0096] Next, we approximate the denominator of the above expression using the arithmetic-geometric mean inequality, as shown below: , For the second monomial, It is the second positive term.

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

[0098] The problem at this time It became a problem : in, As the first constraint weight, As the second constraint weight, This is the third constraint weight.

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

[0100] Furthermore, in some cases, the client may fail to receive the global model or 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 begins. S2 and S3 are repeated once, constituting one round. Specifically, when the client does not receive the global model update (new global model) for this round, its behavior can be summarized as follows: Waiting for the next global round: If no model update is received in the current global round, the client will pause the corresponding model update operation and retain its model update until the next global aggregation round. During this time, the client's model parameters will remain unchanged until the next global round begins, at which point the client will re-participate in the model upload and aggregation process.

[0101] Time Adjustment and Synchronization: During the waiting period, the client will not upload the local model, but will continue its calculation process into the next round. At this time, the client's upload and unload times will be appropriately delayed to ensure timely synchronization at the start of the next round.

[0102] Global model synchronization and adjustment: In the next global round, the client re-participates in the global aggregation process, uploading its latest local model update. At this time, the global model will be adjusted and optimized based on the updates from all clients to ensure the effectiveness of the training process.

[0103] The purpose of this mechanism is to ensure that if the client fails to receive the global model in a timely manner for some reason, the system can maximize resource utilization through waiting mechanisms 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 500m×500m target region with a centrally located edge server and 100 randomly distributed clients, each numbered in ascending order of distance from the edge server. FedAvg is used as the learning algorithm in FL, and two image datasets and their respective training models are used: (1) the MNIST dataset, classified using a DNN model with 23,860 parameters; (2) the CIFAR-10 dataset, classified using a ResNet-20 model with 271,098 parameters. Furthermore, for both models, the number of bits required for the sign function is equal to the number of model parameters, while the upper and lower limits... The values ​​are 4 and 97 respectively.

[0106] Consider two data distribution scenarios: (1) IID (Independent and Identically Distributed) scenario, where the training set data is shuffled and randomly and evenly distributed among all clients; (2) non-IID (Non-Independent and Identically Distributed) scenario, where the training set data is sorted by label and divided into 200 groups, with each client holding a maximum of 3 groups. Since the number of clients accessing the edge server in the real world is often limited, and each client may not be able to participate in every round of global learning, 10 clients are randomly selected from the client set to participate in training before each round of global learning. To avoid loss of generality, all experiments are performed 10 times and the average value is taken. Detailed parameter settings are shown in Table 1.

[0107] Table 1 First, this embodiment verifies that the method of jointly allocating quantization bit depth, bandwidth, and transmit power before an interruption occurs to reduce the impact of quantization error and transmission interruption on training results, and to reduce training latency, is truly effective. Two baseline methods and an ideal solution are considered.

[0108] (1) Optimize bandwidth allocation only: All clients use the maximum transmit power within the energy consumption constraint range and the same number of quantization bits, and optimize bandwidth allocation only.

[0109] (2) Only optimize the number of quantization bits: All clients use the maximum transmit power and uniform bandwidth within the energy consumption constraint range, 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 upper limit of performance in all experiments.

[0111] This embodiment selects a transmission delay budget of 10ms to compare the test accuracy of the MNIST dataset under IID and non-IID conditions. Figure 2 As can be seen in (a), under IID conditions, setting a smaller number of quantization bits ( =2 or The WidthAllocOnly (optimizing only bandwidth allocation) and the test accuracy of this embodiment are close to the ideal solution. This is mainly because, under IID conditions, the data variance is approximately 0, and even with transmission interruptions, 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 quantization bit depth is high ( When the threshold is 10, WidthAllocOnly has a higher interruption probability and more retransmission rounds. Under non-IID conditions, the test accuracy of all methods is reduced to varying degrees, but the performance of this method is still close to the ideal solution and better than WidthAllocOnly. Specifically, it can be seen from... Figure 2 In (b), it was observed that when the number of quantization bits is small ( =2 or When the quantization bit width is 5, the heterogeneity of the data amplifies the impact of quantization errors, significantly reducing test accuracy. Unlike WidthAllocOnly, this method can adaptively adjust the number of quantization bits to ensure accurate representation of model updates while maintaining a uniform transmission interruption probability, thus achieving better performance. WidthAllocOnly (… In the case of (=10), the training effect is negligible due to the combined effects of transmission interruption and quantization error.

[0112] Secondly, this embodiment verifies the necessity of optimizing bandwidth allocation in non-ideal wireless channels. Figure 3 The test accuracy of this method and QuantizLvlOnly (optimizing only the number of quantization bits) was compared at client-side model upload times of 6ms, 10ms, and 15ms, with discussions divided into IID and non-IID cases. Figure 3 In (a), under IID conditions, for a model upload time of 6ms, this method outperforms QuantizLvlOnly. This is because this method tends to allocate more bandwidth to clients farther from the server and less bandwidth to clients closer to the server, thus allowing for a more even distribution of quantization bits. Conversely, QuantizLvlOnly allocates a larger number of quantization bits to clients closer to the server because they have greater channel capacity, while having to allocate a smaller number of quantization bits to more distant clients, leading to significant quantization errors. Similarly, as... Figure 3 In (b), this error is further amplified under non-IID conditions. For example, when the model upload time is 6ms, the final test accuracy of this method is 24.7% higher than that of QuantizLvlOnly.

[0113] Secondly, this embodiment verifies that the proposed method can obtain a suitable gradient unloading strategy and effectively control system cost. Two baseline methods and the case without gradient unloading are considered.

[0114] (1) Random Gradient Offload: After an interruption occurs, the client randomly generates a gradient offload matrix and randomly offloads the gradients to the client that has not experienced an interruption.

[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 processing methods before and after an interruption are complementary and indispensable. First, performing resource allocation only before an 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 an interruption will amplify the negative impact of the interruption on model accuracy and convergence speed. To ensure the model converges correctly, gradient unloading must be performed frequently, which will consume more system resources 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 (b) shows that it has a significant advantage over the other two methods in terms of system cost control.

[0120] This embodiment also provides a federated learning system for dealing with the risk of disruption, which adopts the following technical solution: including: server and client; A server and multiple clients are configured as a federated learning architecture; The server is used to synchronize and initialize the global model to all clients within the coverage area; generate a new global model based on the model parameters uploaded by the clients; and generate the final model upon completion of federated learning. The client is used to jointly allocate the number of quantization bits, bandwidth, and transmission power, minimizing quantization error and training latency under its own energy constraints and unified interruption probability constraints; update the local model through stochastic gradient descent; quantize the local model parameters through a stochastic quantization method and upload them to the server; if a transmission interruption occurs during the upload to the server and the model parameters are re-uploaded, the interrupting client unloads its model parameters to other clients based on the unloading matrix, and the other clients aggregate the interrupting client's model parameters with their own model parameters and upload the aggregated result to the server; the unloading matrix is ​​used to describe the correspondence and proportion of model unloading among clients.

[0121] This embodiment also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the above-described federated learning method oriented towards interruption risk.

[0122] This embodiment also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described federated learning method for addressing interruption risks.

[0123] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A federated learning method for addressing disruption risk, characterized in that, include: S1: Build a federated learning architecture, including one server and multiple clients; 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. S3: Jointly allocate the number of quantization bits, bandwidth, and transmit power. Each client minimizes quantization error and training latency under its own energy constraints and unified interruption probability constraints. Then, each client quantizes its local model parameters using a random quantization method and uploads them to the server, which generates a new global model. If a transmission interruption occurs during the upload to the server and the model parameters are re-uploaded, the interrupting client unloads its model parameters to other clients based on the unloading matrix. The other clients then aggregate the interrupting client's model parameters with their own model parameters and upload the aggregated result to the server. The unloading matrix is ​​used to describe the correspondence and proportion of model unloading between clients; Resource allocation issues related to quantization bit depth, bandwidth allocation, and transmit power. The statement is 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, 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; 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 The bandwidth allocation remains unchanged, but is expressed as the allocation of resource blocks, and the optimal bandwidth allocation is obtained through a reinforcement learning-based algorithm. The optimal bandwidth allocation is determined by a reinforcement learning-based algorithm: Will Replace with ,in, Indicates assignment to the client The number of resource blocks, Given the bandwidth size corresponding to the resource block; design the state space, action space, and reward function, and use reinforcement learning to dynamically solve the integer programming problem in each round; Wherein, the state space represents the number of resource blocks currently allocated to all clients, and the energy constraints for all clients. The remaining battery power; Action space: How many resource blocks each client chooses to allocate; The reward function includes three components: the negative of the time taken to complete each training round; and the client-side reward function. Under energy constraints If the remaining energy is less than 0, a negative reward will be given; if the allocated bandwidth exceeds the total bandwidth limit, a negative reward will be given. Action update strategy: Select the action with the highest Q value; In S3, if a transmission interruption occurs during the upload to the server, the similarity between the local model of the interrupted client and the global model is calculated, and a decision is made on whether to re-upload based on the comparison result with a threshold. when At that time, do not upload model parameters; when At that time, do not upload model parameters; when Re-upload the model parameters; in, For the first The CKA similarity between the local model and the global model in each iteration. This represents the upper limit of model similarity. This is the lower bound for model similarity. S4: Repeat S2-S3 until federated learning is complete, and the server generates the final model.

2. The federated learning method for addressing disruption risk as described in claim 1, characterized in that, The client uses its image dataset to quantize the local model parameters using a random quantization method.

3. The federated learning method for addressing disruption risk as described in claim 1, characterized in that, When the client does not receive the new global model, the client pauses the corresponding model update operation.

4. A federated learning system for addressing disruption risk, characterized in that, A federated learning method for performing a disruption risk-oriented approach as described in any one of claims 1 to 3, comprising: a server and a client; A server and multiple clients are configured as a federated learning architecture; The server is used to synchronize and initialize the global model to all clients within the coverage area; generate a new global model based on the model parameters uploaded by the clients; and generate the final model upon completion of federated learning. The client is used to jointly allocate the number of quantization bits, bandwidth, and transmission power, minimizing quantization error and training latency under its own energy constraints and unified interruption probability constraints; update the local model through stochastic gradient descent; quantize the local model parameters through a stochastic quantization method and upload them to the server; if a transmission interruption occurs during the upload to the server and the model parameters are re-uploaded, the interrupting client unloads its model parameters to other clients based on the unloading matrix, and the other clients aggregate the interrupting client's model parameters with their own model parameters and upload the aggregated result to the server; the unloading matrix is ​​used to describe the correspondence and proportion of model unloading among clients.

5. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements a federated learning method for interruption risk as described in any one of claims 1 to 3.

6. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements a federated learning method for interruption risk as described in any one of claims 1 to 3.

Citation Information

Patent Citations

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

    CN118338448A

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

    CN120066765A