Federal learning method for adaptive evolution pruning strategy

Through the adaptive evolutionary pruning strategy, a personalized subnet network is constructed, which solves the problems of data heterogeneity and model heterogeneity in traditional federated learning, improves model performance and communication efficiency, and adapts to the specific needs of each client.

CN118657194APending Publication Date: 2024-09-17YANTAI ENG & TECH COLLEGE YANTAI TECHNICIAN INST
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202410760167.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-13
Publication Date
2024-09-17

AI Technical Summary

Technical Problem

Traditional federated learning methods face challenges in handling data heterogeneity and model heterogeneity, resulting in degraded model performance and increased communication costs.

Method used

Adopting an adaptive evolutionary pruning strategy, by constructing a parameterized supernet network and initial subnet chromosomes, feature map encoding and structured pruning are performed. Each client updates the subnet network based on local data, and the server performs model parameter aggregation and Global feature updates enable personalized models and reduce communication costs.

Benefits of technology

It improves the local personalization and generalization capabilities of the model, reduces computing and storage resource requirements, optimizes global and local performance, and adapts to the specific data distribution and resource constraints of each client.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118657194A
    Figure CN118657194A
Patent Text Reader

Abstract

The invention relates to the technical field of federated learning, in particular to a federated learning method for a self-adaptive evolution pruning strategy, which learns various private data distribution of all clients by deploying a parameterized hypernet network at a server side, and establishes a subnet adapted to the private data distribution of each client at the same time. The subnet size is reduced through the structured pruning method, the communication cost is reduced, and the local individuation degree of the model is improved. Each client can automatically update subnet chromosome codes according to local data so as to adaptively adjust a model structure. By means of the design, the model can better meet the specific requirements of all clients, and meanwhile the requirements for calculation and storage resources are reduced. In addition, the server updates the global model by integrating the input of all the clients, and the generalization ability and robustness of the model are enhanced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of federated learning, and in particular to a federated learning method of an adaptive evolutionary pruning strategy. Background Art

[0002] In the context of federated learning, multiple clients collaborate, each with its own private dataset that is stored and processed locally. The main goal in this setting is to learn a global model that can effectively learn from datasets that are distributed across clients.

[0003] The current traditional federated learning methods have data heterogeneity and model heterogeneity problems. The data heterogeneity problem is that in a federated learning environment, different clients have different data sets, showing a high degree of statistical heterogeneity. This difference in data distribution poses a challenge to training an efficient and generalizable global model. Since the data distribution of each client may be significantly different, traditional federated learning methods face challenges in dealing with these heterogeneities, which can easily lead to performance degradation of the model on some clients. The model heterogeneity problem is that each client may have different computing and storage capabilities, and it is necessary to consider the resource limitations of each client while maintaining model performance. In addition, differences in computing and storage capabilities of clients also limit the scale and complexity of the model and increase communication costs. Summary of the invention

[0004] In view of the above problems, this application provides a federated learning method with an adaptive evolutionary pruning strategy, which aims to solve the key challenges faced in traditional federated learning, namely statistical heterogeneity and model heterogeneity.

[0005] The present application provides a federated learning method of an adaptive evolutionary pruning strategy, including:

[0006] Constructing a supernet network and an initial subnet chromosome, wherein the supernet network is an over-parameterized network;

[0007] Performing feature graph encoding on the supernet network to obtain a plurality of encoded feature graphs;

[0008] The server sends the supernet network, the initial subnet chromosome, the feature map and the encoding of the feature map to multiple clients;

[0009] For each of the clients, structured pruning is performed on the feature graph according to the initial subnet chromosome to obtain a personalized subnet network, local data is input into the subnet network for training to obtain a feature graph of the subnet network, the encoding of the received feature graph is updated based on the feature graph of the subnet network, and the feature graph of the subnet network and the updated encoding of the feature graph are sent to the server;

[0010] The server aggregates supernet network model parameters based on the characteristic graphs of the subnet networks of the multiple clients and the codes of the updated characteristic graphs, and updates the supernet network model weights of the multiple clients based on the result of parameter aggregation;

[0011] For each of the clients, a subnet chromosome is updated based on an iterative optimization algorithm, the feature graph is restructured and pruned according to the updated subnet chromosome, and the encoding of the feature graph is updated again based on the result of the restructured pruning;

[0012] The codes of the re-pruned feature maps and the re-updated feature maps of the multiple clients are sent to the server to realize global feature aggregation of federated learning; the server sends the aggregated global features to the multiple clients again, and the multiple clients extract features according to the local feature map codes and restart new training until the federated learning training is completed.

