Federal learning method and device for adaptive communication in dynamic bandwidth scenario

The federated learning framework, which employs adaptive sub-model selection and mask weight aggregation strategies, addresses the issues of low communication efficiency and performance degradation in federated learning under dynamic bandwidth, achieving efficient, flexible, and reliable model training.

CN117938690BActive Publication Date: 2026-05-15SOUTH CHINA UNIV OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SOUTH CHINA UNIV OF TECH
Filing Date
2023-12-29
Publication Date
2026-05-15

AI Technical Summary

Technical Problem

Existing federated learning methods cannot effectively cope with network fluctuations in dynamic bandwidth scenarios, resulting in high communication overhead, low learning efficiency, and global model performance degradation.

Method used

The federated learning framework employs adaptive communication, where the client and cloud server adaptively select the best sub-model for communication based on the available bandwidth resources. The Stochastic Frank Wolfe optimizer is used to train an adjustable local model, and a mask weight aggregation strategy is employed to aggregate model parameters.

Benefits of technology

In a dynamic bandwidth environment, communication efficiency is improved, communication overhead caused by network fluctuations is reduced, and the performance and learning efficiency of the global model are enhanced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117938690B_ABST
    Figure CN117938690B_ABST
Patent Text Reader

Abstract

The present application relates to the field of federated learning, and more particularly to a federated learning method and device for adaptive communication in a dynamic bandwidth scenario. The present application mainly comprises the following steps: first, each client trains an "adjustable" model based on SFW, which can be adjusted to any sparsity sub-model; then, the client selects the most suitable sub-model according to the current available uplink bandwidth resources and sends it to the cloud server; again, the cloud server aggregates the model parameters uploaded by the client using the "mask weight aggregation strategy" to obtain the global model; finally, the cloud server selects the most suitable sub-model from the global model according to the current available downlink bandwidth resources and sends it to the client, and the client updates the model parameters after receiving the parameters. The present application improves the problem of large communication overhead, low learning efficiency and performance degradation of the global model caused by network fluctuations in the dynamic bandwidth scenario.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the technical field of federated learning, specifically relating to a federated learning method and apparatus for adaptive communication in dynamic bandwidth scenarios. Background Technology

[0002] Federated learning is a privacy-preserving distributed machine learning training framework that allows multiple clients to collaboratively learn a global model without sharing the original data. During federated learning training, model parameters are frequently transferred between the cloud server and the clients. Specifically, each client trains its model using local data, then transfers the model parameters to the cloud server for aggregation, and finally redistributes the aggregated parameters back to the clients. Therefore, with the rapid increase in model size and the number of clients, communication costs are becoming increasingly expensive. Consequently, communication between the clients and the cloud server has become a significant bottleneck.

[0003] To improve communication efficiency, existing federated learning methods can be divided into two categories: efficient communication federated learning and adaptive communication federated learning. Among them, efficient communication federated learning aims to reduce the cost of transmission by reducing the number of parameters transmitted between the client and the cloud server, while adaptive communication federated learning aims to select the appropriate client for communication based on the available bandwidth. Specifically: (1) Existing efficient communication federated learning methods, such as LotteryFL, HeteroFL, and Flado, use sparsification techniques (i.e., pruning some unimportant parameters) to reduce communication costs in a stable network environment. Furthermore, ScaleFL uses an early exit technique to adaptively sparsify the local model along the width and depth dimensions to find a local model suitable for the client's computing and bandwidth resources. (2) Existing adaptive communication federated learning methods, such as Lian et al., use a method different from the traditional random selection of clients for model updates, selecting the most suitable client for communication based on the currently available bandwidth resources. Furthermore, Chen et al. introduced a network prediction model to predict the network changes at the next moment and select the optimal client for model updates based on the predicted network conditions. Recently, Yun et al. introduced adjustable-width neural networks (SNNs) into federated learning. Specifically, when bandwidth is poor, the model with a width of 0.5 is uploaded to the cloud server, while when bandwidth is good, the complete model parameters are uploaded for aggregation.

[0004] The methods described above either leverage channel-based or parameter sparsity to reduce communication costs or select the most suitable client for communication based on available bandwidth. While these methods can reduce communication latency, they overlook the fact that geographically unevenly distributed heterogeneous clients (e.g., smartphones, smart cars, drones, or subways) are typically in dynamic bandwidth environments. In other words, in real-world network scenarios, clients often face constantly changing and fluctuating network conditions, which can lead to unpredictable communication latency. For example, federated learning extends the global sharing time to wait for clients with lower bandwidth to upload parameters, slowing down training and convergence. Furthermore, network fluctuations prevent clients holding important data from updating parameters, further exacerbating the difficulty of achieving efficient federated learning training. Summary of the Invention

