Machine learning model compression method and system based on federated learning and mean iteration

By adopting federated learning and mean iteration methods in machine learning model compression, redundant network structures and parameters are trimmed, and the problems of low efficiency and insufficient performance of model compression in the prior art are solved, and more efficient computing and storage resource utilization is achieved.

CN119831068APending Publication Date: 2025-04-15CHONGQING UNIV
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411791402.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-06
Publication Date
2025-04-15

AI Technical Summary

Technical Problem

While ensuring model performance, existing machine learning model compression methods cannot effectively reduce computing and storage overhead, increasing network bandwidth burden and data privacy leakage, and poor overall system performance and scalability.

Method used

Using a machine learning model compression method based on federated learning and mean iteration, the basic model is initialized by the server side, the client locally trains and aggregates parameters, and the redundant network structure and parameters are cropped, combined with mean iteration optimization and parameter screening, and the lightweight model is reorganized.

Benefits of technology

It reduces the risk of network bandwidth burden and data privacy leakage, improves the training quality of the global model and the overall system performance, reduces model redundancy and improves computing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119831068A_ABST
    Figure CN119831068A_ABST
Patent Text Reader

Abstract

The invention discloses a machine learning model compression method and system based on federated learning and mean iteration, and belongs to the field of deep learning optimization, and the compression method comprises the following specific steps: I, a server initializes a group of basic models, and distributes the models to each client node; iI, updating model parameters by each client node by using local data, and aggregating the client parameters into a global model by the server side; according to the method, the network bandwidth burden and the risk of data privacy leakage can be reduced, effective fusion of training results of different clients can be promoted, the training quality of a global model can be improved, the overall performance and expandability of a system can be remarkably improved, meanwhile, model redundancy is reduced, and the calculation efficiency is improved; the method can further reduce the storage and calculation overhead, improve the compression efficiency, effectively maintain or even improve the precision of the compressed model, ensure the effectiveness of the model at different clients, reduce the communication overhead and calculation burden, and improve the overall efficiency of the system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of deep learning optimization, and in particular to a machine learning model compression method and system based on federated learning and mean iteration. Background Art

[0002] In the wide application of machine learning and deep learning, how to enable large-scale deep neural network models to be efficiently and flexibly deployed on various devices with limited computing resources has become a key issue that needs to be solved urgently. Traditional model training usually relies on centralized data and computing resources. With the increasing demand for data privacy protection and distributed computing, federated learning, as a new distributed learning method, has gradually become a research hotspot. The basic idea of ​​federated learning is to improve the security of data privacy protection by distributing the model training process to multiple clients without directly sharing data. Although federated learning has significant advantages in data privacy protection, in traditional deep learning models, the complexity and number of parameters of the model are often too large, resulting in challenges in computing, storage, and transmission in its deployment on edge devices and mobile terminals. Therefore, how to reduce computing and storage overhead while ensuring model performance through model compression technology has become a key task in federated learning applications.

[0003] Existing machine learning model compression methods and systems are not conducive to reducing network bandwidth burden and the risk of data privacy leakage, reduce the training quality of the global model, and the overall performance and scalability of the system are poor; in addition, existing machine learning model compression methods and systems increase storage and computing overhead, reduce compression efficiency, cannot maintain the accuracy of the compressed model, and increase communication overhead and computing burden; for this reason, we propose a machine learning model compression method and system based on federated learning and mean iteration. Summary of the invention

[0004] The purpose of the present invention is to solve the defects in the prior art and propose a machine learning model compression method and system based on federated learning and mean iteration.

[0005] In order to achieve the above object, the present invention adopts the following technical solutions:

[0006] A machine learning model compression method based on federated learning and mean iteration. The specific steps of the compression method are as follows:

[0007] Ⅰ. The server initializes a set of basic models and distributes the models to each client node;

[0008] Ⅱ. Each client node uses local data to update the model parameters, and the server aggregates the client parameters into a global model;

[0009] III. Prune the redundant network structure of the global model and simulate the parameter screening process to remove redundant parameters;

[0010] IV. Combine the pruned network structure and optimized parameter set into a compressed machine learning model and evaluate its performance on the test set;

