Personalized federal learning method based on prototype alignment learning

By introducing the prototype alignment learning method in federated learning, using the global class prototype set and the local data of the client for model training and parameter updating, the problem of performance degradation caused by data heterogeneity is solved, and the model generalization ability and privacy protection effect are improved. .

CN118674015APending Publication Date: 2024-09-20ZHEJIANG UNIV
View PDF 0 Cites 16 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

Existing federated learning algorithms face the problem of performance degradation when dealing with data heterogeneity, especially due to the lack of consideration of the heterogeneity of client data distribution and features, resulting in poor model generalization effects.

Method used

A personalized federated learning method based on prototype alignment learning is used to initialize global model parameters and class prototype sets in the central server, and perform iterative training on the client, upload local model parameters and class prototype sets for weighted aggregation, and update global feature extraction. and classifier parameters to facilitate collaboration and knowledge integration between clients.

Benefits of technology

It effectively alleviates the impact of data heterogeneity, improves model performance, reduces the risk of privacy leakage, enhances collaboration efficiency between clients, and improves the model accuracy of federated learning methods.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118674015A
    Figure CN118674015A
Patent Text Reader

Abstract

The invention discloses a personalized federal learning method based on prototype alignment learning, and the method comprises the steps: a server initializes global model parameters and a global class prototype set, and transmits the global model parameters and the global class prototype set to all clients, so as to initialize local models of the clients; each client performs iterative training on a local model by using local private training data and the global class prototype set, obtains trained local model parameters and a local class prototype set, and uploads the local model parameters and the local class prototype set to a server; the server performs weighted aggregation according to the local model parameters and the local class prototype set of all the clients to obtain an updated global class prototype set, global feature extractor parameters and personalized classifier parameters of all the clients, and issues the updated global class prototype set, global feature extractor parameters and personalized classifier parameters to all the clients; and each client repeatedly trains the local model until a preset communication round is reached or the target loss functions of all the local models are converged. The risk of leaking user sensitive information can be greatly reduced, and the precision and performance of the model can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of cloud computing, and in particular to a personalized federated learning method based on prototype alignment learning. Background Art

[0002] The widespread application of deep learning technology has achieved remarkable results in various fields, such as image recognition, natural language processing, and recommendation systems. However, with the development of deep learning models and the growth of data scale, an important issue is how to deal with large-scale, highly sensitive data scattered among different entities. People's concerns about data privacy and security are gradually increasing, and higher requirements are put forward for protecting private data.

[0003] To solve this problem, Federated Learning was proposed as a novel distributed learning framework that allows models to be trained in a distributed environment while protecting the data privacy of clients. In federated learning, clients share information about model updates instead of directly sharing original data. This approach helps reduce the amount of data transmission and the risk of privacy leakage. However, existing federated learning algorithms usually assume that the data between clients is homogeneous, that is, the data has similar distribution and characteristics. This assumption does not always hold true in reality. Data in actual application scenarios usually have heterogeneous characteristics. For example, data generated by different regions, different user groups, or different devices may have different data distributions and characteristics. Due to the lack of consideration of data heterogeneity, existing federated learning algorithms face challenges in processing heterogeneous data. Many studies have shown that ignoring data heterogeneity may lead to a decline in the performance of the model on some clients, thereby affecting the performance of the overall model.

[0004] Therefore, an effective personalized federated learning method is needed to solve data heterogeneity. Specifically, it is to perform model-level personalized settings on the client to alleviate the impact of data heterogeneity and train a more effective personalized model for each client.

[0005] Existing personalized federated learning methods usually divide the neural network model into a feature extractor and a personalized classifier. In this division, the feature extractor is usually located in the first few layers of the neural network and is responsible for extracting shared feature representations from the raw data. These feature representations do not contain sensitive information of individual data and can therefore be shared between clients. Each client then has a personalized classifier for personalized classification tasks based on the feature representations. During the learning process, after the feature extractor is trained locally, it is sent to the cloud for parameter aggregation. In the next round of training, the local feature extractor is overwritten, while the personalized classifier remains in local training and learns from local private data.