[0013] In a possible implementation, the initial subnet chromosome is obtained based on a convolutional neural network, the multiple genes of the initial subnet chromosome are structured pruning rates of multiple convolutional layers and multiple fully connected layers of the convolutional neural network, and the gene length L of the initial subnet chromosome is the number of layers N of the convolutional layer of the convolutional neural network. c The number of fully connected layers N f sum.

[0014] In a possible implementation manner, the step of performing structured pruning on the feature graph according to the initial subnetwork chromosome includes:

[0015] The importance index is calculated for each feature map, and the calculation formula of the importance index is as follows:

[0016]

[0017] Among them, I l,k is the importance index of the kth feature map in the lth layer, Y is the output of the supernet network, X l,k,i is the i-th element of the k-th feature map of the l-th layer;

[0018] For each feature graph, when the importance index of the feature graph is less than a pruning threshold, the feature graph is pruned; the pruning threshold is a preset value or is determined based on the importance indexes of a plurality of the feature graphs;

[0019] Retrain or fine-tune the SuperNet network.

[0020] In a possible implementation manner, the updating the encoding of the received feature map based on the feature map of the subnet network includes:

[0021] If the feature map at a certain position is pruned, the encoding of the feature map at that position is set to 0.

[0022] In a possible implementation, the server aggregating supernet network model parameters based on the characteristic graphs of the subnet networks of the plurality of clients and the encoding of the updated characteristic graphs includes:

[0023] Determine whether the feature map weight value at the location is valid based on the encoding of the feature map updated by each client, sum and average all valid feature map weight values, and update the supernet network model weight of the server.

[0024] In a possible implementation, the subnet chromosome update based on the iterative optimization algorithm includes the following steps:

[0025] Step D1: mining the association relationship between parent chromosomes, and generating the search direction of the child chromosomes according to the association relationship;

[0026] Step D2: generating a daughter chromosome based on the parent chromosome, the search step length and the search direction of the daughter chromosome;

[0027] Step D3: calculating a path index based on the search direction of the parent chromosome, the parent chromosome and the child chromosome;

[0028] Step D4: Calculating the search step length based on the path index;

[0029] Step D5: Based on the performance of the generated offspring chromosomes, select the K best performing chromosomes as the next generation parent chromosomes;

[0030] Repeat multiple rounds of steps D1-D5 until a predetermined number of iterations is reached or the performance of the supernet model meets the requirements, and the subnet chromosome coding update is completed.

[0031] In a possible implementation, mining the association relationship between parent chromosomes and generating a search direction for child chromosomes according to the association relationship includes:

[0032] The chromosome association matrix is ​​calculated based on the search direction of the parent chromosome. The calculation formula for calculating the chromosome association matrix based on the search direction of the parent chromosome is:

[0033]

[0034] Among them, C tis the chromosome association matrix of the tth generation, K is the optimal number of offspring chromosomes that successfully remain in each generation, and K is the preset value. is the search direction of the kth parent chromosome of the tth generation, and the search direction of the 1st parent chromosome is the default value;

[0035] Based on the chromosome association matrix C t Generate the search direction of the offspring chromosome, the generation method of the search direction of the offspring chromosome is to generate the search direction from the multivariate normal distribution N(0,C t ) to extract a random vector.

[0036] In a possible implementation, the calculation formula for generating the offspring chromosome based on the parent chromosome, the search step length and the search direction of the offspring chromosome is:

[0037]

[0038] in, is the kth offspring chromosome of the t+1th generation, is the average value of the k parent chromosomes of the tth generation, is the k-th search step length of the t-th generation, is the search direction of the kth offspring chromosome of the t+1th generation, C t is the chromosome association matrix of the tth generation, the parent chromosome of the first generation and search step length is the default value.

[0039] In a possible implementation, the calculation formula for calculating the path index based on the search direction of the parent chromosome, the parent chromosome and the child chromosome is:

[0040]

[0041] in, is the path index of the t+1th generation, is the path index of the tth generation, C t is the chromosome association matrix of the tth generation, α σ is the learning rate, is the kth offspring chromosome of the t+1th generation, is the k-th parent chromosome of the t-th generation, the path index of the first generation paternal chromosome and search step length is the default value.

[0042] In a possible implementation, the calculation formula for calculating the search step length based on the path index is:

[0043]

[0044] in, is the k-th search step length of the t+1-th generation, is the k-th search step length of the t-th generation, α σ is the learning rate, is the path index of the t+1th generation, N(0,I) is the standard normal distribution, I is the unit matrix, and the search step length of the first generation is is the default value.