[0011] V. Deploy the machine learning model to user devices or edge devices, test its response time and computing performance, collect user feedback data, and verify the practicality and stability of the model.

[0012] As a further solution of the present invention, the specific steps of initializing a set of basic models on the server side in step I and distributing the models to each client node are as follows:

[0013] S1.1: Select training data from various public standard datasets or domain-specific datasets, then normalize, segment, and remove noise data from the selected global dataset, load the model from the model library based on the selected pre-trained model, and verify the loaded model;

[0014] S1.2: Define the model structure after verification, initialize the model parameters through Gaussian distribution or Xavier, train the model through the global data set, assign a unique number to each client node, and the server distributes the trained initial global model and model parameters to each client node. Each client node verifies locally whether the model is loaded correctly and returns the initial verification result to the server.

[0015] S1.3: When all client nodes successfully load the model and the verification results are within the preset expected range, the server records the status as "initialization completed" and enters the next stage of local training of federated learning.

[0016] As a further solution of the present invention, the specific steps of aggregating the client parameters into a global model by the server in step II are as follows:

[0017] S2.1: Each client node trains the received global model with its own private local data set. After dividing the local data set into a training set, a validation set, and a test set, the training set data is input into the global model in the client node. Each global model obtains a predicted value through a forward propagation algorithm, and calculates the loss value between the predicted value and the actual value through a local loss function.

[0018] S2.2: The loss value is propagated from the output layer of the global model, and the gradient of the loss value for each layer of the global model is calculated through the back-propagation algorithm. The model parameters are updated using the gradient descent algorithm. After each round of training, the validation set is used to detect whether the loss value of the global model stops changing. If so, the training is terminated in advance. Otherwise, the training is repeated until the loss function value converges to the preset range, and the performance indicators of the global model after training are detected using the test set.

[0019] S2.3: Each client node sends the updated model parameters back to the server. The server receives the parameter updates from all clients. The server performs weighted aggregation of the model parameters of all client nodes based on the parameter averaging mechanism, and updates the parameters of the global model based on the aggregated model parameters.

[0020] S2.4: Calculate the mean of the global model parameters and use the mean iteration mechanism to optimize the parameters. Repeat the parameter optimization until the parameter change converges to the preset threshold or reaches the maximum number of iterations. After the mean iteration optimization, the new global model parameters are obtained. Then the new global model parameters are passed back to the client and a new training cycle starts.

[0021] As a further solution of the present invention, the specific steps of trimming the redundant network structure of the global model in step III are as follows:

[0022] S3.1: After the global model training is completed, the ratio of the sum of the weights of each network layer of the global model to the sum of the weights of the entire network is calculated to obtain the contribution rate of each layer to the output of the model. If the contribution rate of the network layer is less than the set threshold, the layer is considered redundant and becomes a candidate layer for pruning;

[0023] S3.2: Calculate the sparsity of the weight matrix of the remaining network layers to evaluate the weight sparsity of each layer. If the weight sparsity of a network layer is higher than a preset threshold, the layer is considered redundant and becomes a candidate layer for pruning. A comprehensive evaluation is performed based on the contribution rate and weight sparsity of each candidate layer, and a weight value is assigned to each candidate layer. The larger the weight value, the higher the pruning priority of the corresponding network layer.

[0024] S3.3: The network structure of the current global model is taken as the root node, and the network structure of the global model after a specific pruning strategy is taken as the child node corresponding to the root node. Starting from the root node, based on the upper confidence interval formula, the child node with the highest UCB1 value is selected layer by layer to construct the current optimal path until the leaf node is reached;

[0025] S3.4: When a leaf node is not fully expanded, multiple groups of child nodes are generated based on the pruning operations that can be selected for the current child node, and the generated child nodes are added to the search tree as new leaf nodes. On each expanded node, simulation is performed by random selection to evaluate the performance of the pruning strategy. Based on the results of the simulation phase, the evaluation information of each node on the path is updated until the root node is traced back.

[0026] S3.5: Repeat the selection, expansion, simulation, and backtracking steps until the fixed number of iterations or the specified search time limit is reached, select the clipping path with the highest evaluation value as the optimal clipping strategy, and perform the corresponding clipping operation to delete redundant layers, neurons, or connections and retain important network structures.