[0006] However, when the data distribution between clients is similar, the above method does not fully consider the collaboration between the local classifier and other client classifiers, resulting in poorer generalization than the single global model learned by the traditional federated learning algorithm. In this case, the individual classifiers can collaborate to improve the accuracy of the personalized model by sharing and integrating the knowledge of the individual classifiers. Summary of the invention

[0007] The purpose of the present invention is to provide a personalized federated learning method based on prototype alignment learning to address the deficiencies of the prior art. The present invention aims to share prototype information, encourage clients with similar prototype information to collaborate, and train a personalized model with better performance for each client in different data heterogeneity scenarios.

[0008] The objective of the present invention is achieved through the following technical solution: a personalized federated learning method based on prototype alignment learning, comprising the following steps:

[0009] (1) The central server calculates the global model parameters {φ, ψ} and the global class prototype set Initialize; wherein the global model parameters {φ, ψ} include global feature extractor parameters φ and classifier parameters ψ;

[0010] (2) The central server selects some clients as participants in this round of training and sends the initialized global model parameters {φ, ψ} and the global class prototype set Sent to each client of federated learning, each client initializes the local model according to the received global model parameters {φ, ψ};

[0011] (3) Client i uses local private training data and the received global class prototype set Iteratively train the local model to obtain the trained local model parameters {φ i ,ψ i} and local class prototype set C i , and upload it to the central server;

[0012] (4) The central server calculates the local model parameters {φ i ,ψ i} and local class prototype set C i Perform weighted aggregation to obtain the updated global class prototype set Global feature extractor parameters and each client's personalized classifier parameters are sent to each client;

[0013] (5) Each client updates its local model according to the updated global feature extractor parameters and client personalized classifier parameters received by itself;

[0014] (6) Repeat steps (3) to (5) until a preset communication round is reached or the target loss function of the local model of all clients converges.

[0015] Furthermore, the client i uses the local private training data and the received global class prototype set Iteratively train the local model to obtain the trained local model parameters {φ i ,ψ i}, including:

[0016] The local model of client i includes a feature extractor and a classifier;

[0017] The local private training data is input into the local model, and first passes through the feature extractor to extract the underlying information of the input data and obtain the feature embedding vector;

[0018] The feature embedding vector is then input into the classifier to map it to the predicted value of the corresponding category or label;

[0019] The cross entropy loss function value is calculated based on the predicted value of the category or label and the corresponding true category, and the global class prototype set received by client i is calculated based on the global class prototype set received by client i. And the feature embedding vector output by the feature extractor calculates the prototype alignment loss function value;

[0020] The target loss function is constructed based on the cross entropy loss function and the prototype alignment loss function, with the minimization of the target loss function value as the optimization goal, and the local model parameters {φ i ,ψ i}, until the preset number of iterative training times is reached or the target loss function value converges, the trained local model parameters {φ i ,ψ i}.

[0021] Furthermore, the expression of the objective loss function is:

[0022]

[0023] In the formula, represents the target loss function, represents the cross entropy loss function, represents the prototype alignment loss function, μ is a hyperparameter used to adjust the importance of the cross entropy loss term and the prototype alignment loss term in the objective loss function of the local model;

[0024] The expression of the cross entropy loss function is:

[0025]

[0026] Where N i represents the total number of local private training data samples of the i-th client, y l is the sample data x l The category to which it belongs, Represents the client local model parameters;

[0027] The expression of the prototype alignment loss function is:

[0028]

[0029] Where N i represents the total number of local private training data samples of the i-th client, Given the input sample data x l The feature embedding vector output by the feature extractor, φ i is the feature extractor parameter of the i-th client, y l is the sample data x l The category to which it belongs, is the category y to which the sample belongs l The global class prototype of represents the square of the Euclidean distance between two feature embedding vectors, and d is the dimension of the feature embedding vector.

[0030] Furthermore, in step (3), the local class prototype set C i The specific methods for obtaining include:

[0031] The feature embedding vector output by the feature extractor during the iterative training process is used as the class prototype information, and the prototype information of all categories of client i is obtained according to the following formula; the local class prototype set C of client i is obtained based on the prototype information of all categories i ;

[0032]

[0033] In the formula, represents the prototype information of the jth category of client i, which is also the average value of the feature embedding vectors of all samples in category j; D i,j is the local private training dataset D of the i-th client i A subset of f, consisting of local private training data belonging to category j; i (φ i ; x) represents the feature embedding vector output by the feature extractor of the i-th client, φ i represents the feature extractor parameters of the i-th client, and x represents the local private training data input to the feature extractor.

[0034] Furthermore, in step (4), the updated global class prototype set The specific methods for obtaining include:

[0035] The central server receives the local class prototype set C uploaded by all clients i Then, for category j, the central server selects a group of prototype information uploaded by clients with category j for weighted aggregation, and calculates the global prototype information of category j according to the following formula; the updated global class prototype set is obtained based on the global prototype information of all categories

[0036]

[0037] In the formula, represents the global prototype information of category j, represents the set of clients with category j, Represents the prototype information of client i and category j.

[0038] Furthermore, in step (4), the method for obtaining the updated global feature extractor parameters specifically includes:

[0039] The central server uses the weights of each client to perform weighted averaging on the feature extractor parameters uploaded by each client to obtain updated global feature extractor parameters; wherein the weight of the client is calculated based on the local private training data corresponding to the client.

[0040] Furthermore, the calculation formula of the updated global feature extractor parameters is:

[0041]

[0042] In the formula, φ (t+1) represents the updated global feature extractor parameters, t represents the current communication round, represents the feature extractor parameters of client i in the current communication round, m is the total number of clients participating in federated learning, and β i represents the weight of client i, and its calculation formula is:

[0043]

[0044] Where N i represents the total number of local private training data samples of client i, is the total amount of local private training data of m clients.

[0045] Furthermore, in step (4), the method for obtaining the parameters of the personalized classifiers of each client specifically includes:

[0046] The central server calculates the cosine similarity between the local class prototype representation of the client and the local class prototype representation of other clients based on the local class prototype set uploaded by each client, and obtains the relationship matrix R after normalization. The calculation formula is expressed as:

[0047]

[0048] In the formula, r ib is the cosine similarity; R ib is the relationship matrix weight, which is the element in the relationship matrix R;

[0049] The central server sets the personalized classifier parameters of all clients in round t+1 According to the relationship matrix weight R ib The weighted summation is performed, and the calculation formula is expressed as:

[0050]

[0051] In the formula, is the updated personalized classifier parameter of client i, are the personalized classifier parameters of other clients in the current communication round t.

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

[0053] (1) The present invention uses the output representation of the feature extraction layer as the data prototype and calculates the alignment loss with the global prototype of all categories, thereby making full use of global knowledge, alleviating the impact of data heterogeneity, and improving the performance of the model.

[0054] (2) The present invention can effectively avoid the problem of privacy leakage by uploading class prototypes; each client only needs to upload an abstract representation of its data rather than the specific data itself, which greatly reduces the risk of leaking user sensitive information.

[0055] (3) The present invention updates the personalized classifier model of each client in the next round by weighted combination of the similarities of all the received client prototypes, adaptively promotes potential pairwise collaboration between clients, and significantly improves the effectiveness of collaboration.

[0056] (4) The present invention can make up for the problem that the personalized federated learning method does not consider the knowledge collaboration between different clients. It not only meets the needs of data privacy protection, but also ensures the information sharing and collaboration between clients in the federated learning process, and can effectively improve the accuracy of the model trained by the federated learning method. BRIEF DESCRIPTION OF THE DRAWINGS

[0057] Figure 1 A flowchart of the personalized federated learning method based on prototype alignment learning of the present invention;

[0058] Figure 2 It is a schematic diagram of the workflow of the client of the present invention;