[0045] The beneficial effect of the present application is that the federated learning method of the adaptive pruning strategy of the present application learns the diverse private data distribution of all clients by deploying an over-parameterized supernet network on the server side, and each client establishes a subnet adapted to its private data distribution. By reducing the subnet volume through the structured pruning method, not only the communication cost is reduced, but also the local personalization of the model is improved. Each client can update the subnet chromosome encoding according to local data, thereby adaptively adjusting the model structure. Such a design makes the model more suitable for the specific needs of each client, while reducing the demand for computing and storage resources. In addition, the server updates the global model by integrating the input of all clients, which enhances the generalization ability and robustness of the model. In general, the federated learning method of the adaptive pruning strategy of the present application optimizes the global and local performance of the model, while taking into account the limitations of computing resources and communication costs, and can provide each client with a personalized model that is more suitable for its specific data distribution and resource constraints while ensuring the performance of the global model. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] Figure 1 It is a schematic diagram of a federated learning method of an adaptive evolutionary pruning strategy provided in an embodiment of the present application.

[0047] Figure 2 It is a schematic diagram of communication between a server and a client in an embodiment of the present application. DETAILED DESCRIPTION

[0048] In order to make the above-mentioned purposes, features and advantages of the present application more obvious and easy to understand, the present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field belong to the scope of protection of this application.

[0049] The terms used in the implementation section of this application are only used to explain the specific embodiments of this application and are not intended to limit this application.

[0050] It should be noted that the modifications of "one" and "plurality" mentioned in the present application are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".

[0051] The embodiments of the present application are described below in conjunction with the accompanying drawings. Those skilled in the art will appreciate that, with the development of technology and the emergence of new scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.

[0052] See also Figure 1 As shown, the embodiment of the present application discloses a federated learning method of an adaptive evolutionary pruning strategy, including:

[0053] Step S11, constructing a supernet network and initial subnet chromosomes, wherein the supernet network is an over-parameterized network.

[0054] Each layer and the depth of the supernet network are sufficient to support the client's model training task; taking the convolutional neural network as an example, the initial subnet chromosome includes multiple genes, and the multiple genes correspond to the structured pruning rates of multiple convolutional layers and multiple fully connected layers of the convolutional neural network. The gene length L of the initial subnet chromosome is the number of layers N of the convolutional layer of the convolutional neural network. c is the number of fully connected layers N f The sum of L = N c +N f Through the structured pruning rate, the server guides each client to implement structured pruning of the supernet network.

[0055] Step S12, encoding the feature graph of the supernet network to obtain a plurality of encoded feature graphs.

[0056] The encoding method is to construct a unified encoding sequence for each feature map according to the channel sorting of the feature map.

[0057] Step S13: the server sends the supernet network, the initial subnet chromosome, the feature map and the encoding of the feature map to multiple clients.

[0058] The communication diagram between the server and multiple clients is shown in the attached figure. Figure 2 As shown, clusters S1, ...S C For multiple clients, multiple devices inside the client are connected through D2D communication links, and the client and the server are connected through a device-server communication link.

[0059] Step S14: for each of the clients, structured pruning is performed on the feature graph according to the initial subnet chromosome to obtain a personalized subnet network, local data is input into the subnet network for training to obtain a feature graph of the subnet network, the encoding of the received feature graph is updated based on the feature graph of the subnet network, and the feature graph of the subnet network and the encoding of the updated feature graph are sent to the server.

[0060] In the above step S14, each client performs initial training on the personalized subnet network. The training process is to input local data into the personalized subnet network for training. Since the supernet network is over-parameterized, the client needs to perform structured pruning according to the initial subnet chromosome sent by the server. The structured pruning method is as follows:

[0061] (1) Evaluating the importance of feature maps

[0062] The importance of a feature map can be evaluated by calculating its contribution to the network output. For example, the importance index can be calculated for each feature map using gradient information. The calculation formula of the importance index is as follows:

[0063]

[0064] Among them, I l,k is the importance index of the kth feature map in the lth layer, Y is the output of the supernet network, X l,k,i is the i-th element of the k-th feature map of the l-th layer; the above calculation formula shows how the feature map affects the final output through the result of the derivative.

[0065] (2) Determine the pruning threshold

[0066] According to the importance index of the feature map, a pruning threshold T can be set to determine which feature maps should be pruned, such as a statistical measure based on the distribution of the importance index (e.g., retaining a certain percentage of the total importance). In addition, the pruning threshold can also be a preset value.

[0067] (3) Execute pruning

