A personalized federated learning method, system, and medium for edge computing scenarios
By calculating mutual information values and combining weights of historical models in edge scenarios, a personalized model set is formed and interpolated for updating, which solves the problem of data heterogeneity and improves the personalization capability and training quality of client models.
Patent Information
- Application Number
- CN202310659941.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-05
- Publication Date
- 2025-10-31
- Estimated Expiration
- 2043-06-05
AI Technical Summary
In edge computing scenarios, traditional personalized federated learning methods cannot effectively solve the problem of data heterogeneity, resulting in a decline in the training quality of client models and failing to meet the personalized needs of clients.
Clients are sorted by calculating mutual information values on the parameter server side to form a personalized model set. On the client side, the combined weights of the model are calculated using historical model combination weights and mutual information bias terms, and the model is interpolated and updated to improve the personalization capability of the client model.
It enhances the personalization capabilities of client-side models, meets the training objectives expected by clients, and improves the performance of models in heterogeneous data scenarios.
Smart Images

Figure CN116663683B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing technology, and in particular to a personalized federated learning method, system, and medium for edge computing scenarios. Background Technology
[0002] The rapid development of artificial intelligence technology has had a tremendous impact on people's lives, and its success is inseparable from a large amount of data. In the big data-driven machine learning scenario based on edge devices, there are two key issues: (1) data security and privacy issues. Service providers need a large amount of personal data to train machine learning models, and personal data is usually stored on user devices; (2) training machine learning models requires a powerful platform. In order to collect and process the large amount of data from devices, third-party applications must provide the ability to provide rich transmission, computing and storage resources. However, most emerging service providers often cannot afford too much infrastructure expenditure. To address the above issues, Google proposed Federated Learning, a feasible method for training machine learning models from local data, which promotes client collaboration and protects data privacy. The basic process includes client training of local models and parameter server secure aggregation of global models.
[0003] Because client data is typically distributed across multiple geographical locations, it exhibits heterogeneity. A uniform global model cannot be applied to every client. Currently, personalized federated learning aims to address this data heterogeneity issue. However, traditional personalization methods using a single global model are unsuitable for clients with highly heterogeneous data. Furthermore, when using multiple client models for interpolation training, unrelated client models and inaccurate model weight combinations lead to a decline in training quality. Therefore, improving the personalization capabilities of client models to meet clients' desired training objectives is a pressing issue in current technologies. Summary of the Invention
[0004] This invention provides a personalized federated learning method, system, and medium for edge scenarios to improve the personalization capabilities of client models and meet the expected training objectives of clients.
[0005] To achieve the above objectives, the present invention employs the following technical solution:
[0006] In a first aspect, the present invention provides a personalized federated learning method for edge computing scenarios, comprising:
[0007] S1: On the parameter server side, a personalized model set is calculated based on client sorting using mutual information values, and the personalized model set is sent to the client side;
[0008] S2: On the client side, calculate the model combination weights corresponding to each model in the personalized model set using historical model combination weights and mutual information bias terms;
[0009] S3: On the client side, model interpolation is performed based on each model in the personalized model set and the model combination weights corresponding to each model to obtain the final model;
[0010] S4: Input the acquired data of the object to be identified into the final model, and obtain the recognition result output by the final model.
[0011] Optionally, in S1, the similarity of clients is represented by the mutual information value of the feature parameters of the client model. Multiple clients are sorted according to the similarity. The set of clients whose similarity to the benchmark client exceeds a preset value is formed into a set of personalized models of the benchmark client. The benchmark client is any one of the multiple clients.
[0012] Optionally, the mutual information values satisfy the following relationship:
[0013]
[0014] In the formula, θ i Let θ represent one of the models. j Let ρij represent another model, where ρij represents the correlation coefficient.
[0015] Optionally, the correlation coefficient satisfies the following relationship:
[0016]
[0017] In the formula, V i Representing model θ i The binary index, V j Representing model θ j The binarized index.
[0018] Optionally, S2 includes:
[0019] Select client c i During the t-th round of communication, the model combination weights as follows:
[0020]
[0021] In the formula, For historical model combination weights, As a weight bias term, when t=0, the historical model combination weights are initialized using model mutual information. as follows:
[0022]
[0023] When t>0, historical portfolio weights Set the combined weights of the previous model round, i.e. The larger the bias term, the greater the weight of the model combination. If it is larger, then:
[0024]
[0025] Among them, L i Let MI(θ) be the loss function. i ;θ j )express The size of , sgn is the sign function, and ReLU is the activation function in deep learning.
[0026] Optionally, the following relationship is satisfied when performing model interpolation updates in S3:
[0027]
[0028] In the formula, c i Indicates the client, S i Represents a set of personalized models. This represents one of the models. Representation Model The corresponding weights.
[0029] Secondly, this application provides a personalized federated learning system for edge scenarios, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the method described in the first aspect above.
[0030] Thirdly, this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method described in the first aspect.
[0031] Beneficial effects:
[0032] The personalized federated learning method for edge scenarios provided by this invention calculates a personalized model set composed of multiple client models, calculates the model combination weights using historical model combination weights and mutual information bias terms, and performs model interpolation training using the personalized model set and model combination weights. This can improve the personalization capability of client models and meet the client's expected training objectives. Attached Figure Description
[0033] Figure 1 This is a flowchart of a personalized federated learning method in an edge scenario according to a preferred embodiment of the present invention;
[0034] Figure 2 This is a schematic diagram of the application system architecture of a personalized federated learning method in an edge scenario according to a preferred embodiment of the present invention;
[0035] Figure 3 Features of the preferred embodiments of the present invention Figure 2 Value-based diagram;
[0036] Figure 4 This is a schematic diagram illustrating the impact of the size of the personalized model set on client model updates in a preferred embodiment of the present invention under the CIFAR-10 dataset;
[0037] Figure 5 The impact of the size of the personalized model set on client model updates under the FMNSIT dataset, as a preferred embodiment of the present invention;
[0038] Figure 6 This is a schematic diagram illustrating the validity of the weight bias term in the mutual information calculation model under the FMNSIT dataset according to a preferred embodiment of the present invention.
[0039] Figure 7 This invention relates to the effectiveness of the weight bias term in the mutual information calculation model on the CIFAR-10 dataset, as per a preferred embodiment of the invention. Detailed Implementation
[0040] The technical solution of the present invention will be clearly and completely described below. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0041] Unless otherwise defined, the technical or scientific terms used in this invention shall have the ordinary meaning understood by one of ordinary skill in the art to which this invention pertains. The terms "first," "second," and similar terms used in this invention do not indicate any order, quantity, or importance, but are merely used to distinguish different components. Similarly, the terms "an" or "a" and similar terms do not indicate a quantity limitation, but rather indicate the presence of at least one. The terms "connected" or "linked" and similar terms are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. "Up," "down," "left," "right," etc., are used only to indicate relative positional relationships; when the absolute position of the described object changes, the relative positional relationship also changes accordingly.
[0042] Please see Figures 1-2 This application provides a personalized federated learning method for edge computing scenarios, including:
[0043] S1: On the parameter server side, the personalized model set is calculated based on the client sorting according to the mutual information value, and the personalized model set is sent to the client side;
[0044] S2: On the client side, calculate the model combination weights corresponding to each model in the personalized model set using historical model combination weights and mutual information bias terms;
[0045] S3: On the client side, model interpolation is performed based on each model in the personalized model set and the model combination weights corresponding to each model to obtain the final model;
[0046] S4: Input the acquired data of the object to be identified into the final model and obtain the recognition result output by the final model.
[0047] In this embodiment, the parameter server calculates a personalized model set for each client and sends it to the corresponding client. For the client, after downloading the personalized model set, it calculates the model combination weights based on mutual information and performs model interpolation updates.
[0048] Specifically, the object to be identified can be image information. In other words, the personalized federated learning method for edge scenarios in this application can be applied to specific application scenarios of image recognition.
[0049] The personalized federated learning method described above for edge scenarios calculates a personalized model set consisting of multiple client models, uses historical model combination weights and mutual information bias terms to calculate model combination weights, and uses the personalized model set and model combination weights for model interpolation training. This can improve the personalization capability of client models and meet the client's expected training objectives.
[0050] Optionally, in S1, the similarity of clients is represented by the mutual information value of the feature parameters of the client model. Multiple clients are sorted according to the similarity criterion. The set of clients whose similarity to the benchmark client exceeds a preset value is formed into a set of personalized models of the benchmark client. The benchmark client is any one of the multiple clients.
[0051] To measure the similarity of client models in heterogeneous data scenarios and to calculate the combined weights of models for interpolation training of multiple client models, this optional implementation proposes a mutual information formula based on model representation features. Since the representation feature parameters of the client models are random variables following a specific probability distribution, and these parameters reflect the characteristics of the models, the similarity of client models is represented by calculating the mutual information value of the feature parameter ω; for model θ... i and θ j Its mutual information value MI(θ) i ;θ j )=H(ωi )+H(ω j )-H(ω i ,ω j ), where H(ω) i ) is θ i Feature parameter ω i The entropy, H(ω) j ) is θ j Feature parameter ω j The entropy, H(ω) i ,ω j ) represents the corresponding joint entropy.
[0052] When the feature parameters follow a normal distribution, the mutual information value can be expressed as a function of the correlation coefficient, i.e. This invention calculates the correlation coefficient using a binarized network method. For a single dataset, the same model corresponds to multiple feature maps, such as the convolutional layers of a convolutional network. Each feature map is processed as follows: Figure 3 The binarization operation is performed, and a binarization index (BI) is defined for the binarized feature map, denoted as BI(M′), where e represents an element in the binarized feature map M′. Multiple feature maps together form a feature vector v. s =[BI(M′1),...,BI(M′) i ),...,BI(M′ n Since there are multiple data points, summing all feature vectors and averaging them yields the binary index V representing the model's features. At this point, the correlation coefficient ρ... ij =||V i V j || 1 / 2 Mutual information value
[0053]
[0054] Optionally, S2 includes:
[0055] Select client c i During the t-th round of communication, the model combination weights as follows:
[0056]
[0057] In the formula, For historical model combination weights, As a weight bias term, when t=0, the historical model combination weights are initialized using model mutual information. as follows:
[0058]
[0059] When t>0, historical portfolio weights Set the combined weights of the previous model round, i.e. The larger the bias term, the greater the weight of the model combination. If it is larger, then:
[0060]
[0061] Among them, L i Let MI(θ) be the loss function. i ;θ j )express The size of , sgn is the sign function, and ReLU is the activation function in deep learning.
[0062] In this optional implementation, the client ranking method based on mutual information values is described as follows: Given a client as a baseline client, the mutual information similarity between all clients and the baseline client is calculated, and this similarity is used as a standard for client ranking. For two clients with high similarity, their distances to the baseline client are close, meaning their ranking positions are close. Thus, for any client, clients with high similarity can be obtained, and these clients form a personalized model set. In this implementation, sgn is a commonly used sign function, which transforms the loss value into three values {-1, 0, 1}, smoothing the impact of the difference in loss values on the bias term. ReLU is a common activation function in deep learning, which sets the bias value corresponding to the worse-performing model to 0, ensuring that the poor-performing model cannot obtain the weight gain of the bias term.
[0063] In this way, the update method based on mutual information interpolation can solve the problem of poor performance of the global model on some clients.
[0064] Optionally, client c i Based on the personalized model set S i And the corresponding model combination weights are used for model interpolation updates. When performing model interpolation updates in S3, the following relationship is satisfied:
[0065]
[0066] In the formula, S i Represents a set of personalized models. This represents one of the models. Representation Model The corresponding weights.
[0067] In a complete example, the experimental setup is as follows:
[0068] (1) Experimental Environment. The operating system used in the experiment was Ubuntu 18.04, the graphics card was NVIDIA GeForce RTX2080Ti with 10GB of video memory, and the deep learning framework was PyTorch 1.9. There were 15 client machines with a participation rate of 100%, and each client machine underwent 5 rounds of local training.
[0069] (2) Customer Dataset and Model. The Fashion-MNIST (FMNIST) and CIFAR-10 datasets were used. The FMNIST dataset consists of 70,000 grayscale images across 10 classes, with 7,000 images per class, including 6,000 training images and 1,000 test images. The CIFAR-10 dataset consists of 60,000 color images across 10 classes, with 6,000 images per class, divided into 5,000 training images and 1,000 test images. Non-independent and identically distributed customer data was achieved by assigning data from 5–6 different classes to each customer. The experimental model was a convolutional neural network model with two convolutional layers, a training learning rate of 0.01, and a batch size of 10.
[0070] (3) Evaluation metrics. In order to accurately reflect the personalization capability of the client model, the highest average test accuracy of the client is used as the evaluation metric, where the average test accuracy is the average of the test accuracy of all clients in each round of communication.
[0071] The experimental results are as follows:
[0072] (1) The impact of the size of the personalized model set on client model updates
[0073] The client updates its local model by downloading a personalized model set, verifying the impact of different personalized model set sizes |S| on the client's local training updates. Figure 4 and Figure 5 Increasing the size of the personalized model set |S| does not necessarily improve the average test accuracy of the client; a smaller |S| value can also achieve the desired effect. The reason why a smaller |S| performs better than a larger one is that it retains the best quality models, while a larger |S| retains some lower-quality models. When the client cannot avoid the adverse effects of these low-quality models, it will reduce the quality of the client's model updates. It should be noted that in the attached figures, the horizontal axis represents the number of communication rounds, and the vertical axis represents the average test accuracy of the client.
[0074] (2) Validity of the weight bias term in the mutual information calculation model
[0075] To illustrate the effectiveness of using mutual information (MI) to calculate the bias term, a comparison was made with the average bias term (Avg) and the bias term method using the first-order weight formula (Fomo) in FedFomo. Figure 6 and Figure 7 ,exist Figure 6 In the study, the client-side test accuracy based on bias term weights according to mutual information reached a maximum average of 74%, which is 1% to 2% higher than other methods; Figure 7 In the experiment, the highest average test accuracy for client machines based on bias term weights with mutual information reached 96%, which is about 1% higher than other methods. From the above experiments, we can conclude that bias term weights based on mutual information, calculated using the model mutual information formula, improve the highest average test accuracy for client machines, accurately measure the similarity of client machine models, and effectively calculate model combination weights.
[0076] (3) Comparison of Personalized Federated Learning Algorithms
[0077] The experiment added 50 more clients, a participation rate of 20%. Table 1 shows that pFedMI achieved peak average test accuracies of 96.49%, 97.42%, 76.37%, and 79.88%, significantly higher than the comparison algorithms, indicating that pFedMI outperformed the comparison algorithms. Local training only utilizes client-side data for updates, without benefiting from other clients; therefore, its peak average test accuracies were lower than all federated learning algorithms in all scenarios. The FedAvg algorithm does not consider heterogeneity, making it difficult for clients to benefit from the global model. The FedProx and pFedMe algorithms reconstruct local subproblems, causing clients to favor the local model during updates, but they still cannot solve the problem of weak generalization of the global model in heterogeneous data scenarios, although they are better than the FedAvg algorithm that does not address local subproblems. The FedFomo algorithm, based on the idea of multi-model interpolation, receives multiple client models from the server and uses a first-order optimization formula to obtain the combined model weights, avoiding the situation of global model failure. This invention uses its first-order optimization formula to calculate the combined model weights and compares it with the pFedMI algorithm. Experimental results show that the model combined weights based on mutual information are superior to the first-order optimization formula. Therefore, the model combined weight formula based on mutual information and the pFedMI algorithm, to a certain extent, solve the data heterogeneity problem in federated learning and improve the personalization capability of client models.
[0078] Table 1 Comparison of Personalized Federated Learning Algorithms
[0079]
[0080] In addition, this application also provides a personalized federated learning system for edge scenarios, including a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the above method.
[0081] This personalized federated learning system for edge scenarios can implement various implementation methods of the personalized federated learning method for edge scenarios mentioned above, and can achieve the same beneficial effects. It will not be elaborated here.
[0082] This application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method steps described above.
[0083] This computer-readable storage medium can implement various embodiments of the personalized federated learning method in the above-mentioned edge scenarios and achieve the same beneficial effects, which will not be elaborated here.
[0084] The preferred embodiments of the present invention have been described in detail above. It should be understood that those skilled in the art can make numerous modifications and variations based on the concept of the present invention without creative effort. Therefore, all technical solutions that can be obtained by those skilled in the art based on the concept of the present invention through logical analysis, reasoning, or limited experimentation on the basis of existing technology should be within the scope of protection defined by the claims.
Claims
1. A personalized federated learning method for edge computing scenarios, characterized in that, include: S1: On the parameter server side, a personalized model set is calculated based on client sorting using mutual information values, and the personalized model set is sent to the client side; S2: On the client side, calculate the model combination weights corresponding to each model in the personalized model set using historical model combination weights and mutual information bias terms; S3: On the client side, model interpolation is performed based on each model in the personalized model set and the model combination weights corresponding to each model to obtain the final model; S4: Input the acquired data of the object to be identified into the final model, and obtain the recognition result output by the final model; In step S1, the similarity of clients is represented by the mutual information value of the feature parameters of the client model. The similarity is used as the standard to sort multiple clients. The set of clients whose similarity to the benchmark client exceeds a preset value is formed into a set of personalized models of the benchmark client. The benchmark client is any one of the multiple clients. S2 includes: Select client c i During the t-th round of communication, the model combination weights as follows: In the formula, For historical model combination weights, As a weight bias term, when t=0, the historical model combination weights are initialized using model mutual information. as follows: When t > 0, historical portfolio weights Set the combined weights of the previous model round, i.e. The larger the bias term, the greater the weight of the model combination. If it is larger, then: Among them, L i Let MI(θ) be the loss function. i ;θ j )express The size of , sgn is the sign function, and the ReLU function is the activation function in deep learning; When performing model interpolation updates in S3, the following relationship is satisfied: In the formula, S i Represents a set of personalized models. This represents one of the models. Representation Model The corresponding weights.
2. The personalized federated learning method for edge scenarios according to claim 1, characterized in that, The mutual information values satisfy the following relationship: In the formula, θ i Let θ represent one of the models. j Representing another model, ρ ij This represents the correlation coefficient.
3. The personalized federated learning method for edge scenarios according to claim 2, characterized in that, The correlation coefficients satisfy the following relationship: In the formula, V i Representing model θ i The binary index, V j Representing model θ j The binarized index.
4. A personalized federated learning system for edge computing scenarios, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method described in any one of claims 1 to 3.
5. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the steps of the method as described in any one of claims 1-3.
Citation Information
Patent Citations
Federal recommendation method and system based on model-independent element learning
CN115409203A
Federal learning method for dynamic weight in edge scene
CN115526333A