[0005] To address the shortcomings of the existing technologies, this invention provides a federated learning method and apparatus for adaptive communication in dynamic bandwidth scenarios, called AdaptiveFL. It can adaptively select the best sub-model for communication based on the currently available bandwidth resources between each client and the cloud server, providing users with an efficient, flexible, and reliable new federated learning framework.

[0006] To achieve the above objectives, the present invention adopts the following technical solution:

[0007] In a first aspect, the present invention provides a federated learning method for adaptive communication in dynamic bandwidth scenarios, comprising the following steps:

[0008] The cloud server initializes the model and sends it to the client;

[0009] Each client trains an adjustable local model based on its local private dataset. The adjustable local model is a sub-model that can be adjusted to any sparsity.

[0010] Each client adaptively selects the best sub-model to transmit to the cloud server based on the currently available bandwidth resources;

[0011] The cloud server uses a mask weight aggregation strategy to aggregate model parameters to obtain a global model;

[0012] The cloud server adaptively selects the best sub-model from the global model based on the currently available bandwidth resources and sends it to the client.

[0013] The client updates the local model parameters until the new global model converges.

[0014] As a preferred technical solution, each client trains an "adjustable" local model based on its local private dataset, specifically as follows:

[0015] Read the training set and perform forward propagation;

[0016] The Stochastic Frank Wolfe optimizer is invoked to train the local model, completing backpropagation; that is, the k-supported gradient is used to obtain the optimal gradient update direction v. i,t Specifically, only α is selected during backpropagation. i,t Update parameters based on the largest gradient value; according to v i,t Perform backpropagation to update the gradient;

[0017] Read the validation set to verify the model performance.

[0018] As a preferred technical solution, the objective function for local training on the client side is:

[0019]

[0020] Where, θ i This represents the local model of the i-th client. It calculates the loss value, where CE(.;.) is the cross-entropy function, and D i X represents the local data size. j For the input sample, y j For tags.

[0021] As a preferred technical solution, each client adaptively selects the optimal sub-model to transmit to the cloud server based on the currently available bandwidth resources, specifically:

[0022] The client calculates the amount of parameters to be uploaded based on the currently available uplink bandwidth between the client and the cloud server.

[0023] Client based on the number of uploaded parameters Calculate the mask position of the sub-model;

[0024] The client selects a sub-model based on the mask position and sends it to the cloud server.

[0025] As a preferred technical solution, the mask weight aggregation strategy is specifically as follows:

[0026] The cloud server aggregates overlapping elements based on the masks of the sub-models uploaded by different clients, while retaining non-overlapping elements.

[0027] As a preferred technical solution, the cloud server adaptively selects the best sub-model from the global model based on the currently available bandwidth resources and sends it to the client, specifically:

[0028] The cloud server calculates the amount of parameters to be sent based on the currently available downlink bandwidth between the client and the cloud server.

[0029] Cloud server based on the number of uploaded parameters Calculate the mask position of the sub-model;

[0030] The cloud server selects a sub-model based on the mask position and sends it to the client.

[0031] As a preferred technical solution, the client performs local model parameter updates, specifically as follows:

[0032] The client updates the original parameters of the local model to the received parameters;

[0033] The client sets the remaining parameters of the local model to 0.

[0034] Secondly, the present invention provides a federated learning system for adaptive communication in dynamic bandwidth scenarios, which is applied to the federated learning method for adaptive communication in dynamic bandwidth scenarios, including an initialization module, a model training module, a model selection module, a model aggregation module, a model sending module, and a model update module;

[0035] The initialization module is used to initialize the model on the cloud server and send the model to the client;

[0036] The model training module is used for each client to train an adjustable local model based on a local private dataset. The adjustable local model refers to a sub-model that can be adjusted to any sparsity.

[0037] The model selection module is used by each client to adaptively select the best sub-model based on the currently available bandwidth resources and transmit it to the cloud server.

[0038] The model aggregation module is used by the cloud server to aggregate model parameters using a mask weight aggregation strategy to obtain a global model.