[0068] For each feature map, if the importance index of the feature map is less than the pruning threshold, the feature map is pruned. For each convolutional layer or fully connected layer, if the importance index of a feature map is less than the pruning threshold, the feature map is pruned. k If the kth feature map of layer l is pruned, not only the kth convolution kernel of the layer needs to be removed (affecting the generation of the feature map), but also the convolution kernel of layer l+1 needs to be adjusted, as follows:

[0069] Remove the kth convolution kernel of layer l: This operation will reduce the number of output feature maps of layer l, and the number of output channels of layer l will be reduced.

[0070] Adjust the convolution kernel of layer l+1: Since the output of layer l is the input of layer l+1, each convolution kernel of layer l+1 needs to remove the input channel corresponding to the pruned feature map of layer l. This means that if the convolution kernel of layer l+1 was originally for all l layers of output, each convolution kernel now needs to reduce a part, specifically, the part corresponding to the pruned feature map of layer l.

[0071] Such operations ensure that the network data flow remains coherent after structured pruning. At the same time, structured pruning is much more complicated in operation than simple weight pruning, so the connection relationship between each layer needs to be carefully handled.

[0072] (4) Fine-tune the network

[0073] After pruning, the supernet network needs to be retrained or fine-tuned to compensate for the performance loss caused by pruning. This process involves using the original training dataset but only updating the weights of the remaining unpruned parts.

[0074] For the fully connected layer, there is usually an activation function layer such as RelU after the fully connected layer. The client determines whether to delete the neuron by judging the activation value of the activation function layer. For example, the N neurons with the smallest activation value are deleted.

[0075] After the structured pruning is completed, the client updates the encoding of the received feature map. The updating method is that if the feature map at a certain position is pruned, the feature map encoding sequence number at that position is changed to 0. The encoding of the feature map is rewritten in this way and recorded as the encoding of the client feature map. The client sends the feature map of the subnet network and the encoding of the updated feature map to the server. Since the feature map of the subnet network has much smaller parameters than the feature map of the supernet network, the client's feature map encoding is 0,1 encoding, and the parameter amount can be ignored, thus saving the total transmission amount of parameter transfer in the federated learning calculation.

[0076] Step S15, the server aggregates supernet network model parameters based on the feature graphs of the subnet networks of the multiple clients and the codes of the updated feature graphs, and updates the supernet network model weights of the multiple clients based on the result of parameter aggregation.

[0077] In the above steps, the server performs parameter fusion on the supernet network model based on the feature maps of the subnet networks of multiple clients and the codes of the updated feature maps. The fusion method is to determine whether the feature map weight value of the position is valid according to the code of the updated feature map of each client (if the code of the feature map of this layer is not 0, it means that the feature map weight value of the position (channel) is valid), and sum and average all valid feature map weight values, that is, add the weight of the feature map of the position to the supernet network model weight characteristic value of the corresponding position and then take the average, so as to traverse the feature map weights of all positions one by one, complete the update of the supernet network model weight of the server, and also update the supernet network model weight of multiple clients based on the result of parameter aggregation.

[0078] Step S16: for each of the clients, update the subnet chromosome based on an iterative optimization algorithm, restructure the feature graph according to the updated subnet chromosome, and re-update the encoding of the feature graph based on the result of the restructured pruning.

[0079] Since the private data distribution of each client is different, the optimal subnet formed should be different, that is, the optimization target of each individual is different. Although the individual pruning rate corresponds to the complexity of the client's private data distribution, there is an intrinsic connection between the pruning rates of each layer of the network. For example, for a complex data distribution, each layer may require a smaller pruning rate to ensure the learning performance of the network; while for a simple data distribution, a larger pruning rate can be used for each layer to remove redundant parameters. In addition, each layer of the neural network will perform different functions. For example, the bottom layer network is usually responsible for extracting common bottom-level features and cannot delete too many units; while the upper layer network is responsible for fusing task-related patterns and can adjust the structure according to the output category. Therefore, it is possible to design an iterative optimization algorithm based on the inherent internal connection between the pruning rates to update the subnet chromosome.

[0080] In the above step S16, the subnet chromosome update based on the iterative optimization algorithm includes the following steps:

[0081] Step D1: mining the association relationship between parent chromosomes, and generating the search direction of the child chromosomes according to the association relationship. Step D1 includes:

[0082] The chromosome association matrix is ​​calculated based on the search direction of the parent chromosome. The calculation formula for calculating the chromosome association matrix based on the search direction of the parent chromosome is:

[0083]

