Federal learning method based on difference cognition personalized knowledge absorption

By introducing Bregman divergence regularization and Wasserstein distance measurement mechanisms, combined with the characteristic center of mass fusion algorithm, the personalized knowledge absorption in federated learning is optimized, and the adaptation problem of traditional federated learning is solved under Non-IID data, the stability and adaptability of the model are improved, and privacy protection is ensured.

CN120450085APending Publication Date: 2025-08-08SHANXI MERCURY TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510560773.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-30
Publication Date
2025-08-08

AI Technical Summary

Technical Problem

Traditional federated learning is difficult to build a global model that is adapted to each client under Non-IID data. The existing personalized federated learning method relies on global models, ignores client differential knowledge and privacy protection, resulting in increased client drift and trial and error costs.

Method used

The regularization constraint term algorithm based on Bregman divergence and the data heterogeneity measurement mechanism of Wasserstein distance are adopted, and the Wasserstein feature center of mass fusion algorithm is combined with the Wasserstein feature center of mass fusion algorithm, and the personalized knowledge absorption process is optimized through the differential cognition between the global model and the local model, and the cost of client drift and trial and error is reduced.

Benefits of technology

It improves the stability and generalization ability of the model in the local personalized exploration process, enhances the model's adaptability to the client's personalized needs, and ensures the sustainability and privacy protection of the federated learning ecosystem.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120450085A_ABST
    Figure CN120450085A_ABST
Patent Text Reader

Abstract

The invention discloses a federated learning method (FedDKA) based on difference cognition personalized knowledge absorption, and belongs to the technical field of federated learning. Aiming at the problems that a global model adaptive to each client is difficult to construct under Non-IID data in traditional federated learning, and an existing personalized federated learning method depends on the global model and neglects client difference knowledge and privacy protection and the like, the FedDKA formalizes an optimization target of a personalized model; and a near-regularization term is introduced to deal with the customer single drift problem caused by data heterogeneity, and the over-fitting risk is reduced. In addition, in order to reduce the trial and error cost during personalized exploration of local clients, the FedDKA innovatively designs a distance approximation algorithm, and the difference cognition between the clients is improved. In order to accurately realize personalized knowledge absorption, a personalized feature fusion algorithm is designed, and a client is promoted to realize highly personalized updating of a local model on the basis of differential cognition. The method aims to enhance the personalized performance of the local model in the personalized federated learning system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of federated learning technology, and specifically relates to a federated learning method based on differential cognition and personalized knowledge absorption. Background Art

[0002] Federated learning (FL), as an emerging machine learning paradigm, allows multiple clients to collaboratively train a shared model without directly exposing their private data. In traditional federated learning scenarios, in pursuit of performance optimization of machine learning models and algorithms, a large number of existing studies often presuppose that client data is in an IID state, such as the FedAvg algorithm. However, in real-world applications, data generally exhibits Non-IID characteristics, which makes it difficult for traditional federated learning to accurately grasp the data differences between clients and the personalized knowledge they contain, and thus encounters difficulties when trying to build a global model that can adapt to the diverse and personalized needs of each client. To address this problem, personalized federated learning (PFL) came into being. It implements personalized strategies at multiple levels such as devices, data, and models to alleviate the problem of poor model adaptability caused by data heterogeneity. Specifically, PFL is committed to designing customized models for each client that can demonstrate excellent performance on its local data. By deeply integrating the unique characteristics of local data for model training, the model can adapt to the client's personalized needs, improve its performance on local data, and thus enhance the model's adaptability to the client.

[0003] Due to data heterogeneity, during model training, local models tend to update in a direction that aligns with their own data characteristics. This can cause them to deviate from the update direction of the global model, leading to client drift. Therefore, in the advancement of PFL, meeting client personalization needs while mitigating client drift that may occur during the personalization process is a key issue. Some studies have attempted to establish specific relationships between the global model and personalized models to align with the local data feature distribution (e.g., clustering methods, multi-task learning strategies, and knowledge distillation techniques). Furthermore, regularization-based approaches (e.g., pFedMe and FedAMP) have been employed to narrow the gap between local and global models, addressing client drift caused by data heterogeneity. However, these approaches have limitations. They primarily rely on the knowledge provided by the global model as a priori basis to guide local model updates. In reality, however, each client is a rational individual with unique business logic and personalized application requirements. Relying solely on the global model as a reference for local model updates results in a lack of diversity in the local model construction process, limiting the local model's ability to personalize and address diverse needs.

[0004] Furthermore, as a multi-client collaborative learning paradigm, federated learning leverages the rich, personalized knowledge held by other clients in its ecosystem, offering significant potential as a key resource for improving the personalized performance of local models. In practice, local model personalization relies not only on the general knowledge contained in the global model but, more importantly, on discerning differences between local models and the diverse knowledge sets of other clients, accurately extracting and effectively integrating useful knowledge that is highly adapted to local data characteristics and application scenarios. However, in a federated ecosystem, data privacy protection mechanisms hinder data visibility, hindering the identification of client differences and limiting knowledge absorption. This, in turn, limits clients' ability to train personalized models with limited learning resources, leading to unnecessary increases in trial-and-error costs. To address this issue, several studies have proposed solutions. For example, personalized clustering methods employ hierarchical clustering techniques to partition clients into multiple groups, enhancing the ability to identify differences between them. Data sharing strategies and self-balancing federated learning frameworks reduce the trial-and-error costs of knowledge absorption by optimizing the statistical characteristics of participating clients. However, these approaches undermine the core privacy principles of federated learning. Therefore, under the premise of privacy protection, it is necessary to not only utilize the general knowledge of the global model in personalized federated learning, but also break through the barrier of data invisibility, accurately identify and transform and absorb the differential knowledge of other clients, expand the personalized boundaries of local models, and enhance the adaptability of local models to complex and changeable actual business needs, which is crucial to promoting the sustainability of the federated ecosystem. Summary of the Invention

[0005] In view of the fact that traditional federated learning is difficult to build a global model adapted to each client under Non-IID data, and the problems of existing PFL methods such as relying on the global model and ignoring client differential knowledge and privacy protection, the present invention provides a federated learning method based on differential cognition and personalized knowledge absorption.

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

