A federated learning method, system, device and medium for heterogeneous clients
By combining multi-view feature representation and spectral clustering grouping with a two-stage aggregation method, the privacy leakage and communication overhead problems of heterogeneous clients in federated learning are solved, achieving efficient and privacy-preserving client clustering and model training, and improving the model's generalization ability and training efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HUNAN UNIV OF SCI & TECH
- Filing Date
- 2026-05-09
- Publication Date
- 2026-07-24
AI Technical Summary
Existing federated learning frameworks suffer from data heterogeneity and system heterogeneity when dealing with heterogeneous clients, leading to privacy leaks, huge communication overhead, loss of critical data, and insufficient model generalization ability. Existing technologies struggle to balance privacy protection and clustering efficiency.
We employ multi-view feature representation and spectral clustering methods for client-side clustering and grouping. Combining a two-stage aggregation approach, we obtain model update parameters through the first round of communication for high-precision grouping and aggregation. We design a lightweight spectral clustering algorithm to avoid multiple iterations and exposure of raw data, and introduce a semi-asynchronous mechanism to coordinate the learning progress.
It achieves efficient and privacy-preserving client-side clustering, reduces communication overhead, improves model generalization ability and training fairness, prevents critical data from being marginalized, and improves the performance and training efficiency of the global model.
Smart Images