[0084] Among them, C tis the chromosome association matrix of the tth generation, K is the optimal number of offspring chromosomes that successfully remain in each generation, and K is the preset value. is the search direction of the kth parent chromosome of the tth generation, and the search direction of the 1st parent chromosome is the default value;

[0085] Based on the chromosome association matrix C t Generate the search direction of the offspring chromosome, the generation method of the search direction of the offspring chromosome is to generate the search direction from the multivariate normal distribution N(0,C t ) to extract a random vector.

[0086] Based on the inherent internal connection between pruning rates, for each client, the covariance (chromosome correlation) matrix C is introduced to characterize the correlation between different genes on the chromosome (i.e., pruning rates at different layers), and the search is performed by repeatedly adjusting the normal distribution for multiple rounds of iterations to achieve self-update of the client chromosome; the search direction of the first generation parent chromosome is a preset random initialization vector. This is because there is no previous search information available to guide the search direction in the first generation. For example, independent sampling from the standard normal distribution N(0,I), where I is the identity matrix, ensures that the initial search direction is uncorrelated in all dimensions. Specifically, the search direction for the first generation parent chromosome is This can be pre-generated using the following steps:

[0087] (1) Determine the dimension: The dimension of , which should be equal to the number of prunable layers in the network, N c +N f ;

[0088] (2) Random sampling: Randomly sample N from the standard normal distribution N(0,I) c +N f values ​​to form a vector This means (where j represents the position in the vector) are all sampled independently.

[0089] (3) Construction Constructing vectors As the search direction of the first generation. The mathematical expression is in is an N c +N f dimensional vector, sampled N times in total, k represents the kth one.

[0090] In subsequent generations, The calculation of is updated based on the results of the previous generation, as well as other parameters of the evolution strategy, such as the covariance matrix and the search step size. Such updates are generally aimed at directing the search towards areas where improved performance is observed, while taking into account the correlations between genes.

[0091] Step D2: Generate a child chromosome based on the parent chromosome, the search step length and the search direction of the child chromosome.

[0092] The calculation formula for generating the offspring chromosome based on the parent chromosome, the search step length and the search direction of the offspring chromosome is:

[0093]

[0094] in, is the kth offspring chromosome of the t+1th generation, is the average value of the k-th parent chromosome of the t-th generation, is the k-th search step length of the t-th generation, is the search direction of the kth offspring chromosome of the t+1th generation, C t is the chromosome association matrix of the tth generation, the parent chromosome of the first generation and search step length is the default value.

[0095] During the client chromosome update process of the federated learning framework, each descendant chromosome The chromosomes of the father By adding a covariance matrix C t The multivariate normal distribution N(0,C t ) is the generated search direction y (t +1) (random vector) to update. Search direction y (t+1) The dimension of (random vector) is the same as the length of the chromosome.

[0096] Through the generation of offspring chromosomes, the client updates the chromosomes by itself, thereby updating the structured pruning rate of each layer. Each iteration requires multiple offspring chromosome searches (here N is selected), and N chromosomes are used to update the pruning rate and measure the model performance under the offspring chromosomes, that is, the model performance under the pruning rate. When the next generation of offspring chromosomes is updated, first select the K pruning rates with the best performance based on the model performance under the N pruning rates. is called the selected offspring, and then prepares to calculate the next generation

[0097] Each client updates the subnetwork structure on its own according to the distribution of its private data, which includes using the covariance matrix to represent the correlation between different genes (i.e., pruning rates of different layers) on the chromosome (i.e., model structure). The client searches by repeatedly iteratively adjusting a multivariate normal distribution to achieve self-update of the chromosome. In this way, the model structure can be adjusted more finely to meet the specific needs of different clients, while improving the overall efficiency and effectiveness of federated learning.

[0098] The benefit of a normally distributed search is is from the multivariate normal distribution N(0,C t ) and the search direction y of the extracted offspring chromosomes t+1 satisfy:

[0099]

[0100] This ensures that the search step follows the currently learned covariance structure.

[0101] Step D3: Calculate a path index based on the search direction of the parent chromosome, the parent chromosome and the child chromosome.

[0102] The calculation formula for calculating the path index based on the search direction of the parent chromosome, the parent chromosome and the child chromosome is:

[0103]

[0104] in, is the path index of the t+1th generation, is the path index of the tth generation, C t is the chromosome association matrix of the tth generation, α σ is the learning rate, is the kth offspring chromosome of the t+1th generation, is the k-th parent chromosome of the t-th generation, the path index of the first generation paternal chromosome and search step length is the default value.