[0059] Figure 3 It is a schematic diagram of the workflow of the central server of the present invention. DETAILED DESCRIPTION

[0060] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the attached claims. It should be understood that the above general description and the detailed description that follows are merely exemplary and explanatory and cannot limit the present application.

[0061] The terms used in this application are for the purpose of describing specific embodiments only and are not intended to limit this application. The singular forms of "a", "said" and "the" used in this application and the appended claims are also intended to include plural forms unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.

[0062] It should be understood that, although the term first, second, third, etc. may be used in the present application to describe various information, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of..." or "when..." or "in response to determination". Moreover, the term "include", "comprise" or any other variant thereof is intended to cover non-exclusive inclusion, so that the process and method including a series of elements include not only those elements, but also include other elements not clearly listed, or also include elements inherent to such process and method. In the absence of more restrictions, the elements limited by the statement "including one..." do not exclude the existence of other identical elements in the process, method, article or equipment including the elements.

[0063] See also Figure 1 The personalized federated learning method based on prototype alignment learning of the present invention specifically includes the following steps:

[0064] (1) The central server calculates the global model parameters {φ, ψ} and the global class prototype set Initialization is performed; wherein the global model parameters {φ, ψ} include global feature extractor parameters φ and classifier parameters ψ.

[0065] (2) The central server selects a certain proportion of clients as participants in this round of training and sends the initialized global model parameters {φ, ψ} and the global class prototype set It is sent to each client of federated learning, and each client initializes the local model according to the received global model parameters {φ, ψ}.

[0066] It should be noted that after receiving the global model parameters {φ, ψ}, each client performs local model parameter {φ i ,ψ i} to initialize the local model.

[0067] (3) Client i uses local private training data and the received global class prototype set Iteratively train the local model to obtain the trained local model parameters {φ i ,ψ i} and local class prototype set C i and upload it to the central server.

[0068] In this embodiment, client i uses local private training data and the received global class prototype set Iteratively train the local model to obtain the trained local model parameters {φ i ,ψ i}, specifically including: in the image classification task, the local model of client i includes a feature extractor and a classifier; the local private training data is input into the local model, first through the feature extractor, the underlying information of the input data is extracted, and the feature embedding vector is obtained; the feature embedding vector is then input into the classifier to map it to the predicted value of the corresponding category or label; the cross entropy loss function value is calculated according to the predicted value of the category or label and the corresponding true category, and the global class prototype set received by client i is used as the input. The prototype alignment loss function value is calculated based on the feature embedding vector output by the feature extractor; the target loss function is constructed according to the cross entropy loss function and the prototype alignment loss function, and the local model parameters {φ are adjusted by minimizing the target loss function value to optimize the local model. i ,ψ i}, until the preset number of iterative training times is reached or the target loss function value converges, the trained local model parameters {φ i ,ψ i}.

[0069] Furthermore, the expression of the objective loss function is:

[0070]

[0071] In the formula, represents the target loss function, represents the cross entropy loss function, represents the prototype alignment loss function, and μ is a hyperparameter used to adjust the importance of the cross entropy loss term and the prototype alignment loss term in the objective loss function of the local model.

[0072] Furthermore, the expression of the cross entropy loss function is:

[0073]

[0074] Where N i represents the total number of local private training data samples of the i-th client, y l is the sample data x l The category to which it belongs, Represents client local model parameters.

[0075] Furthermore, the expression of the prototype alignment loss function is:

[0076]

[0077] Where N irepresents the total number of local private training data samples of the i-th client, Given the input sample data x l The feature embedding vector output by the feature extractor, φ i is the feature extractor parameter of the i-th client, y l is the sample data x l The category to which it belongs, is the category y to which the sample belongs l The global class prototype of represents the square of the Euclidean distance between two feature embedding vectors, Represents sample x l The feature embedding vector and its corresponding global class prototype The square of the Euclidean distance between them, d is the dimension of the feature embedding vector.