[0027] A machine learning model compression system based on federated learning and mean iteration, including a model initialization module, a data distribution module, a local training module, a parameter aggregation module, an iterative optimization module, a structure pruning module, a parameter screening module, a model reorganization module, a performance evaluation module, and a deployment verification module;

[0028] The model initialization module is used to construct an initial global model on the server side;

[0029] The data distribution module is used to distribute the global model constructed by the server to the client nodes and manage the participation information of the client;

[0030] The local training module is used for the client node to perform model training using local data to generate optimized parameters;

[0031] The parameter aggregation module is used to aggregate the training results of the client into a global model to complete the parameter update of federated learning;

[0032] The iterative optimization module performs mean iterative optimization on the aggregated global model to remove invalid parameters and improve model sparsity;

[0033] The structure cutting module is used to cut the network architecture of the global model;

[0034] The parameter screening module is used to simulate the parameter screening process and select the optimal parameter subset;

[0035] The model reorganization module is used to combine the pruned network structure with the screening parameters to reconstruct a set of lightweight machine learning models;

[0036] The performance evaluation module is used to comprehensively evaluate the performance of the model and compare it with the original model, quantify the performance improvement and resource saving, and provide a visual report;

[0037] The deployment verification module is used to deploy the compressed model to the target environment and verify its performance in the actual scenario.

[0038] As a further solution of the present invention, the specific steps of the optimal parameter subset of the parameter screening module are as follows:

[0039] S4.1: Encode the pruned global model parameters, treat each parameter as an antibody, initialize the population, and each group of individuals in the population represents a parameter selection scheme. Based on each group of individuals, construct a simplified model, set the corresponding parameters marked as 0 to zero, and calculate the model accuracy on the validation set;

[0040] S4.2: Individuals with model accuracy higher than the preset threshold are regarded as excellent antibodies, and cloned, where the number of clones is proportional to the fitness value. An antibody pool is generated through the cloning operation, and multiple cloned antibodies are used as mutation candidates. The parameter selection scheme corresponding to each cloned antibody in the antibody pool is randomly mutated to generate a new population;

[0041] S4.3: Calculate the model accuracy of each antibody in the new population, and sort them in descending order according to the model accuracy. The best antibody whose model accuracy meets the preset requirements will enter the next round of iteration, and update the original population. Calculate the similarity between the antibodies in the updated population. If there are multiple antibodies with similarities higher than the preset value in the population, retain the antibody with the highest model accuracy and screen out the rest.

[0042] S4.4: Repeat the iterative update of the population until the model accuracy of the best antibody in the population converges to a preset range in multiple rounds of iterations, or the preset maximum number of iterations is reached. The antibody with the highest model accuracy is taken as the final screening result, and the pruned global model parameters are updated according to its corresponding parameter selection scheme.

[0043] Compared with the prior art, the present invention has the following beneficial effects:

[0044] 1. Each client node of the present invention trains the received global model through its own private local data set, divides the local data set into a training set, a validation set and a test set, inputs the training set data into the global model in the client node to generate a predicted value, and calculates the loss value between the predicted value and the actual value, and calculates the loss value through the back propagation algorithm. For the gradient of each layer of the global model, the gradient descent algorithm is used to update the model parameters. After each round of training cycle, the validation set is used to detect whether the loss value of the global model stops changing. If it stops, the training is terminated in advance, otherwise the training is repeated until the loss function value converges to a preset range, and the test set is used to detect the performance index of the global model after the training is completed. Each client node sends the updated model parameters back to the server, and the server receives To the parameter update from all clients, the server-side weightedly aggregates the model parameters of all client nodes based on the parameter averaging mechanism, and updates the parameters of the global model based on the aggregated model parameters, calculates the mean of the global model parameters, and uses the mean iteration mechanism to optimize the parameters, and repeats the parameter optimization until the parameter change converges to the preset threshold or reaches the maximum number of iterations. After the mean iteration optimization, the new global model parameters are obtained, and then the new global model parameters are passed back to the client to start a new training cycle, which helps to reduce the network bandwidth burden and the risk of data privacy leakage, can promote the effective integration of training results from different clients, improve the training quality of the global model, can significantly improve the overall performance and scalability of the system, while reducing model redundancy and improving computing efficiency.