[0039] The model sending module is used by the cloud server to adaptively select the best sub-model from the global model based on the currently available bandwidth resources and send it to the client.

[0040] The model update module is used by the client to update the local model parameters until the new global model converges.

[0041] Thirdly, the present invention provides an electronic device, the electronic device comprising:

[0042] At least one processor; and,

[0043] A memory communicatively connected to the at least one processor; wherein,

[0044] The memory stores computer program instructions that can be executed by the at least one processor to enable the at least one processor to execute the federated learning method for adaptive communication in dynamic bandwidth scenarios.

[0045] Fourthly, the present invention provides a computer-readable storage medium storing a program, which, when executed by a processor, implements the federated learning method for adaptive communication in a dynamic bandwidth scenario.

[0046] Compared with the prior art, the present invention has the following advantages and beneficial effects:

[0047] (1) This invention proposes an adaptive communication federated learning framework, which aims to improve the problems of high communication overhead, low learning efficiency and global model performance degradation caused by network fluctuations in the existing federated learning framework under dynamic bandwidth scenarios.

[0048] (2) This invention proposes a local training method based on SFW, which aims to train an "adjustable" model that can be adjusted to a sub-model with arbitrary sparsity and high inference performance. This ensures that the client can upload the most important parameters to the cloud server for aggregation in each round of communication within the limited bandwidth. This solves the problem of the global model performance degradation caused by network fluctuations in existing federated learning methods, which prevent some clients from uploading parameters in time.

[0049] (3) This invention proposes an effective communication method that aims to maximize the utilization of current bandwidth resources, greatly reduce the high communication overhead caused by network fluctuations in the real environment, and greatly improve the performance of the global model.

[0050] (4) This invention proposes a “mask weight aggregation strategy”, in which the cloud server aggregates overlapping elements based on the masks of the sub-models uploaded by different clients, while retaining non-overlapping elements, thereby improving the performance of the global model while reducing the time overhead caused by parameter aggregation. Attached Figure Description

[0051] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0052] Figure 1 This is a flowchart of the federated learning method for adaptive communication in a dynamic bandwidth scenario according to an embodiment of the present invention;

[0053] Figure 2This is a performance comparison chart in an embodiment of the present invention;

[0054] Figure 3 This is a convergence speed analysis diagram in an embodiment of the present invention;

[0055] Figure 4 This is a communication efficiency analysis diagram in an embodiment of the present invention;

[0056] Figure 5 This is a schematic diagram of the structure of the federated learning system for adaptive communication in a dynamic bandwidth scenario according to an embodiment of the present invention;

[0057] Figure 6 This is a structural diagram of an electronic device according to an embodiment of the present invention. Detailed Implementation

[0058] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are merely some embodiments of the present application, and not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present application without creative effort are within the scope of protection of the present application.

[0059] In this application, the reference to "embodiment" means that a specific feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a mutually exclusive, independent, or alternative embodiment. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described in this application can be combined with other embodiments.

[0060] Please see Figure 1 This embodiment proposes a federated learning method for adaptive communication in dynamic bandwidth scenarios, which includes the following steps:

[0061] S1. The cloud server initializes the model and sends the model to the client.

[0062] Furthermore, the initial model is a neural network model, such as AlexNet, ResNet, etc.

[0063] S2. Each client trains a “tunable” local model based on its local private data, which can be adjusted to a sub-model of arbitrary sparsity.

[0064] Furthermore, step S2 specifically includes the following:

[0065] S201, Client C i Based on local private dataset Di Train a "tunable" model using the Stochastic Frank Wolfe (SFW) optimizer. This model can be tuned to sub-models of arbitrary sparsity with high inference performance. Specifically, the objective function for client-side local training can be defined as:

[0066]

[0067] Where, θ i This represents the local model of the i-th client. It calculates the loss value, and CE(.;.) is the cross-entropy function.

[0068] S202. To minimize the optimization objective (11), in each iteration t, SFW first calls the Linear Minimization Oracle (LMO): in Let v represent the batch gradient for the i-th client. Then, as shown in equation (12), along v i,t Direction update of local model θ i,t :

[0069] θ i,t+1 =(1-η i,t )θ i,t +η i,t v i,t (2)

[0070] Where, η i,t ∈[0,1] represents the learning rate.

[0071] S203. Use k-supported methods to obtain the optimal v. i,t Specifically, only α is selected during backpropagation. i,t The parameter is updated using the largest gradient value, as defined in equation (13):