[0078] It should be noted that the objective loss function of the local model is It consists of two parts. The first part is the cross entropy loss commonly used in multi-classification problems. The second part is the prototype alignment loss Since the data distribution of each client may be significantly different in federated learning, the prototype alignment loss is added to the objective loss function of the local model using the global class prototype set to control the amplitude of the local model update, so that local representation learning can benefit from global data and reduce generalization error.

[0079] In this embodiment, the local class prototype set C i The method for obtaining specifically includes: taking the feature embedding vector output by the feature extractor in the iterative training process as the class prototype information, and obtaining the prototype information of all categories of client i according to the following formula; obtaining the local class prototype set C of client i according to the prototype information of all categories i .

[0080]

[0081] In the formula, represents the prototype information of the jth category of client i, which is also the average value of the feature embedding vectors of all samples in category j; D i,j is the local private training dataset D of the i-th client i The subset of local private training data belonging to category j consists of the local private training data set D i Sampling from distribution P i (x,y);f i (φ i ; x) represents the feature embedding vector output by the feature extractor of the i-th client, φ irepresents the feature extractor parameters of the i-th client, and x represents the local private training data input to the feature extractor.

[0082] For example, there are j=5 categories in the local category of client i, then the prototype information of 5 categories is obtained according to the above formula, which are respectively Then get the local class prototype set of client i based on the prototype information of all categories

[0083] (4) The central server calculates the local model parameters {φ i ,ψ i} and local class prototype set C i Perform weighted aggregation to obtain the updated global class prototype set The global feature extractor parameters and the personalized classifier parameters of each client are sent to each client.

[0084] In this embodiment, the updated global class prototype set The acquisition method specifically includes: the central server receives the local class prototype set C uploaded by all clients i Then, for category j, the central server selects a group of prototype information uploaded by clients with category j for weighted aggregation, and calculates the global prototype information of category j according to the following formula; the updated global class prototype set is obtained based on the global prototype information of all categories

[0085]

[0086] In the formula, represents the global prototype information of category j, represents the set of clients with category j, Represents the prototype information of client i and category j.

[0087] In this embodiment, the method for obtaining the updated global feature extractor parameters specifically includes: the central server uses the weights of each client to perform weighted averaging on the feature extractor parameters uploaded by the client to obtain the updated global feature extractor parameters; wherein the client's weight is calculated based on the local private training data corresponding to the client, so that the local model parameters of clients with larger data volumes can account for a larger proportion in the update process.

[0088] Furthermore, the calculation formula of the updated global feature extractor parameters is:

[0089]

[0090] In the formula, φ (t+1)represents the updated global feature extractor parameters, t represents the current communication round, represents the feature extractor parameters of client i in the current communication round, m is the total number of clients participating in federated learning, and β i represents the weight of client i, and its calculation formula is:

[0091]

[0092] Where N i represents the total number of local private training data samples of client i, is the total amount of local private training data of m clients.

[0093] In this embodiment, the method for obtaining the parameters of the personalized classifier of each client specifically includes: the central server calculates the cosine similarity between the local class prototype representation of the client and the local class prototype representation of other clients according to the local class prototype set uploaded by each client, and obtains the relationship matrix R after normalization, and its calculation formula is expressed as:

[0094]

[0095] In the formula, r ib is the cosine similarity; R ib is the relationship matrix weight, which is the element in the relationship matrix R.

[0096] The central server sets the personalized classifier parameters of all clients in round t+1 According to the relationship matrix weight R ib The weighted summation is performed, and the calculation formula is expressed as:

[0097]

[0098] In the formula, is the updated personalized classifier parameter of client i, are the personalized classifier parameters of other clients in the current communication round t.

[0099] It should be noted that in the case of heterogeneous data domains, the data domains of different clients may be very different, or may have certain correlations. Therefore, the average representation information of all local data of the client can be used as the prototype representation C at the client level, which can reflect the data characteristics of the client. During the communication round, the prototype representation C of each client is i Upload to the central server, and then the central server will perform personalized aggregation on the local model parameters of each client. Taking the i-th client as an example, the central server will calculate the local class prototype representation C of client i i Cosine similarity r with local class prototype representations of other clientsij , after normalization, we get the relation matrix R. By controlling the relation matrix R, we can calculate a personalized classifier parameter ψ for each client that benefits from the collaboration between clients. i .