[0045] 2. The present invention encodes the pruned global model parameters, regards each parameter as an antibody, initializes the population, and each group of individuals in the population represents a parameter selection scheme. Based on each group of individuals, a simplified model is constructed, and the corresponding parameters marked as 0 are set to zero. The model accuracy is calculated on the validation set, and individuals with model accuracy higher than a preset threshold are regarded as excellent antibodies. The excellent antibodies are cloned, wherein the number of clones is proportional to the fitness value. An antibody pool is generated through the cloning operation, and multiple cloned antibodies are used as mutation candidates. The parameter selection scheme corresponding to each cloned antibody in the antibody pool is randomly mutated to generate a new population, and the model accuracy of each antibody in the new population is calculated. The antibodies are sorted in descending order according to the model accuracy, and the optimal antibodies whose model accuracy meets the preset requirements are entered. In the next round of iteration, the original population is updated, and the similarity between the antibodies in the updated population is calculated. If there are multiple antibodies in the population with a similarity higher than the preset value, the antibody with the highest model accuracy is retained, and the remaining antibodies are screened out. The population is repeatedly iterated and updated until the model accuracy of the optimal antibody in the population converges to a preset range in multiple rounds of iterations, or the preset maximum number of iterations is reached. The antibody with the highest model accuracy is used as the final screening result, and the pruned global model parameters are updated according to its corresponding parameter selection scheme, which can further reduce storage and computing overheads, improve compression efficiency, effectively maintain or even improve the accuracy of the compressed model, ensure the effectiveness of the model on different clients, reduce communication overhead and computing burden, and improve the overall efficiency of the system. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] The accompanying drawings are used to provide further understanding of the present invention and constitute a part of the specification. They are used to explain the present invention together with the embodiments of the present invention and do not constitute a limitation of the present invention.

[0047] Figure 1 A flowchart of the machine learning model compression method based on federated learning and mean iteration proposed in the present invention;

[0048] Figure 2 This is a system block diagram of the machine learning model compression system based on federated learning and mean iteration proposed in the present invention. DETAILED DESCRIPTION

[0049] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments.

[0050] Example 1

[0051] Reference Figure 1 This embodiment discloses a machine learning model compression method based on federated learning and mean iteration. The specific steps of the compression method are as follows:

[0052] The server initializes a set of basic models and distributes the models to each client node.

[0053] Specifically, training data is selected from various public standard data sets or domain-specific data sets, and then the selected global data set is normalized, segmented, and noise data is removed. According to the selected pre-trained model, the model is loaded from the model library, and the loaded model is verified. The structure of the verified model is defined, and the model parameters are initialized through Gaussian distribution or Xavier. The model is trained through the global data set, and a unique number is assigned to each client node. The server distributes the trained initial global model and model parameters to each client node. Each client node locally verifies whether the model is correctly loaded and returns the initial verification result to the server. When all client nodes successfully load the model and the verification result is within the preset expected range, the server records the status as "initialization completed" and enters the next stage of local training of federated learning.

[0054] Each client node uses local data to update the model parameters, and the server aggregates the client parameters into a global model.

[0055] Specifically, each client node trains the received global model through its own private local data set, divides the local data set into training set, validation set and test set, and then inputs the training set data into the global model in the client node. Each global model obtains the predicted value through the forward propagation algorithm, calculates the loss value between the predicted value and the actual value through the local loss function, propagates the loss value from the output layer of the global model, and calculates the loss value through the back propagation algorithm. For the gradient of each layer of the global model, the gradient descent algorithm is used to update the model parameters. After each round of training cycle, the validation set is used to detect whether the loss value of the global model stops changing. If it stops, the training is terminated in advance, otherwise the training is repeated until the loss value stops changing. The function value converges to a preset range, and the test set is used to detect the performance indicators of the global model after training. Each client node sends the updated model parameters back to the server. The server receives parameter updates from all clients. The server performs weighted aggregation of the model parameters of all client nodes based on the parameter averaging mechanism, updates the parameters of the global model based on the aggregated model parameters, calculates the mean of the global model parameters, and uses the mean iteration mechanism to optimize the parameters. The parameter optimization is repeated until the parameter change converges to the preset threshold or reaches the maximum number of iterations. After mean iteration optimization, new global model parameters are obtained, which are then passed back to the client to start a new training cycle.

