A federated learning method and system based on data augmentation
By calculating the average samples of the participants and using the MixUp algorithm with neighborhood expansion, the problem of data heterogeneity in federated learning is solved, enabling efficient model training in non-IID scenarios and improving model performance and data security.
Patent Information
- Application Number
- CN202310906570.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-24
- Publication Date
- 2026-01-30
- Estimated Expiration
- 2043-07-24
AI Technical Summary
Existing federated learning lacks effective data augmentation methods, especially FedMix, which only applies to the cross-entropy loss function, leading to a decline in model performance in non-IID scenarios and failing to effectively alleviate the problem of data heterogeneity.
By calculating the average sample of each participant, an average sample set is constructed. The sample and global model are trained using a MixUp federated learning algorithm based on neighborhood expansion. The participant parameters are updated, and the parameters are aggregated to generate a global aggregated model.
While protecting data privacy, the model's generalization ability and robustness are improved, the amount of data transmitted is reduced, data security is enhanced, and the model's accuracy and generalization ability are improved.
Smart Images

Figure CN116822621B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of federated learning technology, and more particularly to a data-augmented federated learning method. Background Technology
[0002] Federated learning technology unites various edge nodes as participants, training the model locally on each participant's machine. It aggregates and updates the global deep learning model by exchanging intermediate data (model parameters) rather than raw data, enabling the mining and utilization of data information scattered across various edge devices. This approach avoids the direct uploading of raw data, reducing the risk of privacy leaks; it also avoids uploading large amounts of raw data, reducing communication overhead. Federated learning methods include... Figure 1 As shown.
[0003] While federated learning overcomes the two major challenges of privacy and communication in distributed data mining, it still encounters numerous challenges in practical applications. Among these, the heterogeneity of data distribution (non-IID) is one of the most critical. Because each device operates in a different environment, the local data distribution differs from the overall data distribution. This leads to significant discrepancies in model updates during training, greatly reducing the efficiency and performance of federated learning. Figure 2 As shown, in non-IID scenarios, the performance of federated learning models degrades significantly compared to IID scenarios. Since non-IID scenarios are very common in reality, this further highlights the impact of heterogeneity issues.
[0004] Data augmentation is a way to increase data diversity and a common method to improve model training from a data perspective. MixUp is a typical example of this method, which generates new virtual samples by linearly combining pairs of existing samples, and then trains a better model based on these virtual samples. The specific method for constructing virtual samples is as follows:
[0005]
[0006] Where (x1,y1) and (x2,y2) are arbitrary sample pairs, α∈[0,1]. However, directly applying MixUp to a federated environment requires data sharing among the participants. For example, when performing a MixUp operation on participant 1, since the sample pairs are randomly selected, if (x1,y1) is a sample from participant 1 and (x2,y2) is a sample from participant 2, then (x2,y2) needs to be shared with participant 1. Therefore, MixUp is not suitable for a federated environment.
[0007] Another intuitive approach is called local MixUp, where each participant uses only their local data for data augmentation. However, in non-IID environments, the data from each participant differs significantly. Augmenting only local data does not introduce data from other participants to alleviate data heterogeneity issues and does not substantially improve the final model.
[0008] Currently, there is very little research on effective data augmentation specifically for federated learning environments. A typical example is FedMix, which applies MixUp to federated learning environments. However, it is only applicable to the cross-entropy loss function and has significant limitations. Summary of the Invention
[0009] This invention addresses the lack of effective data augmentation research specifically for federated learning environments. A typical example is FedMix, which applies MixUp to federated learning; however, it is only applicable to the cross-entropy loss function and has significant limitations. This invention proposes a data augmentation-based federated learning method, specifically including:
[0010] A data-augmented federated learning method, the method comprising:
[0011] Calculate the average sample size for each participant;
[0012] Construct an average sample set based on the average sample;
[0013] The participants send the average sample set to the server;
[0014] The server uses a MixUp-based federated learning algorithm with neighborhood expansion to train the samples in the sample set and the global model, and updates the parameters of the participants.
[0015] The updated participant parameters are aggregated to obtain the parameters of the global aggregation model.
[0016] Furthermore, a preferred method is also provided, wherein calculating the average sample for each participant includes:
[0017] The local data of the participants is divided, and the average sample of the participants after the division is calculated.
[0018] Furthermore, a preferred embodiment is provided, wherein the federated learning algorithm based on neighborhood expansion (MixUp) is used to train the samples in the sample set and the global model, and to update the participant parameters, including:
[0019] The FedM-UNE federated algorithm based on unilateral neighborhood expansion (MixUp) is used to calculate the loss function for the training samples:
[0020]
[0021] Where (x1,y1) is a single sample of participant 1 in the mini-batch B, (x2,y2) is an average sample randomly drawn from the average sample set, and the hyperparameter α represents the degree of mixing between (x1,y1) and (x2,y2).
[0022] The FedM-BNE federated learning algorithm based on bilateral neighborhood expansion (MixUp) is used to calculate the loss function L2(B) for the training samples:
[0023]
[0024] Update participant parameters based on FedM-UNE and FedM-BNE.
[0025] Furthermore, a preferred embodiment is provided, wherein the aggregation of the updated participant parameters to obtain the parameters of the global aggregation model includes:
[0026] Each participant sends its parameters to the server after training locally;
[0027] After receiving the parameters from all participants, the server performs an average operation on each parameter to obtain the average parameter.
[0028] The average parameters of all participants are weighted and averaged with equal weights to generate the parameters of the global aggregation model.
[0029] Based on the same inventive concept, the present invention also provides a data-augmented federated learning system, the system comprising:
[0030] The average sample acquisition unit is used to calculate the average sample for each participant.
[0031] An aggregation unit is used to construct an average sample set based on the average sample.
[0032] The sending unit is used by the participants to send the average sample set to the server.
[0033] The training unit is used by the server to train the samples in the sample set and the global model using the MixUp federated learning algorithm based on neighborhood expansion, and to update the parameters of the participants.
[0034] The output unit is used to aggregate the updated participant parameters to obtain the parameters of the global aggregation model.
[0035] Furthermore, a preferred embodiment is also provided, wherein the average sample acquisition unit includes:
[0036] The local data of the participants is divided, and the average sample of the participants after the division is calculated.
[0037] Furthermore, a preferred embodiment is also provided, wherein the training unit includes:
[0038] The loss function L1(B) of the training samples is calculated using the FedM-UNE federated algorithm based on unilateral neighborhood expansion (MixUp):
[0039]
[0040] Where (x1,y1) is a single sample of participant 1 in the mini-batch B, (x2,y2) is an average sample randomly drawn from the average sample set, and the hyperparameter α represents the degree of mixing between (x1,y1) and (x2,y2).
[0041] The FedM-BNE federated learning algorithm based on bilateral neighborhood expansion (MixUp) is used to calculate the loss function L2(B) for the training samples:
[0042]
[0043] Update participant parameters based on FedM-UNE and FedM-BNE.
[0044] Furthermore, a preferred embodiment is also provided, wherein the output unit includes:
[0045] Each participant sends its parameters to the server after training locally;
[0046] After receiving the parameters from all participants, the server performs a weighted average to generate the parameters for the global aggregation model.
[0047] Based on the same inventive concept, the present invention also provides a computer-readable storage medium for storing a computer program that executes a data-augmented federated learning method as described in any of the preceding claims.
[0048] Based on the same inventive concept, the present invention also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor runs the computer program stored in the memory, the processor executes a data augmentation-based federated learning method according to any one of the preceding claims.
[0049] The advantages of this invention are:
[0050] This invention addresses the current lack of effective data augmentation research specifically for federated learning environments. A typical example is FedMix, which applies MixUp to federated learning environments; however, it is only applicable to the cross-entropy loss function and has significant limitations.
[0051] This invention discloses a data-augmented federated learning method that reduces data volume and ensures data privacy during federated learning by calculating the average sample size of each participant's local data. This eliminates the need for participants to send their complete local data to the server, improving data security. An average sample set is constructed based on the average sample size calculated by each participant, introducing greater sample diversity into federated learning and contributing to improved generalization ability of the global model. By sending the average sample set to the server, participants share a portion of their local data information for joint training. Sending average samples instead of complete individual samples ensures data privacy. The server uses the average sample set sent by the participants and the global model for training. Upon receiving updated parameters from the participants, the server uses a parameter aggregation algorithm to aggregate these parameters, thereby achieving data augmentation.
[0052] This implementation achieves the core objective of federated learning. While protecting data privacy, it trains a high-performance model globally through collaboration among participating parties. By introducing techniques such as averaged sample sets and MixUp augmentation, it can utilize information from more samples, improving the model's accuracy and generalization ability.
[0053] This invention is applied in the field of communications. Attached Figure Description
[0054] Figure 1 A schematic diagram of the federated learning method described in the background technology;
[0055] Figure 2 This is a comparison chart of the accuracy of federated learning models under different data heterogeneities as described in the background technology.
[0056] Figure 3 This is a flowchart of a data augmentation-based federated learning method as described in Implementation Method 1.
[0057] Figure 4 This is a comparison diagram of MixUp-UNE and MixUp-BNE as described in Implementation Method Eleven, wherein... Figure 4 (a) is a schematic diagram of MixUp-UNE. Figure 4 (b) is a schematic diagram of MixUp-BNE;
[0058] Figure 5 This is a performance comparison chart of the classification task method described in Implementation Method Eleven;
[0059] Figure 6 This is a performance comparison chart of the regression task method described in Implementation Method Eleven;
[0060] Figure 7This is a diagram showing the experimental results of the FMNIST large-scale scene described in Implementation Method Eleven;
[0061] Figure 8 This is a diagram showing the experimental results of the CIFAR-10 large-scale scene described in Implementation Method Eleven;
[0062] Figure 9 The figure shows the experimental results of a large-scale scene using UTKFace as described in Implementation Method Eleven. Detailed Implementation
[0063] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments.
[0064] Implementation Method 1, see [link] Figure 3 This embodiment describes a data-augmented federated learning method, which includes:
[0065] Calculate the average sample size for each participant;
[0066] Construct an average sample set based on the average sample;
[0067] The participants send the average sample set to the server;
[0068] The server uses a MixUp-based federated learning algorithm with neighborhood expansion to train the samples in the sample set and the global model, and updates the parameters of the participants.
[0069] The updated participant parameters are aggregated to obtain the parameters of the global aggregation model.
[0070] This implementation reduces the amount of data and ensures data privacy in federated learning by calculating the average sample of each participant's local data. This eliminates the need for participants to send their complete local data to the server, improving data security. An average sample set is constructed based on the average sample calculated by each participant, introducing greater sample diversity into federated learning and improving the generalization ability of the global model. By sending the average sample set to the server, participants share a portion of their local data for joint training, ensuring data privacy by sending average samples rather than complete individual samples. The server uses the average sample set sent by the participants and the global model for training. The neighborhood-based MixUp method is a data augmentation technique that increases sample diversity and improves the model's robustness and generalization ability. After receiving updated parameters from the participants, the server uses a parameter aggregation algorithm to aggregate these parameters.
[0071] This implementation achieves the core objective of federated learning. While protecting data privacy, it trains a high-performance model globally through collaboration among participating parties. By introducing techniques such as averaged sample sets and MixUp augmentation, it can utilize information from more samples, improving the model's accuracy and generalization ability.
[0072] Implementation Method Two: This implementation method further defines the data-augmented federated learning method described in Implementation Method One. The calculation of the average sample for each participant includes:
[0073] The local data of the participants is divided, and the average sample of the participants after the division is calculated.
[0074] In practical applications, the local data of participating parties may exhibit differences in distribution, category distribution, and sample size, which can impact the training of federated learning models. By partitioning the local data of participating parties, the data can be grouped according to certain rules or algorithms, making the data obtained by each participant more balanced and representative. This can reduce model bias problems caused by data imbalance and improve the performance of the global model across different partitions.
[0075] Secondly, the local data of the participants may contain some noisy or outlier samples, which may negatively affect model training. Calculating the average sample size of each participant after splitting the data can smooth the data, help reduce the impact of individual outliers, and improve the model's robustness to noise.
[0076] This implementation partitions the local data of each participant, distributing the data volume across them and reducing the data volume and computational burden for each participant. This helps reduce the amount of data communicated between participants, improving the efficiency and scalability of federated learning. The average sample after partitioning better represents the characteristics of each participant's local data, and aggregating the average samples from multiple participants increases data diversity. This helps improve the robustness and generalization ability of the model, making it more adaptable to different data distributions.
[0077] This implementation method divides the local data of the participants and calculates the average sample size of each participant after the division. This optimizes data distribution, reduces data noise, improves federated learning efficiency, and increases model diversity and robustness. This step aims to improve the training process of federated learning and enhance model performance and reliability.
[0078] This implementation calculates the average sample for each participant, reducing the impact of data noise and imbalance. By averaging the local data of each participant, the influence of individual samples on model training is reduced, making the average sample more representative. Constructing an average sample set increases sample diversity, which helps improve the generalization ability of the global model.
[0079] Implementation Method 3: This implementation method further defines the data augmentation-based federated learning method described in Implementation Method 1. The method employs a neighborhood-expansion-based MixUp federated learning algorithm to train the samples in the sample set and the global model, and updates the participant parameters, including:
[0080] The loss function L1(B) of the training samples is calculated using the FedM-UNE federated algorithm based on unilateral neighborhood expansion (MixUp):
[0081]
[0082] Where (x1,y1) is a single sample of participant 1 in the mini-batch B, (x2,y2) is an average sample randomly drawn from the average sample set, and the hyperparameter α represents the degree of mixing between (x1,y1) and (x2,y2).
[0083] The FedM-BNE federated learning algorithm based on bilateral neighborhood expansion (MixUp) is used to calculate the loss function L2(B) for the training samples:
[0084]
[0085] Update participant parameters based on FedM-UNE and FedM-BNE.
[0086] Data privacy is a crucial consideration in federated learning. FedM-UNE and FedM-BNE utilize the MixUp technique to train and update models at the neighborhood and synthetic sample levels without sharing the original data. This approach helps reduce the risk of sensitive data leakage and protects the privacy of participating parties.
[0087] Through the MixUp technique of neighborhood expansion, FedM-UNE and FedM-BNE can generate new synthetic samples during training. These synthetic samples increase the diversity of the training data by interpolating features from the original samples and their neighboring samples. This helps improve the model's generalization ability, reduce the risk of overfitting, and promote performance improvement on different data distributions.
[0088] FedM-UNE and FedM-BNE utilize one-sided and two-sided neighborhood information to calculate the loss function for samples. This approach considers the similarity and neighborhood relationships between samples, enabling the model to better resist noise, outliers, and interference. Through improved robustness, the model can make more reliable predictions and decisions when faced with uncertainty and complex data.
[0089] FedM-UNE and FedM-BNE utilize the concept of federated learning to collaboratively train a global model by aggregating model updates from multiple participants. This collaboration leverages the local data and knowledge of each participant to improve model performance and learning outcomes. By updating participant parameters and sharing model knowledge, FedM-UNE and FedM-BNE promote mutual learning and iterative model optimization, thereby achieving better overall performance improvements.
[0090] This implementation employs FedM-UNE, a federated learning algorithm based on unilateral neighborhood expansion and MixUp, and FedM-BNE, a federated learning algorithm based on bilateral neighborhood expansion and MixUp, to improve data diversity, enhance model robustness, and improve model performance while protecting data privacy. These methods, combining neighborhood information, synthetic samples, and participant parameter updates, effectively address data privacy issues and improve the effectiveness and feasibility of federated learning. Furthermore, by calculating the loss function of the training samples and generating synthetic samples based on the neighborhood expansion MixUp technique, data diversity can be increased, overfitting reduced, and model robustness and performance improved. This contributes to improving the effectiveness of federated learning, enabling all participants to jointly train a better global model.
[0091] Implementation Method Four: This implementation method further defines the data augmentation-based federated learning method described in Implementation Method One. The aggregation of the updated participant parameters to obtain the parameters of the global aggregation model includes:
[0092] Each participant sends its parameters to the server after training locally;
[0093] After receiving the parameters from all participants, the server performs an average operation on each parameter to obtain the average parameter.
[0094] The average parameters of all participants are weighted and averaged with equal weights to generate the parameters of the global aggregation model.
[0095] In federated learning, each participant trains using local data. Since the data distributions among participants may differ, the model parameters trained by each participant may vary. When the server averages the parameters from all participants, it effectively merges multiple model parameters from different data distributions, thereby increasing data diversity. This data diversity benefits the model's generalization ability and robustness, reduces the risk of overfitting, and improves the model's performance across various data distributions.
[0096] Secondly, in federated learning, each participant may only possess partial data, and this data may have certain biases or peculiarities. By averaging the parameters of each participant and applying a weighted average with equal weights, the influence of a single participant on the global model can be mitigated. This averaging operation helps eliminate the imperfect data characteristics of individual participants or errors in model training, thereby improving the accuracy and robustness of the overall model.
[0097] This implementation of federated learning allows each participant to benefit from the knowledge and experience of others through model parameter sharing. When the server performs parameter fusion, all participants have equal weights, ensuring that their contributions are treated equally. By implementing a weighted average of the global model parameters, the knowledge of each participant is comprehensively considered in the final global aggregated model. This knowledge sharing and fusion helps improve the overall performance and generalization ability of the model.
[0098] This implementation method generates the parameters of the global aggregation model by averaging the parameters of the participating parties and then using a weighted average. Federated learning achieves data augmentation. This approach increases data diversity, reduces the influence of a single participant, and integrates the knowledge of all participants, thereby promoting improved model performance and enhanced generalization ability.
[0099] Implementation Method 5: A data-augmented federated learning system as described in this implementation method, the system comprising:
[0100] The average sample acquisition unit is used to calculate the average sample for each participant.
[0101] An aggregation unit is used to construct an average sample set based on the average sample.
[0102] The sending unit is used by the participants to send the average sample set to the server.
[0103] The training unit is used by the server to train the samples in the sample set and the global model using the MixUp federated learning algorithm based on neighborhood expansion, and to update the parameters of the participants.
[0104] The output unit is used to aggregate the updated participant parameters to obtain the parameters of the global aggregation model.
[0105] Implementation Method Six: This implementation method further defines the data-augmented federated learning system described in Implementation Method Five. The average sample acquisition unit includes:
[0106] The local data of the participants is divided, and the average sample of the participants after the division is calculated.
[0107] Implementation Method Seven: This implementation method further defines the data-augmented federated learning system described in Implementation Method Five. The training unit includes:
[0108] The loss function L1(B) of the training samples is calculated using the FedM-UNE federated algorithm based on unilateral neighborhood expansion (MixUp):
[0109]
[0110] Where (x1,y1) is a single sample of participant 1 in the mini-batch B, (x2,y2) is an average sample randomly drawn from the average sample set, and the hyperparameter α represents the degree of mixing between (x1,y1) and (x2,y2).
[0111] The FedM-BNE federated learning algorithm based on bilateral neighborhood expansion (MixUp) is used to calculate the loss function L2(B) for the training samples:
[0112]
[0113] Update participant parameters based on FedM-UNE and FedM-BNE.
[0114] Implementation Method Eight: This implementation method further defines the data-augmented federated learning system described in Implementation Method Five. The output unit includes:
[0115] Each participant sends its parameters to the server after training locally;
[0116] After receiving parameters from all participants, the server performs a weighted average to generate the parameters for the global aggregation model. The weights are typically proportional to the number of samples from each participant.
[0117] Implementation Method Nine: A computer-readable storage medium according to this implementation method, the computer-readable storage medium being used to store a computer program, the computer program executing a data-augmented federated learning method according to any one of Implementation Methods One to Four.
[0118] Implementation Method 10: A computer device according to this implementation method includes a memory and a processor. The memory stores a computer program. When the processor runs the computer program stored in the memory, the processor executes a data augmentation-based federated learning method according to any one of Implementation Methods 1 to 4.
[0119] Implementation Method 11, see below Figure 4 This embodiment describes a specific example of a data-augmented federated learning method as described in Embodiment 1. It also serves to explain Embodiments 2 through 4. Specifically:
[0120] First, assuming that data can be shared among the participants, for a certain participant (partner 1), data augmentation is performed according to formula (1) recorded in the background to obtain a new sample pair. Training is performed, where (x1, y1) represents local data and (x2, y2) represents data from another participant (participant 2). The loss function is... Let (x, y) = ((1-α)x1, (1-α)y1), (Δx, Δy) = (αx2, αy2). Will A Taylor expansion at the point (x, y) yields...
[0121]
[0122] Where o(α) 2 Let be a higher-order term of α, which can be ignored when α→0. If participant 1 receives a batch of samples (denoted as J) from participant 2, then the average loss of training (x1, y1) with samples from J after MixUp augmentation is:
[0123]
[0124] in
[0125]
[0126] As can be seen from equation (3), when calculating the loss, only the sample mean is needed to achieve the same effect as directly using the original samples of other participants (the operation of calculating the average is moved to...). Therefore, participant 2 only needs to transmit the sample mean, without transmitting the original sample.
[0127] In particular, there are no special requirements for the properties of the loss function in the derivation of equations (2) and (3), so this analysis is applicable to various loss functions. Compared with the FedMix method, which only targets the cross-entropy loss function (and some loss functions that satisfy linear decomposition), this invention has more universal characteristics.
[0128] As shown in equation (3), each participant only needs the average of the local samples of other participants, without needing the original samples, to achieve a MixUp mechanism similar to shared data. Let the total sample size of participant i be |D|. i |, the average number of shared samples is s i (s i <<|D i |), then the sample set D i Divided into s i By dividing the sample into portions and calculating the average sample value for each portion, we can obtain s. i The set of average samples is denoted as V. i Sharing these average samples with other participants achieves the MixUp mechanism of equation (3). During local training, a batch of samples B is randomly selected from the local dataset, and the average samples are shared from the set V = ∪V. i If we randomly select an average sample (x2, y2), the loss is calculated as follows:
[0129]
[0130] Here, α should be greater than 0 and close to 0 (e.g., α∈[0,0.5)). Since the augmented samples are all located between the original two samples in space and will not appear on the other side, we call it MixUp by Unilateral Neighborhood Expansion (MixUp-UNE). Based on this, this implementation proposes a federated algorithm FedM-UNE (Federated Learning based on MixUp-UNE) based on MixUp by Unilateral Neighborhood Expansion. When α=0, the algorithm degenerates into the original federated learning algorithm.
[0131] However, for some problems (such as regression problems), considering only one-sided neighborhoods is not comprehensive. Therefore, this implementation proposes an improvement using MixUp (MixUp-BNE): a bilateral neighborhood expansion.
[0132]
[0133] Where (x1, y1) and (x2, y2) are arbitrary sample pairs, and α ∈ (-0.5, 0.5) (the range of α is different from that in equation (4)). In this case, mixed data may be generated on both sides of (x1, y1). Regardless of where the generated data is located in Δ l Or Δ r The sample labels will be modified to some extent based on y2.
[0134] Under MixUp-BNE, the loss function also changes from equation (5) to
[0135]
[0136] The value of α can be positive or negative, but it is close to 0. In practice, we use the Beta distribution to generate α. Specifically, α' ~ Beta(b,b), where b>1, α=α'-0.5, so that the mean value of α is 0. The larger b is, the higher the probability that α is close to 0. Based on equation (7), we obtain the Federated Learning based on MixUp-BNE algorithm. The comparison diagram between MixUp-UNE and MixUp-BNE is shown below. Figure 4 As shown.
[0137] This implementation provides detailed validation of FedM-UNE and FedM-BNE in classification and regression tasks. Experiments on multiple datasets demonstrate that both methods effectively improve federated learning performance across various loss functions and data mining tasks without significantly increasing communication overhead.
[0138] This implementation simulates N participants with subsets of data having different distributions. Specifically, γ (0≤γ≤1) samples are randomly sampled from the dataset and evenly distributed among the N participants. Then, the remaining (1-γ) samples are sorted by label and divided into N parts, with each participant receiving one part. In this way, each participant's data contains samples of certain labels in proportion (1-γ) and samples of other labels in proportion γ. We denote this data partitioning method as γ-IID. Specifically, when γ = 1, the data is randomly assigned to each participant, degenerating into an IID data distribution scenario. When γ = 0, the data differences between participants are greatest, and this method becomes a completely non-IID scenario.
[0139] This implementation uses the FMNIST, CIFAR-10, and CINIC-10 datasets to verify the performance of the invention on classification problems. For FMNIST, a 5-layer MLP is used; for CIFAR-10 and CINIC-10, 2 convolutional layers and 3 MLP layers are used. The performance of the algorithm on regression problems is verified using the Airfoil Self-Noise, NO2, and UTKFace datasets. For the Airfoil Self-Noise and NO2 datasets, a CNN model with 2 convolutional layers is used; for the UTKFace dataset, the model consists of three stacked convolutional layers and three GroupNorm layers, output by a single MLP layer.
[0140] A federated learning environment with five participants was constructed using a non-IID data partitioning method. Figure 5 The results of different loss functions CE, RCE, GCE and MAE on FMNIST and CINIC-10 are shown. For FMNIST, a total of 100 updates were performed, with each participant training locally for 2 epochs. For CINIC-10, a total of 400 updates were performed, with each participant training locally for 5 epochs.
[0141] It can be seen that FedMix, FedM-UNE, and FedM-BNE (b<1) outperform FedAvg under cross-entropy loss, verifying the effectiveness of data augmentation in federated learning. Furthermore, the performance of these three methods is almost identical, as they are equivalent in principle. However, for the other three loss functions, FedMix's improvement over FedAvg is not significant, and may even degrade the model's performance. This is because FedMix only introduces MixUp into federated learning based on cross-entropy loss. However, the FedM-UNE and FedM-BNE (b<1) proposed in this invention can extend the scope of MixUp in federated learning to all loss functions.
[0142] Figure 6 The results of loss functions MAE, MSE, and Smooth L1 on Airfoil, NO2, and UTKFace are shown. In regression tasks, FedMix performs similarly to FedAvg, or even worse, because it is not suitable for the corresponding loss functions. Conversely, FedM-UNE and FedM-BNE outperform FedAvg on all loss functions, and MSE and Smooth L1 on Airfoil Self-Noise significantly outperform other methods. FedM-BNE (b<1) and FedM-UNE perform similarly due to their equivalence. FedM-BNE (b>1) performs best, demonstrating that bilateral neighborhood expansion is effective in regression tasks.
[0143] To demonstrate the performance of this invention in large-scale scenarios, this embodiment constructs a federated learning scenario with 50 clients on FMNIST. Unlike previous implementations where only a subset of participants are involved in each iteration, this embodiment allows 10% of participants to participate in updates each round, and increases the number of iteration rounds to 300. Figure 7As shown, under the CE loss condition, FedMix, FedM-UNE, and FedM-BNE (b<1) are all comparable and superior to FedAvg. For other loss functions, FedM-UNE and FedM-BNE (b<1) still outperform FedAvg, while FedMix is inferior to FedAvg (e.g., MAE) or the same as FedAvg (e.g., GCE). Furthermore, this implementation validated CIFAR-10 using a scenario with 100 participants, where 10 customers were randomly selected to participate in training in each round. The results are as follows. Figure 8 As shown.
[0144] This implementation also verifies the experimental effectiveness of the method in large-scale regression tasks. Figure 9 The results show a comparison of methods on UTKFace in a scenario with 100 participants, where 60 participants are randomly selected for training in each round. The results demonstrate that our methods FedMUNE, FedM-BNE(b<1), and FedM-BNE(b>1) outperform the other two baseline methods under all three loss functions. Overall, FedM-BNE(b>1) performs best, indicating that the data augmentation designed for the regression task is effective.
[0145] The technical solutions provided by the present invention have been described in further detail above with reference to the accompanying drawings in order to highlight their advantages and benefits, and are not intended to limit the present invention. Any modifications, combinations, improvements and equivalent substitutions of the present invention based on the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A federated learning method based on data augmentation, characterized in that, The method comprises: calculating the average sample of each participant; constructing an average sample set according to the average sample; the participant sends the average sample set to the server; the server trains the samples in the sample set and the global model using a federated learning algorithm based on neighborhood expansion MixUp, and updates the participant parameters; aggregating the updated participant parameters to obtain the parameters of the global aggregated model; the calculation of the average sample of each participant comprises: dividing the participant local data to calculate the average sample of the divided participant: Let the participants be i The total sample size is D i The average sample size shared by each participant is s i , The sample set D i is divided into s i parts, and the average sample of each part is obtained, resulting in s i average samples, and the set composed of them is denoted as V i These average samples are shared with other participants, and the MixUp mechanism is realized: wherein J is the number of samples of a batch received by participant 1 from participant 2, is a loss function, ; the training of the samples in the sample set and the global model using a federated learning algorithm based on neighborhood expansion MixUp, and the updating of the participant parameters, comprise: a federated algorithm, FedM-UNE, that computes the loss function of the training samples using MixUp based on one-sided neighborhood extension : wherein, , ) is a single sample in a small batch of participants, , ) is a certain average sample randomly drawn from the average sample set, and the hyperparameter represents the mixing degree of ( , ) and ( , ). A federated learning algorithm, FedM-BNE, based on MixUp with bilateral neighborhood expansion is used to compute a loss function for training samples : updating the participant parameters according to FedM-UNE and FedM-BNE.
2. The federated learning method based on data augmentation according to claim 1, characterized in that, the aggregation of the updated participant parameters to obtain the parameters of the global aggregated model, comprises: each participant sends its parameters to the server after local training; after receiving the parameters of all participants, the server performs weighted average to generate the parameters of the global aggregated model.
3. A federated learning system based on data augmentation, characterized in that, The system comprises: an average sample acquisition unit for calculating the average sample of each participant; an aggregation unit for constructing an average sample set according to the average sample; a sending unit for the participant to send the average sample set to the server; a training unit for the server to train the samples in the sample set and the global model using a federated learning algorithm based on neighborhood expansion MixUp, and update the participant parameters; an output unit for aggregating the updated participant parameters to obtain the parameters of the global aggregated model; the calculation of the average sample of each participant comprises: dividing the participant local data to calculate the average sample of the divided participant: Let the participants be i The total sample size is D i The average number of samples shared is s i , The sample set D i is divided into s i parts, and the average sample of each part is obtained, resulting in s i average samples, and the set is denoted as V i These average samples are shared with other participants, and the MixUp mechanism is realized: wherein J is the number of samples of a batch received by participant 1 from participant 2, is a loss function, ; the training of the samples in the sample set and the global model using a federated learning algorithm based on neighborhood expansion MixUp, and the updating of the participant parameters, comprise: a federated algorithm, FedM-UNE, that computes the loss function of the training samples using MixUp based on one-sided neighborhood extension : wherein, , ) is a single sample in a mini-batch of participants one, , is a certain average sample randomly drawn from the average sample set, the hyper-parameter represents the mixing degree of , and , ; A federated learning algorithm, FedM-BNE, based on MixUp with bilateral neighborhood expansion is used to compute a loss function for training samples : updating the participant parameters according to FedM-UNE and FedM-BNE.
4. The federated learning system based on data augmentation of claim 3, wherein, the output unit comprises: each participant sends its parameters to the server after local training; after receiving the parameters of all participants, the server performs weighted average to generate the parameters of the global aggregated model.
5. A computer readable storage medium, characterized in that, The computer readable storage medium is used to store a computer program, and the computer program executes the federated learning method based on data enhancement according to any one of claims 1-2.
6. A computer device, characterized by: including a memory and a processor, the memory stores a computer program, when the processor runs the computer program stored in the memory, the processor executes the federated learning method based on data enhancement according to any one of claims 1-2.
Citation Information
Patent Citations
Cross-modal retrieval method and system based on federal learning and data binary representation
CN115080801A