[0100] (5) Each client updates its local model based on the updated global feature extractor parameters and client-side personalized classifier parameters it receives.

[0101] (6) Repeat steps (3) to (5) until a preset communication round is reached or the target loss function of the local model of all clients converges.

[0102] Figure 2 The client workflow is shown. Before each round of local model training begins, the client receives personalized model parameters, namely global feature extractor parameters and personalized classifier parameters, from the central server to initialize the local model for this round. The local model is iteratively trained using local private training data. During the training process, the global class prototype set received is used to plan the training of the local model. After the training is completed, the client uploads the local class prototype set C to the central server. i and the trained feature extractor parameters and classifier parameters.

[0103] Figure 3 The workflow of the central server is shown. In each round of federated learning, after the training of each client is completed, the central server receives the trained feature extractor parameters and local class prototype sets of all clients. Then, the cosine similarity between the current client and other clients is calculated based on the local class prototype set of the client, and the relationship matrix R is further calculated. The global feature extractor parameters and the global class prototype set are obtained by weighted aggregation according to the number of samples of each client. The personalized classifier parameters of each client are then weighted and aggregated using the relationship matrix R. Finally, the global class prototype set, global feature extractor parameters, and personalized classifier parameters of each client are obtained on the central server and sent to each client.

[0104] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A personalized federated learning method based on prototype alignment learning, It is characterized in that The following steps are involved: (1) The central server calculates the global model parameters {φ, ψ} and the global class prototype set Initialize; wherein the global model parameters {φ, ψ} include global feature extractor parameters φ and classifier parameters ψ; (2) The central server selects some clients as participants in this round of training and sends the initialized global model parameters {φ, ψ} and the global class prototype set Sent to each client of federated learning, each client initializes the local model according to the received global model parameters {φ, ψ}; (3) Client i uses local private training data and the received global class prototype set Iteratively train the local model to obtain the trained local model parameters {φ i ,ψ i } and local class prototype set C i , and upload it to the central server; (4) The central server calculates the local model parameters {φ i ,ψ i } and local class prototype set C i Perform weighted aggregation to obtain the updated global class prototype set Global feature extractor parameters and each client's personalized classifier parameters are sent to each client; (5) Each client updates its local model according to the updated global feature extractor parameters and client personalized classifier parameters received by itself; (6) Repeat steps (3) to (5) until a preset communication round is reached or the target loss function of the local model of all clients converges.

2. According to the personalized federated learning method based on prototype alignment learning according to claim 1, It is characterized in that The client i uses the local private training data and the received global class prototype set Iteratively train the local model to obtain the trained local model parameters {φ i ,ψ i }, including: The local model of client i includes a feature extractor and a classifier; The local private training data is input into the local model, and first passes through the feature extractor to extract the underlying information of the input data and obtain the feature embedding vector; The feature embedding vector is then input into the classifier to map it to the predicted value of the corresponding category or label; The cross entropy loss function value is calculated based on the predicted value of the category or label and the corresponding true category, and the global class prototype set received by client i is calculated based on the global class prototype set received by client i. And the feature embedding vector output by the feature extractor calculates the prototype alignment loss function value; The target loss function is constructed based on the cross entropy loss function and the prototype alignment loss function, with the minimization of the target loss function value as the optimization goal, and the local model parameters {φ i ,ψ i }, until the preset number of iterative training times is reached or the target loss function value converges, the trained local model parameters {φ i ,ψ i }.