[0105] In the above path index calculation formula, the path index takes into account the most recent search direction and is updated using an exponential sliding average. σ Pre-set, responsible for balancing the weight of new and old information.

[0106] Step D4: Calculate the search step length based on the path index.

[0107] The calculation formula for calculating the search step length based on the path index is:

[0108]

[0109] in, is the k-th search step length of the t+1-th generation, is the k-th search step length of the t-th generation, α σ is the learning rate, is the path index of the t+1th generation, N(0,I) is the standard normal distribution, I is the unit matrix, and the search step length of the first generation is is the default value.

[0110] In the calculation formula of the search step length above, the search step length is adaptively adjusted according to the length of the path index to make the search more efficient. This update ensures that the search step length is adjusted according to the most recent search results. The adjustment is based on overall performance or global feedback, which means that the search step size The adjustment is based on all N updated descendant chromosomes The process of evaluating the collective performance of the offspring, rather than based on the performance of a single offspring, usually involves the following steps:

[0111] A. Performance evaluation: First, for each Perform performance evaluation, that is, measure the performance of each newly generated offspring chromosome in terms of the objective function or model performance.

[0112] B. Selection and feedback: Based on performance evaluation, the best performing offspring chromosomes may be selected for specific operations, such as for further analysis or to determine the next search strategy. Adjustments usually require overall or average feedback rather than the performance of a single instance, which can be achieved by calculating the average performance or other statistical measures of all or some selected offspring.

[0113] C. Statistical feedback: By calculating all N The average change or performance distribution of all offspring is considered to determine whether the search step size needs to be increased or decreased. Furthermore, in some algorithms, it may be possible to adjust the update directly based on the number of children that were successfully updated or the magnitude of the improvement.

[0114] In addition, in the above calculation formula for the search step, E ∥ N (0, I) ∥ represents the expected value of the norm (length) of the vector extracted from the multidimensional normal distribution N (0, I). This expected value can be obtained through statistical theory. For the n-dimensional standard normal distribution, its value can be pre-calculated or consulted by the following formula:

[0115]

[0116] Here, Γ is the gamma function and n is the dimension of the vector.

[0117] In addition, in the above calculation formula for the search step length, the calculation Is the path The actual length of is compared with the expected value of the length of the standard normal distribution vector. This ratio reflects the degree of deviation of the stability of the current search direction from the standard situation, which is then used to adjust the search step length. This calculation process allows the algorithm to automatically adjust its search strategy according to the dynamics of the search process in order to achieve better optimization results.

[0118] Step D5: Evaluate each generated offspring chromosome, and select K chromosomes with the best performance as the next generation parent chromosomes based on the performance of the generated offspring chromosomes;

[0119] Repeat multiple rounds of steps D1-D5 until a predetermined number of iterations is reached or the performance of the supernet model meets the requirements, and the subnet chromosome coding update is completed.

[0120] Through this repeated multiple rounds of iterative optimization algorithm, it is possible to effectively navigate in the parameter space and find configurations that improve model performance. At the same time, the principle of evolutionary strategy is used, combined with the covariance matrix to consider the correlation between parameters, which not only improves the efficiency of the search, but also increases the possibility of finding the global optimal solution.

[0121] Step S17, sending the codes of the re-pruned feature maps and the re-updated feature maps of the multiple clients to the server to realize global feature aggregation of federated learning; the server sends the aggregated global features to the multiple clients again, and the multiple clients extract features according to the local feature map codes and restart new training until the federated learning training is completed.

[0122] In general, through the above steps, the present application proposes an adaptive federated learning method, deploying an over-parameterized supernet network on the server side to learn the diverse private data distribution of all clients. In order to improve the local personalization of the model, each client can establish a subnet adapted to its private data distribution. In order to alleviate the communication and computing pressure, the subnet volume is reduced by the compression method of structured pruning. The subnet is obtained by structured pruning from the supernet network, and its parameters are inherited from the corresponding network unit in the supernet network. In each round of communication, the server distributes the supernet network and the subnet chromosome to the corresponding client. The client calculates the importance of each network unit in the supernet network according to the local private data distribution, and combines the pruning rate encoded in the chromosome to perform structured pruning on the supernet network to obtain the subnet. Since the subnet only retains the most valuable part of the network units for local private data, the corresponding model parameters have a greater impact on the prediction of the network, and the network update and back propagation are only performed on this part of the most important network units, thereby enhancing the network's ability to fit the data. The same operation is performed on the parent and child chromosomes to obtain two subnets. By training and evaluating the two subnets, the subnet with greater fitness and the corresponding subnet chromosome are uploaded to the server. After the server receives all the subnet chromosomes, it updates the evolution strategy parameters and obtains the next generation of chromosomes; at the same time, the subnets are aggregated to the supernet network according to their original positions to complete the update of the supernet network. Different clients optimize different areas of the supernet network respectively, which weakens the complex internal correlation between network units on the supernet network, and avoids the interference of untrained redundant parameters on the supernet network during the aggregation process, thereby enhancing the generalization ability and robustness of the supernet network.