[0056] Prune the redundant network structure of the global model and simulate the parameter screening process to remove redundant parameters.

[0057] The pruned network structure and optimized parameter set are combined into a compressed machine learning model, and its performance is evaluated on the test set.

[0058] Specifically, when the global model training is completed, the ratio of the sum of the weights of each network layer of the global model to the sum of the weights of the entire network is calculated to obtain the contribution rate of each layer to the output of the model. If the contribution rate of the network layer is less than the set threshold, the layer is considered redundant and becomes a candidate layer for pruning. The sparsity of the weight matrix of the remaining network layers is calculated to evaluate the weight sparsity of each layer. If the weight sparsity of the network layer is higher than the preset threshold, the layer is considered redundant and becomes a candidate layer for pruning. A comprehensive evaluation is performed based on the contribution rate and weight sparsity of each candidate layer, and a weight value is assigned to each candidate layer for pruning. The larger the weight value, the higher the pruning priority of the corresponding network layer. The network structure of the current global model is used as the root node, and the network structure of the global model after a specific pruning strategy is used as the child node corresponding to the root node. Starting from the root node, At the beginning, based on the upper confidence interval formula, the child node with the highest UCB1 value is selected layer by layer to build the current optimal path until the leaf node is reached. When the leaf node is not fully expanded, multiple groups of child nodes are generated based on the various pruning operations that can be selected for the current child node, and the generated child nodes are added to the search tree as new leaf nodes. At each expanded node, simulation is performed by random selection to evaluate the performance of the pruning strategy. Based on the results of the simulation stage, the evaluation information of each node on the path is updated until the root node is traced back. The selection, expansion, simulation and backtracking steps are repeated until the fixed number of iterations is reached or the specified search time limit is reached. The pruning path with the highest evaluation value is selected as the optimal pruning strategy, and the corresponding pruning operations are performed to delete redundant layers, neurons or connections and retain important network structures.

[0059] Deploy machine learning models to user devices or edge devices, test their response time and computing performance, collect user feedback data, and verify the practicality and stability of the model.

[0060] Example 2

[0061] Reference Figure 2 This embodiment discloses a machine learning model compression system based on federated learning and mean iteration, including a model initialization module, a data distribution module, a local training module, a parameter aggregation module, an iterative optimization module, a structure pruning module, a parameter screening module, a model reorganization module, a performance evaluation module and a deployment verification module.

[0062] The model initialization module is used to build the initial global model on the server side; the data distribution module is used to distribute the global model built on the server side to the client nodes and manage the client's participation information.

[0063] The local training module is used by client nodes to train models using local data and generate optimized parameters. The parameter aggregation module is used to aggregate the training results of the client into a global model and complete the parameter update of federated learning. The iterative optimization module performs mean iterative optimization on the aggregated global model to remove invalid parameters and improve model sparsity.

[0064] The structure trimming module is used to trim the network architecture of the global model; the parameter screening module is used to simulate the parameter screening process and select the optimal parameter subset.

[0065] Specifically, the pruned global model parameters are encoded, each parameter is regarded as an antibody, and the population is initialized. Each group of individuals in the population represents a parameter selection scheme. Based on each group of individuals, a simplified model is constructed, and the corresponding parameters marked as 0 are set to zero. The model accuracy is calculated on the validation set, and individuals with model accuracy higher than a preset threshold are regarded as excellent antibodies. The excellent antibodies are cloned, where the number of clones is proportional to the fitness value. An antibody pool is generated through the cloning operation, and multiple cloned antibodies are used as mutation candidates. The parameter selection scheme corresponding to each cloned antibody in the antibody pool is randomly mutated to generate a new population, and the fitness of each antibody in the new population is calculated. The model accuracy of the whole population is calculated, and the antibodies are arranged in descending order according to the model accuracy. The best antibodies whose model accuracy meets the preset requirements enter the next round of iteration, and the original population is updated. The similarity between the antibodies in the updated population is calculated. If there are multiple antibodies with similarities higher than the preset value in the population, the antibody with the highest model accuracy is retained, and the remaining antibodies are screened out. The population is repeatedly iterated and updated until the change value of the model accuracy of the best antibody in the population in multiple rounds of iterations converges to a preset range, or the preset maximum number of iterations is reached. The antibody with the highest model accuracy is used as the final screening result, and the pruned global model parameters are updated according to its corresponding parameter selection scheme.