3. According to the personalized federated learning method based on prototype alignment learning according to claim 2, It is characterized in that The expression of the objective loss function is: In the formula, represents the target loss function, l ce represents the cross entropy loss function, l pa represents the prototype alignment loss function, μ is a hyperparameter used to adjust the importance of the cross entropy loss term and the prototype alignment loss term in the objective loss function of the local model; The expression of the cross entropy loss function is: Where N i represents the total number of local private training data samples of the i-th client, y l is the sample data x l The category to which it belongs, Represents the client local model parameters; The expression of the prototype alignment loss function is: Where N i represents the total number of local private training data samples of the i-th client, Given the input sample data x l The feature embedding vector output by the feature extractor, φ i is the feature extractor parameter of the i-th client, y l is the sample data x l The category to which it belongs, is the category y to which the sample belongs l The global class prototype of represents the square of the Euclidean distance between two feature embedding vectors, and d is the dimension of the feature embedding vector.

4. The personalized federated learning method based on prototype alignment learning according to claim 1, It is characterized in that In step (3), the local class prototype set C i The specific methods for obtaining include: The feature embedding vector output by the feature extractor during the iterative training process is used as the class prototype information, and the prototype information of all categories of client i is obtained according to the following formula; the local class prototype set C of client i is obtained based on the prototype information of all categories i ; In the formula, represents the prototype information of the jth category of client i, which is also the average value of the feature embedding vectors of all samples in category j; D i,j is the local private training dataset D of the i-th client i A subset of f, consisting of local private training data belonging to category j; i (φ i ; x) represents the feature embedding vector output by the feature extractor of the i-th client, φ i represents the feature extractor parameters of the i-th client, and x represents the local private training data input to the feature extractor.

5. The personalized federated learning method based on prototype alignment learning according to claim 1, It is characterized in that In step (4), the updated global class prototype set The specific methods for obtaining include: The central server receives the local class prototype set C uploaded by all clients i Then, for category j, the central server selects a group of prototype information uploaded by clients with category j for weighted aggregation, and calculates the global prototype information of category j according to the following formula; the updated global class prototype set is obtained based on the global prototype information of all categories In the formula, represents the global prototype information of category j, represents the set of clients with category j, Represents the prototype information of client i and category j.

6. The personalized federated learning method based on prototype alignment learning according to claim 1, It is characterized in that In the step (4), the method for obtaining the updated global feature extractor parameters specifically includes: The central server uses the weights of each client to perform weighted averaging on the feature extractor parameters uploaded by each client to obtain updated global feature extractor parameters; wherein the weight of the client is calculated based on the local private training data corresponding to the client.

7. The personalized federated learning method based on prototype alignment learning according to claim 6, It is characterized in that The calculation formula of the updated global feature extractor parameters is: In the formula, φ (t+1) represents the updated global feature extractor parameters, t represents the current communication round, represents the feature extractor parameters of client i in the current communication round, m is the total number of clients participating in federated learning, and β i represents the weight of client i, and its calculation formula is: Where N i represents the total number of local private training data samples of client i, is the total amount of local private training data of m clients.

8. The personalized federated learning method based on prototype alignment learning according to claim 1, It is characterized in that In step (4), the method for obtaining the parameters of the personalized classifiers of each client specifically includes: The central server calculates the cosine similarity between the local class prototype representation of the client and the local class prototype representation of other clients based on the local class prototype set uploaded by each client, and obtains the relationship matrix R after normalization. The calculation formula is expressed as: In the formula, r ib is the cosine similarity; R ib is the relationship matrix weight, which is the element in the relationship matrix R; The central server sets the personalized classifier parameters of all clients in round t+1 According to the relationship matrix weight R ib The weighted summation is performed, and the calculation formula is expressed as: In the formula, is the updated personalized classifier parameter of client i, are the personalized classifier parameters of other clients in the current communication round t.

Citation Information

Cited By

  • Edge anomaly detection method based on global-personalized collaborative federated learning

    CN119202839A

  • Edge Anomaly Detection Method Based on Global-Personalized Collaborative Federated Learning

    CN119202839B

  • Federal learning-based pre-training model fine tuning method and related equipment

    CN119272842A

  • Data and model heterogeneous federated learning method based on adaptive aggregation prototype

    CN119378650A

  • Federal learning method based on attention guidance feature distillation and prototype comparison and alignment

    CN119416915A