[0072]

[0073] Where the bias τ > 0 This means n-α i,t The smallest gradient value is set to 0, while ||.||2 represents the calculation of the L2 norm.

[0074] As shown in Algorithm 1, this embodiment provides specific algorithm steps for local training. Repeating steps S201, S202, and S203 trains to obtain an "adjustable" local model, which can be adjusted to a sub-model with arbitrary sparsity and high inference performance.

[0075] Algorithm 1: SFW-based local training algorithm

[0076]

[0077] S3. Each client adaptively selects the best sub-model to transmit to the cloud server based on the currently available bandwidth resources.

[0078] Furthermore, step S3 specifically includes:

[0079] S301. After the local model training is completed, according to the client C i Calculate the number of parameters to be uploaded based on the currently available uplink bandwidth between the cloud server and the server. As shown in equation (14):

[0080]

[0081] Among them, T i,t Indicates the current uplink bandwidth Transmit all parameters G to the server i The required transmission time can be defined as:

[0082]

[0083] S302. After local training is completed, each client C i Based on the number of uploaded parameters Obtain the maximum parameter gradient value The coordinates are determined and masked with 1, as shown in equation (16):

[0084]

[0085] S303, Client C i parameters Send to the cloud server.

[0086] S4. The cloud server uses a "mask weight aggregation strategy" to aggregate model parameters to obtain a global model.

[0087] Furthermore, in step S4, since each client only sends parameters of one sub-model to the cloud server, the traditional global average aggregation method is not suitable for this framework. Therefore, this invention proposes a "mask weight aggregation strategy." Specifically, due to heterogeneity and the dynamic nature of communication, the weights contain non-overlapping or overlapping elements from different clients. Only overlapping elements are aggregated, while non-overlapping elements are retained. This introduces appropriate diversity and enhances the sparsity of the model. The aggregation method can be defined as:

[0088]

[0089] in, C represents the model parameters uploaded by the i-th client. t The number of times the parameter corresponding to each coordinate is aggregated.

[0090] S5: The cloud server adaptively selects the best sub-model from the global model based on the currently available bandwidth resources and sends it to the client.

[0091] Furthermore, step S5 specifically involves:

[0092] S501. After the global model aggregation is completed, according to client C i The currently available downlink bandwidth between the cloud server and client C is calculated and sent to client C. i Parameter quantity As shown in equation (18):

[0093]

[0094] Among them, T i,t Indicates the current downlink bandwidth To client C i Transmit all parameters G of the global model g The required transmission time can be defined as:

[0095]

[0096] S502, after local training is completed, the cloud server adjusts the parameters based on the uploaded parameters. Obtain the maximum parameter gradient value The coordinates are determined and masked with 1, as shown in equation (20):

[0097]

[0098] S503, cloud server will transmit parameters Send to client C i .

[0099] S6. The client updates the local model parameters.

[0100] Furthermore, step S6 specifically includes: the client receiving model parameters. Then, the local model's corresponding coordinates Replace the parameters and set the rest to 0.

[0101] S7. Repeat steps S2-S6 until the new global model converges.

[0102] This embodiment presents the training algorithm for AdaptiveFL (as shown in Algorithm 2). Repeat steps S2-S6 until the global model converges.

[0103] Algorithm 2: Training Algorithm for AdaptiveFL

[0104]

[0105] In another embodiment of the present invention, the feasibility of the present invention was verified, mainly including the following four steps:

[0106] S1. Experiment setup, details are as follows:

[0107] Datasets and Models: This embodiment conducts experiments on two image classification benchmark datasets (CIFAR-10 and CIFAR-100). To generate non-independent identically distributed (non-IID) datasets, we use a Dirichlet distribution for simulation, with parameter α set to 0.3 and 0.5 respectively. ResNet-9 is used as the backbone model.

[0108] Benchmark Method: In this embodiment, the proposed method, AdaptiveFL, is compared and analyzed with five existing state-of-the-art methods: FedAvg, HeteroFL, ScaleF, LotteryF, and SlimFL. Among these methods, FedAvg is one of the most widely adopted federated learning techniques; HeteroFL, ScaleFL, and LotteryFL utilize sparsity techniques to achieve efficient communication, while SlimFL is a coarse-grained bandwidth adaptive method.