[0007] A federated learning method for personalized knowledge absorption based on differential cognition, the method comprising the following steps:

[0008] Step 1: Establish a personalized federated learning system model consisting of a central server and clients, and use the central server to obtain local data distribution;

[0009] The specific operations in step 1 are:

[0010] The model consists of m clients and a central server. All clients come from a federated community consisting of N clients, where m≤N. The clients and the central server collaborate to train a personalized federated learning model.

[0011] Let F i (w) represents the optimization objective of the local model of the i-th client. The basic optimization objective of personalized federated learning is formalized as:

[0012]

[0013] Where W=(w1,w2,…,w m ) represents the set of all local models;

[0014] During the local model update, it is crucial to ensure the robustness and consistency of the model. Just like preventing overfitting in machine learning, the problem of local model drift caused by data heterogeneity can be effectively dealt with by introducing a regularization term, as shown in formula (2). Considering the numerical stability of Bregman divergence, a regularization term-based optimization algorithm (BRT) is proposed. Specifically, the Bregman divergence between the global model and the local model is used as a proximal regularization term to optimize PFL. The update methods of each local model are inconsistent, which will cause the global model w to deviate from the global optimal value. In addition, there will be weight shift and local optimality and The distance to the global model is equal (ie, d i ≠d j ), which makes it difficult for the model to converge and reduces its generalization. When the Bregman divergence regularization term is introduced, d i ≈d j , and the global model w will approach the global optimal value

[0015] In the local client update process, a proximal regularization term based on the global model parameters is introduced to guide the update direction of the unified local model through the common knowledge of the global model. The Bregman divergence between the global model and the local model is used as the proximal regularization term to optimize the personalized federated learning. Represents a given local model w i The loss function of the local client model optimization target F i (w) is expressed as:

[0016]

[0017] in, is a predefined regularization term with global model as prior knowledge, w irepresents the local model, w represents the global model; γ is the learning rate, which is used to balance the influence of the regularization term and the target optimization function; w Si and w S are all d-dimensional vectors; represents the Bregman divergence associated with f;

[0018] The Bregman divergence is based on the second derivative of a convex function and is more numerically stable than the Euclidean distance. It is defined as follows:

[0019] Given a definition in The Bregman divergence generated by the strictly convex function f on Expressed as: in, represents the gradient of the function f at point y, <·,·> represents the inner product operation, and (xy) represents the difference between two vectors. Since f is a strictly convex function, this ensures that the Bregman divergence is differentiable and non-negative. Differentiability ensures that it can be optimized using algorithms such as gradient descent, while non-negativity ensures the validity and interpretability of this measure. In order to calculate the Bregman divergence, we will perform a Softmax operation on both the global model and the local model to convert them into a probability distribution, that is, w Si Therefore, the local regularization term is shown in formula (3).

[0020] The feature centroid is used as a representation of the personalized knowledge of the local model. The weighted average of the feature centroids of other clients is used as a regularization term to optimize the local loss function. This reduces the model's dependence on specific sensitive data while conveying the overall feature information of the data. Specifically:

[0021] set up Represents distribution based on P i The expectation of client i’s data sample x and corresponding label y, l(x, y; w i ) represents the given model parameter w i Calculate the loss between the predicted output of client i data x and the true label y; thus, the loss function of local client i is Expressed as:

[0022]

[0023] Among them, l(x,y;w i ) represents the given model parameter w i Calculate the loss between the predicted output of client i data x and the true label y; represents the knowledge aggregate absorbed by client i (weighted average of feature centroid set), The specific representation is as follows:

[0024]

[0025] θ i represents the characteristics of client i, Represents the set of other clients connected to client i.

[0026] Step 2: Design a data heterogeneity measurement mechanism based on Wasserstein distance to quantify the heterogeneity between clients and perform personalized screening of client sets;

[0027] The specific operations in step 2 are:

[0028] In order to achieve an accurate assessment of the differences between clients, a data heterogeneity measurement mechanism (WassDDC) based on the Wasserstein distance is designed. This method makes full use of the significant feature of the Wasserstein distance that is highly sensitive to heterogeneous features, and can approximately map the distance values between different models into difference representations at the data level. Through this mapping method, while strictly ensuring that privacy information is not leaked, the level of difference recognition between clients is improved, and thus in the process of local personalized exploration, the trial and error cost caused by the lack of prior knowledge is effectively reduced. Specifically, in actual operation, for any two clients, the central server calculates the Wasserstein distance value of the two clients, namely EMD (Earth Mover's Distance), which is used to evaluate the difference characteristics between the two clients, thereby providing key theoretical support for the subsequent model optimization and knowledge absorption strategy based on client differences. The formula is:

[0029]

[0030] Among them, x and y are derived from w Si and w Sj Parameters, represents the distance between the elements of the vector, Indicates the movement of each element of the vector, <·,·> F is the Frobeniu inner product (i.e. the sum of the products of all corresponding elements); where the joint distribution Ώ(w Si ,w Sj ) is defined as follows:

[0031] ∏(w Si ,w Sj )={γ(x,y)|γ>0,∑ x γ(x,y)=w Si (y),∑ yγ(x,y)=w Sj (x)} (8)

[0032] EMD is expressed as the sum of the joint distribution Π(w Si ,w Sj ) to sample a γ(x,y) that meets the minimum value requirement in Formula 7, which is the value of EMD;

[0033] An approximate method is used to map distance values. The Sinkhorn distance method and entropy regularization are used to approximate the EMD. The optimal transmission problem is transformed into:

[0034]

[0035] Where ∈ is the entropy regularization coefficient, which means that as ∈ increases, the entropy constraint becomes stronger; represents the distance between the elements of the vector, Indicates the amount of movement between vector elements, <·,·> F represents the Frobeniu inner product, that is, the sum of the products of all corresponding elements;

[0036] By optimizing formula (9) using the Lagrangian method, we obtain:

[0037]

[0038] in, ψ is the Lagrange multiplier, They are respectively and The associated diagonal matrix; due to the constraint ∑ x γ(x,y)=w i (y),∑ y γ(x,y)=w j (x) is the approximate solution obtained by matrix scaling, then:

[0039]

[0040] in, The sum of the elements in each row of the matrix Γ is equal to the vector w Sj (x), the sum of the elements in each column is equal to the vector w Si (y);

[0041] Next, the central server publishes information containing the distances between m clients in the form of a matrix. Assuming that there are m clients in the federated community, during the execution of the federated personalized learning task, n clients are randomly selected to participate in collaborative learning, and the distance matrix between these n clients is constructed.

[0042] After obtaining relevant information from the distance matrix, each client derives a distance map.

[0043] Through the above mechanism, the client can clearly understand the differences between itself and other clients, and then make more informed decisions in the process of knowledge absorption, so that each client's model can more closely fit its personalized needs, while fully learning from the advantages of other clients to further enhance the generalization of the model.

[0044] Step 3: Based on the distance matrix, each client performs personalized screening according to its own needs to select the appropriate knowledge absorption object, and then updates the global model;

[0045] The specific operations in step 3 are:

[0046] Based on the distance matrix, each client performs personalized screening according to its own needs to select the appropriate knowledge absorption object; the collaborative mechanism between clients is divided into two dimensions: 1) clients directly establish knowledge absorption with other clients; 2) clients indirectly establish connections with other clients through intermediary clients. In the process of seeking knowledge absorption, if the heterogeneous client C i and C j By collaborating directly, they may be able to obtain richer knowledge resources; however, this approach may be accompanied by higher budget expenditures. In contrast, if clients absorb information from other clients indirectly through intermediary clients, although this may result in a certain degree of noise δ i,j Pollution (i.e. interference and errors introduced due to inaccurate information transmission and heterogeneity of information sources, subject to distribution), but it can reduce the cost of significant differences.

