A method and apparatus for client group partitioning based on federated learning
By extracting client data features and model parameters based on neural networks in federated learning, and constructing a multi-view fusion similarity matrix for clustering, the problem of inaccurate client group segmentation in existing technologies is solved, achieving more accurate group segmentation and model training results.
Patent Information
- Application Number
- CN202411692559.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-25
- Publication Date
- 2025-10-31
- Estimated Expiration
- 2044-11-25
AI Technical Summary
Existing client group partitioning methods for federated learning result in poor accuracy of group partitioning results, failing to effectively capture data and model heterogeneity among clients, thus affecting the progress and effectiveness of model training.
Feature extraction is performed by acquiring the client's local dataset, distribution features are generated using a pre-built neural network learning model, and the model parameters of the federated learning neural network are combined to construct an optimization objective function. Based on the cross-view graph matching mechanism and mean clustering method, a multi-view fusion similarity matrix is generated, and finally, client group division is performed.
It improves the accuracy of client group segmentation, reduces the bias and uncertainty caused by a single perspective, and enhances the robustness and training efficiency of the model.
Smart Images

Figure CN119719827B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of machine learning technology, and in particular to a method and apparatus for client group partitioning based on federated learning. Background Technology
[0002] Artificial intelligence and machine learning technologies are rapidly developing and widely applied in various fields such as healthcare, finance, and transportation. However, data privacy and security issues are becoming increasingly prominent, posing a key obstacle to data sharing and collaboration. Traditional centralized machine learning methods require processing data on a central server, but this approach can lead to data breaches and privacy violations.
[0003] Federated learning, while protecting data privacy, utilizes multiple distributed client devices (such as smartphones and IoT devices) to collaboratively train models. In this approach, data does not need to leave the local device; instead, model updates are performed locally, and the encrypted model parameters are uploaded to a central server for aggregation. Through this method, federated learning not only effectively protects data privacy but also reduces the risks and costs of data transmission.
[0004] In federated learning, the data distribution, volume, and data type of each client can vary significantly. The hardware performance, storage capacity, and network conditions of different devices also differ. Clients may be unable to participate stably in training due to various reasons (such as insufficient battery power or network interruption). This heterogeneity of the model and system affects the progress and effectiveness of model training, thus impacting overall training performance and the model's generalization ability. In other words, the accuracy of client clustering directly affects the effectiveness of federated learning. Therefore, in practical applications, client clustering can group clients with similar performance and data characteristics into the same group for collaborative training, thereby alleviating and resolving the data heterogeneity and system heterogeneity problems in federated learning, ultimately improving model accuracy and reducing training costs and time.
[0005] Existing client group partitioning methods for federated learning are mostly based on a single indicator to represent the client's high-dimensional data, such as using only the mean and variance to represent the data distribution, or determining the partition based on the parameters or update gradient of the client model. However, the data of different clients may have different distributions, noise levels, outliers, etc. It is difficult to accurately capture these differences with a single data source, resulting in poor accuracy of the group partitioning results. Summary of the Invention
[0006] This invention provides a client group partitioning method and apparatus based on federated learning, which solves the technical problem that existing client group partitioning methods for federated learning result in poor accuracy of group partitioning results.
[0007] The first aspect of this invention provides a client group partitioning method based on federated learning, comprising:
[0008] Acquire local datasets from multiple clients, input the local datasets of each client into a pre-set neural network learning model for feature extraction, and output the client dataset distribution features corresponding to each client.
[0009] The local dataset of each client is used to train the initial federated learning neural network corresponding to each client, and the training federated learning neural network corresponding to each client is determined.
[0010] Based on the distribution characteristics of each client dataset and the model parameters of each trained federated learning neural network, an optimization objective function is constructed;
[0011] Based on the cross-view graph matching mechanism, the optimization objective function is solved, and the multi-view fusion similarity matrix is output.
[0012] Based on the mean clustering method, the multi-view fused similarity matrix is clustered to generate client group partitioning results.
[0013] Optionally, the pre-set neural network learning model includes an input module, a feature transformation module, an aggregation module, and an output module; the step of inputting the local datasets of each client into the pre-set neural network learning model for feature extraction and outputting the client dataset distribution features corresponding to each client includes:
[0014] The feature transformation module performs feature mapping on the local datasets of each client received by the input module to generate multiple high-dimensional features corresponding to each local dataset.
[0015] The aggregation module is used to aggregate multiple high-dimensional features corresponding to each local dataset, and outputs the global features corresponding to each local dataset.
[0016] The global features corresponding to each local dataset are input into the output module for transformation, and the distribution features of the client dataset corresponding to each client are output.
[0017] Optionally, constructing the optimization objective function based on the distribution characteristics of each client dataset and the model parameters of each trained federated learning neural network includes:
[0018] Based on the distribution characteristics of each client dataset, a data distribution feature similarity matrix is constructed.
[0019] Based on the model parameters of each of the trained federated learning neural networks, a model parameter similarity matrix is constructed;
[0020] Based on the data distribution feature similarity matrix and the model parameter similarity matrix, an optimization objective function is constructed.
[0021] Optionally, constructing a data distribution feature similarity matrix based on the distribution features of each client dataset includes:
[0022] Similarity calculations are performed on the distribution characteristics of each client dataset to determine multiple feature similarity scalars;
[0023] Normalize each of the aforementioned feature similarity scalars to determine multiple normalized feature similarity scalars;
[0024] A data distribution feature similarity matrix is constructed using multiple normalized feature similarity scalars.
[0025] Optionally, constructing a model parameter similarity matrix based on the model parameters of each of the trained federated learning neural networks includes:
[0026] The similarity of the model parameters of each of the trained federated learning neural networks is calculated to determine multiple model parameter similarity scalars;
[0027] The similarity scalars of each model parameter are normalized to determine multiple normalized model parameter similarity scalars;
[0028] A model parameter similarity matrix is constructed using multiple normalized model parameter similarity scalars.
[0029] Optionally, the clustering of the multi-view fused similarity matrix based on the mean clustering method to generate client group partitioning results includes:
[0030] Based on the multi-view fused similarity matrix, the degree matrix is determined;
[0031] Perform matrix subtraction on the degree matrix and the multi-view fused similarity matrix to output the Laplacian matrix;
[0032] The Laplacian matrix is standardized to determine the standardized Laplacian matrix;
[0033] Based on the standardized Laplacian matrix, the feature matrix is determined;
[0034] The mean clustering method is used to cluster the matrix elements in the feature matrix to generate client group partitioning results.
[0035] A second aspect of the present invention provides a client group partitioning device based on federated learning, comprising:
[0036] The acquisition module is used to acquire local datasets from multiple clients, input the local datasets of each client into a pre-set neural network learning model for feature extraction, and output the client dataset distribution features corresponding to each client.
[0037] The model training module is used to train the initial federated learning neural network corresponding to each client using the local dataset of each client, and to determine the training federated learning neural network corresponding to each client.
[0038] A construction module is used to construct an optimization objective function based on the distribution characteristics of each client dataset and the model parameters of each trained federated learning neural network;
[0039] The solution module is used to solve the optimization objective function based on the cross-view graph matching mechanism and output the multi-view fusion similarity matrix.
[0040] The clustering module is used to cluster the multi-view fused similarity matrix based on the mean clustering method to generate client group partitioning results.
[0041] A computer device provided in a third aspect of the present invention includes a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor performs the steps of the client group partitioning method based on federated learning as described in any of the preceding claims.
[0042] The fourth aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed, implements the steps of the client group partitioning method based on federated learning as described in any of the preceding claims.
[0043] The fifth aspect of the present invention provides a computer program product comprising a computer program stored on a non-transitory computer-readable storage medium, the computer program comprising program instructions, wherein, when the program instructions are executed by a computer, the computer performs the steps of the client group partitioning method based on federated learning as described in any of the preceding claims.
[0044] As can be seen from the above technical solutions, the present invention has the following advantages:
[0045] The above-described technical solution of the present invention provides a client group partitioning method based on federated learning. First, local datasets from multiple clients are acquired, and each client's local dataset is input into a pre-set neural network learning model for feature extraction, outputting the client dataset distribution features corresponding to each client. Next, the initial federated learning neural network corresponding to each client is trained using the local datasets of each client, determining the training federated learning neural network for each client. Based on the client dataset distribution features and the model parameters of each training federated learning neural network, an optimization objective function is constructed. Based on a cross-view graph matching mechanism, the optimization objective function is solved, outputting multi-view graphs. The process involves: first, fusing a multi-view similarity matrix; then, clustering the multi-view fusion similarity matrix using the mean clustering method to generate client group partitioning results; based on the above scheme, constructing an optimization objective function according to the distribution characteristics of each client dataset and the model parameters of each trained federated learning neural network, and solving the optimization objective function based on the cross-view graph matching mechanism and the mean clustering method, and clustering the generated multi-view fusion similarity matrix to generate client group partitioning results. This invention organically fuses the similarity of client data and model parameters from two perspectives, which can reduce the bias and uncertainty that may be caused by a single perspective, thereby improving the accuracy of group partitioning results. Attached Figure Description
[0046] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, 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 the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0047] Figure 1 A flowchart illustrating the steps of a client group partitioning method based on federated learning, as provided in Embodiment 1 of the present invention;
[0048] Figure 2 This is a model framework diagram of the pre-set neural network learning model provided in Embodiment 1 of the present invention;
[0049] Figure 3 This is a flowchart illustrating the client group partitioning method based on federated learning provided in Embodiment 1 of the present invention.
[0050] Figure 4 This is an overall framework diagram of the client group partitioning method based on federated learning provided in Embodiment 2 of the present invention;
[0051] Figure 5 This is a structural block diagram of a client group partitioning device based on federated learning, provided in Embodiment 3 of the present invention. Detailed Implementation
[0052] This invention provides a client group partitioning method and apparatus based on federated learning, which solves the technical problem that existing client group partitioning methods for federated learning result in poor accuracy of group partitioning results.
[0053] To make the objectives, features, and advantages of this invention more apparent and understandable, the technical solutions of the embodiments of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the embodiments described below are only some embodiments of this invention, and not all embodiments. Based on the embodiments of this invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this invention.
[0054] Terminology Explanation:
[0055] Federated Learning: Federated learning is a distributed machine learning framework designed to address data privacy and security issues while reducing data transmission requirements and alleviating the computational burden on the central server. In federated learning, model training is performed on local devices, and only the updated parameters of the model are aggregated and sent to the central server.
[0056] Distributed heterogeneous model: This is a collaborative training model involving multiple participants with different data characteristics and computing resources. In this model, each participant has different data distributions and structures, trains locally using encryption techniques, and only shares model parameter updates.
[0057] Deepsets are a general framework for processing ensemble input data. Their core principle is to ensure that the model's output is independent of the order of elements in the input set, i.e., they possess permutation invariance. Deepsets can effectively extract features from ensemble data, providing valuable input for subsequent data analysis and machine learning tasks. For example, in image classification tasks, a set of images can be considered as a collection, and the Deepsets algorithm can be used to extract features from this image collection for classifier training.
[0058] Multi-view learning: Multi-view learning aims to extract complementary and consistent information from multi-view data in order to learn a comprehensive representation.
[0059] Clustering: Clustering is a technique for analyzing the similarity between features of objects and classifying them into categories. Classic clustering methods include K-means, spectral clustering, and hierarchical clustering. Current developments in clustering technology primarily focus on extracting a more compact and cluster-friendly representation from the original features, and then using classic clustering algorithms to obtain the final data labels.
[0060] Please see Figure 1 , Figure 1 The flowchart illustrates the steps of a client group partitioning method based on federated learning, as provided in Embodiment 1 of the present invention.
[0061] This invention provides a client group partitioning method based on federated learning, comprising:
[0062] Step 101: Obtain local datasets from multiple clients, input the local datasets from each client into a pre-set neural network learning model for feature extraction, and output the client dataset distribution features corresponding to each client.
[0063] The pre-built neural network learning model has a Deepsets model, which includes an input module, a feature transformation module, an aggregation module, and an output module.
[0064] It should be noted that, assuming there are K clients participating in federated learning, where i represents the i-th client, each client has its own local private dataset D. i ={x ij ,y ij |1≤j≤I i}, that is, the local dataset, where I i D represents i The number of samples in the middle, x ij , y ij D i The data and labels of the j-th sample.
[0065] Furthermore, the process of inputting the local datasets of each client into a pre-built neural network learning model for feature extraction and outputting the client dataset distribution features corresponding to each client can be achieved by executing the following steps S11 to S13:
[0066] Step S11: The feature transformation module performs feature mapping on the local datasets of each client received by the input module to generate multiple high-dimensional features corresponding to each local dataset.
[0067] Step S12: Use the aggregation module to aggregate the multiple high-dimensional features corresponding to each local dataset, and output the global features corresponding to each local dataset.
[0068] Step S13: Input the global features corresponding to each local dataset into the output module for transformation, and output the distribution features of the client dataset corresponding to each client.
[0069] It's important to note that most existing clustering federated learning algorithms typically use model parameters or their updates as a "proxy" for the client dataset to represent the client. This invention employs the Deepsets model, extracting distribution information from the client's original data to represent the client. The Deepsets model is a neural network architecture for processing unordered set data, possessing both permutation invariance and permutation isovariance. Its core idea is to use a deep neural network to extract features from the elements in the set, and then aggregate these features using a specific aggregation function. This allows the model to effectively capture the overall characteristics of the set, regardless of the specific order of the elements. Specifically, for a dataset, each element is processed by a feature extractor to obtain its feature vector. Then, aggregation functions (such as summation, averaging, etc.) are used to aggregate the feature vectors of all elements, resulting in a feature vector representing the entire dataset. This feature vector can be viewed as an abstract description of the dataset's distribution characteristics, used for subsequent tasks.
[0070] Further, please refer to Figure 2 The DeepSets model is a deep learning architecture specifically designed to handle unordered set data. It has two key components: a mapping function... and aggregate functions , where the mapping function Aggregation functions are used to map each element of a set to a high-dimensional feature space. This is used to aggregate the features of all elements to generate a representation of the entire set. Specifically, it receives the local private dataset D from each client through the input layer. i ={x ij ,y ij |1≤j≤I i}, i.e., local dataset, I i D represents i The number of samples in the middle, x ij , y ij D i The data and label of the j-th sample are obtained; a mapping function is used through the feature transformation module. Map each feature vector to a new space to obtain Aggregation functions are used through the aggregation module. For the transformed eigenvectors Aggregation is performed to generate a global feature representation of the entire set. (Global features) Common aggregation operations include summation, averaging, maximization, etc. Finally, the aggregated global feature representation is transformed by an output network through the output module to generate a representation describing the distribution characteristics of the client dataset. That is, the distribution characteristics of the client dataset, thereby obtaining the data distribution characteristics representation of each client. .
[0071] Step 102: Use the local dataset of each client to train the initial federated learning neural network corresponding to each client, and determine the training federated learning neural network corresponding to each client.
[0072] It should be noted that the initial federated learning neural network structure is the same for each client. The initial federated learning neural network can be any type of neural network, such as a convolutional neural network or a feedforward neural network. The model training process can refer to existing model training methods, which will not be elaborated on further in this invention.
[0073] Step 103: Construct an optimization objective function based on the distribution characteristics of each client dataset and the model parameters of each trained federated learning neural network.
[0074] It should be noted that by using the data distribution characteristics of each client (client dataset distribution characteristics) and the model parameters uploaded in each round of model updates, a multi-view similarity matrix is constructed. By comprehensively utilizing information from multiple perspectives, the complex structure and features of the data can be better captured.
[0075] Furthermore, the process of constructing and optimizing the objective function based on the distribution characteristics of each client dataset and the model parameters of each trained federated learning neural network can be achieved by executing the following sub-steps S31 to S33:
[0076] Step S31: Construct a data distribution feature similarity matrix based on the distribution characteristics of each client dataset;
[0077] Furthermore, step S31 may include the following sub-steps S311-S313:
[0078] S311. Calculate the similarity of the distribution characteristics of each client dataset and determine multiple feature similarity scalars;
[0079] It should be noted that in the initial stage of federated learning, each client extracts data distribution features using the Deepsets model and uploads them to the server. The server then uses a Gaussian kernel function to define the similarity of the data distributions between clients based on the data distribution feature representation F(x) of each client. The calculation process of the feature similarity scalar can be expressed as follows:
[0080] ;
[0081] in, Let be the feature similarity scalar between the distribution features of the k-th client dataset and the distribution features of the j-th client dataset; Let be the feature similarity scalar corresponding to the distribution features of the k-th client dataset; Let be the feature similarity scalar corresponding to the distribution features of the j-th client dataset; is the width parameter of the Gaussian kernel function; It is the square of the L2 norm.
[0082] S312. Normalize each feature similarity scalar to determine multiple normalized feature similarity scalars;
[0083] It should be noted that, in order to ensure that the similarity matrix is not affected by the units of measurement when merging, this invention normalizes the feature similarity scalar, which can be expressed as:
[0084] ;
[0085] in, Let be the normalized feature similarity scalar between the distribution features of the k-th client dataset and the distribution features of the j-th client dataset; It is a scalar for feature similarity; Let be the feature similarity scalar corresponding to the distribution features of the k-th client dataset; Let K be the feature similarity scalar corresponding to the distribution features of the j-th client dataset; K is the number of clients.
[0086] S313. Construct a data distribution feature similarity matrix by using multiple normalized feature similarity scalars.
[0087] It should be noted that the data distribution feature similarity matrix can be represented as:
[0088] ;
[0089] in, This is a similarity matrix of data distribution features; Let be the normalized feature similarity scalar between the distribution features of the k-th client dataset and the distribution features of the k-th client dataset.
[0090] Step S32: Construct a model parameter similarity matrix based on the model parameters of each trained federated learning neural network;
[0091] Furthermore, step S32 may include the following sub-steps S321-S323:
[0092] S321. Calculate the similarity of the model parameters of each trained federated learning neural network and determine the similarity scalar of multiple model parameters;
[0093] It should be noted that during the server-side update phase, the model update parameters of each client are uploaded to the server. The central server uses cosine similarity to define the similarity between client models for the parameters uploaded by each client model. The calculation process of the model parameter similarity scalar can be expressed as:
[0094] ;
[0095] in, Let be the model parameter similarity scalar between the model parameters of the federated learning neural network corresponding to the i-th client in round t and the model parameters of the federated learning neural network corresponding to the j-th client; These are the model parameters for training the federated learning neural network for the i-th client in round t; These are the model parameters for training the federated learning neural network for the j-th client in round t.
[0096] S322. Normalize the similarity scalars of each model parameter to determine multiple normalized model parameter similarity scalars;
[0097] It should be noted that the normalization process for the model parameter similarity scalar can be expressed as follows:
[0098] ;
[0099] in, This is the normalized model parameter similarity scalar between the model parameters of the federated learning neural network corresponding to the k-th client and the model parameters of the federated learning neural network corresponding to the j-th client. Let be the model parameter similarity scalar between the model parameters of the federated learning neural network corresponding to the i-th client in round t and the model parameters of the federated learning neural network corresponding to the j-th client; These are the model parameters for training the federated learning neural network for the i-th client in round t; The model parameters for training the federated learning neural network for the j-th client in round t.
[0100] S323. Construct a model parameter similarity matrix by using multiple normalized model parameter similarity scalars.
[0101] It should be noted that the model parameter similarity matrix can be represented as:
[0102] ;
[0103] in, This is the similarity matrix of the model parameters; This is a normalized model parameter similarity scalar between the model parameters of the federated learning neural network corresponding to the k-th client and the model parameters of the federated learning neural network corresponding to the k-th client.
[0104] Step S33: Construct an optimization objective function based on the data distribution feature similarity matrix and the model parameter similarity matrix.
[0105] It should be noted that, in order to integrate multi-source information and fuse complementary information from different perspectives, avoiding the incompleteness caused by relying on only a single perspective, multiple similarity matrices... This invention uses a cross-view graph matching mechanism to achieve this objective, and the optimized objective function can be expressed as:
[0106] ;
[0107] Where H is the multi-view fusion similarity matrix; Let v be the similarity matrix of the v-th view, i.e. and ; It is the squared Frobenius norm; This is the similarity matrix after fusion; It is a column vector whose elements are all 1s; is the matrix element in the i-th row and j-th column of the fused similarity matrix; V is the number of viewpoints.
[0108] Step 104: Based on the cross-view graph matching mechanism, solve the optimization objective function and output the multi-view fusion similarity matrix.
[0109] It should be noted that, based on the cross-view graph matching mechanism, the final similarity matrix (multi-view fused similarity matrix) is obtained by solving the optimization objective function, and this matrix is used as input to the spectral clustering algorithm to obtain data labels. The optimization objective essentially aims to minimize the distance between the merged similarity matrix and the data distribution similarity matrix and the model parameter similarity matrix. Therefore, by solving the optimization objective function, we obtain:
[0110] ;
[0111] Where H is the multi-view fusion similarity matrix; Let v be the similarity matrix of the v-th view, i.e. and .
[0112] Step 105: Based on the mean clustering method, cluster the multi-view fused similarity matrix to generate client group partitioning results.
[0113] Specifically, the process of clustering the multi-view fused similarity matrix based on the mean clustering method to generate client group partitioning results can be achieved by executing the following sub-steps S51 to S55:
[0114] Step S51: Determine the degree matrix based on the multi-view fusion similarity matrix;
[0115] Step S52: Perform matrix subtraction on the degree matrix and the multi-view fusion similarity matrix to output the Laplacian matrix;
[0116] Step S53: Standardize the Laplace matrix to determine the standardized Laplace matrix;
[0117] Step S54: Determine the feature matrix based on the standardized Laplacian matrix;
[0118] Step S55: Use the mean clustering method to cluster the matrix elements in the feature matrix to generate client group partitioning results.
[0119] It should be noted that, based on the multi-view fusion similarity matrix H, the degree matrix D is further calculated. The process of processing the degree matrix can be expressed as follows:
[0120] ;
[0121] Where D is the degree matrix; is the matrix element in the i-th row and j-th column of the degree matrix; K is the number of clients.
[0122] Furthermore, the Laplacian matrix L:L=DH can be obtained by fusing the similarity matrix H and the degree matrix D from multiple perspectives. Then, the Laplacian matrix is standardized.
[0123] ;
[0124] in, Let L be the standardized Laplacian matrix; L is the Laplacian matrix; and D is the degree matrix.
[0125] Furthermore, eigenvalue decomposition is performed on the standardized Laplacian matrix to obtain eigenvectors and eigenvalues. The eigenvectors corresponding to the c smallest non-zero eigenvalues in the standardized Laplacian matrix are selected to form a matrix U, which is then row-normalized to obtain the feature matrix Y. Each row of the feature matrix Y is considered a c-dimensional sample, resulting in a total of K samples a1, a2, ..., a... k The sample set A = {a1, a2, ..., a...} is composed of... k The client is clustered using the K-means clustering method, which clusters the matrix elements in the feature matrix to obtain the client group partitioning (client group partitioning result).
[0126] For example, please refer to Figure 3 The overall process of client group partitioning in this invention can be divided into five parts: 1) Data distribution similarity matrix: In the initial stage of federated learning, the central server initializes the Deepsets model parameters and distributes them to each client. The client uses this model to extract features from its local data, generates and uploads feature descriptors reflecting the data distribution. After receiving all descriptors, the server generates a similarity matrix (data distribution feature similarity matrix); 2) Model parameter similarity matrix: During round t of interaction between the server and the client, each client updates the model using its local data and uploads the model parameters to the server. The server generates a cosine similarity matrix (model parameter similarity matrix) based on the model parameters of each client; 3) Multi-view similarity matrix fusion: The server performs weighted fusion of the two similarity matrices to obtain a similarity matrix (multi-view fused similarity matrix); 4) Trusted group partitioning based on spectral clustering: Spectral clustering is used to cluster feature vectors, and clients with similar data distributions and similar model parameters are grouped into the same cluster to achieve client group partitioning (client group partitioning result); 5) Intra-group federated aggregation and model update: Clients in the group perform t+1 rounds of federated model updates, repeating step 1 to construct the model parameter similarity matrix and steps 2 and 3 until the model converges.
[0127] For comparison of technical effects, existing technologies can be referenced. Federated learning, proposed by Google in 2017, is a decentralized machine learning framework that allows user terminals to collaboratively train data in a decentralized manner without exchanging local data or centrally storing raw training data. However, the common problem of model heterogeneity in practical applications poses a challenge to federated learning. Currently, researchers have proposed a series of solutions to address the problems caused by heterogeneity. By clustering clients with similar data into a cluster, each client in the cluster trains a personalized model. By reducing the impact of heterogeneous data, the model training performance within the cluster is more stable and the convergence speed is faster.
[0128] In completed research, based on how users are grouped, the FedFast algorithm extracts the vector for model parameter updates, uses K-means to cluster different nodes based on their similarity, classifying all nodes into different classes, and then randomly selects a certain number of nodes within each cluster to participate in training. The FedPNS algorithm examines the relationship between local and global gradients, identifies and eliminates local updates that are detrimental to global convergence, and finds the optimal subset of nodes participating in local updates in each global round. The selection probability of each node is dynamically changed based on the output of the optimal aggregation. Nodes that can promote faster model convergence can be prioritized for model aggregation. The FedGroup algorithm uses Euclidean distance with decoupled cosine similarity to quantify the similarity between client gradients and uses singular value decomposition to decompose the gradient into multiple directions.
[0129] Furthermore, in personalized federated learning schemes based on client-side clustering, partitioning is mostly determined by the parameters or update gradients of the client-side models. This fails to effectively reflect the correlation and similarity of data between clients. Model parameters mainly reflect information such as weights and biases during a specific training process, but these parameters cannot fully represent the original data characteristics of the clients. Data from different clients may have different distributions, noise levels, outliers, etc., and it is difficult to accurately capture these differences solely through model parameters. Model update gradients mainly reflect the direction and magnitude of parameter adjustments made by the model in the current training step. However, gradient information also cannot comprehensively represent the data characteristics of the clients. Gradients may be affected by various factors, such as learning rate, optimization algorithm, and initial parameters, and may not fully reflect the essential differences in the data. At the same time, many methods represent the high-dimensional data of clients based on a single metric. For example, if only the mean and variance are used to represent the data distribution, the mean and variance may not accurately reflect the characteristics of different peaks for multi-modal data, leading to inaccurate clustering results.
[0130] In addition, different clients may have different device performance and resource limitations, which can also affect the model update speed. If only the similarity of data distribution between clients is considered for classification, clients with different resource limitations may be grouped into the same category, reducing the convergence speed of the federated model.
[0131] To address the aforementioned problems, this invention proposes a client grouping method based on federated learning. In federated learning, this invention uses a neural network model to extract latent features from data in an unsupervised manner and generate descriptors. This allows a central server to identify data patterns and distribution differences among different clients without accessing the original data, thus solving the data heterogeneity problem. This not only improves clustering accuracy but also enhances model robustness, enabling federated learning to operate stably even in complex data environments. Furthermore, unlike traditional methods that typically focus only on a single aspect of data features or model parameters, making it difficult to comprehensively capture the complex relationships between clients, this invention innovatively integrates similarity from both the data level and model parameter perspectives for grouping. This allows for a more comprehensive assessment of the similarity and correlation between clients, resulting in more accurate and reasonable grouping. Furthermore, compared to techniques that determine clustering solely based on client model parameters or update gradients, this invention utilizes a neural network model in an unsupervised manner to deeply mine the latent features of the data and generate unique descriptors. This enables the central server to identify the essential differences in data distribution among different clients, enhancing the model's robustness. By organically integrating the similarity of data and model parameters from multiple perspectives, this invention comprehensively utilizes multidimensional information to more deeply and comprehensively assess the similarity and correlation between clients, reducing the bias and uncertainty that may arise from a single perspective, thereby significantly improving the accuracy of clustering.
[0132] In summary, this invention, while protecting the data privacy of federated learning clients, efficiently extracts features from local data, analyzes the similarity and potential connections between data distributions of different nodes, and fully considers the differences in computing resources and network bandwidth among different clients. It also uses a multi-perspective clustering method to analyze the similarity of distributed heterogeneous models, thereby improving the reliability of client aggregation and the overall efficiency of federated learning models.
[0133] In this embodiment of the invention, a client group partitioning method based on federated learning is provided. First, local datasets from multiple clients are acquired, and each client's local dataset is input into a pre-set neural network learning model for feature extraction, outputting the client dataset distribution features corresponding to each client. Next, the local datasets of each client are used to train the initial federated learning neural network corresponding to each client, determining the training federated learning neural network for each client. Based on the client dataset distribution features and the model parameters of each training federated learning neural network, an optimization objective function is constructed. Based on a cross-view graph matching mechanism, the optimization objective function is solved, outputting multiple... The process involves fusing a multi-view similarity matrix; finally, clustering the multi-view similarity matrix using the mean clustering method to generate client group partitioning results; based on the above scheme, an optimization objective function is constructed according to the distribution characteristics of each client dataset and the model parameters of each trained federated learning neural network, and the optimization objective function is solved based on the cross-view graph matching mechanism and the mean clustering method. The generated multi-view similarity matrix is then clustered to generate client group partitioning results. This invention organically fuses the similarity between client data and model parameters from two perspectives, which can reduce the bias and uncertainty that may be caused by a single perspective, thereby improving the accuracy of group partitioning results.
[0134] For better explanation, refer to Figure 4 The overall framework diagram of the client group partitioning method based on federated learning provided in Embodiment 2 of the present invention includes:
[0135] First, in the initial stage of federated learning, the central server initializes the parameters of the Deepsets model (deep learning model) according to the set model structure and distributes the model parameters to each client participating in federated training. Each client uses the Deepsets model to extract features from its local data, generating a feature descriptor representing the local data distribution, and uploads the feature descriptor to the server. After receiving the feature descriptors from all worker nodes, the server generates a similarity matrix (data distribution feature similarity matrix). During round t of interaction between the server and clients, each client updates its model using its local data and uploads the model parameters to the server. The server generates a cosine similarity matrix based on the model parameters of each client. The server merges the two similarity matrices and uses spectral clustering to cluster the feature vectors, grouping clients with similar data distributions and similar model parameters into the same cluster, thus achieving client grouping.
[0136] Please see Figure 5 , Figure 5 This is a structural block diagram of a client group partitioning device based on federated learning, provided in Embodiment 3 of the present invention.
[0137] This invention provides a client group partitioning device based on federated learning, comprising:
[0138] The acquisition module 501 is used to acquire local datasets from multiple clients, input the local datasets from each client into a pre-set neural network learning model for feature extraction, and output the distribution features of the client datasets corresponding to each client.
[0139] The model training module 502 is used to train the initial federated learning neural network corresponding to each client using the local dataset of each client, and to determine the training federated learning neural network corresponding to each client.
[0140] Module 503 is used to construct an optimization objective function based on the distribution characteristics of each client dataset and the model parameters of each trained federated learning neural network.
[0141] The solver module 504 is used to solve the optimization objective function based on the cross-view graph matching mechanism and output the multi-view fusion similarity matrix.
[0142] Clustering module 505 is used to cluster the multi-view fused similarity matrix based on the mean clustering method to generate client group partitioning results.
[0143] Furthermore, the pre-built neural network learning model includes an input module, a feature transformation module, an aggregation module, and an output module; the acquisition module 501 is specifically used for:
[0144] The feature transformation module performs feature mapping on the local datasets received from each client by the input module, generating multiple high-dimensional features corresponding to each local dataset.
[0145] An aggregation module is used to aggregate multiple high-dimensional features corresponding to each local dataset, and output the global features corresponding to each local dataset.
[0146] The global features corresponding to each local dataset are input into the output module for transformation, and the distribution features of the client dataset corresponding to each client are output.
[0147] Furthermore, module 503 includes:
[0148] The first submodule is used to construct a data distribution feature similarity matrix based on the distribution features of each client dataset;
[0149] The second submodule is used to construct a model parameter similarity matrix based on the model parameters of each trained federated learning neural network.
[0150] The third submodule is used to construct an optimization objective function based on the data distribution feature similarity matrix and the model parameter similarity matrix.
[0151] Furthermore, the first submodule is specifically used for:
[0152] Calculate the similarity of the distribution characteristics of each client dataset and determine multiple feature similarity scalars;
[0153] Normalize each feature similarity scalar to determine multiple normalized feature similarity scalars;
[0154] A data distribution feature similarity matrix is constructed by using multiple normalized feature similarity scalars.
[0155] Furthermore, the second submodule is specifically used for:
[0156] Calculate the similarity of the model parameters of each trained federated learning neural network and determine multiple model parameter similarity scalars;
[0157] Normalize the similarity scalars of each model parameter to determine multiple normalized model parameter similarity scalars;
[0158] A model parameter similarity matrix is constructed using multiple normalized model parameter similarity scalars.
[0159] Furthermore, clustering module 505 is specifically used for:
[0160] Determine the degree matrix based on the multi-view fusion similarity matrix;
[0161] Perform matrix subtraction on the degree matrix and the multi-view fused similarity matrix to output the Laplacian matrix;
[0162] Standardize the Laplace matrix to determine the standardized Laplace matrix;
[0163] The feature matrix is determined based on the standardized Laplacian matrix.
[0164] The mean clustering method is used to cluster the matrix elements in the feature matrix to generate client group partitioning results.
[0165] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0166] This invention also provides a computer device, including a memory and a processor, wherein the memory stores a computer program; when the computer program is executed by the processor, the processor performs the steps of the client group partitioning method based on federated learning as described in Embodiment 1 above.
[0167] This invention also provides a computer-readable storage medium storing a computer program / instructions thereon, which, when executed by a processor, implements the steps of the client group partitioning method based on federated learning as described in Embodiment 1 above.
[0168] This invention also provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements the steps of the client group partitioning method based on federated learning as described in Embodiment 1 above.
[0169] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0170] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0171] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention 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 the present invention.
Claims
1. A client group partitioning method based on federated learning, characterized in that, include: Acquire local datasets from multiple clients, input the local datasets of each client into a pre-set neural network learning model for feature extraction, and output the client dataset distribution features corresponding to each client. The local dataset of each client is used to train the initial federated learning neural network corresponding to each client, and the training federated learning neural network corresponding to each client is determined. Based on the distribution characteristics of each client dataset and the model parameters of each trained federated learning neural network, an optimization objective function is constructed; Based on the cross-view graph matching mechanism, the optimization objective function is solved, and the multi-view fusion similarity matrix is output. Based on the mean clustering method, the multi-view fused similarity matrix is clustered to generate client group partitioning results; The step of constructing an optimization objective function based on the distribution characteristics of each client dataset and the model parameters of each trained federated learning neural network includes: Based on the distribution characteristics of each client dataset, a data distribution feature similarity matrix is constructed. Based on the model parameters of each of the trained federated learning neural networks, a model parameter similarity matrix is constructed; Based on the data distribution feature similarity matrix and the model parameter similarity matrix, an optimization objective function is constructed; The optimization objective function is specifically as follows: ; Where H is the multi-view fusion similarity matrix; Let v be the similarity matrix of the v-th view, i.e. and ; It is the squared Frobenius norm; This is the similarity matrix after fusion; It is a column vector whose elements are all 1s; is the matrix element in the i-th row and j-th column of the fused similarity matrix; V is the number of viewpoints.
2. The client group partitioning method based on federated learning according to claim 1, characterized in that, The pre-built neural network learning model includes an input module, a feature transformation module, an aggregation module, and an output module; the step of inputting the local datasets of each client into the pre-built neural network learning model for feature extraction and outputting the client dataset distribution features corresponding to each client includes: The feature transformation module performs feature mapping on the local datasets of each client received by the input module to generate multiple high-dimensional features corresponding to each local dataset. The aggregation module is used to aggregate multiple high-dimensional features corresponding to each local dataset, and outputs the global features corresponding to each local dataset. The global features corresponding to each local dataset are input into the output module for transformation, and the distribution features of the client dataset corresponding to each client are output.
3. The client group partitioning method based on federated learning according to claim 1, characterized in that, The step of constructing a data distribution feature similarity matrix based on the distribution features of each client dataset includes: Similarity calculations are performed on the distribution characteristics of each client dataset to determine multiple feature similarity scalars; Normalize each of the aforementioned feature similarity scalars to determine multiple normalized feature similarity scalars; A data distribution feature similarity matrix is constructed using multiple normalized feature similarity scalars.
4. The client group partitioning method based on federated learning according to claim 1, characterized in that, The construction of a model parameter similarity matrix based on the model parameters of each of the trained federated learning neural networks includes: The similarity of the model parameters of each of the trained federated learning neural networks is calculated to determine multiple model parameter similarity scalars; The similarity scalars of each model parameter are normalized to determine multiple normalized model parameter similarity scalars; A model parameter similarity matrix is constructed using multiple normalized model parameter similarity scalars.
5. The client group partitioning method based on federated learning according to claim 1, characterized in that, The mean-based clustering method clusters the multi-view fused similarity matrix to generate client group partitioning results, including: Based on the multi-view fused similarity matrix, the degree matrix is determined; Perform matrix subtraction on the degree matrix and the multi-view fused similarity matrix to output the Laplacian matrix; The Laplacian matrix is standardized to determine the standardized Laplacian matrix; Based on the standardized Laplacian matrix, the feature matrix is determined; The mean clustering method is used to cluster the matrix elements in the feature matrix to generate client group partitioning results.
6. A client group partitioning device based on federated learning, applied to the client group partitioning method based on federated learning as described in claim 1, characterized in that, include: The acquisition module is used to acquire local datasets from multiple clients, input the local datasets of each client into a pre-set neural network learning model for feature extraction, and output the client dataset distribution features corresponding to each client. The model training module is used to train the initial federated learning neural network corresponding to each client using the local dataset of each client, and to determine the training federated learning neural network corresponding to each client. A construction module is used to construct an optimization objective function based on the distribution characteristics of each client dataset and the model parameters of each trained federated learning neural network; The solution module is used to solve the optimization objective function based on the cross-view graph matching mechanism and output the multi-view fusion similarity matrix. The clustering module is used to cluster the multi-view fused similarity matrix based on the mean clustering method to generate client group partitioning results.
7. A computer device, characterized in that, The system includes a memory and a processor, wherein the memory stores a computer program that, when executed by the processor, causes the processor to perform the steps of the client group partitioning method based on federated learning as described in any one of claims 1-5.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed, it implements the client group partitioning method based on federated learning as described in any one of claims 1-5.
9. A computer program product, characterized in that, The computer program product includes a computer program stored on a non-transitory computer-readable storage medium, the computer program including program instructions, wherein when the program instructions are executed by a computer, the computer performs the client group partitioning method based on federated learning as described in any one of claims 1-5.
Citation Information
Patent Citations
Federal learning implementation method, device and system, medium, equipment and product
CN115146786A
Federal learning-based user grouping method and system
CN115878954A