[0109] Simulation Settings: This embodiment sets up four simulated bandwidth settings under two environments (i.e., static bandwidth environment and dynamic bandwidth environment). For the static bandwidth environment, this embodiment assumes that the communication bandwidth (i.e., downlink and uplink) between each client and server is fixed during training. For the dynamic environment, this embodiment assumes that the communication bandwidth between each client and server changes dynamically during training. The specific settings are as follows:

[0110] • Static-Fix: The number of uplink / downlink parameters for each client is taken from a fixed set [1, 0.75, 0.5, 0.25] and remains unchanged in each round.

[0111] •Static-Random: The number of uplink / downlink parameters is randomly selected from the interval (0,1] and remains constant in each round.

[0112] • Dynamic-Fix: In each round of communication, the number of uplink / downlink parameters is selected from the set [1, 0.75, 0.5, 0.25].

[0113] • Dynamic-Random: In each round of communication, the number of uplink / downlink parameters is randomly selected from the interval (0,1].

[0114] S2. Performance comparison, details are as follows:

[0115] Please see Figure 2 This example demonstrates the results of image classification using ResNet9 on the CIFAR-10 and CIFAR-100 datasets. AdaptiveFL achieves performance improvements of 2.86–6.33% and 0.37–1.02% compared to the best-performing baseline methods in Dynamic-Random and Dynamic-Fix environments, respectively. This is because, under dynamic bandwidth settings, AdaptiveFL can promptly update the most suitable sub-model parameters based on the currently available bandwidth, while other baseline methods ignore the dynamic nature of bandwidth, leading to performance degradation due to the failure to update important parameters in a timely manner. Similarly, in… Figure 2 As can be seen, compared to the best-performing benchmark method, AdaptiveFL also improves the accuracy by approximately 0.45-1.34% on the test set in Static-Random and Static-Fix scenarios. It is worth noting that even without considering dynamic bandwidth, AdaptiveFL still improves the model's inference performance to some extent, because it uses the SFW optimizer during local training to enhance the model's learning ability.

[0116] S3. Convergence rate analysis, details are as follows:

[0117] This embodiment is in Figure 3 Part (a) of the middle Figure 3 Section (d) shows the convergence of AdaptiveFL and five baseline methods in a Dynamic-Random environment. AdaptiveFL not only demonstrates reliable accuracy on the test set (i.e., above 85% and 57% on CIFAR-10 and CIFAR-100, respectively), but also does not affect the model's convergence, with only slight fluctuations in convergence under the Non-Identical Distribution (Non-IID) setting.

[0118] S4. Communication efficiency analysis, details of which are as follows:

[0119] This embodiment analyzes the performance and communication overhead of six methods in four bandwidth environments. For example... Figure 4As shown in sections (a) to (d), AdaptiveFL exhibits the best model inference performance across all four environments, but its communication cost is not the lowest. This is because AdaptiveFL makes full use of bandwidth resources. Specifically, AdaptiveFL can adaptively select the most suitable sub-model for communication based on the currently available bandwidth, a feat that other benchmark methods cannot achieve. Therefore, AdaptiveFL achieves a balance between communication efficiency and model performance based on the current bandwidth availability.

[0120] It should be noted that, for the sake of simplicity, the aforementioned method embodiments are all described as a series of actions. However, those skilled in the art should understand that the present invention is not limited to the described order of actions, because according to the present invention, some steps can be performed in other orders or simultaneously.

[0121] Based on the same idea as the federated learning method for adaptive communication in dynamic bandwidth scenarios described in the above embodiments, this invention also provides a federated learning system for adaptive communication in dynamic bandwidth scenarios. This system can be used to execute the aforementioned federated learning method for adaptive communication in dynamic bandwidth scenarios. For ease of explanation, the structural diagram of the embodiment of the federated learning system for adaptive communication in dynamic bandwidth scenarios only shows the parts related to the embodiments of this invention. Those skilled in the art will understand that the illustrated structure does not constitute a limitation on the device, and may include more or fewer components than illustrated, or combine certain components, or have different component arrangements.

[0122] Please see Figure 5 In another embodiment of this application, a federated learning system 100 for adaptive communication in a dynamic bandwidth scenario is provided. The system includes an initialization module 101, a model training module 102, a model selection module 103, a model aggregation module 104, a model sending module 105, and a model update module 106.

[0123] The initialization module 101 is used to initialize the model on the cloud server and send the model to the client;

