Dynamic aggregation federated learning system based on pruning and bidirectional quantization
Through pruning and bidirectional quantization technology, the dynamic aggregation federated learning system solves the problems of communication resource limitations and data heterogeneity in federated learning, improves the model convergence rate and training efficiency, and achieves efficient federated learning.
Patent Information
- Application Number
- CN202410966613.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-18
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2044-07-18
AI Technical Summary
When there are a large number of clients or large model parameters, the federated learning system is limited by communication resources and network connections, resulting in a heavy bandwidth burden, and data heterogeneity leads to poor model convergence rate and poor performance. Traditional methods increase the number of training wheels. Counting or limiting the number of clients cannot be effectively solved.
A dynamic aggregation federated learning system based on pruning and bidirectional quantization is adopted. The client receives global quantified weights for local model training and pruning, calculates the contribution value and quantified gradients and uploads them to the server. The server dynamically updates the global model weights and performs quantified delivery. The client performs the next round of training until the model converges.
The amount of transmission parameters is significantly reduced, and the dynamic weight allocation strategy optimizes parameter aggregation, improves the global model convergence rate and training efficiency, and achieves efficient training in a heterogeneous data environment.
Smart Images

Figure CN118863015A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of federated learning, and more specifically, the present invention relates to a dynamic aggregation federated learning system based on pruning and bidirectional quantization. Background Art
[0002] Federated learning (FL) is a new distributed machine learning paradigm that allows multiple clients to collaboratively train the global optimal model based on local data under the coordination of a central server. In each iteration cycle, the client independently trains the local model and regularly uploads the local parameters as updates to the server for aggregation operations. At the same time, the server optimizes and updates the global model, and then distributes the updated global model to the client for the next round of training. Since the above process does not require sharing the user's original data, it effectively overcomes the data island problem. Therefore, FL is widely used in many fields with high security requirements, such as computer vision, recommendation systems, traffic flow prediction, and smart cities. However, when there are a large number of clients or large model parameters, FL is limited by communication resources and network connections, which will generate a heavy bandwidth burden. In addition, the significant differences in client data distribution and quality cause some local parameters to deviate from the global convergence direction during training, seriously affecting the convergence rate and performance of the model.
[0003] Traditional federated learning methods reduce communication rounds by increasing the number of client training rounds or limiting the number of clients participating in training to reduce communication overhead and bandwidth requirements. However, this type of method requires receiving all local parameters before aggregation, which will result in a long communication delay.
[0004] The server aggregation method only performs weighted averaging based on the size of data uploaded by the client, ignoring the diversity of data distribution, resulting in the accumulation of biased parameters during the aggregation process, causing global model weight skewness and instability in model training. In order to solve data heterogeneity and promote model convergence, existing research mainly adopts a dynamic selection strategy, which only selects unbiased parameters consistent with the global convergence direction to participate in server aggregation. However, these selected parameters fail to fully reflect the characteristics of data distribution, making model training incomplete and inaccurate. Summary of the invention
[0005] The present invention provides a dynamic aggregation federated learning system based on pruning and bidirectional quantization, aiming to improve at least one of the above problems.
[0006] The present invention is implemented as follows: a dynamic aggregation federated learning system based on pruning and bidirectional quantization, the system comprising:
[0007] A dynamic aggregation federated learning system based on pruning and bidirectional quantization, characterized in that the system includes:
[0008] A set of clients and a server;
[0009] The client receives the global quantization weight sent by the server The global quantization weight As a local model m c The weight vector w is based on the local sample for the local model m c Perform training, prune the trained weight vector w, and then calculate the corresponding client's contribution value cv and quantized gradient And upload to the server;
[0010] The server receives the contribution value cv and quantized gradient uploaded by the client Use the contribution value cv as the aggregation weight and update the global model M G The global weight vector W is quantized to obtain the global quantized weight It is sent to each client, and the client performs the next round of training until the global model M G Converge or reach the required accuracy.
[0011] Furthermore, the client comes from the set of participants C t After quantizing the updated global weight vector W, the server randomly selects T clients as participants in each round according to the set ratio and puts them into the participant set C t .
[0012] Furthermore, client c has local model m c The convolution kernels of each convolution layer are ranked by importance, and the current local model m is pruned according to the preset model pruning rate pr. c Pruning is performed, that is, the weights of the convolution kernels with low importance in each layer are reset to zero.
[0013] Furthermore, the importance of convolution kernels of each layer is ranked based on their importance scores, where the importance score of the convolution kernel is the sum of the L1 norm and the gradient of the convolution kernel.
[0014] Furthermore, based on the preset model pruning rate pr, the pruning rate pr-1 of each convolutional layer l is set. The method for determining the pruning rate pr-1 of each convolutional layer l is as follows:
[0015] Get the local model m through the test set c The initial accuracy αp 0 , for the lth convolution layer, after removing the convolution kernels with lower importance in a set ratio, update the local model m c The precision is αp l And the precision difference Δαp l =αp l -αp 0, estimate the lth convolution layer to remove a convolution kernel for the local model m c Average loss of precision Determine the number of convolution kernels to be pruned at each layer, so that the loss of local model accuracy caused by pruning each layer is basically the same. The loss of local model accuracy caused by pruning the lth convolution layer is the sum of the convolution kernel pruning data of the lth convolution layer and the average loss. The product of .
[0016] Furthermore, the contribution value cv of client c c The calculation formula is as follows:
[0017] cv c =ds c *dc c
[0018] Among them, dc c is the local model m c The remaining weight vector w after pruning c and the corresponding global quantization weight of the previous round The data correlation between ds c is the sample size of client c, that is, the sample size of client c accounts for the total sample size of the participant set C t The ratio of the total number of client samples in .
[0019] Furthermore, data correlation dc c is the weight vector w after the current round of pruning in client c c and the global quantization weight of the previous round The number of weight parameters with consistent directions and the weight vector w c Ratio of the total number of weight parameters Right now:
[0020]
[0021] Where n is the weight vector w c The total number of weight parameters in .
[0022] Furthermore, the update formula of the global weight vector is as follows:
[0023]
[0024] Among them, W t+1 , W t The global model M G The weight vector in the next round and the current round, It is the contribution value and quantized gradient uploaded by client c in the current round.
[0025] Furthermore, the global model M GThe loss function F(W) is as follows:
[0026]
[0027] Among them, N represents the total number of samples of all clients, N c represents the sample size of client c, w c 、F c (w c ) represent the weight parameters of client c and local model m respectively c The objective function of .
[0028] The present invention proposes a dynamic aggregation federated learning system based on pruning and bidirectional quantization. The client constructs a lightweight local model through pruning and quantization methods, which significantly reduces the amount of parameters transmitted subsequently; the server adopts a dynamic weight allocation strategy to optimize parameter aggregation according to the data scale and correlation of the client, reduce the weight of deviation parameters, and accelerate the convergence rate of the global model. Finally, the new round of global model is quantized to further improve the overall training efficiency, so that the model can be efficiently trained in a data heterogeneous environment. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] Figure 1 A schematic diagram of the structure of a dynamic aggregation federated learning system based on pruning and bidirectional quantization provided in an embodiment of the present invention;
[0030] Figure 2 There are two types of partitioning of the MNIST data set provided in the embodiment of the present invention, where (a) is IID data and (b) is Non-IID;
[0031] Figure 3 Different model accuracies on IID data provided by the embodiments of the present invention, where (a) is the LeNet-5 model on the MNIST dataset, (b) is the ResNet-20 model on the CIFAR-10 dataset, and (c) is the VGG-16 model on the CIFAR-10 dataset;
[0032] Figure 4 Different model accuracies on Non-IID data provided by the embodiments of the present invention, where (a) is the LeNet-5 model on the MNIST dataset, (b) is the ResNet-20 model on the CIFAR-10 dataset, and (c) is the VGG-16 model on the CIFAR-10 dataset;
[0033] Figure 5 Compression effects of different algorithms provided by the embodiments of the present invention, where (a) represents different model sizes and (b) represents different FLOPs. DETAILED DESCRIPTION
[0034] The specific implementation modes of the present invention are further explained in detail below by describing the embodiments with reference to the accompanying drawings, so as to help those skilled in the art to have a more complete, accurate and in-depth understanding of the inventive concept and technical solution of the present invention.
[0035] Figure 1 A structural diagram of a dynamic aggregation federated learning system based on pruning and bidirectional quantization provided in an embodiment of the present invention. For ease of explanation, only the part related to the embodiment of the present invention is shown. The system includes:
[0036] A group of clients and a server. The same model is integrated on both the client and the server. The model on the client is trained based only on local parameters, called a local model. The model on the server updates the weights based on the parameters uploaded by each client, called a global model.
[0037] Client c receives the global quantization weight sent by the server The global quantization weight As a local model m c The weight vector w is based on the local sample for the local model m c After training, the trained weight vector w is pruned and the contribution value cv and quantized gradient are calculated. And upload to the server;
[0038] Client c obtains the gradient value g of the current round c And the gradient value g is quantized by stochastic gradient quantization method c Quantize and obtain quantized gradient
[0039] The server receives the contribution value cv and quantized gradient uploaded by each client Use the contribution value cv as the aggregation weight and update the global model M G After the global model is updated, the global weight vector W of the global model is quantized to obtain the global quantized weight It is sent to each client, and the client performs the next round of training until the global model M G Converge or reach the required accuracy.
[0040] In round 0, server S initializes the global model and the global parameter W 0 , and distributes it to all clients. In each subsequent training, server S randomly selects T clients according to the set ratio (10%) to form the participant set C t , the server sends the global quantized weight of the current global model to the participant set C t The client in the set of participants Ct Client c in the process sends local sample set d according to batch sample size B c Divide into several batches, and use each batch of samples to receive the global quantization weights The local model is trained.
[0041] In the embodiment of the present invention, the client c performs a local model m c The weight vector of the lth convolutional layer in Prune to achieve model sparseness. First, sort the importance of the convolution kernels of the corresponding layer, and then prune the current local model m according to the preset model pruning rate pr. c Prune the convolution kernels with low importance, that is, reset the weights of the convolution kernels to zero, so that these convolution kernels will not participate in the local model m. c The following is an update of the local model m c The pruning process is explained by taking the pruning of the lth convolutional layer in as an example. If the local model m c There are n convolution kernels in the lth convolution layer, so the local model m c The weight of the convolution kernel in the lth convolution layer is The L1 norm of the convolution kernel is in, Calculate the gradient of each convolution kernel at the same time The gradient of the convolution kernel is obtained by derivatizing the loss function with respect to the weight of the convolution kernel, that is, Among them, F c is the loss function of client c. The sum of the L1 norm and the gradient value of the convolution kernel is used as the importance score. Based on the preset model pruning rate pr, the weights of the m convolution kernels with low importance scores are reset to zero.
[0042] In the embodiment of the present invention, in order to balance the accuracy loss during multi-layer pruning, before performing the pruning operation, the pruning rate pr-1 of each convolutional layer l is set based on the preset model pruning rate pr to ensure that the impact of the convolution kernel pruned from each convolutional layer on the local model accuracy is roughly equal. In the subsequent pruning process, the pruning amount is determined based on the pruning rate pr-1 of each layer. The method for determining the pruning rate pr-1 of each convolutional layer l is as follows:
[0043] Get the initial local model m through the test set c The precision of αp 0 , for the lth convolutional layer, after removing the convolution kernels with a set proportion (60%) of lower importance, the local model m is updated c The precision is αp l And the precision difference Δαp l , Δαp l Divide by the number of convolution kernels at the set ratio (60%) of this layer, and estimate the effect of cutting off one convolution kernel in the lth convolution layer on the local model mc Average loss of precision Determine the number of convolution kernels pruned from each layer, so that the loss of local model accuracy due to pruning each layer is basically the same. The loss of local model accuracy due to pruning the lth convolution layer is the sum of the number of convolution kernels pruned from the lth layer and the average loss. The product of .
[0044] In this embodiment of the present invention, the participant set C t The client sample size set in DS = {ds 1 ,ds 2 ,...,ds T}, sample size ds c The sample size of client c accounts for the participant set C t The ratio of the total number of client samples in the local model m is introduced into formula (1) to measure the local model m c The pruned weight vector w c With the global quantization weight of the previous round The data correlation between the last round of global quantization weights The global quantization weight sent by the server is used as the local model m c The initial weight vector w for the current round c , if the weight vector w after the current round of pruning c and the global quantization weight of the previous round The direction is consistent, then Otherwise it is 0. Participant Set C t The client set in is DC = {dc 1 ,dc 2 ,...,dc T}, data dependency dc of client c c is the weight vector w after the current round of pruning in client c c and the global quantization weight of the previous round The number of weight parameters with consistent directions and the weight vector w c (The global quantization weight of the previous round )The ratio of the total number of weight parameters A higher ratio indicates that there are fewer deviation parameters in client c.
[0045]
[0046] Where n is the weight vector w c Or the total number of weight parameters of the last round of global quantization weight W. At this time, the contribution value cv of client c c The calculation formula is as follows:
[0047] cv c =ds c*dc c (2).
[0048] Participant Set C t Each client in the current round contributes its contribution value cv c and quantized gradient Upload to the server.
[0049] The server detects the set of participants C t Are the data sizes of all clients in the same? If so, let the contribution value cv c As the aggregation weight, the client's contribution value cv c Data correlation dc c When the client data scale is different, the server considers both data scale and data relevance and takes the product of the two as the contribution value cv c To ensure that the weight distribution is reasonable, we need to aggregate the weights of the participants C. t The contribution values of all clients in the set C are normalized so that t The sum of the weights of all clients in is equal to 1.
[0050] By analyzing the size and relevance of the data uploaded by the client, the aggregation weight is dynamically allocated, the aggregation deviation parameters are accurately optimized, the global weight offset is prevented, and the global model is ensured to converge smoothly and quickly when multiple data sources are aggregated. t The contribution value cv of all clients in c Update the global model M G Weight vector W t →W t+1 , get the global weight vector W for the next round t+1 , the update formula is as follows:
[0051]
[0052] Among them, W t is the global model M G The weight vector in the current round, is the contribution value and quantized gradient uploaded by client c in the current round, and then the global weight vector W of the next round is quantized by the three-value quantization method. t+1 Quantize, and obtain the global quantization weight At the same time, randomly select T participating clients and put them into the participant set C t , the global quantization weight Sent to participant set C t All clients in the.
[0053] Although pruning operations can significantly reduce the size of the local model, the communication burden during the transmission phase is still too heavy. The client and the server need to further quantize the model parameters to reduce the communication overhead. The present invention uses a two-way quantization method to achieve model compression at both the global and local levels, and adopts a differential quantization strategy for weights and gradients to reduce information loss and optimize the model performance. The client quantizes the local gradients and transmits them to the server, and the server quantizes the updated global weights and distributes them to randomly selected clients.
[0054] In the embodiment of the present invention, the loss function F(W) of the global model M G is specifically as follows:
[0055]
[0056] where N represents the total number of samples of all clients, N c is the sample size of client c, w c , F c (w c ) represent the weight parameters of client c and the objective function of the local model m c respectively. When the loss value calculated by the loss function and its model training accuracy curve converge or the recognition accuracy of the global model M G reaches the required accuracy requirement, the training stops.
[0057] Suppose the neural network with only one hidden layer has a total of N parameters, the batch size is B, and each client only performs one mini-batch training per round. The time complexity of uploading local parameters to the server is ignored. The time complexity of FedAvg is O(NB). The time complexity of the dynamic aggregation federated learning algorithm based on pruning and two-way quantization (abbreviated as FL-STMV) proposed by the present invention mainly includes the following three key components: The time complexity of multi-metric pruning based on model parameters for one parameter evaluation and sorting is O(N + NlogN); the time complexity of quantizing the sparse model is O(N′), where N′ is the remaining number of parameters after pruning, and O(N′) < O(N); the time complexity of calculating the contribution value of the client is O(N′). Considering comprehensively, the total time complexity of FL-STMV on each client can be expressed as: O(N(1 + logN) + 2N′).
[0058] The average time complexity of FedAvg on the server side is O(lCN), where l represents the client participation rate, C is the total number of clients, and lC ≥ 1. The time required for FL-STMV to dynamically weighted aggregate according to the contribution value of the client is also O(lCN). Finally, the time complexity of quantizing the global weights is O(N). The total time complexity of FL-STMV on the server side is O(N(1 + lC)).
[0059] The experiment includes 100 clients and 1 server. 10% of the clients are randomly selected in each round to train the model on two widely used public datasets, MNIST and CIFAR-10. MNIST is a 28×28 grayscale handwritten digit image dataset with 10 categories, divided into 60,000 training images and 10,000 test images. CIFAR-10 contains 10 categories of 32×32 color image labeled samples, 6,000 images per category, of which 50,000 are used for training and 10,000 are used for testing.
[0060] LeNet-5 was selected as the training model for MNIST. The model has 2 convolutional layers and 3 fully connected layers, with a total of about 60,000 parameters, which is suitable for simple image recognition tasks. For the more complex CIFAR-10, two network models, ResNet-20 and VGG-16, were selected. ResNet-20 is a deep residual network with 6 residual blocks. Each residual block consists of 3 convolutional layers and a jump connection, with a total of about 270,000 parameters. VGG-16 includes 13 convolutional layers and 3 fully connected layers, with a total of about 138 million parameters.
[0061] The training samples of MNIST and CIFAR-10 are divided into two types: independent and identically distributed (IID) and non-independent and identically distributed (Non-IID). The test samples are kept independent for accurate evaluation of model performance. Taking MNIST as an example, the specific distribution is as follows: Figure 2 As shown, the y-axis represents the number of samples and the z-axis represents the sample categories (10 categories in total). The division process is described in detail below.
[0062] (1) IID data: To simulate the real data distribution and ensure the randomness and independence of samples, we randomly shuffle the order of samples in the dataset and appropriately distribute the samples by category to meet the requirement that each client holds the same category and amount of data.
[0063] (2) Non-IID data: The client randomly extracts samples of different numbers and categories according to the distribution ratio k of each category in the data set, thereby simulating the heterogeneity of data distribution in reality. k represents the number of sample categories held by each client, and the experiment sets k = 5.
[0064] In addition, the present invention selects three mainstream algorithms that are most relevant to the proposed FL-STMV as benchmarks:
[0065] (1) FedAvg is a federated learning FL algorithm without any improvement; (2) The FTTQ algorithm only uses quantization to reduce the amount of data transmitted in the uplink and downlink; (3) The GWEP algorithm combines the two compression methods of pruning and quantization into model training.
[0066] The experiments were conducted on an Ubuntu 18.04 system equipped with an Intel Ultra9-185H CPU, an RTX 4060 GPU, and 16GB RAM. All models were built and trained using the Python language under the Tensorflow framework. Table 1 shows the models selected for the experiment and their parameter settings.
[0067] Table 1 Model and parameter settings
[0068]
[0069] This section uses the above four algorithms to compare the test accuracy of three models (local model and global model) LeNet-5, ResNet-20 and VGG-16 on MNIST and CIAFR-10. 100 rounds of iterative training are performed on the two data distribution types of IID and Non-IID, and each client is trained locally for 5 rounds in each iteration. The cross entropy loss function is used to evaluate the model performance. The pruning threshold pr and the number of quantization bits are set to 0.6 and 8 respectively. It is found from the experiment that the model can be effectively simplified and the accuracy is maintained at this time. The performance of each algorithm under different data sets and data distributions is analyzed in detail.
[0070] (1) Accuracy on IID data
[0071] On MNIST and CIFAR-10, each client stores a certain number of training samples. The four algorithms are iteratively trained on IID data. The accuracy curves of LeNet-5, ResNet-20, and VGG-16 models on the test set are shown in the figure below. Figure 3 The detailed test accuracy is shown in Table 2.
[0072] Table 2 Detailed model accuracy
[0073]
[0074] from Figure 3As can be seen from Table 2, FL-STMV performs best when training the LetNet-5 model on MNIST, with a test accuracy of up to 94.74%, which is 1.83% and 3.19% higher than the accuracy of GWEP and FTTQ. In addition, FL-STMV can reach a stable state in only about 60 rounds, while GWEP and FTTQ need 90 rounds to reach a similar level of convergence. This is mainly attributed to the fact that the pruning and quantization process takes into account multiple factors and finely controls the loss of model accuracy. Similarly, when training the ResNet-20 model on CIAFR-10, FL-STMV has a higher test accuracy than FedAvg and the other two compression algorithms, and converges the fastest. Although the accuracy of the VGG-16 model is slightly lower than that of FedAvg, FL-STMV reaches the required accuracy faster, significantly reducing the communication cost. In summary, FL-STMV can not only significantly improve the efficiency of model training, but also maintain a high accuracy.
[0075] (2) Accuracy on Non-IID Data
[0076] When k is less than the total number of classes in the training dataset, the local data of the client satisfies Non-IID. At this time, the union of all client data is the entire dataset, but the number of data classes contained in each client is not equal to the total number of classes in the dataset, and the data between different clients partially overlaps. Figure 4 The model accuracy curves of the four algorithms on the Non-IID dataset are shown, and the detailed test accuracy is shown in Table 3.
[0077] Table 3 Detailed model accuracy
[0078]
[0079] Figure 4It can be seen that when k = 5, FL-STMV improves the accuracy of 1.05% and 2.4% on MNIST compared with GWEP and FTTQ, respectively, and the accuracy loss between FL-STMV and FedAvg is negligible. This is mainly attributed to the optimization of the aggregation process by FL-STMV, and the dynamic aggregation strategy effectively accelerates the training process without losing model accuracy. When training the other two models on CIAFR-10, FL-STMV performs best, and the test accuracy of ResNet-20 and VGG-16 reaches 91.17% and 88.18%, respectively, which are better than GWEP and FTTQ. In terms of convergence speed, FL-STMV is also better than GWEP and FTTQ, further proving its effectiveness and efficiency on Non-IID datasets. The model compression effects of different algorithms are comprehensively evaluated using two key indicators, model size and FLOPs. Among them, model size directly reflects the storage space occupied by each model during training and the number of parameters it contains, while FLOPs effectively measures the amount of computation required to train the model. The intermediate variables generated during training are ignored. Since the number of layers and structural complexity of the LeNet-5 model are significantly different from those of the other two models, the size of the LeNet-5 and ResNet-20 models is in MB, while that of VGG-16 is in GB. Similarly, the computational effort of LeNet-5 is expressed in FLOPs, while that of ResNet-20 and VGG-16 models is expressed in GFLOPs. Figure 5 The memory size and FLOPs required for a single client to train three models under different algorithms are intuitively shown.
[0080] like Figure 5 As shown in (a), the memory usage of the dense model obtained by FedAvg is as high as 2.06GB, which has a high storage burden. The compression effect of FTTQ and GWEP is limited, and the model size can only be compressed to about 1 / 5 of its original size. FL_STMV is significantly better than the above two methods, achieving a compression effect of about 17.1 times, which shows that each model has too many redundant parameters. Figure 5 (b) shows that the amount of computation required by FedAvg to train the VGG-16 model is as high as 15.5GFLOPs. For resource-constrained clients, the high computational requirements lead to a slow training process. The FL_STMV algorithm reduces the computational complexity by at least 15.2 times, greatly reducing the resource consumption of the client. In addition, the compression process should follow clear metrics. Blindly reducing the model size will result in significant accuracy loss.
[0081] The experiment sets the test accuracy target of the LeNet-5 model on MNIST to 85%, and the test accuracy target of the ResNet-20 and VGG-16 models on CIFAR-10 to 80%. The number of communication rounds and the average training time required for each round when the training model uses the four algorithms to achieve the preset accuracy are observed. The specific results are shown in Table 4.
[0082] Table 4. Number of communication rounds and time required for different algorithms to achieve preset accuracy
[0083]
[0084] From the data in Table 4, when training the LeNet-5 model, FL-STMV and FedAvg reach the preset accuracy in a similar time, but the number of communication rounds of FL-STMV is significantly less than that of the other three algorithms, which is mainly attributed to the dynamic aggregation strategy that accelerates model convergence. On the more complex CIFAR-10, although the number of communication rounds and time required for the four algorithms to reach the target accuracy increased significantly, FL-STMV still maintained a high training efficiency, especially when training the VGG-16 model, its number of communication rounds was reduced by 22 and 24 rounds respectively compared with GWEP and FTTQ. These results show that FL-STMV effectively reduces communication costs while maintaining high efficiency.
[0085] In order to improve the communication constraints faced during the transmission process and the model weight deviation caused by data heterogeneity, this paper proposes a system resource-friendly and efficient communication FL algorithm FL-STMV, which improves the generalization ability of the model under different data distributions by pruning model redundant parameters, quantizing transmission data, and dynamically allocating aggregation weights to the client. At the same time, it realizes the effective utilization of client resources and efficient processing of data transmission. Experimental data on two public datasets show that FL-STMV is superior to the comparison algorithm in terms of training efficiency and performance, and the model accuracy is not significantly lost.
[0086] The present invention has been described exemplarily. Obviously, the specific implementation of the present invention is not limited to the above-mentioned method. As long as various non-substantial improvements are made using the method concept and technical solution of the present invention, or the concept and technical solution of the present invention are directly applied to other occasions without improvement, they are all within the protection scope of the present invention.
Claims
1. A dynamic aggregation federated learning system based on pruning and bidirectional quantization, characterized in that: The system comprises: A set of clients and a server; The client receives the global quantization weight sent by the server The global quantization weight As a local model m c The weight vector w is based on the local sample for the local model m c Perform training, prune the trained weight vector w, and then calculate the corresponding client's contribution value cv and quantized gradient And upload to the server; The server receives the contribution value cv and quantized gradient uploaded by the client Use the contribution value cv as the aggregation weight and update the global model M G The global weight vector W is quantized to obtain the global quantized weight It is sent to each client, and the client performs the next round of training until the global model M G Converge or reach the required accuracy.
2. The dynamic aggregation federated learning system based on pruning and bidirectional quantization as claimed in claim 1, characterized in that: The client comes from the set of participants C t After quantizing the updated global weight vector W, the server randomly selects T clients as participants according to the set ratio in each round and puts them into the participant set C t .
3. The dynamic aggregation federated learning system based on pruning and bidirectional quantization as claimed in claim 1, characterized in that: Client c has access to local model m c The convolution kernels of each convolution layer are ranked by importance, and the current local model m is pruned according to the preset model pruning rate pr. c Pruning is performed, that is, the weights of the convolution kernels with low importance in each layer are reset to zero.
4. The dynamic aggregation federated learning system based on pruning and bidirectional quantization as claimed in claim 3, characterized in that: The importance of convolution kernels in each layer is ranked based on their importance scores, where the importance score of the convolution kernel is the sum of the L1 norm and the gradient of the convolution kernel.
5. The dynamic aggregation federated learning system based on pruning and bidirectional quantization as claimed in claim 3, characterized in that: The pruning rate pr-1 of each convolutional layer l is set based on the preset model pruning rate pr. The method for determining the pruning rate pr-1 of each convolutional layer l is as follows: Get the local model m through the test set c The initial accuracy αp0 of the lth convolution layer is αp0, and after removing the convolution kernels with lower importance in the set ratio, the local model m is updated. c The precision is αp l And the precision difference Δαp l =αp l -αp0, estimates the local model m of the lth convolutional layer by pruning a convolution kernel c Average loss of precision Determine the number of convolution kernels to be pruned at each layer, so that the loss of local model accuracy caused by pruning each layer is basically the same. The loss of local model accuracy caused by pruning the lth convolution layer is the sum of the convolution kernel pruning data of the lth convolution layer and the average loss. The product of .
6. The dynamic aggregation federated learning system based on pruning and bidirectional quantization as claimed in claim 3, characterized in that: The contribution value cv of client c c The calculation formula is as follows: cv c =ds c *dc c Among them, dc c is the local model m c The remaining weight vector w after pruning c and the corresponding global quantization weight of the previous round The data correlation between ds c is the sample size of client c, that is, the sample size of client c accounts for the total sample size of the participant set C t The ratio of the total number of client samples in .
7. The dynamic aggregation federated learning system based on pruning and bidirectional quantization as claimed in claim 6, characterized in that: Data Dependency c is the weight vector w after the current round of pruning in client c c and the global quantization weight of the previous round The number of weight parameters with consistent directions and the weight vector w c Ratio of the total number of weight parameters Right now: Where n is the weight vector w c The total number of weight parameters in .
8. The dynamic aggregation federated learning system based on pruning and bidirectional quantization as claimed in claim 6, characterized in that: The update formula of the global weight vector is as follows: Among them, W t+1 , W t The global model M G The weight vector in the next round and the current round, It is the contribution value and quantized gradient uploaded by client c in the current round.
9. The dynamic aggregation federated learning system based on pruning and bidirectional quantization as claimed in claim 1, characterized in that: Global Model M G The loss function F(W) is as follows: Among them, N represents the total number of samples of all clients, N c represents the sample size of client c, w c 、F c (w c ) represent the weight parameters of client c and local model m respectively c The objective function of .
Citation Information
Patent Citations
Deep neural network compression method based on joint dynamic pruning
CN112613610A
Federal learning method based on dynamic adjustment model aggregation weight
CN113112027A
Federal learning model compression method based on model rarefaction and weight quantization
CN113222179A
CAV decision-making method applying selective federated learning
CN115660113A
Federal learning-oriented model pruning method and system
CN115983366A
Cited By
Dish identification optimization method based on parameter offset
CN119323717A
A dish recognition optimization method based on parameter offset
CN119323717B
Lightweight processing method for digital twin model
CN119556571A
Traffic flow prediction method based on combination of channel pruning and network quantification
CN120071641A
Communication optimization method and system for quantum federal learning
CN121418308A