[0066] The model reconstruction module is used to combine the pruned network structure with the screening parameters to rebuild a set of lightweight machine learning models; the performance evaluation module is used to comprehensively evaluate the performance of the model and compare it with the original model to quantify the performance improvement and resource savings, while providing a visual report; the deployment verification module is used to deploy the compressed model to the target environment and verify its performance in the actual scenario.

Claims

1. A machine learning model compression method based on federated learning and mean iteration, characterized in that: The specific steps of the compression method are as follows: Ⅰ. The server initializes a set of basic models and distributes the models to each client node; Ⅱ. Each client node uses local data to update the model parameters, and the server aggregates the client parameters into a global model; III. Prune the redundant network structure of the global model and simulate the parameter screening process to remove redundant parameters; IV. Combine the pruned network structure and optimized parameter set into a compressed machine learning model and evaluate its performance on the test set; V. Deploy the machine learning model to user devices or edge devices, test its response time and computing performance, collect user feedback data, and verify the practicality and stability of the model.

2. The machine learning model compression method based on federated learning and mean iteration according to claim 1, characterized in that: The specific steps of initializing a set of basic models on the server side in step Ⅰ and distributing the models to each client node are as follows: S1.1: Select training data from various public standard datasets or domain-specific datasets, then normalize, segment, and remove noise data from the selected global dataset, load the model from the model library based on the selected pre-trained model, and verify the loaded model; S1.2: Define the model structure after verification, initialize the model parameters through Gaussian distribution or Xavier, train the model through the global data set, assign a unique number to each client node, and the server distributes the trained initial global model and model parameters to each client node. Each client node verifies locally whether the model is loaded correctly and returns the initial verification result to the server. S1.3: When all client nodes successfully load the model and the verification results are within the preset expected range, the server records the status as "initialization completed" and enters the next stage of local training of federated learning.

3. The method for compressing a machine learning model based on federated learning and mean iteration according to claim 2, characterized in that: The specific steps of the server aggregating the client parameters into a global model in step II are as follows: S2.1: Each client node trains the received global model with its own private local data set. After dividing the local data set into a training set, a validation set, and a test set, the training set data is input into the global model in the client node. Each global model obtains a predicted value through a forward propagation algorithm, and calculates the loss value between the predicted value and the actual value through a local loss function. S2.2: The loss value is propagated from the output layer of the global model, and the gradient of each layer of the global model is calculated by the back-propagation algorithm. The model parameters are updated using the gradient descent algorithm. After each round of training, the validation set is used to detect whether the loss value of the global model stops changing. If so, the training is terminated in advance. Otherwise, the training is repeated until the loss function value converges to the preset range, and the performance indicators of the global model after training are detected using the test set. S2.3: Each client node sends the updated model parameters back to the server. The server receives the parameter updates from all clients. The server performs weighted aggregation of the model parameters of all client nodes based on the parameter averaging mechanism, and updates the parameters of the global model based on the aggregated model parameters. S2.4: Calculate the mean of the global model parameters and use the mean iteration mechanism to optimize the parameters. Repeat the parameter optimization until the parameter change converges to the preset threshold or reaches the maximum number of iterations. After the mean iteration optimization, the new global model parameters are obtained. Then the new global model parameters are passed back to the client and a new training cycle starts.