[0124] The model training module 102 is used for each client to train an adjustable local model based on a local private dataset. The adjustable local model refers to a sub-model that can be adjusted to any sparsity.

[0125] The model selection module 103 is used for each client to adaptively select the best sub-model based on the currently available bandwidth resources and transmit it to the cloud server.

[0126] The model aggregation module 104 is used by the cloud server to aggregate model parameters using a mask weight aggregation strategy to obtain a global model.

[0127] The model sending module 105 is used by the cloud server to adaptively select the best sub-model from the global model and send it to the client based on the currently available bandwidth resources.

[0128] The model update module 106 is used by the client to update the local model parameters until the new global model converges.

[0129] It should be noted that the federated learning system for adaptive communication in dynamic bandwidth scenarios of the present invention corresponds one-to-one with the federated learning method for adaptive communication in dynamic bandwidth scenarios of the present invention. The technical features and beneficial effects described in the embodiments of the federated learning method for adaptive communication in dynamic bandwidth scenarios described above are all applicable to the embodiments of the federated learning method for adaptive communication in dynamic bandwidth scenarios. For details, please refer to the description in the embodiments of the present invention, which will not be repeated here.

[0130] Furthermore, in the above embodiments of the federated learning system for adaptive communication in dynamic bandwidth scenarios, the logical division of each program module is merely an example. In actual applications, the above functions can be assigned to different program modules as needed, for example, for the sake of corresponding hardware configuration requirements or the convenience of software implementation. That is, the internal structure of the federated learning system for adaptive communication in dynamic bandwidth scenarios can be divided into different program modules to complete all or part of the functions described above.

[0131] Please see Figure 6 In one embodiment, an electronic device is provided for implementing a federated learning method for adaptive communication in dynamic bandwidth scenarios. The electronic device 200 may include a first processor 201, a first memory 202 and a bus, and may also include a computer program stored in the first memory 202 and executable on the first processor 201, such as a federated learning program 203 for adaptive communication in dynamic bandwidth scenarios.

[0132] The first memory 202 includes at least one type of readable storage medium, including flash memory, portable hard drive, multimedia card, card-type memory (e.g., SD or DX memory), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the first memory 202 can be an internal storage unit of the electronic device 200, such as the portable hard drive of the electronic device 200. In other embodiments, the first memory 202 can be an external storage device of the electronic device 200, such as a plug-in portable hard drive, smart media card (SMC), secure digital card (SD), flash card, etc., equipped on the electronic device 200. Furthermore, the first memory 202 can include both internal storage units and external storage devices of the electronic device 200. The first memory 202 can be used not only to store application software and various types of data installed on the electronic device 200, such as the code of the federated learning program 203 for adaptive communication in dynamic bandwidth scenarios, but also to temporarily store data that has been output or will be output.

[0133] In some embodiments, the first processor 201 may be composed of integrated circuits, such as a single packaged integrated circuit or multiple integrated circuits with the same or different functions, including combinations of one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and various control chips. The first processor 201 is the control unit of the electronic device, connecting various components of the entire electronic device through various interfaces and lines. It executes programs or modules stored in the first memory 202 and calls data stored in the first memory 202 to perform various functions of the electronic device 200 and process data.

[0134] Figure 6 Only electronic devices with components are shown; it will be understood by those skilled in the art that... Figure 6 The structure shown does not constitute a limitation on the electronic device 200, and may include fewer or more components than shown, or combine certain components, or have different component arrangements.

[0135] The federated learning program 203 for adaptive communication under dynamic bandwidth scenarios, stored in the first memory 202 of the electronic device 200, is a combination of multiple instructions. When run in the first processor 201, it can achieve the following:

[0136] The cloud server initializes the model and sends it to the client;

[0137] Each client trains an adjustable local model based on its local private dataset. The adjustable local model is a sub-model that can be adjusted to any sparsity.

[0138] Each client adaptively selects the best sub-model to transmit to the cloud server based on the currently available bandwidth resources;

[0139] The cloud server uses a mask weight aggregation strategy to aggregate model parameters to obtain a global model;

[0140] The cloud server adaptively selects the best sub-model from the global model based on the currently available bandwidth resources and sends it to the client.

[0141] The client updates the local model parameters until the new global model converges.

[0142] Furthermore, if the modules / units integrated in the electronic device 200 are implemented as software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium. The computer-readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a portable hard drive, a magnetic disk, an optical disk, a computer memory, or a read-only memory (ROM).