[0123] Specifically, the federated learning method of the adaptive evolutionary pruning strategy of the present application has the following technical effects:

[0124] (1) Innovation in the framework of federated learning: We propose an adaptive federated learning framework that solves the statistical heterogeneity and model heterogeneity problems in traditional federated learning. In this framework, multiple clients collaborate to jointly train a global model while preserving their respective data privacy and security.

[0125] (2) Over-parameterized supernet and subnet structure: The server deploys an over-parameterized supernet to learn and adapt to the diverse private data distribution of each client. Each client creates an adaptive subnet from the supernet according to its own data distribution, and reduces the size of the model through structured pruning methods.

[0126] (3) Structured pruning and personalized subnets: Each client performs structured pruning on the supernet based on the local data distribution to generate a personalized subnet that better matches its data characteristics, reducing the size of the model and lowering communication and computing costs.

[0127] (4) Dynamic subnet chromosome update: The client updates the subnet chromosome code based on the characteristics of local data. The self-update mechanism allows the client to dynamically adjust the subnet structure based on its private data, increasing the flexibility and adaptability of the model.

[0128] (5) Global and local model optimization: This approach allows each client to be provided with a personalized model that adapts to its specific data and resource constraints without sacrificing the performance of the global model. This optimization method helps to enhance the effectiveness of the model on each client.

[0129] (6) Covariance matrix and evolutionary strategy: The covariance matrix is ​​used to capture the dependencies between different pruning rates, and the evolutionary strategy is used to guide the search process and optimize the structure of the subnetwork.

[0130] (7) Improved communication efficiency: Since the size of the pruned model is reduced, the communication cost between the client and the server is greatly reduced, which is especially important in scenarios with limited bandwidth.

[0131] (8) Iterative update of the global model: The server updates the global model by integrating the pruned models and feature map encodings from each client, ensuring the generalization and robustness of the model.

[0132] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.

[0133] The above is a detailed introduction to the federated learning method of an adaptive evolutionary pruning strategy provided by the present application. This article uses specific examples to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for general technical personnel in this field, according to the idea of ​​the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A federated learning method with an adaptive evolutionary pruning strategy, characterized in that: include: Constructing a supernet network and an initial subnet chromosome, wherein the supernet network is an over-parameterized network; Performing feature graph encoding on the supernet network to obtain a plurality of encoded feature graphs; The server sends the supernet network, the initial subnet chromosome, the feature map and the encoding of the feature map to multiple clients; For each of the clients, structured pruning is performed on the feature graph according to the initial subnet chromosome to obtain a personalized subnet network, local data is input into the subnet network for training to obtain a feature graph of the subnet network, the encoding of the received feature graph is updated based on the feature graph of the subnet network, and the feature graph of the subnet network and the updated encoding of the feature graph are sent to the server; The server aggregates supernet network model parameters based on the characteristic graphs of the subnet networks of the multiple clients and the codes of the updated characteristic graphs, and updates the supernet network model weights of the multiple clients based on the result of parameter aggregation; For each of the clients, a subnet chromosome is updated based on an iterative optimization algorithm, the feature graph is restructured and pruned according to the updated subnet chromosome, and the encoding of the feature graph is updated again based on the result of the restructured pruning; Sending the codes of the re-pruned feature graphs and the re-updated feature graphs of the multiple clients to the server to realize global feature aggregation of federated learning; The server sends the aggregated global features to the multiple clients again. After the multiple clients extract features according to the local feature map encoding, they restart new training until the federated learning training is completed.

2. The federated learning method of the adaptive evolutionary pruning strategy according to claim 1, characterized in that: The initial subnet chromosome is obtained based on a convolutional neural network. The multiple genes of the initial subnet chromosome are structured pruning rates of multiple convolutional layers and multiple fully connected layers of the convolutional neural network. The gene length L of the initial subnet chromosome is the number of layers N of the convolutional layer of the convolutional neural network. c The number of fully connected layers N f sum.