[0047] In order to minimize transmission errors and reduce the impact of remote clients on local updates, a Dijkstra algorithm based on Wasserstein distance is designed to determine the shortest path (WassDDC). This algorithm performs differentiated cognitive enhancement and client personalization screening, enabling each client to determine an optimal knowledge transfer path and prioritize clients with data distributions closer to their own as information sources. The specific description is as follows:

[0048] (1) Local model (2) The number of clients m is used as input, (1) the knowledge absorption set and (2) client connection type As output, initialize the knowledge absorption set and connection type

[0049] In iteration t, the server receives the local model from client i∈{1,…,m} For all i,j, calculate The distance matrix Broadcast to all clients;

[0050] Calculate the shortest path distance from i to each client and record the predecessor client of client j; when Direct connection when Time indirect connection; the algorithm is as follows:

[0051]

[0052]

[0053] A Wasserstein feature centroid fusion algorithm (BsKA) is proposed. The client is represented by the feature centroid. It can not only accurately measure the difference between model parameters, but also capture the overall characteristics of the client model parameter distribution. The formula of Wasserstein feature centroid is as follows:

[0054]

[0055] When client C i As the leading client integration from client C j When we know the distribution w * , so that client C i With client C j The sum of the Wasserstein distances between the distributions is minimal;

[0056] When client C i Integration with clients When adjacent, the set Client C in j Through direct or indirect paths with client C i Connected, knowledge aggregation is expressed as:

[0057]

[0058] Where m represents the total number of key clients, τ i,j It is an indicator function with a value of 1 or 0. 1 indicates that there is an indirect connection between the client and the client, whereas 0 indicates a direct connection. i,j represents noise; Substituting formula (13) into formula (6) yields the following formula, which describes how the connection relationship between clients in a distributed system affects the knowledge integration process:

[0059]

[0060] Through the above method, clients can rationally and accurately integrate knowledge based on connection relationships and feature centroids. This strengthens the personalized characteristics of local models, maintains an orderly knowledge flow, and improves system stability and robustness. Furthermore, because the algorithm calculates client-side difference values based on probability distribution characteristics, it meets differential privacy requirements and prevents privacy leaks. Ultimately, this effectively improves the overall performance of the federated learning system, enabling it to better cope with diverse tasks and complex data environments, and ensuring the sustainability of the federated learning ecosystem.

[0061] An alternating optimization mechanism is designed to iteratively and efficiently learn local personalized knowledge absorption and global feature representation. In a federated learning architecture, each client has unique data distribution and characteristics. Local personalized knowledge plays a key role in model generalization and adaptability, while global feature representation can integrate client information to improve model performance. This mechanism aims to strike a balance between the two, achieving even better results at both the local and global levels through iterative updates.

[0062] In the tth round of global iteration, before the local model training starts, the central server measures the differences between the client models Analyze and calculate the model parameters, characteristics and other information of each client to obtain the difference matrix It reflects the degree of similarity and difference between models. Broadcast to all local clients.

[0063] Local client receives After in-depth analysis, choose the knowledge set to absorb based on your own characteristics and needs That is, select the most suitable knowledge from the knowledge set, identify the knowledge that will improve you the most, and learn and absorb it in a targeted manner. The specific selection strategies and implementation methods are as follows:

[0064]

[0065] In the tth global iteration, local client i uses the received Calculate the feature centroid c of adjacent clients j , and based on Computational Knowledge Collection Specifically:

[0066] Define the local model loss function of the current iteration and substitute formula (14) into formula (5):

[0067]

[0068] After obtaining the loss function of the t-th global iteration, multiple rounds of local model training are performed based on the local model and the global model:

[0069]

[0070] Among them, η and γ are learning rates, is the local model of the rth local iteration in the tth global iteration; is the regularization term shown in formula (4);

[0071] The server receives the local model uploaded by the client And perform the following aggregation operations:

[0072]

[0073] Among them, w (t) Represents the global model after the t-th round aggregation of the local models of m clients.

[0074] Compared with the prior art, the present invention has the following advantages:

[0075] This paper proposes a personalized federated learning method based on difference-aware knowledge absorption (FedDKA). This method aims to leverage the universal knowledge of the global model in personalized federated learning to effectively address client drift while accurately measuring differential knowledge and absorbing it into local model personalized updates. Specifically, to ensure the stability of local model updates and mitigate the impact of client drift, a Bregman divergence-based regularization constraint (BRT) algorithm is designed, inspired by the numerical stability of the Bregman divergence. This algorithm uses the Bregman divergence between the local and global models as a regularization constraint to guide local model updates, thereby enhancing the stability of local model updates. Furthermore, to accurately assess differences between clients, a data heterogeneity measure based on the Wasserstein distance (WassDDC) is designed. Leveraging Wasserstein's high sensitivity to heterogeneous features, the distance values between models are approximately mapped to data differences. This approach improves client-side difference recognition without compromising privacy and reduces the trial-and-error cost incurred by clients during local personalized exploration due to a lack of prior knowledge. To achieve accurate and efficient personalized knowledge absorption, we designed an optimal search personalized feature fusion algorithm (BsKA). In this algorithm, each client can use optimal search to filter out a personalized set of differential knowledge based on differential cognition. Through a personalized feature fusion mechanism based on model probability distribution, it can personalized transform and absorb information from other clients, thereby achieving highly personalized customization of local model updates, ensuring that the model can closely meet the specific needs of each client and guaranteeing the sustainability and robustness of the federated learning ecosystem. BRIEF DESCRIPTION OF THE DRAWINGS

[0076] Figure 1 This is the FedDKA framework diagram;

[0077] Figure 2 is the Bregman divergence regularization constraint;

[0078] Figure 3 is the distance matrix and distance graph;

[0079] Figure 4 Filter graphs for personalized clients;

[0080] Figure 5 This is a diagram of the FedDKA training process;

[0081] Figure 6 Schematic diagram for comparing the robustness of FedDKA to data heterogeneity;

[0082] Figure 7 This is a schematic diagram of the comparison of heat maps of data heterogeneity;

[0083] Figure 8 A comparison chart of the differences in measurement mechanisms. DETAILED DESCRIPTION

[0084] To gain a deeper understanding of the present invention, we will provide a comprehensive and detailed description thereof. However, the present invention has various implementations and is not limited to the specific examples listed herein. These examples are presented to enhance a comprehensive understanding of the present disclosure.

[0085] A federated learning method for personalized knowledge absorption based on differential cognition, the method comprising the following steps:

[0086] Step 1: Establish a personalized federated learning system model consisting of a central server and clients, and use the central server to obtain local data distribution;

[0087] The specific operations in step 1 are:

[0088] The model consists of m clients and a central server. All clients come from a federated community consisting of N clients, where m≤N. The clients and the central server collaborate to train a personalized federated learning model.

[0089] Let F i (w) represents the optimization objective of the local model of the i-th client. The basic optimization objective of personalized federated learning is formalized as:

[0090]

[0091] Where W=(w1,w2,…,wm ) represents the set of all local models;

[0092] During the local model update, it is crucial to ensure the robustness and consistency of the model. Just like preventing overfitting in machine learning, the problem of local model drift caused by data heterogeneity can be effectively dealt with by introducing regularization terms, as shown in formula (2). Considering the numerical stability of Bregman divergence, a regularization term-based optimization algorithm (BRT) is proposed. Specifically, the Bregman divergence between the global model and the local model is used as a proximal regularization term to optimize PFL. Figure 2 As shown, the update methods of each local model are inconsistent, which will cause the global model w to deviate from the global optimal value In addition, if Figure 2 As shown in (a), there will also be weight shift and local optimality and The distance to the global model is equal (ie, d i ≠d j ), which makes it difficult for the model to converge and reduces its generalization. When the Bregman divergence regularization term is introduced, such as Figure 2 (b) as shown, d i ≈d j , and the global model w will approach the global optimal value

[0093] In the local client update process, a proximal regularization term based on the global model parameters is introduced to guide the update direction of the unified local model through the common knowledge of the global model. The Bregman divergence between the global model and the local model is used as the proximal regularization term to optimize the personalized federated learning. Represents a given local model w i The loss function of the local client model optimization target F i (w) is expressed as:

[0094]

[0095] in, is a predefined regularization term with global model as prior knowledge, w i represents the local model, w represents the global model; γ is the learning rate, which is used to balance the influence of the regularization term and the target optimization function; w Si and w S are all d-dimensional vectors; represents the Bregman divergence associated with f;

[0096] The Bregman divergence is based on the second derivative of a convex function and is more numerically stable than the Euclidean distance. It is defined as follows:

[0097] Given a definition in The Bregman divergence generated by the strictly convex function f on Expressed as: in, Represents the gradient of function f at point y, <·,·> represents the inner product operation, and (xy) represents the difference between two vectors. Since f is a strictly convex function, this ensures that the Bregman divergence is differentiable and non-negative. Differentiability ensures that it can be optimized using algorithms such as gradient descent, while non-negativity ensures the validity and interpretability of this measure. In order to calculate the Bregman divergence, we will perform a Softmax operation on both the global model and the local model to convert them into a probability distribution, that is, w Si Therefore, the local regularization term is shown in formula (3).

[0098] The feature centroid is used as a representation of the personalized knowledge of the local model. The weighted average of the feature centroids of other clients is used as a regularization term to optimize the local loss function. This reduces the model's dependence on specific sensitive data while conveying the overall feature information of the data. Specifically:

[0099] set up Represents distribution based on P i The expectation of client i’s data sample x and corresponding label y, l(x, y; w i ) represents the given model parameter w i Calculate the loss between the predicted output of client i data x and the true label y; thus, the loss function of local client i is Expressed as:

[0100]

[0101] Among them, l(x,y;w i ) represents the given model parameter w i Calculate the loss between the predicted output of client i data x and the true label y; represents the knowledge aggregate absorbed by client i, The specific representation is as follows:

[0102]

[0103] θ i represents the characteristics of client i, Represents the set of other clients connected to client i.

[0104] Step 2: Design a data heterogeneity measurement mechanism based on Wasserstein distance to quantify the heterogeneity between clients and perform personalized screening of client sets;

[0105] The specific operations in step 2 are:

[0106] In order to achieve an accurate assessment of the differences between clients, a data heterogeneity measurement mechanism (WassDDC) based on the Wasserstein distance is designed. This method makes full use of the significant feature of the Wasserstein distance that is highly sensitive to heterogeneous features, and can approximately map the distance values between different models into difference representations at the data level. Through this mapping method, while strictly ensuring that privacy information is not leaked, the level of difference recognition between clients is improved, and thus in the process of local personalized exploration, the trial and error cost caused by the lack of prior knowledge is effectively reduced. Specifically, in actual operation, for any two clients, the central server calculates the Wasserstein distance value of the two clients, namely EMD (Earth Mover's Distance), which is used to evaluate the difference characteristics between the two clients, thereby providing key theoretical support for the subsequent model optimization and knowledge absorption strategy based on client differences. The formula is:

[0107]

[0108] Among them, x and y are derived from w Si and w Sj Parameters, represents the distance between the elements of the vector, Indicates the movement of each element of the vector, <·,·> F is the Frobeniu inner product (i.e. the sum of the products of all corresponding elements); where the joint distribution Ώ(w Si ,w Sj ) is defined as follows:

[0109] ∏(w Si ,w Sj )={γ(x,y)|γ>0,∑ x γ(x,y)=w Si (y),∑ y γ(x,y)=w Sj (x)} (8)

[0110] EMD is expressed as the sum of the joint distribution Π(w Si ,w Sj ) to sample a γ(x,y) that meets the minimum value requirement in Formula 7, which is the value of EMD;

[0111] An approximate method is used to map distance values. The Sinkhorn distance method and entropy regularization are used to approximate the EMD. The optimal transmission problem is transformed into:

[0112]

[0113] Where ∈ is the entropy regularization coefficient, which means that as ∈ increases, the entropy constraint becomes stronger; represents the distance between the elements of the vector, Indicates the amount of movement between vector elements, <·,·> F represents the Frobeniu inner product, that is, the sum of the products of all corresponding elements;

[0114] By optimizing formula (9) using the Lagrangian method, we obtain:

[0115]

[0116] in, ψ is the Lagrange multiplier, They are respectively and The associated diagonal matrix; due to the constraint ∑ x γ(x,y)=w i (y),∑ y γ(x,y)=w j (x) is the approximate solution obtained by matrix scaling, then:

[0117]

[0118] in, The sum of the elements in each row of the matrix Γ is equal to the vector w Sj (x), the sum of the elements in each column is equal to the vector w Si (y);

[0119] Next, the central server publishes information containing the distances between m clients in the form of a matrix. Assuming that there are m clients in the federated community, during the execution of the federated personalized learning task, n clients are randomly selected to participate in collaborative learning, and the distance matrix between these n clients is constructed. The detailed data is shown in Figure 3 (a) in.

[0120] After obtaining relevant information from the distance matrix, each client derives a distance map, such as Figure 3 (b).

[0121] Through the above mechanism, the client can clearly understand the differences between itself and other clients, and then make more informed decisions in the process of knowledge absorption, so that each client's model can more closely fit its personalized needs, while fully learning from the advantages of other clients to further enhance the generalization of the model.

[0122] Step 3: Based on the distance matrix, each client performs personalized screening according to its own needs to select the appropriate knowledge absorption object, and then updates the global model;

[0123] The specific operations in step 3 are:

[0124] Based on the distance matrix, each client performs personalized screening according to its own needs to select the appropriate knowledge absorption object; the collaborative mechanism between clients is divided into two dimensions: 1) the client directly establishes knowledge absorption with other clients; 2) indirectly establishes connections with other clients through intermediary clients. Figure 4 shown.

[0125] In the process of seeking knowledge absorption, if the heterogeneous client C i and C j By collaborating directly, they may be able to obtain richer knowledge resources; however, this approach may be accompanied by higher budget expenditures. In contrast, if clients absorb information from other clients indirectly through intermediary clients, although this may result in a certain degree of noise δ i,j Pollution (i.e. interference and errors introduced due to inaccurate information transmission and heterogeneity of information sources, subject to distribution), but it can reduce the cost of significant differences.

[0126] In order to minimize transmission errors and reduce the impact of remote clients on local updates, a Dijkstra algorithm based on Wasserstein distance is designed to determine the shortest path (WassDDC). This algorithm performs differentiated cognitive enhancement and client personalization screening, enabling each client to determine an optimal knowledge transfer path and prioritize clients with data distributions closer to their own as information sources. The specific description is as follows:

[0127] (1) Local model (2) The number of clients m is used as input, (1) the knowledge absorption set and (2) client connection type As output, initialize the knowledge absorption set and connection type

[0128] In iteration t, the server receives the local model from client i∈{1,…,m} For all i,j, calculate The distance matrix Broadcast to all clients;

[0129] Calculate the shortest path distance from i to each client and record the predecessor client of client j; when Direct connection when Time indirect connection; the algorithm is as follows:

[0130]

[0131] A Wasserstein feature centroid fusion algorithm (BsKA) is proposed. The client is represented by the feature centroid. It can not only accurately measure the difference between model parameters, but also capture the overall characteristics of the client model parameter distribution. The formula of Wasserstein feature centroid is as follows:

[0132]

[0133] When client C i As the leading client integration from client C j When we know the distribution w * , so that client C i With client C j The sum of the Wasserstein distances between the distributions is minimal;

[0134] When client C i Integration with clients When adjacent, the set Client C in j Through direct or indirect paths with client C i Connected, knowledge aggregation is expressed as:

[0135]

[0136] Where m represents the total number of key clients, τ i,j It is an indicator function with a value of 1 or 0. 1 indicates that there is an indirect connection between the client and the client, whereas 0 indicates a direct connection. i,j represents noise; Substituting formula (13) into formula (6) yields the following formula, which describes how the connection relationship between clients in a distributed system affects the knowledge integration process:

[0137]

[0138] Through the above method, clients can rationally and accurately integrate knowledge based on connection relationships and feature centroids. This strengthens the personalized characteristics of local models, maintains an orderly knowledge flow, and improves system stability and robustness. Furthermore, because the algorithm calculates client-side difference values based on probability distribution characteristics, it meets differential privacy requirements and prevents privacy leaks. Ultimately, this effectively improves the overall performance of the federated learning system, enabling it to better cope with diverse tasks and complex data environments, and ensuring the sustainability of the federated learning ecosystem.