[0143] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments described above. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0144] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0145] The above embodiments are preferred embodiments of the present invention, but the embodiments of the present invention are not limited to the above embodiments. Any changes, modifications, substitutions, combinations, or simplifications made without departing from the spirit and principle of the present invention shall be considered equivalent substitutions and shall be included within the protection scope of the present invention.

Claims

1. A federated learning method for adaptive communication in dynamic bandwidth scenarios, characterized in that, Includes the following steps: The cloud server initializes the model and sends it to the client; Each client trains an adjustable local model based on its local private dataset. The adjustable local model is a sub-model that can be adjusted to any sparsity. Each client adaptively selects the optimal sub-model to transmit to the cloud server based on the currently available bandwidth resources. Specifically, the client calculates the amount of parameters to be uploaded based on the currently available uplink bandwidth between the client and the cloud server. The client is based on the number of parameters uploaded. Calculate the mask position of the sub-model; the client selects the sub-model based on the mask position and sends it to the cloud server; The cloud server uses a mask weight aggregation strategy to aggregate model parameters to obtain a global model; the mask weight aggregation strategy specifically means that the cloud server aggregates overlapping elements based on the masks of the sub-models uploaded by different clients, while retaining non-overlapping elements. The cloud server adaptively selects the best sub-model from the global model based on the currently available bandwidth resources and sends it to the client. The client updates the local model parameters until the new global model converges.

2. The federated learning method for adaptive communication in dynamic bandwidth scenarios according to claim 1, characterized in that, Each client trains an "adjustable" local model based on its local private dataset, specifically as follows: Read the training set and perform forward propagation; The Stochastic Frank Wolfe optimizer is called to train the local model, completing backpropagation; that is, the k-supported gradient is called to obtain the optimal gradient update direction. Specifically, in the backpropagation process, only select Update parameters based on the largest gradient value; according to Perform backpropagation to update the gradient; Read the validation set to verify the model performance.

3. The federated learning method for adaptive communication in dynamic bandwidth scenarios according to claim 2, characterized in that, The objective function for local training on the client side is: in, Indicates the first Local model for each client, It calculates the loss value. Let be the cross-entropy function, where For local data size, For the input sample, For tags.

4. The federated learning method for adaptive communication in dynamic bandwidth scenarios according to claim 1, characterized in that, The cloud server adaptively selects the best sub-model from the global model based on the currently available bandwidth resources and sends it to the client, specifically: The cloud server calculates the amount of parameters to be sent based on the currently available downlink bandwidth between the client and the cloud server. ; Cloud server based on the number of uploaded parameters Calculate the mask position of the sub-model; The cloud server selects a sub-model based on the mask position and sends it to the client.

5. The federated learning method for adaptive communication in dynamic bandwidth scenarios according to claim 1, characterized in that, The client updates the local model parameters as follows: The client updates the original parameters of the local model to the received parameters; The client sets the remaining parameters of the local model to 0.

6. A federated learning system for adaptive communication in dynamic bandwidth scenarios, characterized in that, A federated learning method for adaptive communication in a dynamic bandwidth scenario as described in any one of claims 1-5 includes an initialization module, a model training module, a model selection module, a model aggregation module, a model sending module, and a model update module; The initialization module is used to initialize the model on the cloud server and send the model to the client; The model training module is used for each client to train an adjustable local model based on a local private dataset. The adjustable local model refers to a sub-model that can be adjusted to any sparsity. The model selection module is used by each client to adaptively select the best sub-model based on the currently available bandwidth resources and transmit it to the cloud server. The model aggregation module is used by the cloud server to aggregate model parameters using a mask weight aggregation strategy to obtain a global model. The model sending module is used by the cloud server to adaptively select the best sub-model from the global model based on the currently available bandwidth resources and send it to the client. The model update module is used by the client to update the local model parameters until the new global model converges.

7. An electronic device, characterized in that, The electronic device includes: At least one processor; and, A memory communicatively connected to the at least one processor; wherein, The memory stores computer program instructions that can be executed by the at least one processor to enable the at least one processor to perform the federated learning method for adaptive communication in dynamic bandwidth scenarios as described in any one of claims 1-5.

8. A computer-readable storage medium storing a program, characterized in that, When the program is executed by the processor, it implements the federated learning method for adaptive communication in dynamic bandwidth scenarios as described in any one of claims 1-5.