3. The federated learning method of the adaptive evolutionary pruning strategy according to claim 1, characterized in that: The step of performing structured pruning on the feature graph according to the initial subnet chromosome comprises: The importance index is calculated for each feature map, and the calculation formula of the importance index is as follows: Among them, I l,k is the importance index of the kth feature map in the lth layer, Y is the output of the supernet network, X l,k,i is the i-th element of the k-th feature map of the l-th layer; For each feature graph, when the importance index of the feature graph is less than a pruning threshold, the feature graph is pruned; the pruning threshold is a preset value or is determined based on the importance indexes of a plurality of the feature graphs; Retrain or fine-tune the SuperNet network.

4. The federated learning method of the adaptive evolutionary pruning strategy according to claim 1, characterized in that: The updating of the encoding of the received feature map based on the feature map of the subnet network comprises: If the feature map at a certain position is pruned, the encoding of the feature map at that position is set to 0.

5. The federated learning method of the adaptive evolutionary pruning strategy according to claim 1, characterized in that: The server aggregates supernet network model parameters based on the characteristic graphs of the subnet networks of the plurality of clients and the codes of the updated characteristic graphs, including: Determine whether the feature map weight value at the location is valid based on the encoding of the feature map updated by each client, sum and average all valid feature map weight values, and update the supernet network model weight of the server.

6. The federated learning method of the adaptive evolutionary pruning strategy according to claim 1, characterized in that: The subnet chromosome update based on the iterative optimization algorithm comprises the following steps: Step D1: mining the association relationship between parent chromosomes, and generating the search direction of the child chromosomes according to the association relationship; Step D2: generating a daughter chromosome based on the parent chromosome, the search step length and the search direction of the daughter chromosome; Step D3: calculating a path index based on the search direction of the parent chromosome, the parent chromosome and the child chromosome; Step D4: Calculating the search step length based on the path index; Step D5: Based on the performance of the generated offspring chromosomes, select the K best performing chromosomes as the next generation parent chromosomes; Repeat multiple rounds of steps D1-D5 until a predetermined number of iterations is reached or the performance of the supernet model meets the requirements, and the subnet chromosome coding update is completed.

7. The federated learning method of the adaptive evolutionary pruning strategy according to claim 6, characterized in that: The mining of the association relationship between the parent chromosomes and generating the search direction of the child chromosomes according to the association relationship includes: The chromosome association matrix is ​​calculated based on the search direction of the parent chromosome. The calculation formula for calculating the chromosome association matrix based on the search direction of the parent chromosome is: Among them, C t is the chromosome association matrix of the tth generation, K is the optimal number of offspring chromosomes that successfully remain in each generation, and K is the preset value. is the search direction of the kth parent chromosome of the tth generation, and the search direction of the 1st parent chromosome is the default value; Based on the chromosome association matrix C t Generate the search direction of the offspring chromosome, the generation method of the search direction of the offspring chromosome is to generate the search direction from the multivariate normal distribution N(0,C t ) to extract a random vector.

8. The federated learning method of the adaptive evolutionary pruning strategy according to claim 6, characterized in that: The calculation formula for generating the offspring chromosome based on the parent chromosome, the search step length and the search direction of the offspring chromosome is: in, is the kth offspring chromosome of the t+1th generation, is the average value of the k parent chromosomes of the tth generation, is the k-th search step length of the t-th generation, is the search direction of the kth offspring chromosome of the t+1th generation, C t is the chromosome association matrix of the tth generation, the parent chromosome of the first generation and search step length is the default value.

9. The federated learning method of the adaptive evolutionary pruning strategy according to claim 6, characterized in that: The calculation formula for calculating the path index based on the search direction of the parent chromosome, the parent chromosome and the child chromosome is: in, is the path index of the t+1th generation, is the path index of the tth generation, C t is the chromosome association matrix of the tth generation, α σ is the learning rate, is the kth offspring chromosome of the t+1th generation, is the k-th parent chromosome of the t-th generation, the path index of the first generation paternal chromosome and search step length is the default value.

10. The federated learning method of the adaptive evolutionary pruning strategy according to claim 6, characterized in that: The calculation formula for calculating the search step length based on the path index is: in, is the k-th search step length of the t+1-th generation, is the k-th search step length of the t-th generation, α σ is the learning rate, is the path index of the t+1th generation, N(0,I) is the standard normal distribution, I is the unit matrix, and the search step length of the first generation is is the default value.

Citation Information

Cited By

  • Class-level federal forgetting method and system based on double-layer expert mixing and TF-IDF discriminant pruning

    CN120911536A

  • Client architecture construction method and device for federation scene, equipment and storage medium

    CN121072645A