[0139] An alternating optimization mechanism is designed to iteratively and efficiently learn local personalized knowledge absorption and global feature representation. In a federated learning architecture, each client has unique data distribution and characteristics. Local personalized knowledge plays a key role in model generalization and adaptability, while global feature representation can integrate client information to improve model performance. This mechanism aims to strike a balance between the two, achieving even better results at both the local and global levels through iterative updates.

[0140] In the tth round of global iteration, before the local model training starts, the central server measures the differences between the client models Analyze and calculate the model parameters, characteristics and other information of each client to obtain the difference matrix It reflects the degree of similarity and difference between models. Broadcast to all local clients.

[0141] Local client receives After in-depth analysis, choose the knowledge set to absorb based on your own characteristics and needs That is, select the most suitable knowledge from the knowledge set, identify the knowledge that will improve you the most, and learn and absorb it in a targeted manner. The specific selection strategies and implementation methods are as follows:

[0142]

[0143]

[0144] In the tth global iteration, local client i uses the received Calculate the feature centroid c of adjacent clients j , and based on Computational Knowledge Collection Specifically:

[0145] Define the local model loss function of the current iteration and substitute formula (14) into formula (5):

[0146]

[0147] After obtaining the loss function of the t-th global iteration, multiple rounds of local model training are performed based on the local model and the global model:

[0148]

[0149] Among them, η and γ are learning rates, is the local model of the rth local iteration in the tth global iteration; is the regularization term shown in formula (4);

[0150] The server receives the local model uploaded by the client And perform the following aggregation operations:

[0151]

[0152] Among them, w (t) Represents the global model after the t-th round aggregation of the local models of m clients.

[0153] Theoretical analysis:

[0154] 1) Sinkhorn distance:

[0155]

[0156] The expression of entropy is as follows:

[0157] Ent(γ)=∑ x,y γ(x,y)(logγ(x,y)-1) (21)

[0158] The Lagrangian optimization of formula (20) is expressed as:

[0159]

[0160] right Find the partial derivative with respect to γ:

[0161]

[0162] 2) Matrix scaling:

[0163] Assumptions: is a matrix with all elements being positive. We start with Find the positive diagonal matrix in and Make Construct a doubly random matrix, which means that the sum of each row element and the sum of each column element of the matrix are equal to 1. Given:

[0164] ∑ x γ(x,y)=w i (y) and∑ y γ(x,y)=w j (x) (25)

[0165] By combining formulas (23) and (24) and taking (25) as the constraint, we solve the doubly random matrix Therefore, γ(x,y) can be expressed as:

[0166] 3) Distance matrix satisfies query privacy

[0167] From formula (9), we can get the Wasserstein distance between client i and client j. and are two adjacent data sets that differ by only one record. and Represent the models of client i based on these two datasets. Similarly, define and set up is the set of possible values of Wasserstein distance. The calculation of depends only on the probability distribution characteristics of the model parameters, rather than the specific model parameter values. Therefore:

[0168]

[0169] where F(·) is the mapping function from model parameters to Wasserstein distance.

[0170] Since the calculation of Wasserstein distance depends on the probability distribution, for adjacent data sets and Calculation results and The difference between is bounded.

[0171] Assume there is a constant Cons such that:

[0172]

[0173] Then for get:

[0174]

[0175] Right now:

[0176]

[0177] Therefore, the Wasserstein distance function The calculation of satisfies ∈-differential privacy, that is, the distance matrix satisfies differential privacy and will not cause privacy leakage.

[0178] The present invention considers image classification tasks and evaluates the method designed by the present invention on four popular datasets: the EMNIST dataset with 62 categories of handwritten characters, the Fashion-MNIST dataset with 10 categories of clothing, and the CIFAR-10 and CINIC-10 datasets with 10 categories of color images. Specifically: (1) EMNIST (Extended MNIST), which is a 62-category image classification dataset that extends the classic MNIST dataset. It contains 62 categories of handwritten characters, including 10 numbers, 26 uppercase letters, and 26 lowercase letters; (2) Fashion-MNIST, which has 10 categories of clothing; (3) CIFAR-10, which has 10 categories of color images; and (4) CINIC-10, which is built from ImageNet and is larger than CIFAR-0. The present invention constructs two different CNN models for EMNIST / Fashion-MNIST and CIFAR-10 / CINIC-10, respectively. The first CNN model consists of two convolutional layers with 16 and 32 channels respectively, each followed by a max pooling layer, and two fully connected layers with 128 and 10 units before the softmax output, using the LeakyReLU activation function. The second CNN model is similar to the first one, but with a single convolutional layer with 64 channels.

[0179] Data partitioning: The present invention ensures that the amount of data for all clients is consistent. The data of each client (the default percentage is 20%) is evenly sampled from all categories, while the remaining 100-s% of the data is sampled from an uneven set of dominant categories. The present invention divides all clients into several groups, and the clients in the same group have the same dominant category. Specifically, for the Fashion-MNIST, CIFAR-10, and CINIC-10 datasets, the clients are divided into 5 groups, and 5 consecutive categories are used as the dominant categories of each group, and the starting categories are 0, 2, 4, 6, and 8 respectively. For the EMNIST dataset, the clients are divided into 3 groups, and numbers, uppercase letters, and lowercase letters are used as the dominant categories of each group respectively. In addition, the size of local training data is kept small to highlight the need for federated learning (FL). The test data on each client has the same distribution as the training data.

[0180] Training settings: This paper uses mini-batch stochastic gradient descent (mini-batch SGD) as the local optimizer for all methods. For the EMNIST and FMNIST datasets, the training step size is set to 0.1; and the step size is set to 0.02 for the CIFAR10 and CINIC datasets. For the client difference metric, this paper uses the Sinkhorn approximation algorithm to reduce time complexity. The fully connected layer parameters are used as the metric, focusing on how the model performs high-level processing and mapping of the extracted features, which more directly understands the model's feature representation capabilities in the critical decision-making stage. The number of global communication rounds for all datasets is uniformly set to 200.