Figure CN122452818A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of computer technology, and in particular relates to a federated learning method, system, device and medium for heterogeneous clients. Background Technology
[0002] In recent years, with the increasing demand for privacy protection and data security, federated learning, as an advanced distributed machine learning framework, has shown great application potential in many fields such as smart healthcare, finance, and the Internet of Things. Specifically, federated networks based on parameter exchange provide an innovative solution for building privacy-reliable collaborative models, promoting an important shift from traditional centralized training to distributed privacy computing. However, in the actual implementation of existing federated learning frameworks, due to the significant imbalances in node size, computing resources, and network communication among different clients, there are at least two problems: (1) Data heterogeneity, that is, the local data distribution of clients varies significantly, resulting in inconsistencies in the optimization direction of local model updates; (2) System heterogeneity, that is, the differences in computing power and communication capabilities of each node greatly restrict the training efficiency of the entire network.
[0003] To address the aforementioned technical challenges, existing technologies include clustered federated learning and asynchronous federated learning. Clustered federated learning mitigates data heterogeneity by grouping clients with similar data distributions or model performance into different clusters. This allows each cluster to train internally, effectively improving consistency and aggregation within the cluster and mitigating performance degradation caused by differences in data distribution or tasks. Asynchronous federated learning addresses efficiency bottlenecks caused by system heterogeneity. It allows clients to upload models and trigger server updates independently without waiting for all devices on the network to complete local training, thereby improving system responsiveness and throughput.
[0004] However, existing clustering federated learning techniques typically employ either feature clustering or model clustering, but these require the client to disclose crucial information about data distribution to the server, fundamentally violating the core principle of privacy protection in federated learning. Furthermore, existing asynchronous federated learning and its derivative semi-asynchronous federated learning frameworks often use obsolete aggregation mechanisms, such as assigning different weights based on update timestamps to mitigate the impact of slow devices. However, this training process forces the model to focus primarily on training speed, neglecting the critical impact of data value on global model performance, resulting in the severe marginalization of critical data during training. Moreover, data heterogeneity and system heterogeneity in federated learning frameworks often coexist and are intertwined. Existing techniques such as clustering federated learning and asynchronous federated learning are difficult to reconcile, leading to technical problems such as privacy leaks, huge communication overhead, and loss of critical data, thus significantly impairing the generalization ability and fairness of the global model. Summary of the Invention
[0005] This application provides a federated learning method, system, device, and medium for heterogeneous clients, which can solve one of the problems of the prior art mentioned above.
[0006] Firstly, embodiments of this application provide a federated learning method for heterogeneous clients, including: The initial global model is distributed to all client models for training, and the model update parameters of all client models after training are collected. Based on the model update parameters, a multi-view feature representation is constructed; Based on the multi-view feature representation, a spectral clustering method is used to cluster and group clients to obtain multiple client clusters. A two-stage aggregation method is adopted to aggregate the client clusters to obtain global gradient parameters; Based on the global gradient parameters, the initial global model is iteratively updated to obtain the final global model.
[0007] Furthermore, the model update parameters include the classifier layer parameters of the classifier model, which include the local data features of the output neurons of different categories; The construction of multi-view feature representation includes: treating each category of the classifier model as an independent viewpoint, extracting local data features of each classifier model under the corresponding viewpoint, constructing a viewpoint feature matrix, and encapsulating the viewpoint feature matrices of each viewpoint into a multi-view feature representation, wherein the local data features include the weights and biases of the output neurons of the corresponding category.
[0008] Furthermore, based on the multi-view feature representation, the client clustering method is used to obtain multiple client clusters, including: For each viewpoint feature matrix, construct a k-adjacency graph and compute the graph Laplacian matrix; Based on the graph Laplacian matrix, calculate the single-view similarity matrix; The L2 norm of the local data features from each perspective is used as a weight, and a weighted sum is performed in combination with the single-view similarity matrix to obtain the fused view from each perspective. Figure 1 Consistency matrix; Based on the view Figure 1 Consistency matrix, obtain globally consistent similarity graph; Low-rank spectral clustering is performed on the globally consistent similarity graph to divide the client model into multiple client clusters.
[0009] Furthermore, the construction of a k-adjacency graph for the view feature matrix of each viewpoint includes: In the visual feature matrix, the distance feature between any two local data features is calculated, and a distance matrix is constructed; For each client model in the visual feature matrix, select k nearest neighbor distances from the distance matrix, sort the k nearest neighbor distances, and determine the k adjacency value; Based on the k-adjacency value, an initial adjacency matrix is constructed, and the initial adjacency matrix is symmetricized to obtain a k-adjacency graph.
[0010] Furthermore, the two-stage aggregation method is used to aggregate the client clusters to obtain global gradient parameters, including: Based on a preset upload ratio threshold, the first-stage intra-group semi-asynchronous aggregation is performed on each client cluster to obtain the corresponding group gradient. Based on the group gradient, a second-stage inter-group synchronization aggregation is performed to obtain a global gradient update; Based on the global gradient update, the parameters of the initial global model are updated to obtain the global gradient parameters.
[0011] Furthermore, the step of performing a first-stage intra-group semi-asynchronous aggregation on each client cluster based on a preset upload ratio threshold to obtain the corresponding group gradient includes: Establish a model gradient buffer for each of the client clusters and set an upload ratio threshold; Based on the upload ratio threshold and the number of client models in each client cluster, a model update function is set for the gradient buffer of each model. When the number of client model updates in all client clusters meets the corresponding model update function, then perform intra-group semi-asynchronous aggregation to calculate the group gradient.
[0012] Furthermore, the semi-asynchronous aggregation within the execution group includes first-round aggregation within the group and round-by-round aggregation; For the first round of intra-group aggregation, the gradient is calculated by weighted averaging according to the size of the local dataset of each client model in the client cluster to obtain the group gradient; For the intra-group aggregation in the round, the similarity score between the gradient direction of the current client model and the global gradient update in the previous round is calculated and normalized to obtain the aggregation weight of each client. Based on the aggregation weight, the gradient is weighted and summed to obtain the group gradient.
[0013] Secondly, embodiments of this application provide a federated learning system for heterogeneous clients, including: The first processing module is used to distribute the initial global model to all client models for training and to collect the model update parameters after training all client models. The second processing module is used to update parameters based on the model and construct multi-view feature representations. The third processing module is used to perform client clustering and grouping based on the multi-view feature representation and the spectral clustering method to obtain multiple client clusters. The fourth processing module is used to aggregate the client clusters in a two-stage aggregation method to obtain global gradient parameters. The fifth processing module is used to iteratively update the initial global model based on the global gradient parameters to obtain the final global model.
[0014] Thirdly, embodiments of this application provide a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the above-described federated learning method for heterogeneous clients.
[0015] Fourthly, embodiments of this application provide a computer-readable storage medium, including a computer program stored in the computer-readable storage medium, which, when executed by a processor, implements the above-described federated learning method for heterogeneous clients.
[0016] The beneficial effects of the embodiments in this application compared with the prior art are: This application discloses a federated learning method for heterogeneous clients, providing a novel, efficient, and privacy-preserving clustering grouping method. It overcomes the dilemma of existing technologies in balancing privacy protection and clustering efficiency. Specifically, this invention innovatively decouples multiple complementary similarity perspectives from the model update parameters of each client model, and designs a lightweight spectral clustering algorithm based on this. This allows for stable grouping without multiple rounds of iteration, while also concealing the original data distribution of the clients. High-precision grouping can be achieved using only the model update parameters uploaded in the first round of communication, fundamentally solving the core defects of traditional federated clustering, such as privacy leakage risks and huge communication overhead. Furthermore, a two-stage aggregation method was designed to balance model convergence efficiency and training fairness, which can collaboratively address the dual heterogeneity of system resources and data distribution. Specifically, for the first-stage aggregation, a semi-asynchronous mechanism based on dynamic weighting of client update quality is introduced into the client cluster obtained by the spectral clustering algorithm to avoid slow nodes slowing down the overall progress. For the second-stage aggregation, a synchronization barrier is established between client clusters to coordinate the learning progress, thereby effectively mitigating the excessive dominance of high-performance devices on the training direction, improving the positive impact of outdated models on global performance, preventing resource-poor clients or those carrying minority class data from being marginalized, and greatly enhancing the model's generalization ability. Attached Figure Description
[0017] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0018] Figure 1 This is a flowchart illustrating a federated learning method for heterogeneous clients provided in an embodiment of the present invention; Figure 2 This is a schematic diagram of the overall process of multi-view clustering grouping and global model two-stage aggregation of the classifier client provided in the embodiments of the present invention; Figure 3 This is a test graph showing the impact of the number of clusters M on the global model accuracy on the CIFAR10 dataset, provided in an embodiment of the present invention. Figure 4 This is a test graph illustrating the impact of the timing of grouping on the grouping results in the CIFAR10 dataset, as provided in this embodiment of the invention. Figure 5 This is a comparison chart of the accuracy of various asynchronous federated learning algorithms under three datasets with different non-IID distributions, provided by embodiments of the present invention; wherein, Figure 5a This is a schematic diagram illustrating the test accuracy of the ResNet18-CIFAR10-NonIIDp=0.1 model in the experimental group; Figure 5b This is a schematic diagram illustrating the test accuracy of the ResNet18-CIFAR10-NonIIDp=0.5 model in the experimental group; Figure 5c This is a schematic diagram illustrating the test accuracy of the ResNet18-CIFAR10-NonIIDp=1.0 model in the experimental group; Figure 5d This is a schematic diagram illustrating the test accuracy of the CNN-Fashion-NonIIDp=0.1 model in the experimental group; Figure 5e This is a schematic diagram illustrating the test accuracy of the CNN-Fashion-NonIIDp=0.5 model in the experimental group; Figure 5f This is a schematic diagram illustrating the test accuracy of the CNN-Fashion-NonIIDp=1.0 model in the experimental group; Figure 5g This is a schematic diagram illustrating the test accuracy of the CNN-MNIST-NonIIDp=0.1 model in the experimental group; Figure 5h This is a schematic diagram illustrating the test accuracy of the CNN-MNIST-NonIIDp=0.5 model in the experimental group; Figure 5i This is a schematic diagram illustrating the test accuracy of the CNN-MNIST-NonIIDp=1.0 model in the experimental group; Figure 6 This is a schematic diagram of the structure of a federated learning system for heterogeneous clients provided in an embodiment of the present invention; Figure 7 This is a schematic diagram of the structure of a computer device provided in an embodiment of the present invention. Detailed Implementation
[0019] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.
[0020] It should be understood that, when used in this application specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or a collection thereof.
[0021] It should also be understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.
[0022] As used in this application specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrase "if determined" or "if detected [the described condition or event]" may be interpreted, depending on the context, as meaning "once determined," "in response to determination," "once detected [the described condition or event]," or "in response to detection [the described condition or event]."
[0023] Furthermore, in the description of this application and the appended claims, the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0024] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.
[0025] Please see Figure 1 As shown, this invention is a federated learning method for heterogeneous clients, comprising the following steps: S100. Distribute the initial global model to all client models for training, and collect the model update parameters after training all client models; To mitigate privacy risks, existing model clustering methods typically cluster models by analyzing model parameters or gradients. For example, expanding the model gradient into a one-dimensional vector and calculating cosine similarity is a single-view clustering approach. However, this method fails to adequately consider the bias in the data output of different client models during the clustering process, resulting in poor accuracy in single-view gradient clustering. For instance, if the client model is a classifier, its output layer typically provides predictions across multiple class dimensions, and its data heterogeneity is more evident in the skewed classification labels. Conversely, if the client model is a regression model, its output layer typically provides continuous numerical values. The prediction, i.e. the output of a single neuron or a few neurons, faces data heterogeneity that manifests more as feature bias. Specifically, different client models have different biases in their data heterogeneity. Therefore, this application selects corresponding model parameters to extract and construct multi-view features based on the characteristics of the data output of the client model. For example, when the client model is a classifier model, the neuron features of its classifier layer are extracted for multi-view construction. If the client model is a regression model, the neuron features of its representative layer are extracted for multi-view construction, usually the second to last layer, such as a fully connected hidden layer.
[0026] Specifically, in the first round of communication in federated learning, the server distributes the initial global model to all selected client models. Each client model completes its first round of independent training on its local dataset and uploads the global gradient updates of each initial global model after training to the server. Then, the corresponding model update parameters for multi-view feature construction are extracted from the global gradient updates uploaded by each client model.
[0027] S200. Based on the model, update the parameters and construct a multi-view feature representation; In some embodiments, the model update parameters include classifier layer parameters of the classifier model, which include local data features of output neurons for different categories; The construction of multi-view feature representation includes: treating each category of the classifier model as an independent viewpoint, extracting local data features of each classifier model under the corresponding viewpoint, constructing a viewpoint feature matrix, and encapsulating the viewpoint feature matrices of each viewpoint into a multi-view feature representation, wherein the local data features include the weights and biases of the output neurons of the corresponding category.
[0028] Specifically, such as Figure 2 As shown, taking the client model as a classifier model as an example, its model update parameters are the classifier layer parameters of the classifier model. The classifier layer parameters include local data features corresponding to the output neurons of different categories. Specifically, the local data features are the weights and biases of the corresponding output neurons.
[0029] Specifically, taking a classifier model with C categories as an example, the local data features of the vth category are extracted from the classifier layer parameters of each classifier model, as follows: ,in, and Let represent the weights and biases of the output neuron corresponding to the v-th class of classifier model i, respectively.
[0030] In this embodiment, each category of the classifier model is treated as an independent viewpoint. Therefore, under the v-th viewpoint, the local data features of all client models can be constructed into a viewpoint feature matrix, specifically... Where N represents the number of client models, thus, for a classification task with C categories, a multi-view feature representation for C perspectives can be constructed. Through this multi-view feature representation, the local data features of the client models in different categories can be deeply decoupled.
[0031] S300. Based on the multi-view feature representation, the client clustering method is used to group the clients to obtain multiple client clusters; In this application, the traditional K-means algorithm measures similarity using Euclidean distance. However, Euclidean distance implicitly assumes that "data is spherically symmetric in space," resulting in an isotropic convex sphere distribution for each cluster. Furthermore, the hard assignment principle that each data point must strictly belong to a single cluster makes the K-means algorithm unable to express the ambiguity of "partially belonging to multiple clusters." This either-or partitioning approach struggles to effectively integrate multi-perspective feature information. Additionally, existing model clustering methods typically require the server to collect complete update information from multiple rounds, or even all client models, and iterate repeatedly, a process that is extremely slow and difficult to respond quickly and form stable groups in large-scale or dynamically changing federated systems. Therefore, this application employs a graph Laplacian-based spectral clustering method to decouple multiple complementary similarity perspectives from multi-perspective feature representations. This eliminates the need for multiple iterations to form stable groups and achieves high-precision grouping using model update parameters uploaded by each client model during the first round of training, without exposing the original client data distribution. This fundamentally solves the privacy leakage and high communication overhead defects inherent in traditional federated clustering.
[0032] In some embodiments, step S300 above includes: For each viewpoint feature matrix, construct a k-adjacency graph and compute the graph Laplacian matrix; Based on the graph Laplacian matrix, calculate the single-view similarity matrix; The L2 norm of the local data features from each perspective is used as a weight, and a weighted sum is performed in combination with the single-view similarity matrix to obtain the fused view from each perspective. Figure 1 Consistency matrix; Based on the view Figure 1 Consistency matrix, obtain globally consistent similarity graph; Low-rank spectral clustering is performed on the globally consistent similarity graph to divide the client model into multiple client clusters.
[0033] In this embodiment, for each viewpoint v, a corresponding k-adjacency graph is constructed to mine the potential manifold results between the local data features of each client model under the same viewpoint, thereby accurately characterizing the local topological relationship of each client model under that viewpoint, which is beneficial to the subsequent construction of the single-view similarity matrix.
[0034] In some embodiments, constructing a k-adjacency graph for each viewpoint feature matrix includes: In the visual feature matrix, the distance feature between any two local data features is calculated, and a distance matrix is constructed; For each client model in the visual feature matrix, select k nearest neighbor distances from the distance matrix, sort the k nearest neighbor distances, and determine the k adjacency value; Based on the k-adjacency value, an initial adjacency matrix is constructed, and the initial adjacency matrix is symmetricized to obtain a k-adjacency graph.
[0035] In this embodiment, the distance feature between any two local data features in the visual feature matrix is calculated as follows: ,in, and These represent the client model in the view feature matrix from the current perspective. and The feature vector, taking the v-th viewpoint as an example, corresponds to the viewpoint feature matrix. In and ,pass and The square of the Euclidean distance between each client model is used to calculate the distance features between local feature data, and this distance matrix is used to construct the visual feature matrix. .
[0036] Furthermore, for each client model i in the visual feature matrix, from the distance matrix Find the k smallest distance values in the i-th row vector and use them as the k nearest neighbor distances. Sort the k nearest neighbor distances in ascending order to obtain the k-th nearest neighbor distance, which is used as the k-adjacency value. In a preferred embodiment, k=9.
[0037] Furthermore, to ensure the sparsity and local representativeness of the final generated k-adjacency graph, an asymmetric adjacency matrix is constructed, specifically: ,in Let k represent the adjacency value. This asymmetric adjacency matrix serves as the initial adjacency matrix. In subsequent steps, to eliminate directed connections and enhance the robustness of the graph, it needs to be symmetricized. The specific calculation formula is as follows: Thus, the k-adjacency graph is obtained. .
[0038] Furthermore, calculate the k-adjacency graph. Normalized graph Laplace matrix , specifically ,in, Representation and normalized graph Laplacian matrix The corresponding degree matrix, The identity matrix is used to connect from the original to the difference operator. Furthermore, according to graph theory, the single-view similarity matrix under this perspective is obtained by subtracting the normalized graph Laplacian matrix from the identity matrix. Its mathematical expression is: Where I is used to smooth similarity, thus, through the above symmetric normalization process, the k-adjacency graph is... Absolute edge weights between nodes Convert to relative similarity This effectively suppresses the weight bias caused by uneven distribution of client data in heterogeneous edge networks, which leads to different degrees of association of some clients in the k-adjacency graph. At the same time, this symmetric normalization operation strictly restricts the feature values of the graph structure under different perspectives to the same numerical scale, thereby ensuring the stability of the subsequent multi-view weighted fusion process.
[0039] Furthermore, to integrate graph structure information from different categories, the L2 norm of local data features from each perspective is used as weights to calculate the single-view similarity matrix for each perspective. Perform a weighted summation to obtain the view Figure 1 The consistency matrix S, specifically, Where C represents the number of viewpoints v, and The weights of each single-view similarity matrix represent the weights of the data features. By weighting the single-view similarity matrices of each viewpoint, the dominant role of the category viewpoint with higher local data feature importance in the clustering process can be enhanced. In the embodiment, the importance of the data features is measured by the L2 norm of the local data features. Specifically, a larger norm indicates a stronger response. Taking the classifier model mentioned above as an example, the local data features of each viewpoint are as follows: Then, the weights of the single-view similarity matrix for each viewpoint are specifically expressed as follows: Where N represents the number of client-side models and n represents the index of the client-side model.
[0040] Furthermore, regarding the aforementioned fused view... Figure 1 The consistency matrix S is symmetricized to obtain Then, it is converted into a distance metric, and based on this distance metric, a new K-adjacency graph is constructed as a globally consistent similarity graph. ,in, Let K represent the distance metric, and K represent the number of nearest neighbors to which each data point needs to be connected. This is achieved using a k-adjacency graph as described above. Construct the new K-adjacency graph using the same method.
[0041] Furthermore, based on the aforementioned globally consistent similarity graph... Low-rank spectral clustering is performed to divide each client model into multiple client clusters with similar data distributions. Specifically, the normalized Laplacian matrix of the global consistency similarity graph is calculated. Where I represents the unit matrix; then, eigenvalue decomposition is performed on L to extract the first M smallest eigenvectors. And construct the spectral feature matrix column by column. Where N represents the number of client models and M represents the number of spectral clusters; furthermore, in order to eliminate the differences in numerical dimensions of different feature vectors, each row of the above spectral feature matrix is processed... Normalization process to obtain the normalized spectral matrix , specifically ,in, Represents the normalized spectral matrix The elements in Representation of spectral characteristic matrix The elements in The dimension of the feature space is typically equivalent to the predefined number of clusters in spectral clustering. Then, the K-means clustering algorithm is used to normalize the spectral matrix. The row vectors are divided, and the sum of squared errors within each client cluster is minimized. Specifically, ,in, Indicates the result of the partitioning A client cluster, Represents the normalized spectral matrix The Row vector, i.e., the first row vector The feature representation of each client in the normalized spectral space For the first The centroid of each client cluster is the mean of all spectral vectors within that client cluster. It's worth noting that the aforementioned low-rank spectral clustering process only requires updating the model parameters of each client model in the first round of communication, and does not require exchanging original data, achieving high-precision privacy-preserving clustering with extremely low communication overhead.
[0042] S400. A two-stage aggregation method is adopted to aggregate the client clusters to obtain global gradient parameters; This application designs a two-stage aggregation method that balances model convergence efficiency and training fairness. It effectively alleviates the excessive dominance of high-performance devices on the training direction, enhances the positive impact of outdated models on the overall model performance, prevents resource-poor clients or those carrying minority class data from being marginalized, and greatly enhances the model's generalization ability.
[0043] In some embodiments, step S400 above includes: Based on a preset upload ratio threshold, the first-stage intra-group semi-asynchronous aggregation is performed on each client cluster to obtain the corresponding group gradient. Based on the group gradient, a second-stage inter-group synchronization aggregation is performed to obtain a global gradient update; Based on the global gradient update, the parameters of the initial global model are updated to obtain the global gradient parameters.
[0044] The two-stage aggregation method in this embodiment is designed to address the dual heterogeneity of system resources and data distribution. For the first stage of aggregation, a semi-asynchronous mechanism based on dynamic weighting of client update quality is introduced into the client cluster obtained by the spectral clustering algorithm to avoid slow nodes slowing down the overall progress. For the second stage of aggregation, a synchronization barrier is established between each client cluster to coordinate the learning progress.
[0045] In some embodiments, the step of performing a first-stage intra-group semi-asynchronous aggregation on each client cluster based on a preset upload ratio threshold to obtain the corresponding group gradient includes: Establish a model gradient buffer for each of the client clusters and set an upload ratio threshold; Based on the upload ratio threshold and the number of client models in each client cluster, a model update function is set for the gradient buffer of each model. When the number of client model updates in all client clusters meets the corresponding model update function, then perform intra-group semi-asynchronous aggregation to calculate the group gradient.
[0046] In this embodiment, to avoid the problem of fast devices dominating the training direction in traditional semi-asynchronous mechanisms, an upload ratio threshold is set for each client cluster. Meanwhile, an independent model gradient buffer of varying length is established for each client cluster to store the updated client models after training. Specifically, each client model is trained according to its own computing power and then asynchronously uploaded to the model gradient buffer.
[0047] Furthermore, regarding the number of client model updates uploaded to the model gradient buffer, if the number of updates satisfies... When this condition is met, it indicates that the client cluster meets the intra-group aggregation conditions. Once all groups meet the aggregation conditions, each group can perform intra-group semi-asynchronous aggregation. Indicates client cluster The number of updates in the model gradient buffer for the client model. This represents the number of client models clustered into client cluster i through the above step S300.
[0048] In some embodiments, the execution group semi-asynchronous aggregation includes first-round group aggregation and round group aggregation; For the first round of intra-group aggregation, the gradient is calculated by weighted averaging according to the size of the local dataset of each client model in the client cluster to obtain the group gradient; For the intra-group aggregation in the round, the similarity score between the gradient direction of the current client model and the global gradient update in the previous round is calculated and normalized to obtain the aggregation weight of each client. Based on the aggregation weight, the gradient is weighted and summed to obtain the group gradient.
[0049] In this embodiment, when performing semi-asynchronous aggregation within a group, the traditional "timestamp-based decay" outdated awareness strategy is abandoned. Instead, a client-based gradient quality contribution-based aggregation method is adopted. Specifically, the gradient direction of the current client update upload is calculated. The global gradient update is obtained by combining the previous round's client models through a two-stage aggregation method. Cosine similarity between , and then to Normalization is performed to obtain the aggregate weights of each client model. Based on this aggregated weight, the gradient directions of each client model in the model gradient buffer are weighted and summed to obtain the group gradient of the corresponding client cluster. .
[0050] Understandably, the aforementioned perceptual aggregation method based on client-side gradient quality contribution can be applied to intra-group aggregation during model updates in non-first-round communication processes. This perceptual aggregation process can obtain the global gradient update from the previous round of model updates. However, for the first-round intra-group aggregation, since there is no global gradient update from the previous round, the corresponding aggregation weight is calculated according to the size of each client model's local dataset. Then, based on this aggregation weight, a weighted average is calculated for the gradient direction to obtain the desired result. Specifically, the two-stage aggregation method of this application only requires the gradient information in the first round to obtain the group gradient and obtain the global gradient parameters. In the subsequent rounds of communication, only the global gradient parameters of the previous round are needed to iteratively update the global model, and there is no need to interact with the original data, thus achieving high-precision privacy protection with extremely low communication overhead.
[0051] Specifically, through the above-mentioned intra-group semi-asynchronous aggregation, the key discrimination information of a minority class contained in slow devices is effectively identified and preserved, preventing it from being indiscriminately weakened.
[0052] Furthermore, once all client clusters have completed the first phase of intra-group semi-asynchronous aggregation and generated their respective valid group gradients... Then, a global synchronization barrier is triggered, which involves the second stage of inter-group synchronization aggregation to coordinate the training rhythm between different client clusters. Specifically, proportional weights are assigned to each client cluster according to the proportion of client models in each cluster to the total number of client models. Then, global synchronization aggregation is performed to obtain global gradient updates. As in one embodiment, ,in, This represents the total amount of data from all client-side models, corresponding to the number of client-side models represented by N in step S200 above. M represents the amount of data in the client model within client cluster i, and M is the total number of client clusters.
[0053] Understandably, in some embodiments, this global gradient update can serve as the data basis for evaluating the client's gradient quality contribution during the first-stage semi-asynchronous aggregation in the next round of two-stage aggregation.
[0054] Furthermore, the aforementioned global gradient update is applied to the global model to update the global model parameters and obtain the global gradient parameters, specifically as follows: ,in The global learning rate, These are the global model parameters from the previous round. These are the global gradient parameters for this round. Through the design of "intra-group semi-asynchronous aggregation + inter-group synchronous aggregation" in the two-stage aggregation method, the overall throughput is improved while ensuring the fairness of contributions from different data heterogeneous clusters to the global model.
[0055] Specifically, such as Figure 2 As shown, taking the above classifier model as an example, each client model is classified into four client clusters, A, B, C, and D, through low-rank spectral clustering in step S300. For each client cluster, the first-stage semi-asynchronous aggregation is performed within the group to obtain the group gradient of the corresponding client cluster. In this embodiment, they are respectively... , , , Taking client cluster A as an example, we will now explain how to calculate the gradient of each client model in client cluster A. The global gradient update obtained after two-stage aggregation with the previous client model If cosine similarity is calculated, then Where i is the index of each client model in the client cluster, T is the transpose of the gradient of the client model, and then the cosine similarity calculated for each client model is normalized to obtain the corresponding aggregate weight. ,but Therefore, by weighted summing of the gradients of each client model, the group gradient of client cluster A can be obtained. If the number of client models in client cluster A is 2, then... For client clusters B, C, and D, the same method described above can be used to obtain the corresponding group gradients. Then, for the four client clusters, the second-stage inter-group synchronization aggregation is performed to obtain the global gradient update for this round. , specific ,in, The proportional weights are assigned to each client cluster, and then the obtained global gradient is updated. This is applied to the global model from the previous round to update the global model parameters and obtain the global gradient parameters for the current round. Specifically This enables two-stage aggregation of the client-side model.
[0056] S500. Based on the global gradient parameters, the initial global model is iteratively updated to obtain the final global model.
[0057] In this embodiment, during the first round of communication, the initial global model is sent to the client model to perform the training and update steps S100-S400 described above, thereby obtaining the global gradient parameters. This process obtains a new global model, which is then used as the initial global model for the next round of communication and distributed to each client model. Step S400 is repeated until the preset global model convergence condition is met and the final global model is output. The global model convergence condition is reaching the maximum number of communication rounds or model accuracy convergence.
[0058] Specifically, the model update parameters, multi-view feature representation construction, and clustering of each client model in steps S100-S300 are performed only in the first round of communication to cluster each client model into multiple client clusters with similar data distributions. Stable grouping can be formed without multiple rounds of iteration, and the original data distribution of the client models is not exposed. High-precision grouping can be achieved by using only the model update parameters uploaded by each client model during the first round of training, thus achieving high-precision privacy-preserving clustering with extremely low communication overhead.
[0059] In one embodiment of this application, a test experiment is set up for the final global model constructed by the above-mentioned federated learning method for heterogeneous clients to verify the effectiveness of the federated learning method. Specifically, the test experiment builds a federated learning virtual simulation environment on a high-performance computer device. The federated learning simulation environment includes one central server and 100 heterogeneous client devices, and the configuration of the high-performance computer device is: Intel Core Ultra 7265K processor, 48GB of RAM and NVIDIA RTX 5070 Ti high-performance graphics card.
[0060] It should be noted that this test experiment is a simulated environment. By combining an event-driven mechanism with multi-threaded concurrency and GPU memory isolation technology, it simulates the parallel training and state synchronization behavior of multiple heterogeneous edge devices. Through the event-driven scheduling method, it can accurately control and realistically reproduce the timeline differences of heterogeneous edge devices in local training and network communication according to the preset device computing power parameters. The proposed method is fully applicable to real heterogeneous federated learning systems, especially in scenarios with extremely high data privacy requirements such as smart healthcare, IoT, and vehicle networking. The federated learning framework of this application will run in a real distributed network composed of multiple heterogeneous physical edge nodes, such as local servers of various hospitals, various IoT terminals, and a central aggregation server. Based on the above-mentioned federated learning method for heterogeneous clients, each node can first perform multi-view clustering grouping in steps S100-S300, then use local computing power to execute iterative model training in step S400, and interact with the central server through the two-stage aggregation method described in this application.
[0061] Specifically, the test experiments in this embodiment used three classic public datasets: MNIST, Fashion-MNIST (Fashion), and CIFAR10. To realistically reflect the data heterogeneity of edge devices, the data on each client device was divided based on a Dirichlet distribution. A parameter p was used to control the degree of heterogeneity among the client device data; a smaller p value indicates greater data heterogeneity, which can be used to test scenarios where the data heterogeneity of the client models in this application is relatively large. Simultaneously, a CNN model was used to process the MNIST and Fashion datasets, and ResNet18 was used to process the CIFAR10 dataset. A unified optimization algorithm, such as stochastic gradient descent (SGD), was employed, with the global learning rate set to... Furthermore, the core parameter for clustering and grouping each client device is set to cluster number M=10, and the upload ratio threshold is set for aggregation within the first stage group. .
[0062] Furthermore, an evaluation standard is set for the test experiment of this embodiment. Specifically, since each client model participates in training at a different pace in asynchronous federated learning, the traditional "number of communication rounds" is difficult to fairly reflect efficiency. Therefore, this embodiment uses "client trip" as the evaluation index. That is, one client trip represents a complete interaction process between the client and the server, including model download, local training and uploading. This evaluation index covers both communication and computing overhead and can more accurately characterize the wall clock training time in the actual physical environment.
[0063] More specifically, in order to comprehensively evaluate the performance of the federated learning method for heterogeneous clients described in this application, three typical asynchronous federated learning baseline methods were selected for comparison, including: FedBuff, Quality, and CA2FL.
[0064] Therefore, based on the experimental configuration of the above test experiments, and by comparing the three typical asynchronous federated learning baseline methods, the specific process is as follows: (1) Verification of parameter configuration and clustering timing in the embodiment, namely, evaluating the above core parameter cluster number M and the grouping time of clustering in the first round of communication of this application, in order to verify its impact on the trade-off between model performance and efficiency.
[0065] Specifically, such as Figure 3 The diagram illustrates the impact of the cluster number M on global accuracy on the CIFAR10 dataset. Figure 3 It can be seen that as M increases, the global model accuracy first increases and then decreases. Specifically, when M is small, the number of clients in each client cluster is large and the internal data heterogeneity is extremely high, resulting in the global model accuracy failing to reach the optimal level. However, when M is increased to a specific range, for example, in this embodiment, preferably when M=10, the distribution of client data in each client cluster reaches a high degree of homogeneity, thereby achieving the optimal global model performance. If it continues to increase, it will cause the system device heterogeneity of the client models in each client cluster to increase sharply, thereby slowing down the training efficiency and causing the accuracy to decrease.
[0066] More specifically, by conducting 200 rounds of full communication across all client models, and using the silhouette coefficient as an offline evaluation metric for clustering quality, the clustering results of the model classifier in each round are calculated. Figure 4 As shown, the impact of the timing of grouping at the start of clustering on the grouping results is illustrated. Points marked with pentagrams represent the best clustering results. According to the test results, the optimal clustering quality can be obtained by grouping in the very early stage of training, i.e., the first round. The principle is that in the first round of training, each client model has not yet been disturbed by global aggregation and has not been affected by the conflict between "local and global" objectives. Its local data features can maintain the discrimination results of its local dataset distribution in the feature space in the purest way, and feature interleaving or degradation has not yet occurred. This result confirms that the mechanism design of this application, which can achieve high-precision grouping in the first round, is scientific and efficient.
[0067] (2) Comparison scale test and core component technology effect verification, used to prove the independent technical contribution of the multi-view clustering mechanism in step S300 and the two-stage aggregation mechanism in step S400 in the federated learning method of this application and their beneficial effects. Specifically, this embodiment sets different comparison scales on three datasets for performance testing, and the global model accuracy results are shown in Table 1 below.
[0068] Table 1 shows the global model accuracy for ablation experiments on core components.
[0069] Specifically, as shown in Table 1, Comparative Example 1 uses the most basic full-communication, i.e., global synchronous aggregation, and its three datasets have the lowest accuracy. This conversely proves the absolute necessity of introducing the collaborative mechanism of multi-view clustering and two-stage aggregation proposed in this application in the context of severe dual heterogeneity. In Comparative Example 2, replacing the multi-view clustering in step S300 of this application with ordinary "random grouping" significantly reduces the performance of all three datasets. This verifies that the method of client clustering and grouping based on multi-view feature representation and spectral clustering in step S300 of this application can accurately capture the similarity of client data distribution and has significant technical advantages. In Comparative Example 3, after degrading the first-stage intra-group semi-asynchronous aggregation in step S400 of this application to the existing "traditional perceptual aggregation", the accuracy of each dataset also declines significantly. This proves that the existing technology relies on the "timestamp decay" outdated perception strategy for weighting, which will wrongly penalize slow clients carrying valuable minority class data. The perceptual aggregation method based on client gradient quality contribution proposed in this application effectively solves this unfair phenomenon and greatly improves the generalization ability of the model.
[0070] (3) Verification of the technical effect of the clustering feature selection mechanism, which is used to verify the superiority of the model update parameters used in this application, which correspond to the classifier layer parameters of the classifier model as the basis for clustering. This test experiment compared three different classification feature dimensions in the classifier model, and the test results are shown in Table 2 below.
[0071] Table 2. Impact of Different Client Classification Criteria on Packet Performance
[0072] Specifically, as shown in Table 2, the classification method based on "model gradient direction" is extremely unstable in single-round communication, with the accuracy dropping sharply to 0.4764 on the MNIST dataset. While the classification method based on "original data features" can achieve better performance, it requires the client to upload the original data distribution statistics, posing a fatal risk of privacy leakage. In contrast, the multi-view clustering method based on "classifier layer parameters" proposed in this application achieves high accuracy comparable to directly using data features without disclosing the privacy of the underlying original data, thus achieving an excellent balance between privacy protection and clustering accuracy.
[0073] (4) Verification of the comprehensive technical effect in heterogeneous scenarios, used to verify the robustness of this application in complex real-world environments, such as... Figure 5 As shown, corresponding Figures 5a-5i The test results show a comparison of the global model accuracy of the embodiments of this application with existing asynchronous federated learning algorithms under three datasets and different non-independent and identically distributed data partitioning parameters. The different non-independent and identically distributed data partitioning parameters, i.e., the parameters p set for the Dirichlet distribution, are different.
[0074] Depend on Figures 5a-5i In the various heterogeneous scenarios encountered in the test experiments shown, the convergence speed and final test accuracy of the embodiments of this application consistently and significantly outperform the baseline methods. Especially in the harsh high non-IID scenario, i.e., when p is extremely small, existing algorithms such as CA2FL and FedBuff suffer from severe accuracy oscillations and slow convergence due to the dual impact of extremely heterogeneous data distribution and outdated gradients. In contrast, the convergence curve of this application exhibits extremely high smoothness and a steady upward trend, fully demonstrating the stability of the two-stage collaborative aggregation method of this application.
[0075] Furthermore, Table 3 records a comparison of the time required for each algorithm to reach the target accuracy in highly non-IID scenarios, as shown below.
[0076] Table 3. Comparison of time required for each algorithm to reach the target accuracy in highly non-IID scenarios (p=0.1)
[0077] Specifically, as shown in Table 3, the embodiments of this application demonstrated convergence speeds far exceeding those of the comparison algorithms when achieving the highest preset accuracy in each dataset. Specifically, in CIFAR10, with a target accuracy of 0.6, the embodiments of this application took 161,900 seconds, a 42.81% improvement in convergence efficiency compared to the average time of the three comparative examples (283,103 seconds). In Fashion, with a target accuracy of 0.8, the embodiments of this application took 18,167 seconds, a significant 20.46% reduction compared to the average time of the three comparative examples (22,841.3 seconds). In MNIST, with a target accuracy of 0.9, the embodiments of this application took only 4,090 seconds, a 53.34% reduction compared to the average time of the three comparative examples (9,157.7 seconds). This strongly demonstrates that while ensuring high model accuracy, this application significantly saves system communication resources and shortens the training cycle.
[0078] In summary, the test results fully verify the effectiveness and advancement of the proposed method. This application deeply integrates multi-view clustering grouping with two-stage aggregation, which not only achieves accurate clustering without privacy leakage with extremely low communication overhead, but also achieves a double leap in model generalization accuracy and system training efficiency in highly non-IID and heterogeneous edge environments, and has extremely high practical industrial deployment value.
[0079] Please see Figure 6 As shown, the present invention also provides a federated learning system for heterogeneous clients, the system comprising: First processing module 601: used to distribute the initial global model to all client models for training, and collect the model update parameters after training of all client models; The second processing module 602 is used to update parameters based on the model and construct a multi-view feature representation; The third processing module 603 is used to perform client clustering and grouping based on the multi-view feature representation and the spectral clustering method to obtain multiple client clusters. The fourth processing module 604 is used to aggregate the client clusters in a two-stage aggregation method to obtain global gradient parameters. The fifth processing module 605 is used to iteratively update the initial global model based on the global gradient parameters to obtain the final global model.
[0080] It is understandable that, such as Figure 1 The content of the federated learning method embodiments for heterogeneous clients shown are all applicable to this federated learning system embodiment for heterogeneous clients. The specific functions implemented in this federated learning system embodiment for heterogeneous clients are the same as those shown below. Figure 1The federated learning method for heterogeneous clients shown is the same as the one described above, and the beneficial effects achieved are the same as those described above. Figure 1 The beneficial effects achieved by the federated learning method embodiment for heterogeneous clients shown are the same.
[0081] It should be noted that the information interaction and execution process between the above systems are based on the same concept as the method embodiments of the present invention. For details on their specific functions and technical effects, please refer to the method embodiments section, which will not be repeated here.
[0082] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the system can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0083] Please see Figure 7 As shown, this embodiment of the invention also provides a computer device 7, including: a memory 702 and a processor 701, and a computer program 703 stored on the memory 702. When the computer program 703 is executed on the processor 701, it implements the federated learning method for heterogeneous clients as described in any of the above methods.
[0084] The computer device 7 can be a desktop computer, laptop, handheld computer, or cloud server, etc. The computer device 7 may include, but is not limited to, a processor 701 and a memory 702. Those skilled in the art will understand that... Figure 7 The computer device 7 is merely an example and does not constitute a limitation on the computer device 7. It may include more or fewer components than shown, or combine certain components, or different components, such as input / output devices, network access devices, etc.
[0085] The processor 701 may be a Central Processing Unit (CPU), or it may be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor.
[0086] In some embodiments, the memory 702 may be an internal storage unit of the computer device 7, such as a hard disk or memory of the computer device 7. In other embodiments, the memory 702 may be an external storage device of the computer device 7, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., equipped on the computer device 7. Further, the memory 702 may include both internal and external storage units of the computer device 7. The memory 702 is used to store the operating system, applications, bootloader, data, and other programs, such as the program code of the computer program. The memory 702 can also be used to temporarily store data that has been output or will be output.
[0087] This invention also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the federated learning method for heterogeneous clients as described in any of the above methods.
[0088] In this embodiment, if the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include at least: any entity or device capable of carrying computer program code to a photographic device / computer device, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium. Examples include USB flash drives, portable hard drives, magnetic disks, or optical disks. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electrical carrier signals or telecommunication signals.
[0089] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.
Claims
1. A federated learning method for heterogeneous clients, characterized in that, include: The initial global model is distributed to all client models for training, and the model update parameters of all client models after training are collected. Based on the model update parameters, a multi-view feature representation is constructed; Based on the multi-view feature representation, a spectral clustering method is used to cluster and group clients to obtain multiple client clusters. A two-stage aggregation method is adopted to aggregate the client clusters to obtain global gradient parameters; Based on the global gradient parameters, the initial global model is iteratively updated to obtain the final global model.
2. The method as described in claim 1, characterized in that, The model update parameters include the classifier layer parameters of the classifier model, which include the local data features of the output neurons of different categories; The construction of multi-view feature representation includes: treating each category of the classifier model as an independent viewpoint, extracting local data features of each classifier model under the corresponding viewpoint, constructing a viewpoint feature matrix, and encapsulating the viewpoint feature matrices of each viewpoint into a multi-view feature representation, wherein the local data features include the weights and biases of the output neurons of the corresponding category.
3. The method as described in claim 1, characterized in that, Based on the multi-view feature representation, a spectral clustering method is used to cluster and group clients to obtain multiple client clusters, including: For each viewpoint feature matrix, construct a k-adjacency graph and compute the graph Laplacian matrix; Based on the graph Laplacian matrix, calculate the single-view similarity matrix; The L2 norm of the local data features from each perspective is used as the weight, and the weighted sum is combined with the single-view similarity matrix to obtain the view consistency matrix that integrates the perspectives. Based on the view consistency matrix, a globally consistent similarity graph is obtained; Low-rank spectral clustering is performed on the globally consistent similarity graph to divide the client model into multiple client clusters.
4. The method as described in claim 3, characterized in that, The construction of a k-adjacency graph based on the view feature matrix for each viewpoint includes: In the visual feature matrix, the distance feature between any two local data features is calculated, and a distance matrix is constructed; For each client model in the visual feature matrix, select k nearest neighbor distances from the distance matrix, sort the k nearest neighbor distances, and determine the k adjacency value; Based on the k-adjacency value, an initial adjacency matrix is constructed, and the initial adjacency matrix is symmetricized to obtain a k-adjacency graph.
5. The method as described in claim 1, characterized in that, The two-stage aggregation method is used to aggregate the client clusters to obtain global gradient parameters, including: Based on a preset upload ratio threshold, the first-stage intra-group semi-asynchronous aggregation is performed on each client cluster to obtain the corresponding group gradient. Based on the group gradient, a second-stage inter-group synchronization aggregation is performed to obtain a global gradient update; Based on the global gradient update, the parameters of the initial global model are updated to obtain the global gradient parameters.
6. The method as described in claim 5, characterized in that, The first-stage semi-asynchronous aggregation within each client cluster, based on a preset upload ratio threshold, to obtain the corresponding group gradient includes: Establish a model gradient buffer for each of the client clusters and set an upload ratio threshold; Based on the upload ratio threshold and the number of client models in each client cluster, a model update function is set for the gradient buffer of each model. When the number of client model updates in all client clusters meets the corresponding model update function, then perform intra-group semi-asynchronous aggregation to calculate the group gradient.
7. The method as described in claim 6, characterized in that, The semi-asynchronous aggregation within the execution group includes the first-round aggregation within the group and the aggregation within subsequent rounds; For the first round of intra-group aggregation, the gradient is calculated by weighted averaging according to the size of the local dataset of each client model in the client cluster to obtain the group gradient; For the intra-group aggregation in the round, the similarity score between the gradient direction of the current client model and the global gradient update in the previous round is calculated and normalized to obtain the aggregation weight of each client. Based on the aggregation weight, the gradient is weighted and summed to obtain the group gradient.
8. A federated learning system for heterogeneous clients, characterized in that, include: The first processing module is used to distribute the initial global model to all client models for training and to collect the model update parameters after training all client models. The second processing module is used to update parameters based on the model and construct multi-view feature representations. The third processing module is used to perform client clustering and grouping based on the multi-view feature representation and the spectral clustering method to obtain multiple client clusters. The fourth processing module is used to aggregate the client clusters in a two-stage aggregation method to obtain global gradient parameters. The fifth processing module is used to iteratively update the initial global model based on the global gradient parameters to obtain the final global model.
9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the method as described in any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1 to 7.