Federated learning method and system for diffusion enhancement and asynchronous scheduling, and medium
By introducing diffusion enhancement and asynchronous scheduling in federated learning, and using a denoising diffusion implicit model to generate synthetic datasets and perform asynchronous training, the problems of model performance degradation and training instability caused by uneven data distribution are solved, and the model generalization ability and system efficiency are improved. It is suitable for various application scenarios such as medical care and finance.
Patent Information
- Application Number
- CN202510986671.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-17
- Publication Date
- 2025-10-17
AI Technical Summary
When faced with problems of uneven data distribution and heterogeneity, existing federated learning algorithms suffer from degraded model performance, unstable training, and increased communication costs, making it difficult to effectively improve model performance while ensuring data privacy and communication efficiency.
A federated learning method with diffusion enhancement and asynchronous scheduling is adopted. By synthesizing diverse supplementary data among clients with significant differences in accuracy, a denoising diffusion implicit model is used to generate synthetic datasets. Asynchronous training is performed during the data generation phase. Representative clients are selected for data generation tasks in combination with a periodic evaluation and ranking mechanism to achieve asynchronous aggregation and redistribution of model parameters.
It effectively alleviates the problem of training imbalance caused by data distribution differences, improves the generalization ability and stability of the global model, improves system resource utilization and training efficiency, and is suitable for a variety of application scenarios with high requirements on privacy and data heterogeneity.
Smart Images

