A personalized federated learning method applied to privacy computing
By separating sample features into general and personalized information in personalized federated learning and processing them using global and personalized classifiers, the problem of sample-level information extraction is solved, generating a local model suitable for each client and addressing the challenges of data heterogeneity and privacy protection.
Patent Information
- Application Number
- CN202211375337.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-04
- Publication Date
- 2026-01-02
- Estimated Expiration
- 2042-11-04
AI Technical Summary
Existing personalized federated learning methods fail to effectively capture general and personalized information from different samples, resulting in low model generalization and an inability to achieve collaborative training while protecting client data privacy.
By separating sample feature information into general feature information and personalized feature information, and processing them by a global classifier and a personalized classifier respectively, personalized information extraction at the sample level is achieved. Collaborative training is performed between clients without data transmission using the conditional policy module.
It enables fine-grained capture of sample feature information while protecting data privacy, mitigating data heterogeneity issues and generating local personalized models suitable for each client.
Smart Images

Figure CN115660107B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of privacy computing, and particularly relates to a personalized federated learning method applied to privacy computing. BACKGROUND
[0002] With the continuous development of artificial intelligence (AI), the size of AI models is also increasing, and the parameter quantity of the AI models has reached the level of billions. In order to train such a huge AI model, a data quantity matching the parameter quantity of the model is one of the indispensable conditions. At present, the data used by various institutions is mostly collected from various end devices such as computers, mobile phones and sensors and the like. With the gradual popularization of intelligent terminals, the data quantity generated on the intelligent terminals also presents exponential growth. However, due to the demand for data privacy protection, various institutions cannot directly collect user data on intelligent terminal devices. How to give full play to the value of huge user data while ensuring user data privacy has become an important research direction at present. Federated learning can train a reasonable AI model by using data distributed on various end devices while providing data privacy protection function. In recent years, federated learning has attracted widespread attention from the academic and industrial circles due to its outstanding characteristics.
[0003] The most common federated learning framework currently adopts a "client-server" architecture mode in which a server aggregates models and controls training, while a client trains a model using its local data. In order to protect the privacy of the user data, during the federated learning process, the client data is prohibited from being uploaded to the server or other external devices such as other clients, and only the model parameters or other data-unrelated information obtained by training is allowed to be transmitted between the client and the server. Compared with the traditional distributed machine learning framework, the biggest difference of federated learning lies in the way of generating training data. In the distributed machine learning framework, the data is first collected, cleaned and distributed by the central server, and then sent to the worker node. This process has higher controllability of data, such as using random shuffling when distributing data to ensure that the data received by each worker node meets the independent and identically distributed characteristics, which is beneficial to model training and aggregation. However, in the federated learning framework, the data is initially present on the client side, and the server has no right to manipulate the data and cannot adjust the distribution of the data on each client. Because the way of generating data on each client is not consistent, this will lead to the non-independent and identically distributed characteristics of the data on these clients participating in federated learning. In this case, aggregating multiple client models will result in a lower generalization of the final global model when applied to a specific client, which is the "data heterogeneity" problem widely existing in the federated learning environment. The personalized federated learning framework modifies the way of training a unified global model in the traditional federated learning and then distributing it to each client for use. Its goal is no longer to learn a global model, but to focus on the client side, aiming to learn a local model suitable for each client. Compared with not using federated learning and allowing each client to train independently, personalized federated learning can make up for the lack of local data by regarding the global model or other information aggregated on the server as an information supplement to the data on the local client.
[0004] At present, a large number of research works have emerged in the field of personalized federated learning. However, most of the existing personalized federated learning methods only consider the model at the client level, ignoring the personalized characteristics at the sample level of finer granularity. At the same time, due to the differences between samples, the features extracted from different samples contain different amounts of general information and personalized information. Therefore, how to accurately capture general information and personalized information in different samples at the feature level and utilize them is one of the keys to realizing a finer-grained personalized federated learning framework.
[0005] Therefore, the skilled person in the art is committed to developing a learning framework that can accurately capture general information and personalized information in different samples at the feature level. SUMMARY
[0006] In view of the above-mentioned deficiencies of the prior art, the technical problem to be solved by the present invention is how to protect client data privacy and enable multiple clients to collaboratively participate in AI model training without data transmission between clients.
[0007] To achieve the above objectives, this invention provides a personalized federated learning method for privacy computing, relating to the field of privacy computing. It separates the feature information of each sample into general feature information and personalized feature information through a conditional policy module, and processes these two types of information through a global classifier and a personalized classifier respectively, thereby achieving sample-level and sample-specific personalized information extraction.
[0008] Furthermore, the method includes the following steps: Step 1, the N clients participating in federated learning are numbered 1, 2, ..., i, ..., N; the dataset containing privacy information on the i-th client is denoted as D. i The size of this dataset is denoted as |D. i |;Let the global feature extractor received on the i-th client be denoted as f(·;W fe Let the personalized feature extractor on the i-th client be denoted as . Let x be the sample i Extracted features Let g(·W) be the global classifier received on the i-th client. hd Let the personalized classifier on the i-th client be denoted as . The personalized conditional policy network is denoted as CP(·;Θ). i The outputs of the local conditional policy network, "general information policy" and "personalized information policy," are denoted as p, respectively. i,g and p i,p Let Θ denote the global conditional policy network parameters; define the personalized local model as... Let the loss function be denoted as L(·); let the local objective function be denoted as...
[0009] Step 2: Define the global objective function for the federated learning training;
[0010] Step 3: The server sends the initial global conditional policy network parameters Θ and the global feature extractor parameters W. fe and the global classifier parameters W hd To all clients;
[0011] Step 4: Iterate through training for t rounds;
[0012] Step 5: Client i receives the global conditional policy network parameter Θ and the global feature extractor parameter W.fe Then it updates its personalized conditional policy network parameters Θ i and personalized feature extractor parameters
[0013] Step 6, Client i freezes the global feature extractor f(·; W fe ) and the global classifier g(·; W hd );
[0014] Step 7, Client i trains the personalized model M(·; W i ) on the local dataset D i , where p i,g is the general information policy corresponding to each sample on the i-th client; is the personalized feature extractor parameter on the i-th client; is the personalized classifier parameter on the i-th client; f(·) is the feature extractor; g(·) is the classifier;
[0015] Step 8, Client i performs statistics on p i,g and p i,p generated according to each data (x i , y i ) in the dataset D i , and obtains the average and Then the vectors and are obtained respectively and and are called local classifier aggregation weights; where p i,p is the personalized information policy corresponding to each sample on the i-th client;
[0016] Step 9, Client i obtains the new client-specific information v i by averaging all h i ; where h i is the sample feature;
[0017] Step 10, Client i aggregates p and W hd as follows to obtain
[0018]
[0019] Then upload to the server for aggregation; where, is the classifier parameter of the i-th client for uploading;
[0020] Step 11, the server receives the model transmitted by all clients in the subset I t Step 5-Step 11 are executed on all clients in the set I
[0021] Step 12, the server receives the model transmitted by all clients in the subset I t , and then performs aggregation to generate a global model:
[0022]
[0023] wherein, θ is the global conditional policy network parameter; θ i is the personalized conditional policy network parameter on the i-th client;
[0024] Step 13, Steps 3-12 are executed until the local model training of each client converges, and finally output the local personalized model of each client.
[0025] Further, the global objective function in Step 2 is {W1,…,W N}=argmin G(L1,…,L N ), generally,
[0026] Further, in the step 3, the personalized conditional policy network parameter θ i , the personalized feature extractor parameter and the personalized classifier parameter
[0027] Further, in the step 4, the server randomly selects a subset I t of N clients according to the client participation rate ρ of each iteration, and sends the global conditional policy network parameter θ, the global feature extractor parameter W fe and the global classifier parameter W hd obtained in the last iteration to the clients in the set I t .
[0028] Further, in the step 5, the personalized classifier parameter is not updated when receiving the parameters of each round.
[0029] Further, in the step 6, the parameters W fe and the parameters W hd are not updated.
[0030] Further, the step 7 further includes the following steps:
[0031] Step 7.1: For dataset D i Each data (x) i ,y i Generate sample-specific information.
[0032] Step 7.2, h i Compared with the client-specific information v obtained in the previous round i (Initialized to all 1s) Multiplication yields the input C of the personalized conditional policy network. i =h i ⊙v i ;
[0033] Step 7.3, Personalized Conditional Strategy Network Reading C i It also generates "General Information Strategy" and "Personalized Information Strategy" p i,g and p i,p :
[0034] {p i,g ,p i,p}=CP(C i ;θ i ),
[0035] Among them, for p i,g and p i,p The k-th value in the equation satisfies CP(·) is a conditional policy network;
[0036] Step 7.4, in order to generate p i,g and p i,p Furthermore, satisfying the above constraints, the personalized conditional strategy network first generates the intermediate value 'a'. i ={a i,1 ,a i,2 Then, the Softmax function is used to obtain p respectively. i,g and p i,p The k-th value in:
[0037]
[0038] Step 7.5: Obtain information about sample x i Output
[0039] Step 7.6: For dataset D i Each data (x) i ,y i ), execute steps 7.1-7.5 to obtain information about the local dataset D. i loss function value where the second term adopts MMD (Maximum Mean Discrepancy) loss function to guide feature learning, λ is a hyper-parameter to control the importance of MMD loss function, κ(·) is a kernel function, and Gaussian kernel (RBF kernel) is adopted here;
[0040] Step 7.7, according to the loss function value F i , update the personalized model parameters W i as follows:
[0041]
[0042] where η is the learning rate of model training.
[0043] Further, in the step 7.2, the client-specific information v i needs to be initialized to all 1.
[0044] Further, in the step 8, and are two numerical values.
[0045] The present application firstly captures personalized information from the level of features of different samples on the basis of the federated learning framework with data privacy protection function, realizes more fine-grained information extraction compared to the personalized model parameter information from the client level, and realizes separation of general information and personalized information of sample features. By aggregating only the global classifier and combining the aggregated global classifier with the personalized classifier to process feature information, the data heterogeneity problem in federated learning is alleviated, and a local personalized model suitable for each client is obtained. For different samples, a feature information separation strategy is generated according to the characteristics of the samples, so that the separation of feature information is more fine-grained and accurate.
[0046] The concept, specific structure and technical effects of the present application will be further described below with reference to the accompanying drawings, so as to fully understand the purpose, features and effects of the present application. BRIEF DESCRIPTION OF DRAWINGS
[0047] Figure 1 is a communication process schematic diagram between the server and the client of a preferred embodiment of the present application;
[0048] Figure 2 is a local model internal data flow schematic diagram on the client of a preferred embodiment of the present application. DETAILED DESCRIPTION
[0049] The application can be embodied in a multitude of different forms and thus the scope of the application is not limited to the embodiments set forth in the following description.
[0050] In the drawings, like reference numerals indicate like elements throughout the several views. The sizes and the thicknesses of the components shown in the drawings are arbitrarily shown for the purpose of making the drawings easier to understand, and the present application is not limited to the sizes and the thicknesses of the components. The thicknesses of some components are exaggerated in some places in the drawings for the purpose of making the drawings easier to understand.
[0051] As Figure 1 described, the communication process between the server and the clients in the federated learning of the present application is described. Specifically, in each round: (1) the server selects a client set I t from all the clients according to the participation rate ρ of each iteration, and distributes the feature extractor parameters, the classifier parameters and the conditional policy network parameters to the clients in the set I t ; (2) for the client numbered i in I t , after receiving the global conditional policy network parameters θ and the global feature extractor parameters W fe , it updates its personalized conditional policy network parameters θ i and personalized feature extractor parameters W , and then retains and freezes W fe and W hd so that they do not participate in the local learning to update the parameters; (3) after the local learning is performed, the local classifier aggregation weights W and are obtained, and W hd and are aggregated to obtain the classifier parameters for uploading; (4) the client i uploads the locally updated W and θ i to the server; (5) the server receives all the parameters sent by the clients in the set I t , and aggregates them to obtain the global parameters corresponding to the individual modules.
[0052] As Figure 2 shown, the details of the data flow in the local model on the client are described. Among them, the rounded rectangle represents the sub-module of the personalized model, the right-angled rectangle represents the neural network layer in the sub-module, the solid arrow represents the data flow in the training and inference process, the dotted arrow represents the loss value calculation in the training process, and the dashed arrow represents the data flow that only occurs in the training process. The specific data flow process is divided into training process and inference process, which are described as follows: training process (W fe(Only has an effect during training): (1) For any input sample x i Feature vectors are obtained through a global feature extractor and a personalized feature extractor. and (2) Calculate the MMD loss value κ(h) i (3) h i Compared with the client-specific information v obtained in the previous round i Multiplication yields the input (conditional information) C of the personalized conditional policy network. i =h i ⊙v i (4) Generate both the general information policy and the personalized information policy p on client i simultaneously through the personalized conditional policy network. i,g and p i,p (5) Extract general feature information h⊙p i,g and personalized feature information h i ⊙p i,p (6) Input these two types of information into the global classifier and the personalized classifier respectively, and sum the outputs to obtain the final personalized model output. i (7) According to out i Calculate the loss value L(M(x) i W i ),y i (8) Execute the backpropagation algorithm based on the loss value to update the parameters in the modules whose parameters are not frozen. Inference process: (1) For any input sample x i Feature vectors are obtained through a personalized feature extractor. (2) h i Compared with the client-specific information v obtained in the previous round i Multiplication yields the input (conditional information) C of the personalized conditional policy network. i =h i ⊙v i (3) Generate both the general information policy and the personalized information policy p on client i simultaneously through the personalized conditional policy network. i,g and p i,p (4) Extract general feature information h⊙p i,g and personalized feature information h i ⊙p i,p (5) Input these two types of information into the global classifier and the personalized classifier respectively, and sum the outputs to obtain the final personalized model output.
[0053] The preferred embodiments of the present application have been described above in detail. It should be understood that modifications and variations to the preferred embodiments could be made by those skilled in the art without departing from the spirit and scope of the application. Accordingly, it is intended that there be included within the scope of the application, all such modifications and variations as would be apparent to those skilled in the art upon reading this disclosure. It is intended to obtain for the inventors such patent rights as are available for any patent granted on the present application.
Claims
1. A personalized federated learning method for privacy computing, relating to the field of privacy computing, which separates the feature information of each sample into general feature information and personalized feature information through a conditional policy module, and processes these two types of information through a global classifier and a personalized classifier respectively, thereby realizing sample-level and sample-specific personalized information extraction; The method includes the following steps: Step 1: Participating in Federated Learning The client number is ; will the first The dataset containing privacy information on each client machine is denoted as follows: The size of this dataset is denoted as . ; will the first The global feature extractor received on each client is denoted as . ; will the first The personalized feature extractor on each client machine is denoted as _____. ; Record through samples Extracted features ; will the first The global classifier received on each client is denoted as . ; will the first The personalized classifier on each client machine is denoted as ; Let the personalized conditional policy network be denoted as... The outputs of the local conditional policy network, "General Information Policy" and "Personalized Information Policy," are denoted as follows: and ; Let the global conditional policy network parameters be denoted as... ; Define personalized local models as The loss function is denoted as The local objective function is denoted as... ; Step 2: Define the global objective function for the federated learning training; Step 3: The server sends the initial global conditional policy network parameters. The parameters of the global feature extractor and the global classifier parameters To all clients; Step 4: Iterate through training for t rounds; Step 5, numbered The client receives the global conditional policy network parameters. and the global feature extractor parameters They are then used to update the personalized conditional policy network parameters. And personalized feature extractor parameters ; Step 6, Client The global feature extractor and the global classifier freeze; Step 7, Client In the dataset The above training of the personalized local model ,in ;in, It is the first A general information strategy corresponding to each sample on each client; It is the first Personalized feature extractor parameters on each client machine; It is the first Personalized classifier parameters on each client machine; It is a feature extractor; It is a classifier; Step 8, Client Based on the dataset Each data in generated and Perform statistical analysis and calculate the average to obtain... and Then obtain the vector. and Their respective average values and This is referred to as the local classifier aggregation weight; where, It is the first Personalized information strategy corresponding to each sample on each client machine; Step 9, Client For all Calculate the average to obtain new client-specific information. ;in, These are sample features; Step 10, Client right and The following aggregation was performed to obtain : Then Uploaded to the server for aggregation; among which, It is the first Classifier parameters used by each client for uploading; Step 11, for the first The set of clients participating in federated learning in rounds All clients execute steps 5-11; Step 12: The server receives the subset. The model is then processed from all client data, and then aggregated to generate a global model. in, ; These are global conditional policy network parameters; It is the first Personalized conditional policy network parameters on each client machine; Step 13: Execute steps 3-12 until the local model training of each client converges, and finally output the local personalized model of each client.
2. The personalized federated learning method for privacy-preserving computation as described in claim 1, characterized in that, The global objective function mentioned in step 2 is , .
3. The personalized federated learning method for privacy computing as described in claim 2, characterized in that, In step 3, the personalized conditional policy network parameters need to be initialized. The parameters of the personalized feature extractor and the personalized classifier parameters .
4. The personalized federated learning method for privacy computing as described in claim 3, characterized in that, In step 4, the server determines the client participation rate based on the client participation rate of each iteration. Random selection One of the subsets of clients The global conditional policy network parameters obtained from the previous iteration are then used. The parameters of the global feature extractor and the global classifier parameters Send to collection The client machine in the middle.
5. A personalized federated learning method for privacy-preserving computation as described in claim 4, characterized in that, In step 5, when parameters are received in each round, the personalized classifier parameters are not... Update.
6. The personalized federated learning method for privacy computing as described in claim 5, characterized in that, In step 6, the parameters are not... and parameters Update.
7. A personalized federated learning method for privacy computing as described in claim 6, characterized in that, Step 7 also includes the following steps: Step 7.1, for the dataset Each data in Generate sample-specific information ; Step 7.2, Compared with the client-specific information obtained in the previous round Initialize to all 1s, multiply to obtain the input of the personalized conditional policy network. ; Step 7.3, Personalized Conditional Policy Network Reading It also generates "general information strategy" and "personalized information strategy". and : Among them, for and The first in The values satisfy ; It is a conditional policy network; Step 7.4, in order to generate and And satisfy the constraints Personalized conditional strategy network first generates intermediate values Then, the Softmax function is used to obtain... and The first in One value: Step 7.5: Obtain information about the sample Output ; Step 7.6, for the dataset Each data in Perform steps 7.1-7.5 to obtain information about the local dataset. loss function value The second term uses the MMD (Maximum Mean Difference) loss function to guide feature learning. It is a hyperparameter that controls the importance of the MMD loss function. It is a kernel function; here, the Gaussian kernel function RBF kernel is used. Step 7.7: Based on the loss function value Personalized model parameters are updated through backpropagation algorithm. as follows: in, It is the learning rate for model training.
8. A personalized federated learning method for privacy computing as described in claim 7, characterized in that, In step 7.2, the client-specific information It needs to be initialized to all 1s.
9. A personalized federated learning method for privacy computing as described in claim 8, characterized in that, In step 8 and There are two values.