[0181] Comparison Methods: FedDKA is compared with the following methods: APFL, a model ensemble-based method; multi-task learning-based methods, including pFedMe and Ditto; parameter decoupling-based methods, including LG-FedAvg and FedAvg with local fine-tuning; methods that learn personal classifiers on top of a shared feature extractor, such as FedRep and FedBABU, which keep the global classifier unchanged during feature representation learning; model ensemble methods, including Fed-RoD and kNN-Per; FedFomo, which performs client-side linear combination; and pFedHN, which uses a server-side hypernetwork to generate personalized models.

[0182] Evaluation Criteria: Models were evaluated on each client's private test data, whose distribution matches that of their training data. Performance was evaluated by averaging the test accuracy across all local models. The performance of various federated learning algorithms was compared on non-IID datasets.

[0183] Table 1 Comparison of accuracy results of FedDKA on different datasets

[0184]

[0185] FedDKA performance: In this experiment, four representative datasets, EMNIST, Fashion-MNIST, CIFAR-10, and CINIC-10, were carefully selected to comprehensively evaluate the algorithm performance. Different datasets cover different types of image data and can test the algorithm from multiple dimensions. The experimental comparison results are summarized in Table 1. The results of the FedDKA training process are shown in Table 1. Figure 5 Demonstration (using Fashion-MNIST, CIFAR-10, and 20Clients training results as demonstration).

[0186] From Table 1, we can see that FedDKA outperforms other algorithms on all datasets, verifying the effectiveness of FedDKA in personalized model training. Under two different client number settings of 20Clients and 100Clients, the FedDKA algorithm performs better than almost all other algorithms on all datasets. On the EMNIST dataset, FedDKA's accuracy reached 85.46 (20Clients) and 87.53 (100Clients); on the Fashion-MNIST dataset, FedDKA's accuracy was 91.16 (20Clients) and 90.87 (100Clients); and on the CIFAR-10 and CINIC-10 datasets, it outperformed other algorithms. This series of experimental data strongly verifies the effectiveness of FedDKA in personalized model training, highlights its advantages over other algorithms, and provides a better choice for model training in related fields.

[0187] FedDKA Ablation Analysis: FedDKA has two key modules: Bregman divergence regularization (BR) and Wasserstein distance feature centroid personalized feature fusion (WD). Therefore, ablation experiments were conducted on these two key modules to verify their effectiveness. BR and WD were used on four representative datasets: EMNIST, Fashion-MNIST, CIFAR-10, and CINIC-10, respectively, and the average model accuracy of 20 clients was returned.

[0188] Table 2 Comparison of FedDKA ablation results

[0189]

[0190] The results, shown in Table 2, show that each of the BR and WD modules can improve average test accuracy, and the combination of the two can achieve the most ideal model performance. This shows that the proposed method is expected to build a more optimized global feature extractor and a more adaptive personalized classifier.

[0191] Robustness of FedDKA: In order to explore the robustness of FedDKA to heterogeneous data, this paper verifies its robustness by adjusting the heterogeneity of data distribution. Specifically, the value of h is changed to simulate different data heterogeneities, where the heterogeneity of data decreases with the increase of h. This paper sets the value of h to 0, 0.2, 0.4, and 0.8. The results of different methods are shown in the CIFAR10 dataset. Figure 6 In. Through Figure 6It can be found that FedDKA performs better than other methods in various data heterogeneous situations, which fully demonstrates its adaptability and robustness in diverse heterogeneous data scenarios.

[0192] Accuracy of FedDKA data heterogeneity measurement mechanism: In order to evaluate the rationality of FedDKA's measurement of heterogeneous data differences, the present invention draws a heat map of the heterogeneity of each client data after performing non-independent and identically distributed operations on the four different data, EMNIST, Fashion-MNIST, CIFAR-10, and CINIC-10. Among them, KL divergence is used as the metric for measuring the difference in client data distribution. At the same time, FedDKA constructs a data heterogeneity measurement mechanism (WassDDC) based on the Wasserstein distance, and generates heat maps of client data heterogeneity on these four types of data sets. The heat map based on KL divergence is compared with the heat map based on WassDDC, and the results are as follows: Figure 7-8 shown. Figure 7 Eight data heterogeneity heatmaps are presented. The top four are heatmaps of real-world data distribution divergence for the CIFAR10, CINIC-10, FMNIST, and EMNIST datasets, visually demonstrating the true heterogeneity of data distribution within each dataset. The corresponding four bottom four are heatmaps of heterogeneity measurement results for these four datasets using the FedDKA client heterogeneity measurement mechanism. Figure 8 It is the difference between the true difference measurement mechanism and the WassDDC measurement mechanism in the FedDKA framework.

[0193] Depend on Figure 7-8 It was found that, judging from the color distribution and change trend of the heat map, the heat map generated by FedDKA's WassDDC mechanism and the real data distribution divergence heat map based on KL divergence have high consistency in key features. Both reflect the large data heterogeneity between clients, which shows that FedDKA can effectively capture the difference information of data distribution.

[0194] Any matters not described in detail in this specification are prior art known to those skilled in the art. Although the above description of the present invention is based on specific embodiments to facilitate understanding of the present invention by those skilled in the art, it should be understood that the present invention is not limited to the scope of the specific embodiments. As long as various modifications are within the spirit and scope of the present invention as defined and determined by the appended claims, such modifications will be obvious to those skilled in the art, and all inventions and creations utilizing the concepts of the present invention are protected.

Claims

1. A federated learning method based on differential cognition and personalized knowledge absorption, characterized by: The method comprises the following steps: Step 1: Establish a personalized federated learning system model consisting of a central server and clients, and use the central server to obtain local data distribution; Step 2: Design a data heterogeneity measurement mechanism based on Wasserstein distance to quantify the heterogeneity between clients and perform personalized screening of client sets; Step 3: Based on the distance matrix, each client performs personalized screening according to its own needs to select the appropriate knowledge absorption object, and then updates the global model.

