Single-round federated learning method based on integrated promotion in model market environment
By adopting a single-round federated learning method based on image data and ensemble improvement in the model market, synthetic image data and feature pools are generated, combined with personalized weighted class activation map technology, to solve the high communication overhead and data heterogeneity in single-round federated learning. The resulting problem of poor global model performance enables more efficient data utilization and privacy protection.
Patent Information
- Application Number
- CN202410850939.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-28
- Publication Date
- 2024-09-27
AI Technical Summary
In the model market, single-round federated learning faces high communication overhead and data privacy protection challenges. At the same time, due to differences in client computing capabilities and data distribution, global model performance is poor.
Using a single-round federated learning method based on image data and ensemble enhancement, the generator generates synthetic image data and feature pools, optimizes the training of ensemble models and global models, and uses personalized weighted class activation maps to guide global model training and alleviate data heterogeneity. structure problem.
It improves the performance of the integrated model and global model, enhances data utilization efficiency, ensures data privacy protection, and improves the generalization ability of the global model.
Smart Images

Figure CN118709807A
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of single-round federated learning under heterogeneous data, and in particular to a single-round federated learning method based on image data and integrated improvement in a model market environment. Background Art
[0002] In order to meet the growing demand for machine learning and artificial intelligence applications and improve the effective utilization of resources, the model market has become a focus area in the forefront of science and technology. In the model market, model consumers do not need to build models from scratch, which greatly saves model consumers' time and costs.
[0003] However, in the field of model markets, potential training data is scattered among multiple data providers around the world, and model developers need to collect these image data to develop models, which leads to high communication overhead. Therefore, how to reduce communication overhead has become a challenge for model markets.
[0004] In addition, the centralized way model developers process image data will inevitably conflict with increasingly stringent data privacy protection regulations, especially when the data involves sensitive information, such as personal identity information and health records. Therefore, how to ensure data privacy becomes another challenge for the model market. In order to meet these two challenges and promote the development of the model market, it is urgent to find a solution that can effectively utilize decentralized image data resources while ensuring low communication overhead and data privacy.
[0005] In order to address the above two challenges, single-round federated learning was introduced as an innovative solution. Single-round federated learning means that multiple clients can collaboratively train a global model through only one round of communication from the client to the server under the premise of protecting privacy. This method not only inherits the core advantages of traditional federated learning, namely protecting image data privacy and utilizing distributed image data, but also optimizes it specifically for reducing communication overhead, becoming an effective strategy for the model market to combat data privacy, security issues, and high communication overhead challenges.
[0006] However, although single-round federated learning is currently widely recognized, it still faces many challenges. For example, there are differences in computing power, storage capacity, communication bandwidth, etc. between clients, which will lead to clients often having different model structures. In this case, the operation of simply averaging client models is no longer effective.
[0007] In addition to the differences in model structures, in a single round of federated learning, multiple client models are aggregated on the server side based on only one update of each node. Such a step limits the depth and breadth of model optimization because the training image data of each node may only cover a small part of the total dataset, which may cause the aggregated global model to fail to achieve the ideal generalization ability, especially when there are significant differences in data distribution on the clients. Summary of the invention
[0008] In order to meet the above challenges, the present invention provides a single-round federated learning method based on data and integration improvement in a model market environment, which can solve the problem that the global model of single-round federated learning has poor performance compared with the global model trained under the framework of multi-round federated learning in the scenario of heterogeneous models. The present invention also discloses a solution for guiding global model training with a personalized weighted class activation map, which is used to alleviate the impact of significant differences in client data distribution on global model performance in single-round federated learning.
[0009] The present invention provides a single-round federated learning method based on ensemble improvement in a model market environment, comprising the following steps:
[0010] S1. Customers choose a suitable local model structure based on their own computing resources and storage capabilities.
[0011] S2. The client uploads the updated local model to the central server.
[0012] S3. After receiving the model parameters uploaded by the client, the server combines multiple models into an integrated model, where the default integration weight is the average value.
[0013] S4. Gaussian noise and labels are sampled from Gaussian distribution and uniform distribution, and the generator Gaussian noise and labels are input into the generator to obtain synthetic image data. The server uses the integrated model and the global model to construct a fidelity loss function and a migration loss function for the model output of the synthetic image data to train the generator. If this round is not the first round, the integrated weight of the integrated model is the integrated weight of the previous round.
[0014] S5. Store the synthetic image data generated by the generator and the features output by the intermediate layer of the generator into the synthetic image dataset and the feature pool respectively.
[0015] S6. Construct a cross entropy loss based on the model output of the integrated model for the synthetic image dataset to find the integrated weight that minimizes the loss, that is, update the integrated weight using the gradient direction and fixed step size.
[0016] S7. Randomly sample the feature pool and input the sampling results into the specified layer of the generator to obtain diverse new synthetic image data outputs, and fill them with the new synthetic image dataset.
[0017] S8. After obtaining a new synthetic image dataset and a new integration weight, the new synthetic image data is input into the integration model and the global model to obtain the integration model output and the global model output. The global model is updated by constructing a distillation loss between the two outputs, thereby realizing the transfer of knowledge from the integration model to the global model.
[0018] S9. Repeat S4 to S8 for a specified number of rounds.
[0019] Compared with the prior art, the present invention has the following beneficial effects:
[0020] The present invention proposes a method for single-round federated learning based on image data and ensemble enhancement. The method accelerates ensemble distillation by producing synthetic image data that is between the decision boundaries of a global model and an ensemble model through fidelity and migration losses. In order to prevent the limited number of generated image data and the insufficient diversity of image data through multiple rounds of training, the present invention increases the number and diversity of synthetic image data by mixing generator feature channels.
[0021] In addition, the present invention uses a synthetic image dataset to update the weight of the integrated model. The upper bound of the performance of the global model is the performance of the integrated model. The performance of the integrated model is improved by training the weights, which greatly improves the upper limit of the performance of the integrated model, thereby improving the performance of the distilled global model. In addition, since the performance of the integrated model is improved, and the fidelity loss of the generator training mainly refers to the output of the integrated model, this can further improve the quality of the synthetic image data.
[0022] The present invention also proposes a method for guiding global model training with personalized weighted class activation maps. On the one hand, because the class activation map is essentially a feature map of the same size as the training image obtained by multiplying the weight matrix of the fully connected layer and the set of feature maps output by the convolutional layer, the gradient-based class activation map technology can effectively solve the problem of being unable to align intermediate features between heterogeneous client models in the integrated model. On the other hand, due to the problem of data heterogeneity on the client side, the decision-making capabilities of different clients for the same image data vary greatly. The present invention calculates the similarity between each client output and the integrated model output to obtain a weighted class activation map, thereby alleviating the problem of client data heterogeneity. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] Figure 1 A schematic diagram of the principle framework of a single-round federated learning method based on image data and integrated improvement in a model market environment provided by an embodiment of the present invention;
[0024] Figure 2A schematic diagram of the main process of a single-round federated learning method based on image data and integrated improvement in a model market environment provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0025] The embodiments of the present invention are described in detail below with reference to the accompanying drawings.
[0026] The present invention shows different implementation modes through specific examples, and is intended to make it easier for those skilled in the art to understand the advantages and effects of the present invention. Obviously, the embodiments only represent a part of possible implementation modes of the present invention, not all. The present invention can also be applied through other specific implementation modes, and the details in this specification can also be modified or changed according to different viewpoints and applications, but should not deviate from the core idea of the present invention.
[0027] It should be emphasized that the terms used herein are intended to describe specific embodiments and are not intended to limit the exemplary embodiments of the present disclosure. Within the scope of the present invention, the skilled person should understand that any aspect described herein can be implemented independently and can be combined in a variety of ways. For example, any number of aspects described herein can be used to implement the device and / or practice the method.
[0028] In addition, the terms such as "include", "comprising", "having", "containing", etc. used in this document are open terms, which include but are not limited to the listed contents. In the absence of conflict, the embodiments and features in the embodiments of this application can be combined with each other. Next, the application will be described in detail with reference to the drawings and in combination with the embodiments.
[0029] An embodiment of the present invention provides a single-round federated learning method based on image data and integrated improvement in a model market environment, which can solve the problem that in single-round federated learning, the global model has poor performance compared to the global model trained under a multi-round federated learning framework in the scenario of heterogeneous client models and heterogeneous data.
[0030] Before performing the model optimization operation, the present invention first defines the single-round federated learning system integration model and optimization objectives in the scenarios of model heterogeneity and data heterogeneity as follows:
[0031] 1) Assume there is a group of data providers C, with a total of n = |C| data providers. Each data provider c k ∈C, each has a local private image dataset in is the number of local image data samples of the kth data provider.
[0032] The goal of single-round federated learning is to learn Based on training a parameter θ SThe optimization objective of the model is expressed as follows:
[0033]
[0034] Among them l CE (*, *) is the cross entropy function, f S (x i θ S ) is the input x i Given parameter θ S The output of the last fully connected layer of the server, y i is the image data x i The corresponding label.
[0035] 2) In a single round of federated learning, model developers cannot access the original training set The client only provides k Parameterized pre-trained model. This application defines the ensemble model composed of a collection of data providers as:
[0036]
[0037] Among them, f k (x;θ k ) indicates that the model parameter is θ k The model output of the model for the image data x, and the integrated weights w = [w1, w2, .., w n ] adjusts the weight of each data provider model. When w k = 1 / n, the integration is the same as the average integration. This application uses A w (x) represents the output of the integrated model for a given x.
[0038] The present invention mainly targets the scenario of the model market and proposes a method for single-round federated learning based on image data and integrated enhancement to solve the problem of poor global model performance, as well as a method for guiding global model training with personalized weighted class activation maps to alleviate the impact of significant differences in client data distribution in single-round federated learning on global model performance.
[0039] like Figure 1As shown, a method for single-round federated learning based on image data and integrated improvement in an embodiment of the present invention. In the model market, models and developers usually need to collect image data from data providers scattered around the world for training models, which leads to high communication overhead and the inability to guarantee the privacy and security of data providers. This method combines single-round federated learning to solve the above problems well. In addition, in the model market environment, different data providers often require different model structures due to differences in computing and resources, and the global model performance obtained by single-round federated learning through only one round of aggregation is poor. The above problems cannot be simply solved by average aggregation. Therefore, the present invention uses a single-round federated learning method based on image data and integrated improvement to solve the above problems, see Figure 2 , specifically the following steps:
[0040] S1: n data providers select a suitable local model structure based on their own computing resources and storage capabilities.
[0041] S2: n data providers upload the updated local models to the central server.
[0042] S3: After receiving the model parameters uploaded by the client, the model developer combines multiple models into an integrated model, where the default integration weight is the average value. The model developer receives the models of n data providers and combines them into an integrated model T, where T k Represents the k-th data provider model.
[0043] Initialize the generator G, the global model S and the integrated model weight vector w of size n×1. The initial value of each dimension of the weight vector is 1 / n. Synthesize the image dataset Empty set, diverse synthetic image dataset Initialize the feature pool F to be empty, the generator training round C1, the integrated distillation round C2, and the alternating training round C3.
[0044] S4: First, Gaussian noise z and label y are sampled from Gaussian distribution and uniform distribution respectively. s , the generator Gaussian noise z and label y s Input the generator to get the synthetic image data x s . The synthetic image data x generated by the generator s Input into the integrated model T and the global model S to obtain the integrated model output and the global model output. If this round is not the first round, the integrated weight of the integrated model is the integrated weight of the previous round.
[0045] According to the output of the integrated model and the output of the global model, they are respectively compared with the label y of the synthetic image data s Construct the fidelity loss function together And the transfer loss function To update the parameters θ of the generator G G , the round is C1.
[0046] The fidelity loss function The form is:
[0047]
[0048] Among them l CE (A w (x s ), y s ) represents the integrated model for the synthetic image data x s Output A w (x s ) and the synthetic image data x s Label y s The cross entropy loss is Represents a synthetic image dataset.
[0049] The migration loss function The form is:
[0050]
[0051] Among them l KL (A w (x s ), f S (x s θ S )) represents the integrated model A w and the parameter is θ S The global model for the synthetic image data x s The Kullback-Leibler (KL) divergence loss between the outputs of Represents a synthetic image dataset.
[0052] The total loss form of training generator G is:
[0053]
[0054] S5: After the generator training is completed, a batch of synthetic image data x s join in At the same time, the generator G generates the synthetic image data x s The intermediate feature F(x) of the specified layer s ) to the feature pool F.
[0055] S6: Get each batch of synthetic image data in S5 After that, the cross entropy loss function is used to update the integrated weight w of the integrated model's integrated weight gradient direction and fixed step size μ each time. The cross entropy loss function is as follows:
[0056]
[0057] in Represents the integrated model for the synthetic image data x s The output and synthesized image data x s Label y s The cross entropy loss.
[0058] The w update formula is as follows:
[0059]
[0060] Normalize() means normalizing the w vector, and the symbol represents a symbolic function, if the gradient If it is positive, the output is 1, otherwise it is 0, where t represents the training round, and w t Represents the integration weight of the t-th round integration model.
[0061] S7: After filling the feature pool F in S5, random sampling is performed from the feature pool F, and the sampling results are input into the specified layer of the generator to obtain diverse new synthetic image data x s* , and fill it with a new synthetic image dataset
[0062] S8: Obtaining a new synthetic image dataset After integrating weights w, the new synthetic image data x s* Input the integrated model T and the global model S to obtain the output of the integrated model T, the output of the global model S, and the output of each data provider model in the integrated model. The parameters of the global model are updated by constructing the distillation loss between the two outputs, thereby realizing the transfer of knowledge from the integrated model to the global model.
[0063] In a preferred embodiment, the global model is updated using the distillation loss between the ensemble model output and the global model output, and the distillation loss is as follows:
[0064]
[0065] Among them A w (x s* ) and f S (x s* θ s ) represents the integrated model output and the global model output, represents a new synthetic dataset, x s* Representative synthetic image dataset The synthetic image data in θ s Represents the model parameters of the global model.
[0066] S9: Repeat S4 to S8 until the specified round C3.
[0067] like Figure 1 In the personalized integrated distillation stage, an embodiment of the present application also provides a method for guiding global model training with a personalized weighted class activation map. In the model market, data providers often have different data distributions, which leads to large differences in the decision-making capabilities of different data provider models for the same image data. During the integrated distillation process, data provider models with too large a difference in decision-making capabilities will interfere with the integrated distillation process, and this problem cannot be well solved by simply weighting the integrated model output. To address this problem, this embodiment uses the intermediate features of each model to obtain a class activation map, and at the same time calculates the similarity between each client output and the integrated model output to weight the class activation map to obtain a comprehensive class activation map, and finally guides the global model by constructing a class activation map loss, specifically the following steps:
[0068] S1: After obtaining a new synthetic image dataset After integrating weights w, the new synthetic image data x s* Input the integrated model T and the global model S to obtain the output of the integrated model T, the output of the global model S, and the output of each data provider model in the integrated model.
[0069] The process of calculating the class activation map includes: calculating the gradient of the target category for each channel, performing global average pooling on the gradient, and performing weighted summation of the feature maps of all channels to obtain the class activation map. According to this process, the class activation maps of each data provider model and the global model for the new synthetic image data are calculated respectively, and CAM is used k (x s* θ k ) represents the kth data provider model for the synthetic image data x s* Class activation maps and CAM s (x s* θ S ) represents the global model synthesized image data x s* The class activation map of .
[0070] S2: Calculate the similarity between the model output of each data provider and the output of the integrated model T, with a weight of a. The calculation formula is as follows:
[0071] a=Normalize(KL(A w (x s* ), f k (x s* θ k ))),
[0072] Where a indicates that the weight vector size is n×1, Normalize() indicates normalizing the weight vector, KL(A w (x s* ), f k (x s* θ k )) represents the KL divergence used to constant the k-th data provider model and the integrated model for the image data x s* The similarity of the model output, where A w (x s* ), f k (x s* θ k ) are the integrated model T and the kth data provider model T k For the synthetic image data x s* Output.
[0073] S3: The class activation map of the data provider is weighted according to the similarity between the output of each data provider model and the output of the integrated model to obtain a comprehensive class activation map, and then the class activation map loss is formed by using this map and the class activation map of the global model. Subsequently, the distillation loss is formed according to the output of the integrated model T and the global model S. The global model is trained according to these two loss functions, and the training round is C2. The loss function for training the global model is as follows:
[0074]
[0075] in, Represents a new synthetic image dataset, A w (x s* ) and f S (x s* θ s ) represents the integrated model and the global model for the synthetic image data x s* The output of KL (A w (x s* ), f s (x s* θ s )) represents the distillation loss of the two outputs, a k The weight of the class activation map of the k-th data provider model in ,CAM k (x s* θ k ) means getting the kth data provider model for image data x s* Class activation map, CAM S (x s* θ S ) represents obtaining the global model S for the image data x s* The class activation map of .
[0076] The technical solution of the present invention is not limited to the above-mentioned specific embodiments. All technical variations made according to the technical solution of the present invention fall within the protection scope of the present invention.
Claims
1. A single-round federated learning method based on ensemble improvement in a model market environment, comprising the following steps: S1. Customers choose a suitable local model structure based on their own computing resources and storage capabilities; S2, the client uploads the updated local model to the central server; S3. After receiving the model parameters uploaded by the client, the central server combines multiple models into an integrated model; S4, the central server uses the integrated model and the global model to construct a fidelity loss function and a transfer loss function for the model output of the synthetic image data to train the generator; S5, storing the synthetic image data generated by the generator and the features output by the intermediate layer of the generator into the synthetic image data set and the feature pool respectively; S6. Construct a cross entropy loss based on the model output of the integrated model for the synthetic image dataset to find the integrated weight that minimizes the loss, that is, update the integrated weight using the gradient direction and fixed step size; S7, randomly sample the feature pool, and input the sampling results into the specified layer of the generator to obtain diverse new synthetic image data outputs, and fill them with new synthetic image data sets; S8. After obtaining a new synthetic image dataset and a new integration weight, the new synthetic image data is input into the integration model and the global model to obtain the integration model output and the global model output; the global model is updated by constructing a distillation loss between the two outputs, thereby realizing the transmission of knowledge from the integration model to the global model; S9. Repeat S4 to S8 for a specified number of rounds.
2. The single-round federated learning method based on ensemble improvement in a model market environment according to claim 1, characterized in that: The integration model is defined as follows: where f k (x;θ k ) indicates that the sample x has the client parameter θ k The model output, w k represents the weight of the client, and n represents the number of clients.
3. The single-round federated learning method based on ensemble improvement in a model market environment according to claim 1, characterized in that: The fidelity loss is: Among them l CE (A w (x s ),y s ) represents the integrated model for the synthetic image data x s Output A w (x s ) and the synthetic image data x s Label y s The cross entropy loss is represents a synthetic image dataset; The migration loss is: Among them l KL (A w (x s ),f S (x s θ S )) represents the integrated model A w and the parameter is θ S The global model for the synthetic image data x s The KL divergence loss between the outputs of 4. A single-round federated learning method based on data and integration improvement for a model market according to claim 1, characterized in that: After obtaining each batch of synthetic image data Finally, the cross entropy loss function is used to update the integrated weight w of the integrated model each time with a fixed step size μ.
5. A single-round federated learning method based on data and integration improvement for a model market according to claim 4, characterized in that: The cross entropy loss function is as follows: in Represents the integrated model for the synthetic image data x s The output and synthesized image data x s Label y s The cross entropy loss of The integrated weight w update formula is as follows: Normalize() means normalizing the w vector, and the symbol represents a symbolic function, if the gradient If it is positive, the output is 1, otherwise it is 0, where t represents the training round, and w t Represents the integration weight of the t-th round integration model.
6. The single-round federated learning method based on ensemble improvement in a model market environment according to claim 1, characterized in that: After filling the feature pool F, random sampling is performed from the feature pool F, and the sampling results are input into the specified layer of the generator to obtain diverse new synthetic image data x s* , and fill it with a new synthetic dataset 7. The single-round federated learning method based on ensemble improvement in a model market environment according to claim 6, characterized in that: The global model is updated using the distillation loss between the ensemble model output and the global model output. The distillation loss is as follows: Among them A w (x s* ) and f S (x s* θ S ) represents the integrated model output and the global model output, represents a new synthetic dataset, x s* Representative synthetic image dataset The synthetic image data in θ S Represents the model parameters of the global model.
8. The single-round federated learning method based on ensemble improvement in a model market environment according to claim 1, characterized in that: Step S8 is replaced by the following operation: Calculate the class activation maps of each client, the global model and the ensemble model for the synthetic image dataset according to the method of calculating gradient-based class activation maps; Calculate the similarity between the output of each customer model and the output of the integrated model; The class activation map of each customer is weighted according to the similarity between the output of each customer model and the output of the integrated model to obtain a comprehensive class activation map. This map is then used together with the class activation map of the global model to form a class activation map loss to update the model parameters of the global model, thereby realizing the transfer of knowledge from the integrated model to the global model.
9. The single-round federated learning method based on ensemble improvement in a model market environment according to claim 8, characterized in that: The formula for calculating the similarity between the output of the customer model and the output of the integrated model is as follows: a=Normalize(KL(A w (x s* ),f k (x s* ;θ k ))), Where a indicates that the weight vector size is n×1, Normalize() indicates normalizing the weight vector, KL(A w (x s* ),f k (x s* θ k )) indicates that the similarity between the model output of customer k and the integrated model is measured by KL divergence, A w (x s* ), f k (x s* θ k ) are respectively the integrated model and the customer model for the synthetic image data x s* Output.
10. The single-round federated learning method based on ensemble improvement in a model market environment according to claim 8, characterized in that: The class activation map loss is as follows: Where a indicates that the weight vector size is n×1, CAM k (x s* θ k ) means obtaining customer k pairs of image data x s* Class activation map, CAM S (x s* θ S ) indicates obtaining the global model for data x S* The class activation map of .
Citation Information
Patent Citations
Long-tail data personalized federal learning method, system and device based on adversarial feature augmentation and storage medium
CN115688939A
Image classification method based on federal knowledge distillation and ensemble learning
CN117523291A
Applications of deep neuroevolution on models for evaluating biomedical images and data
WO2023114519A1