4. The method for compressing a machine learning model based on federated learning and mean iteration according to claim 3, characterized in that: The specific steps of trimming the redundant network structure of the global model in step III are as follows: S3.1: After the global model training is completed, the ratio of the sum of the weights of each network layer of the global model to the sum of the weights of the entire network is calculated to obtain the contribution rate of each layer to the output of the model. If the contribution rate of the network layer is less than the set threshold, the layer is considered redundant and becomes a candidate layer for pruning; S3.2: Calculate the sparsity of the weight matrix of the remaining network layers to evaluate the weight sparsity of each layer. If the weight sparsity of a network layer is higher than a preset threshold, the layer is considered redundant and becomes a candidate layer for pruning. A comprehensive evaluation is performed based on the contribution rate and weight sparsity of each candidate layer, and a weight value is assigned to each candidate layer. The larger the weight value, the higher the pruning priority of the corresponding network layer. S3.3: The network structure of the current global model is taken as the root node, and the network structure of the global model after a specific pruning strategy is taken as the child node corresponding to the root node. Starting from the root node, based on the upper confidence interval formula, the child node with the highest UCB1 value is selected layer by layer to construct the current optimal path until the leaf node is reached; S3.4: When a leaf node is not fully expanded, multiple groups of child nodes are generated based on the pruning operations that can be selected for the current child node, and the generated child nodes are added to the search tree as new leaf nodes. On each expanded node, simulation is performed by random selection to evaluate the performance of the pruning strategy. Based on the results of the simulation phase, the evaluation information of each node on the path is updated until the root node is traced back. S3.5: Repeat the selection, expansion, simulation, and backtracking steps until the fixed number of iterations or the specified search time limit is reached, select the clipping path with the highest evaluation value as the optimal clipping strategy, and perform the corresponding clipping operation to delete redundant layers, neurons, or connections and retain important network structures.

5. A machine learning model compression system based on federated learning and mean iteration, used to implement the machine learning model compression method based on federated learning and mean iteration as described in any one of claims 1-4, characterized in that: It includes model initialization module, data distribution module, local training module, parameter aggregation module, iterative optimization module, structure cutting module, parameter screening module, model reorganization module, performance evaluation module and deployment verification module; The model initialization module is used to construct an initial global model on the server side; The data distribution module is used to distribute the global model constructed by the server to the client nodes and manage the participation information of the client; The local training module is used for the client node to perform model training using local data to generate optimized parameters; The parameter aggregation module is used to aggregate the training results of the client into a global model to complete the parameter update of federated learning; The iterative optimization module performs mean iterative optimization on the aggregated global model to remove invalid parameters and improve model sparsity; The structure cutting module is used to cut the network architecture of the global model; The parameter screening module is used to simulate the parameter screening process and select the optimal parameter subset; The model reorganization module is used to combine the pruned network structure with the screening parameters to reconstruct a set of lightweight machine learning models; The performance evaluation module is used to comprehensively evaluate the performance of the model and compare it with the original model, quantify the performance improvement and resource saving, and provide a visual report; The deployment verification module is used to deploy the compressed model to the target environment and verify its performance in the actual scenario.

6. The machine learning model compression system based on federated learning and mean iteration according to claim 5, characterized in that: The specific steps of the optimal parameter subset of the parameter screening module are as follows: S4.1: Encode the pruned global model parameters, treat each parameter as an antibody, initialize the population, and each group of individuals in the population represents a parameter selection scheme. Based on each group of individuals, construct a simplified model, set the corresponding parameters marked as 0 to zero, and calculate the model accuracy on the validation set; S4.2: Individuals with model accuracy higher than the preset threshold are regarded as excellent antibodies, and cloned, where the number of clones is proportional to the fitness value. An antibody pool is generated through the cloning operation, and multiple cloned antibodies are used as mutation candidates. The parameter selection scheme corresponding to each cloned antibody in the antibody pool is randomly mutated to generate a new population; S4.3: Calculate the model accuracy of each antibody in the new population, and sort them in descending order according to the model accuracy. The best antibody whose model accuracy meets the preset requirements will enter the next round of iteration, and update the original population. Calculate the similarity between the antibodies in the updated population. If there are multiple antibodies with similarities higher than the preset value in the population, retain the antibody with the highest model accuracy and screen out the rest. S4.4: Repeat the iterative update of the population until the model accuracy of the best antibody in the population converges to a preset range in multiple rounds of iterations, or the preset maximum number of iterations is reached. The antibody with the highest model accuracy is taken as the final screening result, and the pruned global model parameters are updated according to its corresponding parameter selection scheme.

Citation Information

Cited By

  • Internet data risk early warning and collaborative management system and method

    CN120611391A

  • Artificial intelligence information security protection system and method

    CN121012680A