2. The federated learning method based on differential cognition and personalized knowledge absorption according to claim 1 is characterized in that: The specific operations in step 1 are: The model consists of m clients and a central server. All clients come from a federated community consisting of N clients, where m≤N. The clients and the central server collaborate to train a personalized federated learning model. Let F i (w) represents the optimization objective of the local model of the i-th client. The basic optimization objective of personalized federated learning is formalized as: Where W=(w1,w2,…,w m ) represents the set of all local models; The Bregman divergence between the global model and the local model is used as a proximal regularization term to optimize personalized federated learning. Represents a given local model w i The loss function of the local client model optimization target F i (w) is expressed as: in, is a predefined regularization term with global model as prior knowledge, w i represents the local model, w represents the global model; γ is the learning rate, which is used to balance the influence of the regularization term and the target optimization function; w Si and w S are all d-dimensional vectors; represents the Bregman divergence associated with f; set up Represents distribution based on P i The expectation of client i’s data sample x and corresponding label y, l(x, y; w i ) represents the given model parameter w i Calculate the loss between the predicted output of client i data x and the true label y; thus, the loss function of local client i is Expressed as: Among them, l(x,y;w i ) represents the given model parameter w i Calculate the loss between the predicted output of client i data x and the true label y; represents the knowledge aggregate absorbed by client i, The specific representation is as follows: θ i represents the characteristics of client i, Represents the set of other clients connected to client i.

3. The federated learning method based on differential cognition and personalized knowledge absorption according to claim 2 is characterized in that: The specific operations in step 2 are: For any two clients, the central server calculates the Wasserstein distance (EMD) between the two clients to evaluate the difference between the two clients. The formula is: Among them, x and y are derived from w Si and w Sj Parameters, represents the distance between the elements of the vector, Indicates the movement of each element of the vector, <·,·> F is the Frobeniu inner product, where the joint distribution Ώ(w Si ,w Sj ) is defined as follows: ∏(w Si ,w Sj )={γ(x,y)|γ>0,∑ x γ(x,y)=w Si (y),∑ y γ(x,y)=w Sj (x)} (8) EMD is expressed as the sum of the joint distribution Π(w Si ,w Sj ) to sample a γ(x,y) that meets the minimum value requirement in formula (7), and the minimum value is the value of EMD; An approximate method is used to map distance values. The Sinkhorn distance method and entropy regularization are used to approximate the EMD. The optimal transmission problem is transformed into: Where, ∈ is the entropy regularization coefficient; represents the distance between the elements of the vector, Indicates the amount of movement between vector elements, <·,·> F represents the Frobeniu inner product, that is, the sum of the products of all corresponding elements; By optimizing formula (9) using the Lagrangian method, we obtain: in, ψ is the Lagrange multiplier, They are respectively and The associated diagonal matrix; due to the constraint ∑ x γ(x,y)=w i (y),∑ y γ(x,y)=w j (x) is the approximate solution obtained by matrix scaling, then: in, The sum of the elements in each row of the matrix Γ is equal to the vector w Sj (x), the sum of the elements in each column is equal to the vector w Si (y); Next, the central server publishes information containing the distances between m clients in the form of a matrix. Assuming that there are m clients in the federated community, during the execution of the federated personalized learning task, n clients are randomly selected to participate in collaborative learning, and a distance matrix between these n clients is constructed. After obtaining relevant information from the distance matrix, a distance graph is derived for each client.

4. The federated learning method based on differential cognition and personalized knowledge absorption according to claim 3 is characterized in that: The specific operations in step 3 are: Based on the distance matrix, each client performs personalized screening based on its own needs to select the appropriate knowledge absorption object; the collaborative mechanism between clients is divided into two dimensions: 1) clients directly establish knowledge absorption with other clients; 2) clients indirectly establish connections with other clients through intermediary clients; A Dijkstra algorithm based on Wasserstein distance is designed to determine the shortest path, perform differentiated cognitive enhancement, and perform client-specific screening, enabling each client to determine an optimal knowledge transfer path. Specifically: (1) Local model (2) The number of clients m is used as input, (1) the knowledge absorption set and (2) client connection type As output, initialize the knowledge absorption set and connection type In iteration t, the server receives the local model from client i∈{1,…,m} For all i,j, calculate The distance matrix Broadcast to all clients; Calculate the shortest path distance from i to each client and record the predecessor client of client j; when Direct connection when Time is connected directly; A Wasserstein feature centroid fusion algorithm is proposed to represent the client through the feature centroid. The formula of Wasserstein feature centroid is as follows: When client C i As the leading client integration from client C j When we know the distribution w * , so that client C i With client C j The sum of the Wasserstein distances between the distributions is minimal; When client C i Integration with clients When adjacent, the set Client C in j Through direct or indirect paths with client C i Connected, knowledge aggregation is expressed as: Where m represents the total number of key clients, τ i,j It is an indicator function with a value of 1 or 0. 1 indicates that there is an indirect connection between the client and the client, whereas 0 indicates a direct connection. i,j represents noise; Substituting formula (13) into formula (6) yields the following formula, which describes how the connection relationship between clients in a distributed system affects the knowledge integration process: Design an alternating optimization mechanism to iteratively and efficiently learn local personalized knowledge absorption and global feature representation; In the tth round of global iteration, before the local model training starts, the central server measures the differences between the client models Analyze and calculate the difference matrix The central server will then Broadcast to all local clients; Local client receives After in-depth analysis, choose the knowledge set to absorb based on your own characteristics and needs In the tth global iteration, local client i uses the received Calculate the feature centroid c of adjacent clients j , and based on Computational Knowledge Collection Specifically: Define the local model loss function of the current iteration and substitute formula (14) into formula (5): After obtaining the loss function of the t-th global iteration, multiple rounds of local model training are performed based on the local model and the global model: Among them, η and γ are learning rates, is the local model of the rth local iteration in the tth global iteration; is the regularization term shown in formula (4); The server receives the local model uploaded by the client And perform the following aggregation operations: Among them, w (t) Represents the global model after the t-th round aggregation of the local models of m clients.

Citation Information

Cited By

  • Personalized composite federal learning method based on ADMM

    CN121457661A