Decentralized medical federal learning method based on dynamic collaboration diagram
By using a decentralized federated learning method based on dynamic collaboration graphs, the problem of low collaboration efficiency in existing technologies is solved, enabling efficient knowledge sharing and personalized needs in heterogeneous data scenarios, thereby improving collaboration efficiency and model stability.
Patent Information
- Application Number
- CN202510962554.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-14
- Publication Date
- 2025-11-07
AI Technical Summary
Existing federated learning methods suffer from low collaboration efficiency when faced with data heterogeneity and cannot effectively cope with the widespread differences in data distribution in real-world environments. Especially in decentralized scenarios, the collaboration mechanism lacks dynamic adaptability, fails to fully utilize the knowledge of high-contribution nodes, and the assumption of symmetric collaboration leads to efficiency limitations.
We adopt a decentralized federated learning method based on dynamic collaboration graphs. By maintaining unidirectional knowledge flow between clients through a global collaboration graph, we dynamically select client models that meet the knowledge contribution requirements and update the collaboration graph structure during training to achieve adaptive and efficient knowledge aggregation.
It improves collaboration efficiency in heterogeneous data scenarios, makes full use of the knowledge of high-contribution clients, achieves sensitivity and adaptability to dynamic changes in data distribution, meets personalized needs, reduces computational load, and improves model stability.
Smart Images