Figure CN120806072A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of artificial intelligence, and particularly relates to a diffusion-enhanced and asynchronous scheduling federated learning method, system and medium. BACKGROUND
[0002] As a new distributed machine learning method, federated learning completes model training locally on data, uploads model parameters or gradients to the server for aggregation, and realizes cross-device and cross-organizational data collaborative modeling without leaking user privacy data. This technology has wide application prospects in fields with strict data privacy and compliance requirements, such as medical diagnosis, financial risk control, intelligent transportation, etc.
[0003] Most of the current mainstream federated learning algorithms are based on the assumption that the data distribution of each participating client is relatively consistent, or can converge to a representative global model through enough rounds, but in real scenarios, due to user behavior differences, uneven regional distribution, device capability limitations, etc., there is usually a serious data non-independent and identically distributed problem between clients. This heterogeneity leads to the following problems in the training process of the federated model: ① Model performance degradation: Local models on different clients fit in different directions on local data, and the aggregated global model is difficult to achieve good results on all data distributions, resulting in reduced accuracy and insufficient generalization ability; ② Unstable training: too much data difference will lead to conflicting local model update directions, affecting the convergence speed and stability of the global model; ③ Increased communication cost: due to the difficulty of fast convergence of the model, more rounds of communication and synchronization are required, further increasing the system burden.
[0004] To address the above problems, existing research has proposed some solutions, such as federated regularization algorithms, personalized federated learning methods, and knowledge distillation assisted federated frameworks, which attempt to improve model performance on heterogeneous data by introducing new objective functions or auxiliary mechanisms. However, these methods cannot fundamentally solve the problem caused by large differences in data distribution; another approach is to share data or generate auxiliary data to compensate for the lack of client data or distribution bias, such as using small-sample public datasets for global distillation on the server side, or using GANs and other generative models to enhance local sample distribution, which to some extent improves the data heterogeneity problem, but GANs and other models have limitations in training stability, generated quality, etc., and often rely on centralized samples or partial sharing, which poses certain privacy risks.
[0005] Therefore, there is an urgent need for a new federated learning mechanism that can dynamically alleviate data heterogeneity and continuously improve model performance while ensuring data privacy and communication efficiency. SUMMARY
[0006] To solve the above problems existing in the prior art, the present application realizes the technical scheme as follows: In a first aspect of the present application, a diffusion-enhanced and asynchronous scheduling federated learning method is provided, comprising the following steps: Step one: based on the local data set, the global model parameters of the N clients are respectively iteratively updated to obtain N local model parameters, the N local model parameters are aggregated to obtain new global model parameters, and the classification accuracy is calculated on the local test set of the N clients according to the new global model parameters; Step two: the classification accuracy is listed and sorted to obtain a sorting result, and the top and the last name of the clients are deployed with a diffusion model, the diffusion model is used to generate a synthetic data set, the synthetic data set is merged with the local data set to obtain an enhanced sample set, and the latest generated K enhanced sample sets are selected as the enhanced data set; Step three: the remaining clients other than the top and the last are asynchronously trained based on the new global model parameters on the local data set to obtain updated local model parameters, and the updated local model parameters are continuously aggregated asynchronously to obtain updated global model parameters; Step four: the enhanced data set is used as the local data set of the N clients in the next round of training, and the updated global model parameters are used as the global model parameters of the N clients in the next round of training; Step five: the cycle training process of steps one to four is repeatedly performed until the training is completed.
[0007] In step one, the global model parameters of the N clients are iteratively updated based on the local data set using the Adam optimization algorithm to obtain N local model parameters.
[0008] In step one, the N local model parameters are aggregated using the federated average algorithm to obtain new global model parameters.
[0009] The diffusion model in step two is a denoising diffusion implicit model.
[0010] In step three, the asynchronous federated training based on the new global model parameters on the local data set is performed synchronously with the generation of the synthetic data set using the diffusion model in step two, and is ended with the end of the generation of the synthetic data set using the diffusion model in step two.
[0011] In a second aspect of the present application, a diffusion-enhanced and asynchronous scheduling federated learning system is provided, which comprises a central processor and N clients; The central processor is used for aggregating N local model parameters to obtain new global model parameters, calculating classification accuracy on the local test set of the N clients respectively according to the new global model parameters, performing list sorting on the classification accuracy to obtain a sorting result, deploying the diffusion model to the clients in the front and rear of the sorting result, selecting the latest generated K enhanced sample sets as an enhanced data set, continuously aggregating the updated local model parameters to obtain updated global model parameters, taking the enhanced data set as the local data set of the N clients in the next round of training, taking the updated global model parameters as the global model parameters of the N clients in the next round of training, and repeatedly performing the periodic training process until the training is completed. The client is used for iteratively updating the global model parameters of the N clients based on the local data set to obtain N local model parameters, generating a synthetic data set by using the diffusion model, merging the synthetic data set and the local data set of the client to obtain an enhanced sample set, and performing asynchronous training on the local data set based on the new global model parameters by the remaining clients in the front and rear of the enhanced sample set to obtain updated local model parameters.
[0012] In a third aspect of the present application, a computer readable storage medium is provided, which stores computer executable instructions for causing a computer to execute a diffusion enhancement and asynchronous scheduling federated learning method.
[0013] Compared with the prior art, the present application has the following beneficial effects: 1. By introducing a generation model based on DDIM, diversified supplementary data is synthesized between clients with obvious accuracy differences, effectively alleviating the training imbalance problem caused by data distribution differences, and improving the generalization ability and stability of the global model.
[0014] 2. In the data generation phase, the remaining clients continue to perform local training in an asynchronous manner, which not only improves the utilization rate of system resources, but also shortens the overall training period, and enhances the efficiency and practicality of federated learning.
[0015] 3. Through periodic evaluation and sorting of the accuracy of the client model, representative clients can be selected to participate in the data generation task, taking into account model performance and system overhead, and realizing more intelligent resource scheduling.
[0016] 4. After the data generation and asynchronous training phase, a unified global model aggregation and redistribution mechanism is used to ensure the consistency of the model state of each client, and to improve the controllability and stability of the overall system.
[0017] 5. It can adapt to different types of diffusion model, aggregation strategy and task scene, has good scalability, and is suitable for medical, financial, edge computing and other application scenes with high requirements for privacy and data heterogeneity.
[0018] The application will be further described in detail below with reference to the accompanying drawings and embodiments. BRIEF DESCRIPTION OF DRAWINGS
[0019] Figure 1 is a flow chart of a diffusion enhancement and asynchronous scheduling federated learning method provided by an embodiment of the application; Figure 2 is a specific flow chart of a diffusion enhancement and asynchronous scheduling federated learning method provided by an embodiment of the application; Figure 3 is a system schematic diagram of a diffusion enhancement and asynchronous scheduling federated learning method provided by an embodiment of the application; Fig. 4(a) is a comparison diagram of experimental results under the condition of MNIST data set and IID data distribution provided by an embodiment of the application; Fig. 4(b) is a comparison diagram of experimental results under the condition of CIFAR-10 data set and IID data distribution provided by an embodiment of the application; Fig. 5(a) is a comparison diagram of experimental results under the condition of MNIST data set and Non-IID data distribution provided by an embodiment of the application; Fig. 5(b) is a comparison diagram of experimental results under the condition of CIFAR-10 data set and Non-IID data distribution provided by an embodiment of the application. DETAILED DESCRIPTION
[0020] In order to further illustrate the technical means and effects adopted by the application to achieve the predetermined purpose, the scheme according to the application is described in detail below in combination with the drawings and specific embodiments.
[0021] The foregoing and other technical contents, features and effects of the application can be clearly presented in the specific embodiment description below in combination with the drawings. Through the description of the specific embodiments, the technical means and effects adopted by the application to achieve the predetermined purpose can be understood more deeply and specifically. However, the attached drawings are provided for reference and explanation only, and are not used to limit the technical scheme of the application.
[0022] It should be noted that, in this text, relational terms such as first and second are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between such entities or operations. Moreover, the terms "include", "contain" or any other variant are intended to cover non-exclusive inclusion, so that the article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed. Without more limitation, the element defined by the statement "includes a" does not exclude the presence of additional identical elements in the article or device including the element.
[0023] Please refer to Figure 1 and Figure 2 , Figure 1 is a diffusion enhancement and asynchronous scheduling federated learning method flowchart provided by the embodiment of the application, comprising the following steps: Step one: based on the local data set, the global model parameters of the N clients are respectively iteratively updated to obtain N local model parameters, and the N local model parameters are aggregated to obtain new global model parameters, and the classification accuracy is calculated on the local test set of the N clients according to the new global model parameters.
[0024] Step two: list sorting is performed on the classification accuracy to obtain a sorting result, and the top and the last The diffusion model is deployed on the client, the synthetic data set is generated by using the diffusion model, the synthetic data set and the local data set are merged to obtain an enhanced sample set, and the latest generated K enhanced sample sets are selected as the enhanced data set.
[0025] Step three: the remaining clients other than the top and the last The new global model parameters are trained on the local data set to obtain updated local model parameters, and the updated local model parameters are continuously aggregated to obtain updated global model parameters.
[0026] Step four: the enhanced data set is used as the local data set of the N clients in the next round of training, and the updated global model parameters are used as the global model parameters of the N clients in the next round of training.
[0027] Step five: the periodic training process of the above steps one to four is repeatedly performed until the training is completed.
[0028] Figure 2 is a diffusion enhancement and asynchronous scheduling federated learning method specific flowchart provided by the embodiment of the application, and the technical scheme steps of the application will be further described below: Figure 2 Step one: First, build an initial global model on the central server The model can select the appropriate neural network structure according to the task type, and the initial model parameters can be represented as:
[0029] Where, is the initial parameter of the global model, represents the initialization operation.
[0030] After the model parameters are initialized, the system distributes the global initial model parameters to all clients in a broadcast manner , , is the total number of clients participating in federated learning, and the client receives the initial model, and sets its initial local model copy as , which satisfies:
[0031] Where, represents the initial local model copy of the client , represents the initial parameter of the global model, represents the initial parameter of the local model of the client .
[0032] At the same time of distributing the initial model parameters, the central server also synchronously issues training configurations, including learning rate, local iteration rounds, batch size, optimizer type, loss function, and random seed. The system configuration of each client is C:
[0033] Where, is the learning rate, is the local iteration round of the client, is the batch size, is the optimizer type, is the loss function, is the random seed.
[0034] When all clients have completed the initialization, they can enter the federated training phase.
[0035] The current training period is the th round, and the central server holds the global model parameters obtained after the last round update (such as the current training period is the 1st round, and the central server holds the initial parameter of the global model ), and broadcasts the global model parameters to all clients The client then iteratively updates the local model parameters based on the global model parameters and the local data set (e.g., the first round of the current training period, based on the local original data set) Specifically, based on the Adam optimization algorithm, the optimization objective is:
[0036] wherein, represents the local model parameters, represents the optimal model parameters, is the expected operator, represents the samples collected from the local data set , and is the loss function of the cross-entropy loss, represents the forward propagation output of the model under the parameters to the input , and represents the true label.
[0037] The central server waits for all clients to complete uploading and then performs the federated average algorithm (FedAvg) to aggregate the local model parameters to obtain new global model parameters :
[0038] wherein, represents the number of samples of the client , and is the total number of samples of all clients.
[0039] After aggregation is completed, the central server returns the new global model parameters to the clients , and calculates the classification accuracy on the local test set of the clients according to the new global model parameters:
[0040] wherein, represents the accuracy of the client , and represents the t-th round of global model parameters , and is the predicted output of the model with the parameters to the data x, is the indicator function, which is 1 if the prediction is correct, and 0 otherwise.
[0041]
[0042] wherein, represents the t-th The accuracy of all clients after a round of training, Represents the client The corresponding accuracy.
[0043] Sort the classification accuracy list of N clients to get the sorting result:
[0044] in, Indicates the The client list is sorted in descending order of accuracy. Indicates descending sort order.
[0045] The ranking results are used for the client selection strategy of subsequent diffusion model deployment. Considering that data heterogeneity comes from the extreme differences between data distributions, the top clients ranked by accuracy are selected. Name and Post Named clients as participants in the diffusion data generation , recorded as:
[0046] Then in Diffusion models are deployed on these clients to generate synthetic data. The diffusion model uses the denoising diffusion implicit model (DDIM). The total dataset generated is recorded as a synthetic dataset. , client local dataset With synthetic datasets Merge to obtain enhanced sample set :
[0047] Considering data storage capacity and training efficiency, after several rounds of diffusion generation, not all generated data are saved. Instead, the most recently generated K augmented sample sets are selected according to the timestamp as the augmented dataset:
[0048] in, Select the latest generated strip enhancement sample based on the timestamp.
[0049] Step 3: Deploy the diffusion model to some clients During data generation, Name and Other clients Based on the new global model parameters Perform local asynchronous training on the local dataset to obtain updated local model parameters ,in Represents the client training round progress.
[0050] the central server receives the updated local model parameters , continuously aggregates the updated local model parameters to obtain updated global model parameters:
[0051] wherein, is a dynamically adjusted time decay factor, is the current average round, is a hyperparameter for adjusting the degree of synchronization.
[0052] The above process is based on the new global model parameters for asynchronous federated training on the local data set and the generation of synthetic data sets using the diffusion model. With the end of the generation of synthetic data sets using the diffusion model, the updated global model parameters are distributed to all clients:
[0053] wherein, denotes the updated global model parameters, denotes the global model parameters of the client in the next round of training.
[0054] Step four: the enhanced data set obtained in this period is used as the local original data set of the N clients in the next round of training, and the updated global model parameters obtained in this period are used as the global model parameters of the N clients in the next round of training.
[0055] Step five: continuously repeat the periodical training process of steps one to four until the convergence condition is met and the training is completed. The convergence condition is to reach the number of training periods.
[0056] Figure 3 is a diffusion enhancement and asynchronous scheduling federated learning system schematic diagram provided by an embodiment of the application, comprising a central processor and N clients.
[0057] The central processor is used to aggregate the N local model parameters to obtain new global model parameters, calculate the classification accuracy on the local test set of the N clients according to the new global model parameters, list sort the classification accuracy to obtain a sorting result, and select the top and the last The first client selects the latest generated K enhanced sample set as an enhanced data set, continuously aggregates updated local model parameters to obtain updated global model parameters, takes the enhanced data set as the local data set of N clients in the next round of training, takes the updated global model parameters as the global model parameters of N clients in the next round of training, and repeatedly cycles the training process until the training is completed. The client is used for respectively updating the global model parameters of N clients based on the local data set to obtain N local model parameters, generating a synthetic data set by using a diffusion model, merging the synthetic data set and the local data set of the client to obtain an enhanced sample set, taking the first The last The remaining clients outside the first and last
[0058] The present application also provides a computer readable storage medium, the computer readable storage medium stores computer executable instructions, the computer executable instructions are used for making the computer execute the method embodiment of the present application.
[0059] In order to verify the effectiveness of the proposed diffusion enhancement and asynchronous scheduling federated learning method (hereinafter referred to as "FedDA"), a plurality of comparative experiments are designed, and IID and Non-IID data distribution environments are constructed on standard image classification data sets MNIST and CIFAR10 respectively, and the performance advantages of the present application in accuracy and convergence efficiency are evaluated.
[0060] The method of the present application is compared with the existing three kinds of federated learning, and the existing three kinds of federated learning are FedAvg, FedAsync and FedProx. The experimental parameter configuration is as follows: 5 federated learning client numbers; the Dirichlet distribution is used for non-uniform distribution of data labels, wherein the concentration parameter alpha of Dirichlet distribution is set to 0.1 and 1.0 respectively, which is used to represent the data distribution scene of non-independent and identical distribution (Non-IID) and independent and identical distribution (IID), to simulate the data heterogeneity in real scene; the total number of federated training rounds is 100, and in order to realize data enhancement, a pre-trained diffusion model is used to generate synthetic samples for selected clients in the present application, to alleviate the problem of non-independent data and improve the model generalization ability.
[0061] As shown in FIG. 4(a), it is an experimental result comparison chart under the condition of MNIST data set and IID data distribution provided by the embodiment of the present application; as shown in FIG. 4(b), it is an experimental result comparison chart under the condition of CIFAR-10 data set and IID data distribution provided by the embodiment of the present application; as shown in FIG. 5(a), it is an experimental result comparison chart under the condition of MNIST data set and Non-IID data distribution provided by the embodiment of the present application; as shown in FIG. 5(b), it is an experimental result comparison chart under the condition of CIFAR-10 data set and Non-IID data distribution provided by the embodiment of the present application, the horizontal coordinates are all training cycle numbers, and the vertical coordinates are all model accuracies.
[0062] Under the condition of IID data distribution, the method provided by the present application has slightly improved accuracy compared with the prior art; under the condition of Non-IID data distribution, the method provided by the present application is obviously superior to the prior art. On the MNIST data set, the accuracy is improved by about 30%, and the convergence speed is accelerated by nearly 20 rounds; on the CIFAR-10 data set, the accuracy is improved by about 35%, and the convergence speed is accelerated by nearly 5 rounds. This shows that in the scene of serious data heterogeneity, the present application can effectively improve the performance of the global model by combining the data generation strategy of the diffusion model and the periodic synchronization mechanism, and greatly alleviate the training instability problem caused by uneven data.
[0063] The present application synchronously trains and aggregates global model parameters and calculates the accuracies of each client, selects part of high and low accuracy clients to generate auxiliary data by using the DDIM diffusion model, and the remaining clients are synchronously trained asynchronously, the generated data is uniformly entered into the next cycle of training, and the process is repeated until the end; the difference between the accuracies of the clients is obvious, and the supplementary data is synthesized, which effectively alleviates the training imbalance caused by the difference in data distribution, improves the generalization ability and stability of the global model; at the same time, the remaining clients are asynchronously trained during the data generation stage, which can improve the utilization rate of system resources and shorten the overall training period; by periodically evaluating and ranking the accuracies of the client models, representative clients can be selected for data generation, taking into account the model performance and system overhead; after data generation and asynchronous training, a unified global model aggregation and distribution mechanism is used to ensure that the states of the client models are consistent, and the controllability and stability of the system are improved.
[0064] The above is a further detailed description of the present application in combination with a specific preferred embodiment, and the specific implementation of the present application cannot be limited to these descriptions. For ordinary skilled persons in the technical field to which the present application belongs, without departing from the concept of the present application, a number of simple deductions or substitutions can be made, which should be regarded as falling within the protection scope of the present application.
Claims
1. A federated learning method with diffusion enhancement and asynchronous scheduling, characterized in that: The following steps are involved: Step 1: Based on the local dataset, the global model parameters of N clients are iteratively updated to obtain N local model parameters. The N local model parameters are aggregated to obtain new global model parameters. The classification accuracy is calculated on the local test sets of N clients based on the new global model parameters. Step 2: Sort the classification accuracy rates to get the sorting results, and sort the top Name and Post The client deploys a diffusion model, uses the diffusion model to generate a synthetic dataset, merges the synthetic dataset with the local dataset to obtain an enhanced sample set, and selects the latest generated K enhanced sample sets as the enhanced dataset; Step 3: Move the front Name and Post The remaining clients perform asynchronous training on the local dataset based on the new global model parameters to obtain updated local model parameters. The updated local model parameters are continuously asynchronously aggregated to obtain updated global model parameters. Step 4: Use the enhanced dataset as the local dataset of N clients in the next round of training, and use the updated global model parameters as the global model parameters of N clients in the next round of training; Step 5: Repeat the cyclic training process from step 1 to step 4 until the training is completed.
2. The method for federated learning with diffusion enhancement and asynchronous scheduling according to claim 1, characterized in that: In the step 1, the global model parameters of the N clients are iteratively updated using the Adam optimization algorithm based on the local data set to obtain N local model parameters.
3. The method for federated learning with diffusion enhancement and asynchronous scheduling according to claim 1, characterized in that: In the step 1, the federated averaging algorithm is used to aggregate N local parameter models to obtain new global model parameters.
4. The method for federated learning with diffusion enhancement and asynchronous scheduling according to claim 1, characterized in that: The diffusion model in step 2 is a denoising diffusion implicit model.
5. The method for federated learning with diffusion enhancement and asynchronous scheduling according to claim 1, characterized in that: The asynchronous federated training based on the new global model parameters on the local dataset in step three is performed synchronously with the generation of the synthetic dataset using the diffusion model in step two, and ends with the completion of the generation of the synthetic dataset using the diffusion model in step two.
6. A federated learning system with diffusion enhancement and asynchronous scheduling, characterized in that: The system includes a central processing unit and N clients; The central processor is used to aggregate N local model parameters to obtain new global model parameters, calculate the classification accuracy on the local test sets of N clients according to the new global model parameters, sort the classification accuracy to obtain a sorting result, and sort the top Name and Post The client deployment diffusion model is named, and the newly generated K enhanced sample sets are selected as the enhanced data set. The updated local model parameters are continuously asynchronously aggregated to obtain the updated global model parameters. The enhanced data set is used as the local data set of N clients in the next round of training, and the updated global model parameters are used as the global model parameters of N clients in the next round of training. The cyclic training process is repeated until the training is completed. The client is used to iteratively update the global model parameters of N clients based on the local data set to obtain N local model parameters, generate a synthetic data set using the diffusion model, merge the synthetic data set with the client's local data set to obtain an enhanced sample set, and Name and Post The remaining clients perform asynchronous training on the local dataset based on the new global model parameters to obtain updated local model parameters.
7. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to execute the method according to any one of claims 1 to 5.