Figure CN120911549A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of artificial intelligence, in particular to the field of federated learning, and more particularly to a decentralized medical federated learning method based on a dynamic collaboration graph. BACKGROUND
[0002] In recent years, artificial intelligence technology, especially machine learning methods represented by deep learning, is driving rapid changes in the field of medical health. In the field of medicine, especially in large-scale analysis tasks involving medical images and clinical data, deep learning has shown strong expressive power. For example, in disease prediction, auxiliary diagnosis, treatment plan recommendation, etc., significant achievements have been made. However, these deep learning models are highly dependent on large-scale, high-quality data. With the rapid development of artificial intelligence, the demand for data continues to grow, especially in the context of the widespread application of pre-training large models in recent years, the data "hunger" problem is becoming increasingly serious. At the same time, there are limited publicly available medical data resources, and the problem of data exhaustion is becoming increasingly prominent. More importantly, medical data itself has strong privacy, involving sensitive information of patients, its use is subject to privacy protection regulations (such as GDPR, HIPAA, etc.) and inter-agency data barriers, resulting in a large amount of high-quality private data not being effectively utilized, forming a "data island" phenomenon. It is further found that federated learning can break through the above difficulties.
[0003] In the field of medicine, especially in multi-institutional cooperation scenarios, federated learning provides a new means to break through the limitations of data islands and has been widely explored for tasks such as medical image analysis, electronic health record modeling, and personalized diagnosis and treatment recommendation generation, providing innovative solutions for the compliant use of medical data. For example, in the field of ophthalmology, federated learning is particularly suitable for disease research that requires multi-center collaboration, such as intelligent diagnosis of common blinding eye diseases such as diabetic retinopathy, glaucoma, and age-related macular degeneration. Through the federated learning framework, different medical institutions can jointly train auxiliary diagnosis models without sharing raw data, protecting patient privacy and data security, and improving the generalization ability of the model. For example, the FEDEYE ophthalmic federated learning platform achieves high disease recognition accuracy, promoting the clinical application of ophthalmic artificial intelligence. This technology overcomes the problem of limited data in a single institution, aggregates multi-regional and multi-population data, and enables the model to better capture disease heterogeneity, helping to provide precise ophthalmic diagnosis and treatment.
[0004] Traditional federated learning methods coordinate the federated learning process consisting of multiple rounds of communication by a central server. At the beginning of each round of training, the central server sends an initialized global model to each participant. Then, each participant trains the model on its local data and only transmits the model update back to the central server. Finally, the central server collects all the participants' updates and updates the global model accordingly, completing this round of federated training.
[0005] However, such federated learning has practical problems because it requires the data of participants to be independent and identically distributed. But in real-world large-scale applications, the local data of different clients often presents diversified distribution due to differences in collection methods, preferences and characteristics, which leads to data heterogeneity in federated learning. This data heterogeneity brings significant challenges to federated learning, including slower convergence speed, increased training time, reduced reliability, biased models, inability to meet the individual needs of all clients, and affecting the enthusiasm of high-performance clients to participate in federated learning, etc.
[0006] Existing technologies solve the data heterogeneity problem of federated learning from the data sharing, data enhancement, data selection and other data perspectives, but these data-based methods may leak privacy and improper data processing may exacerbate model learning bias and unfairness of federated learning. From the model perspective, existing technologies have adopted a series of methods such as improved model update method, aggregation strategy, adaptive optimization and model regularization, but these methods increase the computational and communication overhead to some extent, and are too dependent on the performance of the central server. From the model framework perspective, it mainly includes similarity clustering, knowledge distillation and additional personalized layer, etc. Adding a clustering step in federated learning training may increase communication costs, especially when hundreds of clients are involved, and may also cause convergence instability and other problems. In addition, most existing methods can only alleviate a certain type of data heterogeneity and perform poorly under other types, so their applicability is limited in the complex multi-type data heterogeneity context in the real world.
[0007] For example, in the medical federated learning scenario, significant label heterogeneity exists between medical clients due to geographical differences in different regions (such as different disease types and their distribution). The southern humid region is more prone to eye allergies, while the northern dry region is more prone to dry eye and inflammation. At the same time, differences in patient lifestyle and data collection equipment also lead to feature heterogeneity. The types and degrees of these heterogeneities are unknown among medical clients. Complex real-world scenarios pose higher challenges to the development of federated learning methods that can effectively cope with diverse heterogeneity.
[0008] Moreover, most of the research on federated learning focuses on the scenario with a central server, and less on the federated learning scenario with a decentralized structure. Relying on a central server for model aggregation can lead to single point of failure, high communication cost and trust issues. In particular, in the medical federated learning scenario, when different medical institutions with comparable capabilities participate, no institution can absolutely act as a server to coordinate federated aggregation, and each institution is also unwilling to introduce a non-medical third party into federated learning. This makes decentralized medical federated learning a challenge to be solved. However, in the decentralized federated learning scenario, existing methods mostly rely on static or random topology, which limits the collaboration effect between federated clients.
[0009] Although there are various personalized methods for heterogeneous data in the prior art, the collaboration mechanism between clients in the federated learning system still has significant defects and cannot effectively cope with the data distribution differences widely existing in real environments. After in-depth analysis, the inventors found that this defect mainly comes from the following aspects:
[0010] Firstly, most existing methods use static collaboration mechanisms, that is, the collaboration relationship between clients is preset or fixed throughout the training process, and lack the ability to adaptively adjust according to the dynamic changes of data distribution. For example, in decentralized federated learning, the topology graph of the communication between clients, that is, the connection structure graph between clients, is set before federated training, such as: ring, fully connected, etc. This leads to limited collaboration effect when facing highly heterogeneous data distribution, and cannot adapt to the changes of local data distribution of clients in time.
[0011] Secondly, most methods ignore the differences in influence and importance of clients. In real scenarios, different clients may have different sizes, qualities or representative data, and their contribution to the global model or other clients' knowledge is also different. Most existing collaboration methods use average or symmetric aggregation strategies in knowledge sharing, which fail to reflect the actual contribution relationship between clients, resulting in low utilization of knowledge of high contribution nodes and low collaboration efficiency.
[0012] Thirdly, many methods assume that the collaboration between clients is symmetric, that is, if client A can learn knowledge from client B, then the reverse is also true. However, in the data heterogeneous scenario, this symmetry assumption often does not hold. The knowledge dependency between clients is essentially asymmetric: some clients tend to learn from data sources with similar distribution, and do not necessarily provide equal feedback to others.
[0013] Therefore, the existing method has problems including: the static cooperation mechanism lacks dynamic adaptability and cannot cope with dynamic changes in data distribution; the difference of clients is ignored, and the knowledge of high contribution nodes cannot be fully utilized; the assumption of cooperation symmetry limits the cooperation effect in a heterogeneous data scenario. These problems collectively result in low cooperation efficiency of the existing technology in the face of data distribution differences widely existing in real environments, and the technology cannot effectively cope with the personalized needs of heterogeneous data.
[0014] It should be noted that the background technology is only used to introduce the related information of the present application, so as to help understand the technical solutions of the present application, but does not mean that the related information must be prior art. The related information is submitted and disclosed together with the present application scheme, and in the absence of evidence that the related information has been publicly disclosed before the filing date of the present application, the related information should not be regarded as prior art. SUMMARY
[0015] Therefore, the purpose of the present application is to overcome the defects of the prior art and provide a decentralized medical federated learning method based on a dynamic cooperation graph.
[0016] The purpose of the present application is achieved by the following technical solutions:
[0017] According to a first aspect of the present application, a decentralized federated learning method based on a dynamic cooperation graph is provided, the method comprising multiple rounds of federated training of models of multiple clients participating in federated learning for a classification task, the model comprising a feature layer and a classification layer, each round of federated training comprising: S1, obtaining each client model and a global cooperation graph, the graph comprising all client nodes and multiple edges, each edge being a directed edge from one client node to another client node, indicating that one client model will be aggregated by another client; S2, dividing each client into one or two categories of clients, for one category of client models, based on the global cooperation graph, a candidate client set is obtained, and a client model meeting the knowledge contribution requirement is selected from the set for one category of client models to learn; S3, updating the edges in the global cooperation graph pointing to each one category of client node according to the client models selected for all one category of clients; S4, according to all edges in the updated global cooperation graph pointing to each client node, aggregating all client models that each client needs to aggregate to obtain an aggregated model; S5, replacing the classification layer of the client model with the classification layer of the aggregated model to obtain a new model, and updating the parameters of the new model based on the classification loss of the new model and the representation difference loss between the new model and the aggregated model.
[0018] In some embodiments of the present application, the S2 comprises: calculating the centrality indexes of each client node in the global collaboration graph obtained by the S1 by using a graph centrality calculation method, selecting candidate clients based on the centrality indexes of each client node to obtain a candidate client set; calculating the similarity between the classification layer parameters of each candidate client model in the candidate client set and the classification layer parameters of a client model of a class, and taking the similarity as the knowledge contribution degree; and selecting the candidate client model with a knowledge contribution degree greater than a preset contribution degree as a client model satisfying the knowledge contribution degree requirement.
[0019] In some embodiments of the present application, each edge in the global collaboration graph comprises an edge weight, and in the S3, the global collaboration graph updating method comprises: updating the edge pointing to each client node of a class and the corresponding edge weight according to all the client models selected for each client node of a class and the knowledge contribution degrees of the selected client models, and not updating the edge pointing to each client node of a class and the corresponding edge weight.
[0020] In some embodiments of the present application, the updating method of the edge pointing to each client node of a class comprises: removing the edge pointing to each client node of a class and the corresponding edge weight in the global collaboration graph obtained by the S1; and establishing an edge pointing from the selected client node to the client node of a class according to the client model selected for the client node of a class.
[0021] In some embodiments of the present application, in the global collaboration graph, the sum of the edge weights of all edges pointing to each client node is a preset weight value, and the updating method of the edge weight comprises: calculating the ratio of the knowledge contribution degree of the selected client model to the sum of the knowledge contribution degrees of all the client models selected for the client node of a class, and then multiplying the ratio by the preset weight value to obtain the edge weight of the edge pointing from the selected client node to the client node of a class.
[0022] In some embodiments of the present application, the candidate client set obtaining method comprises: selecting client nodes with a centrality index greater than a preset threshold to obtain one or more core client nodes; and selecting a preset number of clients from the neighbor clients of all the core client nodes, and together with all the core client nodes, forming a candidate client set comprising a plurality of candidate clients, wherein the clients pointed to by the core client nodes are the neighbor clients of the core client nodes.
[0023] In some embodiments of the present application, in each round of federated training, the manner of obtaining the client model in S1 comprises: performing local training on the current model by using the local training set of the client to obtain the client model, in the first round, the current model adopts the initialized model, and in other rounds, the current model adopts the client model updated after the previous round of federated training; and the manner of obtaining the global collaboration graph in S1 comprises: obtaining the initially constructed global collaboration graph in the first round, and obtaining the global collaboration graph updated in the previous round in other rounds.
[0024] In some embodiments of the present application, in S2, the manner of dividing the clients into one or two categories comprises: adopting a cyclic token scheduling mechanism to pass one or more tokens to the specified clients in the current cycle according to the set client cycle order, and the clients that obtain the tokens in each round are the clients in one category, and the clients that do not obtain the tokens are the clients in two categories.
[0025] According to a second aspect of the present application, an electronic device is provided, comprising: one or more processors; and a memory, wherein the memory is configured to store executable instructions; and the one or more processors are configured to implement the steps of the method of the first aspect of the present application by executing the executable instructions.
[0026] Compared with the prior art, the present application has the following advantages:
[0027] Firstly, the present application maintains a global collaboration graph for each client, the directionality of the edges in the graph reflects the unidirectionality of knowledge flow, rather than forcibly establishing a mutual collaboration relationship between two clients, in the face of the widely existing data heterogeneity in the real environment, the collaboration graph better reflects the inherent asymmetric knowledge dependency relationship between the clients in the federated environment, thereby improving the collaboration efficiency in the data heterogeneous scenario. Secondly, the present application dynamically selects the client model that meets the knowledge contribution degree requirement of the clients in one category for learning, and fully utilizes the knowledge of high-contribution clients. Finally, the structure of the global collaboration graph can be dynamically updated with the change of the training process, realizing the continuous self-evolution of the collaboration graph structure, and also making the entire federated scenario have sensitivity and adaptability to the dynamic change of data distribution. And after replacing the classification layer of the client model with the classification layer of the aggregated model, the present application realizes more effective response to the personalized needs of heterogeneous data. BRIEF DESCRIPTION OF DRAWINGS
[0028] The embodiments of the present application are further described below with reference to the accompanying drawings, in which:
[0029] Figure 1 The figure is a schematic diagram of the federated training process according to the embodiments of the present application;
[0030] Figure 2 The figure is a structural schematic diagram of the global collaboration graph according to the embodiments of the present application;
[0031] Figure 3 A schematic diagram of the principle of the decentralized federated learning method according to an embodiment of the application;
[0032] Figure 4 A schematic diagram of experimental results of average test accuracy of clients under different feature distribution heterogeneity according to an embodiment of the application;
[0033] Figure 5 A schematic diagram of average test accuracy results of client models obtained by the application and three representative methods under four different degrees of data heterogeneity according to an embodiment of the application. DETAILED DESCRIPTION
[0034] In order to make the objects, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and do not limit the present application.
[0035] As mentioned in the background section, the problems of existing methods include: the lack of dynamic adaptability of static collaboration mechanism, which cannot adapt to the dynamic changes of data distribution; the ignorance of the differences between clients, which fails to fully utilize the knowledge of high contribution nodes; the assumption of collaboration symmetry, which limits the collaboration effect in data heterogeneous scenarios. These problems together lead to low collaboration efficiency of existing technologies in the face of the data distribution differences widely existing in real environments, and cannot effectively cope with the personalized needs of heterogeneous data.
[0036] To solve the above problems, the inventors propose a decentralized medical federated learning method based on dynamic collaboration graph, which includes multiple rounds of federated training of models for classification tasks of multiple clients participating in federated learning. In the multiple rounds of federated training of the present application, the following improvements are made:
[0037] 1. In each round of federated training, the clients are divided into one or two categories of clients. For one category of client models, dynamically select client models that meet the knowledge contribution requirement of one category of clients for learning, which not only fully utilizes the knowledge of high contribution clients, but also better ensures that high contribution clients become the key intermediaries of knowledge transfer in collaboration, thereby enhancing the overall knowledge circulation.
[0038] 2. A global collaboration graph is maintained for each client, which includes all client nodes and multiple edges, each edge being a directed edge to represent that a client model will be aggregated by another client, and the direction of the edge in the graph reflects the unidirectionality of knowledge flow, that is, the client is allowed to learn from the client node that contributes more to it, rather than being forced to establish a mutual collaboration relationship between the two clients. In the face of the widely existing data heterogeneity in the real environment, the collaboration graph better reflects the inherent asymmetric knowledge dependency relationship between clients in the federated environment, thereby improving the collaboration efficiency in the data heterogeneous scenario.
[0039] 3. In each round of federated training, the edges in the global collaboration graph pointing to each type of client node are updated according to the client model selected for all type of clients to meet the knowledge contribution requirement of the type of client, that is, the structure of the global collaboration graph can be dynamically updated as the training process changes, realizing the continuous self-evolution of the collaboration graph structure, and also making the entire federated scenario more sensitive and adaptive to dynamic changes in data distribution.
[0040] 4. Since the classification layer can better represent data differences, the invention replaces the classification layer of the client model with the classification layer of the aggregated model before updating the parameters, which can more effectively cope with the personalized needs of heterogeneous data. In addition, the invention drives the client to perform local knowledge aggregation and model updating through the collaboration graph structure, and the entire process does not rely on the coordination of the central server, which embodies the high autonomy of decentralized learning.
[0041] According to an embodiment of the present application, the above decentralized federated learning method can be applied to practical scenarios such as medical and financial fields that require high data security and model customization. For example, in the medical field, medical data often has data heterogeneity, such as different collection devices between different medical institutions resulting in feature distribution heterogeneity of collected data, and different types of diseases collected by medical institutions in different regions have large differences. In different regions, in southern China, the air humidity is relatively high, and the incidence of fungal keratitis and other infectious eye diseases is relatively high; while in the northern region, the climate is dry and the sand is large, which is more prone to dry eye syndrome, pterygium and other ocular surface diseases. Using the method of the present application, knowledge aggregation can be performed using the dynamically updated global collaboration graph to adapt to different types of data heterogeneity, thereby better coping with data heterogeneity in medical federations.
[0042] According to an embodiment of the present application, the model includes a feature layer and a classification layer. The model structure should be selected according to the data modality, and the data for human activity recognition can use a CNN model structure, and the image modality can use a LeNet, AlexNet, etc. In the decentralized federated learning method, each round of federated training process is as follows: Figure 1As shown, it includes steps S1, S2, S3, S4 and S5. For better understanding of the present application, each step will be described in detail below in combination with specific embodiments.
[0043] Step S1, obtaining each client model and a global collaboration graph, which includes all client nodes and a plurality of edges, each edge being a directed edge from one client node to another client node, to represent that one client model will be aggregated by another client.
[0044] According to one embodiment of the present application, each edge in the global collaboration graph includes an edge weight, and the sum of the edge weights of all edges pointing to each client node is a preset weight value. In the personalized federated learning system including a plurality of clients , each client is denoted as , , each client model parameter is denoted as , , the parameter dimension is denoted as , and the corresponding local data set is denoted as . , the input data of the i-th sample of the client , , the label of the i-th sample of the client , , and the number of samples of the client . To describe the collaboration relationship between clients, a global collaboration graph is constructed , wherein each element of the global collaboration graph indicates whether there is an edge from the client to another client , the element of the adjacency matrix indicates the edge weight of the edge from one client to another client , , and the size of the global collaboration graph determines the information propagation strength of the client to . When the preset weight value is 1, the global collaboration graph satisfies the constraint , which means that the sum of the edge weights of all edges pointing to each client node is 1.
[0045] For illustration, see Figure 2 , which is a structural diagram of the global collaboration graph. The diagram includes 10 client nodes numbered 0-9, and each edge is a directed edge, such as the directed edge from node 1 to node 2, whose edge weight is 1.0, and the directed edge from node 1 to node 0, whose edge weight is 0.4. In this graph, the sum of the edge weights of all edges pointing to each client node is 1.
[0046] According to an embodiment of the present invention, the method of obtaining the client model in step S1 includes: using the client's local training set to train the current model locally to obtain the client model. In the first round, the current model uses the initialized model, and in other rounds, the current model uses the client model updated after the previous round of federated training.
[0047] According to one embodiment of the present invention, for a model applied in the medical field, in each round of federated training, multiple client models participating in federated learning use a local training set for the medical field for local training. The current model for the medical field is trained using the local training set for the medical field within the client, resulting in a client model for the medical field. In the first round, the current model uses the initialized model for the medical field; in other rounds, the current model uses the client model for the medical field updated after the previous round of federated training. For example, a model for a chest classification task can use a training set from the corresponding domain to train the model to classify and predict the input chest image collected from the user's chest, obtaining the classification prediction result for the chest image. This provides a reference for doctors to diagnose chest diseases. The chest image can be a chest X-ray image or a chest CT image. The classification categories include normal, viral pneumonia, and bacterial pneumonia.
[0048] According to an embodiment of the present invention, the method for obtaining the global collaboration graph in step S1 includes: obtaining the initially constructed global collaboration graph in the first round, and obtaining the updated global collaboration graph from the previous round in subsequent rounds. The method for initially constructing the global collaboration graph includes the following steps: initializing an empty graph. ,Include 1 node, to represent One client; for each client Perform the following operations: from other Randomly selected from 1 client Each client is considered as a set of neighboring nodes, where... Assign random weights to each neighbor node ~Uniform(0,1), and normalized, where Uniform(0,1) represents a random variable uniformly distributed within the closed interval from 0 to 1; in the figure Add directed edges The edge weight is The diagram copy This yields an initial global collaboration graph for each client. .
[0049] Step S2, divide each client into a class or two classes of clients, for a class of client model, based on the global collaboration graph screening to obtain a candidate client set, from the set select the client model that meets the knowledge contribution degree requirement for a class of client model learning.
[0050] According to an embodiment of the application, in step S2, the way of dividing each client into a class or two classes of clients includes: adopting a round token scheduling mechanism to set a client round order, and passing one or more tokens to the specified client in the current round in each round. The client that gets the token in each round is a class of client, and the client that does not get the token is a two-class client.
[0051] Illustratively, the number of tokens is set to 4, there are 20 clients, and the client numbers are 0-19. The 20 clients are divided into 4 groups, which are 0-4, 5-9, 10-14, and 15-19, respectively, and the round order is the order of the client numbers. In the first round of training, 4 tokens are respectively sent to 0, 5, 10, and 15, and in the next round of training, all clients pass the token to the next client in their group, i.e. 1, 6, 11, and 16. This cycle continues until the training is completed. Among them, the client that holds the token in each round is a class of client, which needs to reselect the client model that meets the knowledge contribution degree requirement in the current round, and perform subsequent graph structure updating operation, i.e. update the edges and edge weights in the global collaboration graph pointing to the class of client node; the client without token is a two-class client, which does not need to reselect the client model and does not need to perform the graph structure updating operation, i.e. does not update the edges and edge weights in the global collaboration graph pointing to the class of client node.
[0052] The technical solutions of the above embodiments can at least achieve the following beneficial technical effects: adopting a round token scheduling mechanism, on the one hand, can reduce the model selection and graph updating operation in each round, and reduce the calculation amount in the overall training; on the other hand, it does not aggregate the client model it reselects every time, but after several rounds of aggregation of the same client model, it reselects a new client model for knowledge aggregation when it gets the token, which ensures the stability of the aggregated model to a certain extent.
[0053] According to an embodiment of the application, in step S2, for a class of client, a dual selection mechanism of graph centrality measurement and classification layer similarity guidance is adopted to select the client model that meets the knowledge contribution degree requirement, including the following steps a1, a2 and a3:
[0054] Step a1: calculate the centrality index of each client node in the global collaboration graph obtained in S1 by adopting a graph centrality calculation method, select the candidate client based on the centrality index of each client node, and obtain a candidate client set.
[0055] According to one embodiment of the present invention, graph centrality calculation methods include: medium centrality calculation method, eigenvector centrality calculation method, compactness centrality calculation method, PageRank centrality calculation method, degree centrality calculation method, etc. By selecting a specific centrality calculation method through hyperparameters, the centrality index of each client node in the graph structure can be obtained. This index is generally represented by a score, which can intuitively reflect the importance of the client.
[0056] According to one embodiment of the present invention, the method for obtaining the candidate client set includes: selecting client nodes with a centrality index greater than a preset threshold to obtain one or more core clients; selecting a preset number of clients from the neighboring clients of all core clients, and forming a candidate client set including multiple candidate clients together with all core clients, wherein the client pointed to by the core client is its neighboring client.
[0057] To illustrate, for example, with 10 clients, a global collaboration graph that meets the requirements is generated as follows: Figure 2 As shown in Table 1 below, the centrality metrics of the 10 clients are sorted:
[0058] Table 1
[0059]
[0060] In the table above, R represents the ranking, C_B(V) in the middle represents the centrality index calculated using the media centrality calculation method, and V represents the client node number. Based on Table 1 above and Figure 2 The collaboration graph first selects core clients, including choosing the k client nodes ranked by metrics, resulting in k core clients. For example, if k=2, then the two clients corresponding to the two client nodes numbered 5 and 8 in the table are selected as core clients, resulting in a candidate set of core clients.
[0061] Secondly, the core client candidate set is randomly expanded, including selecting neighboring clients of the core clients. A preset number of clients are randomly selected from all neighboring clients of all core clients in the core client candidate set. One client, and Each client is added to the core client candidate set, resulting in the final candidate client set. For example, let... =2, such as Figure 2 As shown, the neighboring clients of client number 5 are 1, 6, and 8, and the neighboring client of client number 8 is 6. Select the two clients numbered 1 and 8 from the neighboring clients of the two clients numbered 5 and 8 (including the clients numbered 1, 6, and 8).
[0062] Finally, the selected core client and neighbor client are combined to obtain a candidate client set including clients numbered 1, 5 and 8.
[0063] In step a2, similarity between the classification layer parameters of each candidate client model in the candidate client set and the classification layer parameters of a class client model is calculated, and the similarity is used as the knowledge contribution degree.
[0064] According to an embodiment of the present application, the similarity between the classification layer parameters can be calculated by using the cosine similarity calculation method as follows:
[0065] ,
[0066] wherein, similarity between the classification layer parameters of the i-th client and the classification layer parameters of the j-th client,
[0067] In step a3, the candidate client model with the knowledge contribution degree greater than the preset contribution degree is selected as the client model meeting the knowledge contribution degree requirement.
[0068] According to an embodiment of the present application, if the preset contribution degree is set to 0, only the client node with the similarity greater than 0 is reserved, and the preset contribution degree can also be set to 0.2 or 0.3, etc., which is not limited in the present application. Illustratively, assuming that the present round is for the class client numbered 6, and the candidate client set includes the clients numbered 1, 5 and 8, if the knowledge contribution degree between the classification layer parameters of the client model numbered 5 and the classification layer parameters of the class client model numbered 6 is less than or equal to the preset contribution degree, the client model numbered 5 is not selected, and the client models numbered 1 and 8 are selected.
[0069] The technical scheme of the above model selection scheme embodiment can at least achieve the following beneficial technical effects: the centrality measurement in graph theory is introduced to improve the cooperation efficiency, the similarity between the classification layers of the models is combined to dynamically screen the nodes with higher classification layer similarity in cooperation, so that each client can dynamically select the cooperation client with more similar data distribution, thereby maximizing the knowledge gain, and at the same time, minimizing the influence of data heterogeneity on the individualization of the local client model.
[0070] In step S3, the edges pointing to each class client node in the global cooperation graph are updated according to the client models selected for all the class clients respectively.
[0071] According to one embodiment of the present application, in the S3, the global collaborative graph updating method comprises: updating the edges and corresponding edge weights pointing to each one-type client node according to all the selected client models for each one-type client and the knowledge contribution degree of each selected client model, and not updating the edges and corresponding edge weights pointing to two-type client nodes.
[0072] According to one embodiment of the present application, the updating method of the edges pointing to each one-type client node comprises: removing the edges and corresponding edge weights pointing to each one-type client node in the global collaborative graph obtained in the S1, and then establishing the edges of the selected client nodes pointing to the one-type client node according to the selected client model for each one-type client. For the established edges of the selected client nodes pointing to the one-type client node, the updating method of the corresponding edge weights comprises: calculating the ratio of the knowledge contribution degree of the selected client model to the sum of the knowledge contribution degrees of all the selected client models for the one-type client, and then multiplying the ratio by a preset weight value to obtain the edge weight of the edge from the selected client node pointing to the one-type client node. The technical solution of the above embodiment can at least achieve the following beneficial technical effects: the client re-calculates the edge weight and updates the collaborative graph according to the client model learned by selection, realizes dynamic updating of the collaborative graph, makes the federated learning system have higher sensitivity and adaptability to dynamic changes in data distribution, and also ensures that each client preferentially connects to the client nodes with high aggregation relevance and strong centrality. In addition, the in-edge weight values of the nodes in the graph are normalized to make the sum of the in-edge weights of all the clients a preset weight value, and the interpretability of the graph structure is maintained.
[0073] Illustratively, if the client models numbered 1 and 8 are selected for the one-type client numbered 6 in this round. Then the edges and edge weights pointing to the one-type client numbered 6 in the S2 are deleted, including deleting the directed edges 3 Figure 2 6、5 6 and 8 6 and 8 6 and 8 6 and 8 6 and 8 6 and 8 6 and 8
[0074] According to one embodiment of the present invention, the global collaboration graph update method for each client includes: each type of client first updates the edges and edge weights pointing to itself, then broadcasts its updated edges and edge weights to all other clients, and receives update information of edges and edge weights sent by all other type of clients, so as to perform synchronous updates on the local client and obtain the global collaboration graph of that type of client; each type of client does not update the edges and edge weights pointing to itself, but only receives update information of edges and edge weights sent by all type of clients, so as to perform synchronous updates on the local client and obtain the global collaboration graph of that type of client. The updated global collaboration graphs are identical among all clients.
[0075] According to one embodiment of the present invention, let the current client be... One type of client set is For any type of client In its first The update information of the edges and edge weights that need to be updated in each round is denoted as a matrix. ,in, Central African zero element This indicates that the client needs to be updated from the [previous version]. The client node points to the first The edges and edge weights of each client node, and This means that updates will not be made from the first... The client node points to the first The edges and edge weights of each client node. The methods for updating the global collaboration graph include:
[0076] ① The edge weights of the edges that need to be updated are initialized using the following formula, that is, the knowledge contribution of the client model selected for a certain type of client is directly used as the corresponding initial edge weights:
[0077] ,
[0078] This formula represents the condition if the current client contains... ,but ,on the contrary, , Indicates the current client From the middle The client node points to the first The edge weight of the edge of the client node in the th case. Round update to , Represented as the first The client selected the first The knowledge contribution of each client model Indicates the current client From the middle edges and edge weights of the edges pointing to the client nodes in the round remain unchanged , , and respectively represent a set of client node numbers, and both sets of numbers are .
[0079] ②The initial edge weights of all edges pointing to each one-type client node in the round update are normalized as follows to obtain the final updated edge weights:
[0080] ,
[0081] wherein represents the final edge weight of the edge pointing from the client node to the client node in the global collaborative graph corresponding to the round, , represents the sum of the knowledge contribution degrees of all client models selected as the one-type client, represents a preset weight value.
[0082] In step S4, according to all edges pointing to each client node in the updated global collaborative graph, the knowledge of all client models to be aggregated by each client is aggregated to obtain an aggregated model.
[0083] According to one embodiment of the present application, in step S4, the knowledge aggregation method includes: performing weighted summation on the parameters of all client models to be aggregated by each client according to all edges pointing to each client node and the edge weights of each edge. The weighted summation method is as follows:
[0084] ,
[0085] wherein represents the parameter of the aggregated model obtained after knowledge aggregation of the client, represents the set of client nodes pointing to the client node obtained through the updated global collaborative graph, represents the client node pointing to the client node, represents the client node pointing to the An edge weight of an edge pointing to the i-th client node, An edge weight of an edge pointing to the i-th client node, A client model parameter corresponding to the i-th client node, A client model parameter corresponding to the i-th client node, A feature layer parameter of a client model corresponding to the i-th client node, A feature layer parameter of a client model corresponding to the i-th client node, A classification layer parameter of a client model corresponding to the i-th client node. Illustratively, as shown in FIG. 8, a client node 8 includes two edges, 5
[0086] 8 and 9 Figure 2 8, indicating that it needs to aggregate the client model parameters corresponding to the client nodes 5 and 9, and perform weighted summation on the two client model parameters based on the edge weights of the two edges to obtain the aggregated model corresponding to the client node 8. Step S5, replacing the classification layer of the client model with the classification layer of the aggregated model to obtain a new model, and updating the parameters of the new model based on the classification loss of the new model and the representation difference loss between the new model and the aggregated model.
[0087] According to an embodiment of the present application, the overall optimization objective of federated learning is to minimize the collaborative loss of each client in the
[0088] According to an embodiment of the present application, the overall optimization objective of federated learning is to minimize the collaborative loss of each client in the The parameters of the
[0089]
[0090] Each row element of an adjacency matrix corresponding to the global collaborative graph is added to be preset weight 1.
[0091] Based on the above overall optimization target, according to an embodiment of the present application, the classification loss of the new model is calculated using the following cross-entropy loss function:
[0092] ,
[0093] wherein, denotes the calculated classification loss, denotes the feature layer parameter of the client model corresponding to the i-th client node, , , denotes the classification layer parameter of the aggregated model, denotes the new model obtained by replacing the classification layer of the client model with the classification layer of the aggregated model, denotes the input data of the sample of the i-th client's local data set , denotes the input data of the sample input into the new model, predicts the class probability distribution.
[0094] According to an embodiment of the present application, the calculation method of the representation difference loss between the new model and the aggregated model includes: calculating the distillation loss according to the difference between the features extracted from the input data of the same sample in the local data set by the feature layers of the new model and the aggregated model, and taking the distillation loss as the representation difference loss. The representation difference loss can be calculated in the following way:
[0095] ,
[0096] wherein, denotes the calculated representation difference loss, , denotes the feature layer parameter of the aggregated model, denotes the input data of the sample extracted by the feature layer of the new model, denotes the input data of the sample extracted by the feature layer of the aggregated model, denotes the L2 norm. denotes the distillation regularization term used to calculate the distillation loss.
[0097] According to an embodiment of the present application, based on the above classification loss and representation difference loss, the final optimization target function is constructed. Wherein, the optimization target function is as follows:
[0098] .
[0099] The optimization objective function calculates the total loss by weighting and summing the classification loss and the representation difference loss. Then, the total loss is minimized to minimize the collaboration loss. This optimization objective function also updates the model parameters by minimizing the representation differences between the feature layers of the new model and the aggregate model, thus achieving knowledge transfer and personalized knowledge distillation.
[0100] According to one embodiment of the present invention, the model parameters are updated using the following gradient descent method:
[0101] ,
[0102] in, Indicates the first The client in the first Wheel model parameters, This represents the learning rate in gradient descent. Represents the gradient of the model parameters. Indicates the first The client in the first Total losses.
[0103] In summary, the principle of the decentralized federated learning method of this invention is as follows: Figure 3 As shown, the entire federated training process is executed alternately by two update modules (a global collaboration graph update module and a model parameter update module), with each update module being a continuously looping process. Through this alternating execution mechanism of the two modules, this invention enables the construction and dynamic updating of the global collaboration graph structure in scenarios without a central server, enhancing the personalized modeling capabilities of models in heterogeneous data, and improving overall performance through adaptive knowledge fusion methods, thus possessing strong practical application value.
[0104] The global collaboration graph update module on the left side of the diagram represents the global collaboration graph jointly maintained by all clients (clients 1 to N). All clients of the same type select a set of candidate clients based on the global collaboration graph, obtain the classification layer parameters of each client model in the candidate client set, calculate the similarity between each classification layer and the classification layer of the client model of the same type, and use it as the knowledge contribution. Based on the knowledge contribution, select the client that meets the requirements and update the edges and edge weights pointing to the current client. Broadcast the locally updated edges and edge weights to other clients. The current client combines the edges and edge weights broadcast by all other clients that need to be updated to update the current client's global collaboration graph.
[0105] The model parameter updating module on the right in the figure: each client performs knowledge aggregation according to the updated global collaborative graph, obtains an aggregated model, and then the aggregated model initializes the client model (that is, replaces the classification layer of the client model with the classification layer of the aggregated model) to obtain a new model, and updates the parameters of the new model through the final optimization objective function constructed above, to obtain the client model after the federated training of this round.
[0106] To verify the beneficial effects of the present application, the inventors conducted the following experiments:
[0107] I. Basic settings of the experiment
[0108] 1.1) Obtain baseline methods, including traditional centralized federated learning methods: FedAvg, FedProx and FedBN methods, centralized personalized federated learning method: pFedGraph method, and decentralized federated learning method: MetaFed method. Compare the present application method (referred to as FedDNG) with the above-mentioned five baseline methods. The baseline methods are as follows:
[0109] FedAvg is the reference: B. McMahan, E. Moore, D. Ramage, S. Hampson, and B. A. y Arcas, “Communication-efficient learning of deep networks from decentralized data,” in Artificial intelligence and statistics. PMLR, 2017, pp. 1273 1282.
[0110] FedProx is the reference: T. Li, A. K. Sahu, M. Zaheer, M. Sanjabi, A. Talwalkar, and V. Smith, “Federated optimization in heterogeneous networks,” Proceedings of Machine learning and systems, vol. 2, pp. 429-450, 2020.
[0111] FedBN is referenced in: X. Li, M. Jiang, X. Zhang, M. Kamp, and Q. Dou,“Fedbn: Federated learning on non-iid features via local batchnormalization,” arXiv preprint arXiv:2102.07623, 2021.
[0112] pFedGraph is referenced in: R. Ye, Z. Ni, F. Wu, S. Chen, and Y. Wang,“Personalized federated learning with inferred collaboration graphs,” in International Conference on Machine Learning. PMLR, 2023, pp. 39 801–39 817.
[0113] MetaFed is referenced in: Y. Chen, W. Lu, X. Qin, J. Wang, and X. Xie,“Metafed: Federated learning among federations with cyclic knowledge distillation for personalized healthcare,” IEEE Transactions on Neural Networks and Learning Systems, 2023.
[0114] 1.2) Obtain datasets, including the following eight different datasets:
[0115] PAMAP2 dataset: It is a publicly available human activity recognition dataset containing data from 9 participants performing 18 different activities. The original data has been modified and only data collected from 3 inertial measurement units (IMUs) worn on the dominant wrist, chest, and dominant ankle are used. These data are collected at a fixed frequency of 100 Hz, resulting in a dataset containing 27 channels.
[0116] CIFAR-10 Dataset: is an image classification dataset containing 60,000 color images divided into 10 classes, with 50,000 images for training and 10,000 images for testing. Each class contains 6,000 32x32 pixel RGB images, and the classes include: airplane, automobile, bird, cat, deer, dog, frog, horse, ship, and truck.
[0117] FEMNIST Dataset: is a handwritten character recognition dataset built on EMNIST (Extended MNIST), containing 814,255 character images from 62 writers. The images are 28x28 pixel grayscale images, each representing a handwritten character. FEMNIST contains data from multiple clients, allowing it to reflect the natural heterogeneity of real-world handwritten data.
[0118] PACS Dataset: is an image classification dataset composed of four sub-datasets: photo, art, cartoon, and sketch. Each sub-dataset contains 7 classes, with a total of 9,991 image samples. The images vary significantly in style, making PACS a typical case study for investigating feature distribution heterogeneity.
[0119] OrganMNISTA, OrganMNISTC, and OrganMNISTS Datasets: are derived from 3D CT images in the Liver Tumor Segmentation Benchmark (LiTS) for multi-class classification of 11 body organs. The main difference between these three datasets lies in the slice perspective, which belongs to: axial view (OrganMNISTA), coronal view (OrganMNISTC), and sagittal view (OrganMNISTS), respectively. These datasets are generated by converting 3D images into grayscale images and extracting 2D slices from the center of the 3D bounding box corresponding to the specified view. The final image size is uniform at 1x28x28 pixels, with sample sizes of 58,850, 23,660, and 25,221, respectively.
[0120] COVID-19 Dataset: is a publicly available chest X-ray image dataset covering anteroposterior chest radiographs related to COVID-19. This dataset is collected from 15 public data sources, containing a total of 9,208 images, divided into 4 categories: 1,281 COVID-19 images, 3,270 normal images, 1,656 viral pneumonia images, and 3,001 bacterial pneumonia images. This dataset provides real image samples for health-related research.
[0121] The above datasets can be divided into three types of tasks: human activity recognition (PAMAP2), general image classification (CIFAR-10, FEMNIST, PACS), and medical image classification (OrganMNISTA, OrganMNISTC, OrganMNISTS, COVID-19).
[0122] 1.3) Neural network architecture. For each dataset, the following neural network architecture is designed:
[0123] The neural network architecture designed for CIFAR-10 and FEMNIST datasets is a CNN model consisting of three convolutional layers (3Conv as feature layers) and three fully connected layers (3FC as classification layers).
[0124] The neural network architecture designed for PACS and COVID-19 datasets is an AlexNet as feature extractor (i.e., feature layers) and three fully connected layers (3FC) as classification layers.
[0125] The neural network architecture designed for PAMAP2 dataset is a CNN model consisting of two convolutional layers (2Conv), two pooling layers, two batch normalization layers, and two fully connected layers (2FC as classification layers), where the two convolutional layers (2Conv), two pooling layers, and two batch normalization layers form the feature layers.
[0126] The neural network architecture designed for OrganMNISTA, OrganMNISTC, and OrganMNISTS datasets is an improved LeNet-5 model containing three fully connected layers (3FC as classification layers) with the same feature layers as PAMAP2.
[0127] To ensure fairness, all baseline methods use the same neural network architecture as their corresponding dataset. As shown in Table 2 below:
[0128] Table 2
[0129]
[0130] 1.4) Training and testing dataset division strategy. The pre-defined training / testing sets are divided as follows:
[0131] (a) CIFAR-10 dataset: keep its original training / testing set division result;
[0132] (b) FEMNIST dataset: take 20% of its original training set as the training set, and the test set remains unchanged.
[0133] The following division is made for datasets without pre-defined training / testing sets:
[0134] (a) PACS dataset: 40% of it is taken as the training set, and 20% is taken as the test set;
[0135] (b) PAMAP2, OrganMNISTA, OrganMNISTC, OrganMNISTS, COVID-19 dataset: all are divided into training set and test set according to 80% and 20%.
[0136] Among them, since the MetaFed method needs the participation of the validation set in the algorithm part, the MetaFed is additionally divided into a validation set, that is, the above-mentioned training set is again divided into a training set and a validation set for model training.
[0137] Test set distribution: In order to verify the individualization ability of the client, when assigning data to each client, it is necessary to ensure that the distribution of the test data and the training data allocated to each client is consistent, so that the test result can reflect the individualization ability of the model.
[0138] 1.5) Model training parameter setting: learning rate 0.01, SGD optimizer, batch size 32, communication round number 50, local training round number 10.
[0139] II. Experimental results of label distribution heterogeneity
[0140] In order to evaluate the performance of the method (FedDNG) of the application in label distribution heterogeneity, the method (FedDNG) of the application and the above-mentioned five kinds of baseline methods are compared on six data sets (CIFAR-10, PAMAP2, OrganMNISTA, OrganMNISTC, OrganMNISTS and FEMNIST respectively). At the same time, three kinds of label distribution heterogeneity are set to simulate the division of data heterogeneity, and the parameter settings are as follows:
[0141] ① Dirichlet distribution is used for data label heterogeneity division, represented by Dir(0.1);
[0142] ② Fixed 3-class label data heterogeneity division for each client, represented by C(5);
[0143] ③ 80% of the data of each class is given to one client, and the rest is given to other clients, represented by LTLD(0.8).
[0144] In the long-tail label heterogeneity experiment, the number of clients is set to 10, while in other cases, the number of clients is set to 20. The experimental results are shown in Table 3 below. The values in the table represent the average test accuracy of the client model obtained by using the method of the application and the above-mentioned baseline methods under the three simulated label distribution heterogeneity divisions of the six data sets.
[0145] Table 3
[0146]
[0147] From the data in Table 3, the following conclusions can be drawn: the method of the present application (FedDNG) has performance improvement on different data sets. On all six data sets, the method of the present application (FedDNG) always shows the best or near-best performance compared to other methods. For example, on the CIFAR-10 data set, the method of the present application (FedDNG) outperforms all other methods, and the performance of the method of the present application is improved by about 3%, 7% and 3% compared to the second-best MetaFed method under three simulated label distribution heterogeneous partitions. This shows that the method of the present application (FedDNG) can effectively utilize the dynamic changes of the global collaboration graph for each client, thereby dynamically selecting appropriate clients for collaborative learning to optimize the local client model.
[0148] Robustness to different types of label distribution heterogeneity. The method of the present application (FedDNG) always shows the highest accuracy in most types of scenarios. This shows that the method of the present application (FedDNG) has strong ability to mitigate the impact of label distribution heterogeneity and excellent robustness to different types of label distribution heterogeneity.
[0149] III. Experimental results on feature distribution heterogeneity
[0150] On the PAMAP2 data set, noise-based feature heterogeneity is constructed using the noise addition method. In the PACS data set, which contains four different domains (photos, artistic paintings, cartoons, and sketches), domain-based feature heterogeneity is used, and the data of the 4 domains are divided into 5 equal subsets, and the 20 subsets are assigned to 20 clients. In the FEMNIST data set, user-based feature heterogeneity strategy is used for data division, and each client selects data from the handwriting of 20 different users, and there is no overlapping user between clients.
[0151] Based on the above data division results, the method of the present application (FedDNG) and the above-mentioned 5 baseline methods are experimented, and the experimental results of the average test accuracy of the clients under different feature distribution heterogeneity are obtained, as shown in Figure 4 The horizontal axis represents the data set, and the vertical axis represents the average test accuracy (Accuracy). From Figure 1As can be seen, the method (FedDNG) of the present application has high accuracy on different data sets and different types of label distribution heterogeneity. This shows that the method (FedDNG) of the present application can adapt to different data sets and different types of feature heterogeneity, and exhibits strong robustness and adaptability. Similar to the results of the label distribution heterogeneity experiment, the method (FedDNG) of the present application exhibits a low standard deviation in three experiments under the condition of feature distribution heterogeneity on three data sets. This shows that the method (FedDNG) of the present application can select appropriate collaborative clients based on the dynamic changes of the directed graph structure, thereby maintaining stable performance under different conditions.
[0152] IV. Experimental results on mixed data heterogeneity
[0153] In the PAMAP2 data set, first, Dirichlet distribution is used for label distribution heterogeneity-based partitioning, and then Gaussian noise is applied to each client to construct mixed type I.
[0154] In the PACS data set, Dirichlet distribution is used to partition the data sets of the 4 domains based on distribution-based label heterogeneity, and the data set of each domain is divided into 5 data subsets, a total of 20 subsets, and the 20 subsets are assigned to 20 clients to construct mixed type II.
[0155] In the OrganMNISTA, OrganMNISTC and OrganMNISTS data sets, each data set is regarded as a separate domain, and Dirichlet distribution is applied within the three domains for partitioning, 6 subsets, 6 subsets and 8 subsets are respectively constructed, and are assigned to 20 clients to construct mixed type II. The experimental results of the two types of label heterogeneity are shown in Table 4. The values in Table 4 represent the average test accuracy of the client models obtained by the method of the present application and the above baseline methods under the two simulated mixed type distribution heterogeneity partitions of the three data sets.
[0156] Table 4
[0157]
[0158] The experimental results of Table 4 above show that the method (FedDNG) of the present application has excellent adaptability in dealing with various types of mixed data heterogeneity. Whether in different data sets or in complex mixed data heterogeneity scenarios where feature heterogeneity and label heterogeneity coexist, the method (FedDNG) of the present application can stably achieve an accuracy performance superior to or close to other advanced methods. This result fully shows that the method (FedDNG) of the present application has strong generalization ability and robustness in dealing with diversified data distribution and dynamic heterogeneous environment, can effectively adapt to various federated learning scenarios, and ensure that the local models of each client are continuously optimized and cooperatively improved.
[0159] From the experimental results of label distribution heterogeneity, feature distribution heterogeneity and mixed data heterogeneity above, it can be observed that: 1) traditional federated learning methods (such as FedAvg, FedBN and FedProx) perform well in dealing with feature distribution heterogeneity, but perform poorly in dealing with label distribution heterogeneity; 2) MetaFed has the opposite characteristics: they perform excellently in dealing with label distribution heterogeneity, but perform poorly in feature distribution heterogeneity. 3) pFedGraph performs more balanced in dealing with the three types of data heterogeneity, but its performance is still inferior to the method (FedDNG) of the present application, and its performance on different data sets is not stable enough; 4) the method (FedDNG) of the present application exhibits significant flexibility in dealing with data heterogeneity, greatly improves the learning performance of the personalized model of the local client, and exhibits strong robustness in various data heterogeneity scenarios.
[0160] V. Performance comparison results under different data heterogeneity degrees
[0161] In order to verify the adaptability of the method (FedDNG) of the present application under different degrees of data heterogeneity, three representative methods (FedAvg, MetaFed and pFedGraph) are compared with the method (FedDNG) of the present application under different degrees of label distribution and feature distribution heterogeneity. Four data heterogeneity construction strategies are applied on the PAMAP2 data set, three label distribution heterogeneities and one feature distribution heterogeneity, and different heterogeneity parameters are set for each data heterogeneity.
[0162] Referring to Figure 5 , which is the average test accuracy of the client model obtained by using the present application and the three representative methods under different degrees of four data heterogeneity. The figure includes four coordinate graphs, and each coordinate graph has the heterogeneity degree under the corresponding data heterogeneity on the horizontal coordinate and the average test accuracy on the vertical coordinate. Among them, the coordinate graph Dir( ) represents the average accuracy of each method under different degrees of isomerism under Dirichlet distribution, the coordinate graph C(k) represents the average accuracy of each method when each client fixes k class labels for data isomerism division, the coordinate graph LTLD( ) represents the average accuracy of each method when most data of each category is divided into 1 client and the rest is divided into other clients, and the coordinate graph Gau represents the average accuracy of each method when the above mixed data isomerism is used.
[0163] Figure 5 The experimental results show that the method (FedDNG) can always obtain higher or comparable accuracy under different degrees of data heterogeneity. This shows that the method (FedDNG) has strong adaptability and can dynamically identify beneficial collaborative clients in complex data distribution environments and share valuable information between them, thereby optimizing the learning performance of personalized models.
[0164] Six, personalized experimental results
[0165] Further, two public data sets are used to evaluate the effectiveness of the method (FedDNG) in dealing with data isomerism and improving personalized ability. The two data sets include a real-world health-related data set COVID-19 and a widely used benchmark data set CIFAR-10. The experiment compares the personalized performance of a variety of representative and strong baseline methods (including FedAvg, MetaFed, pFedGraph and the method FedDNG) in the distribution-based label isomerism scenario, specifically by evaluating the accuracy achieved by each client. As shown in Table 5 below, the data represents the test accuracy of each client obtained by using FedAvg, MetaFed, pFedGraph and the method FedDNG under the distribution-based label isomerism division strategy COVID-19 and CIFAR-10 data sets.
[0166] Table 5
[0167]
[0168] Table 5 above shows the performance of all clients. In the two data sets, the method (FedDNG) outperforms other methods on most clients, indicating that it has strong personalized modeling ability when dealing with diverse data distribution in real-world scenarios.
[0169] It is to be understood that even though various embodiments can be described in conjunction with a specific order, the order is not absolute and the steps can be performed in other orders.
[0170] The present application can be a system, a method, and / or a computer program product. The computer program product can include a computer readable storage medium (or media) having computer readable program instructions thereon for causing a processor to carry out aspects of the present application.
[0171] The computer readable storage medium can be a tangible device that can retain and store instructions for use by an instruction execution device. The computer readable storage medium can be, for example, but is not limited to, an electronic storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. A non-exhaustive list of more specific examples of the computer readable storage medium includes the following: a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), a static random access memory (SRAM), a portable compact disc read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanically encoded device such as punch-cards or raised structures in a groove having instructions recorded thereon, and any suitable combination of the foregoing. A computer readable storage medium, as used herein, is not to be construed as being transitory signals per se.
[0172] Embodiments of the application have been described above with the aid of example embodiments described above. The description above is intended to be illustrative, and not exhaustive, of the embodiments disclosed. Many modifications and variations of the described embodiments are possible and are within the scope of the described embodiments, as those skilled in the relevant art will recognize. The embodiments were chosen and described in order to best explain the principles of the application and the practical application and to enable others skilled in the art to best utilize the application. The terminology used herein is for the purpose of describing only the embodiments and is not intended to be limiting.
Claims
1. A dynamic collaboration graph-based decentralized federated learning method, comprising multiple rounds of federated training of models of multiple clients participating in federated learning for a classification task, the models comprising a feature layer and a classification layer, each round of federated training comprising: S1, obtaining each client model and a global collaboration graph, the graph comprising all client nodes and multiple edges, each edge being a directed edge from one client node to another client node to represent that a client model will be aggregated by another client; S2, dividing each client into one or two categories of clients, for a one-category client model, selecting a candidate client set based on the global collaboration graph, and selecting a client model satisfying a knowledge contribution requirement from the set for the one-category client model to learn; S3, updating edges in the global collaboration graph pointing to each one-category client node according to the client model selected for each one-category client; S4, performing knowledge aggregation on all client models to be aggregated by each client according to all edges in the updated global collaboration graph pointing to each client node, to obtain an aggregated model; S5, replacing the classification layer of the client model with the classification layer of the aggregated model to obtain a new model, and updating the parameters of the new model based on the classification loss of the new model and the representation difference loss between the new model and the aggregated model.
2. The method of claim 1, wherein, The S2 comprises: calculating the centrality index of each client node in the global collaboration graph obtained in S1 using a graph centrality calculation method, selecting candidate clients based on the centrality index of each client node to obtain a candidate client set; calculating the similarity of the classification layer parameters of each candidate client model in the candidate client set to the classification layer parameters of the one-category client model, and taking the similarity as the knowledge contribution; selecting a candidate client model with a knowledge contribution greater than a preset contribution as a client model satisfying the knowledge contribution requirement.
3. The method of claim 2, wherein, Each edge in the global collaboration graph comprises an edge weight, and in S3, the global collaboration graph updating method comprises: updating the edges pointing to each one-category client node and the corresponding edge weights according to all client models selected for each one-category client and the knowledge contribution of each selected client model, and not updating the edges pointing to two-category client nodes and the corresponding edge weights.
4. The method of claim 3, wherein, The updating method of the edge pointing to each one-category client node comprises: removing the edges pointing to each one-category client node and the corresponding edge weights in the global collaboration graph obtained in S1; establishing an edge from the selected client node to the one-category client node according to the client model selected for each one-category client.
5. The method of claim 3, wherein, In the global collaboration graph, the sum of the edge weights of all edges pointing to each client node is a preset weight value, and the updating method of the edge weight comprises: calculating the ratio of the knowledge contribution of the selected client model to the sum of the knowledge contributions of all client models selected for the one-category client, and multiplying the ratio by the preset weight value to obtain the edge weight of the edge from the selected client node to the one-category client node.
6. The method of claim 2, wherein, The candidate client set obtaining method comprises: selecting client nodes with a centrality index greater than a preset threshold to obtain one or more core clients; A preset number of clients are selected from the neighbor clients of all core clients, and together with all the core clients, a candidate client set including a plurality of candidate clients is formed, wherein the client pointed to by the core client is a neighbor client of the core client.
7. The method of claim 1, wherein, In each round of federated training, the client model in S1 is obtained in the following manner: The local training set of the client is used to locally train the current model to obtain a client model, in the first round, the current model uses an initialized model, and in other rounds, the current model uses the client model updated after the previous round of federated training; The global collaboration graph in S1 is obtained in the following manner: in the first round, an initially constructed global collaboration graph is obtained, and in other rounds, a global collaboration graph updated in the previous round is obtained.
8. The method according to one of claims 1 to 7, characterized in that In S2, the manner in which each client is divided into one or two categories of clients includes: A loop token scheduling mechanism is used to set a client loop order, one or more tokens are passed to the specified client in the loop in each round, the client that gets the token in each round is a first category of client, and the client that does not get the token is a second category of client.
9. A computer-readable storage medium, characterized in that, A computer program is stored thereon, and the computer program can be executed by a processor to implement the steps of the method of any one of claims 1-8.
10. An electronic device, comprising: Comprise: One or more processors; And A memory, wherein the memory is used to store executable instructions; The one or more processors are configured to implement the steps of the method of any one of claims 1-8 by executing the executable instructions.