Federated clustering method, apparatus, central server, system, and electronic device

By using the parameters of the target master clustering network and the target sub-clustering network for training in the federated clustering model, it is ensured that each participant only obtains the clustering categories of the samples it owns, thus solving the data privacy problem in federated clustering analysis and improving the recognition accuracy of the clustering model.

CN116010832BActive Publication Date: 2026-06-05IFLYTEK CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
IFLYTEK CO LTD
Filing Date
2023-01-18
Publication Date
2026-06-05

AI Technical Summary

Technical Problem

In existing technologies, federated clustering analysis cannot guarantee the data privacy of each participant. Especially in horizontal federated learning, the central server may expose clustering model parameters for categories that a participant does not have to that participant.

Method used

By acquiring a federated clustering model, including a target master clustering network and at least two target sub-clustering networks, horizontal federated clustering training is performed. The parameters of the target master network and the target sub-networks are sent to the participating devices to generate the target clustering model. Based on the target sample clustering category, the target sub-clustering network of each participating device is determined to ensure that each participating device can only acquire the network corresponding to the sample clustering category it owns.

Benefits of technology

This approach protects the data privacy of participants in federated clustering analysis, avoids exposing clustering category parameters of samples that are not available, and improves the recognition accuracy of the clustering model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116010832B_ABST
    Figure CN116010832B_ABST
Patent Text Reader

Abstract

The application provides a federal clustering method, device, center server, system and electronic equipment, and relates to the technical field of clustering analysis. The method comprises the following steps: sending target main network parameters corresponding to a target main clustering network in a federal clustering model to each participant device, and receiving target sample clustering categories transmitted by each participant device; for each participant device, determining a first target sub-clustering network corresponding to the participant device from at least two target sub-clustering networks in the federal clustering model based on the target sample clustering categories corresponding to the participant device; and sending target sub-network parameters corresponding to the first target sub-clustering network to the participant device, so that the participant device generates a target clustering model based on the target main network parameters and the target sub-network parameters, and performs clustering analysis on the clustering data of the participant device based on the target clustering model, thereby solving the technical problem that the data privacy of each participant in the federal clustering analysis process cannot be guaranteed in the prior art.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of cluster analysis technology, and in particular to a federated clustering method, apparatus, central server, system and electronic device. Background Technology

[0002] Clustering is a method of statically classifying similar objects into different groups or subsets, ensuring that members within the same subset share similar attributes. Clustering algorithms are primarily used in pattern recognition for speech recognition and character recognition, and in image processing for data compression and information retrieval. Horizontal federated learning, a distributed structure within federated learning, aims to protect the data privacy of data owners during model training and inference. In this model, each distributed node shares the same data features but has a different sample space.

[0003] Because machine learning-based federated clustering methods have limited application scenarios and accuracy, and cannot express complex clustering relationships, current technologies generally employ deep learning-based federated clustering methods for data clustering analysis. However, in horizontal federated learning, since all participants share a single clustering model, the central server may expose clustering model parameters for categories that a participant does not possess, compromising data privacy for all participants.

[0004] Therefore, ensuring the data privacy of all participants in the federated clustering analysis process is a technical problem that urgently needs to be solved by professionals in the relevant field. Summary of the Invention

[0005] This invention provides a federated clustering method, apparatus, central server, system, and electronic device to address the shortcomings of existing technologies that cannot guarantee the data privacy of various participants in the federated clustering analysis process.

[0006] This invention provides a federated clustering method, comprising:

[0007] A federated clustering model is obtained, which includes a target master clustering network and at least two target sub-clustering networks. The federated clustering model is obtained by training an initial clustering model through horizontal federated clustering based on clustering sample data from at least two participating devices.

[0008] The target master network parameters corresponding to the target master clustering network are sent to each of the participating devices, and the target sample clustering category transmitted by each of the participating devices is received. The target sample clustering category is determined based on the target master network parameters and the clustering sample data of the participating devices.

[0009] For each participating device, based on the target sample clustering category corresponding to the participating device, a first target sub-clustering network corresponding to the participating device is determined from the at least two target sub-clustering networks;

[0010] The target sub-network parameters corresponding to the first target sub-clustering network are sent to the participating device, so that the participating device generates a target clustering model based on the target main network parameters and the target sub-network parameters, and performs clustering analysis on the data to be clustered based on the target clustering model.

[0011] According to a federated clustering method provided by the present invention, the initial clustering model includes an initial master clustering network and at least two initial sub-clustering networks, wherein the target master clustering network and the target sub-clustering network in the federated clustering model are trained based on the following method:

[0012] Send the initial master network parameters corresponding to the initial master clustering network to each of the participating devices, and receive the first loss corresponding to the initial master clustering network sent by each of the participating devices. Determine the first master network clustering loss corresponding to the initial master clustering network after safe aggregation based on each first loss, and determine the optimized master clustering network based on the first master network clustering loss and the initial master clustering network.

[0013] The tuning master network parameters corresponding to the tuning master clustering network are sent to each of the participating devices, and the first sample clustering category transmitted by each of the participating devices is received. The first sample clustering category is determined based on the tuning master network parameters and the clustering sample data of the participating devices.

[0014] For each participating device, a first initial sub-clustering network corresponding to the first sample clustering category of the participating device is determined, and the first sub-network parameters corresponding to the first initial sub-clustering network are sent to the participating device.

[0015] Receive the second loss corresponding to the optimized main clustering network sent by each of the participating devices, and determine the second main network clustering loss corresponding to the optimized main clustering network after secure aggregation based on each of the second losses;

[0016] Receive the third loss corresponding to the first initial sub-clustering network sent by each of the participating devices, and determine the first sub-network clustering loss corresponding to the at least two initial sub-clustering networks after secure aggregation based on each of the third losses;

[0017] The optimized main clustering network is optimized based on the second main network clustering loss to obtain the optimized target main clustering network, and the at least two initial sub-clustering networks are optimized based on the first sub-network clustering loss to obtain the optimized target sub-clustering network.

[0018] According to a federated clustering method provided by the present invention, the step of determining and optimizing the master clustering network based on the clustering loss of the first master network and the initial master clustering network includes:

[0019] In one iteration, an optimized first main clustering network is determined based on the first main network clustering loss and the initial main clustering network. The first main network parameters corresponding to the first main clustering network are sent to each of the participating devices. The fourth loss corresponding to the first main clustering network sent by each of the participating devices is received. The second main network clustering loss corresponding to the first main clustering network after secure aggregation is determined based on each of the fourth losses.

[0020] If the clustering loss of the second main network is not less than the preset loss threshold and the current iteration number is not greater than the maximum iteration number, repeat the above steps to iteratively update the initial main clustering network and determine the iteratively updated initial main clustering network as the optimized main clustering network.

[0021] If the clustering loss of the second main network is less than a preset loss threshold, or if the current iteration number is greater than the maximum iteration number, the first main clustering network is optimized based on the clustering loss of the second main network, and the optimized first main clustering network is determined as the tuned main clustering network.

[0022] According to a federated clustering method provided by the present invention, the optimization of the tuned master clustering network based on the second master network clustering loss to obtain an optimized target master clustering network, and the optimization of the at least two initial sub-clustering networks based on the first sub-network clustering loss to obtain an optimized target sub-clustering network, includes:

[0023] The optimized main clustering network is optimized based on the second main network clustering loss to obtain the optimized second main clustering network, and the at least two initial sub-clustering networks are optimized based on the first sub-network clustering loss to obtain the optimized first sub-clustering network.

[0024] If both the clustering loss of the second main network and the clustering loss of the first sub-network are less than a preset loss threshold, or if the current iteration number is greater than the maximum iteration number, the second main clustering network is determined as the target main clustering network, and the first sub-clustering network is determined as the target sub-clustering network.

[0025] If either the clustering loss of the second main network or the clustering loss of the first sub-network is greater than a preset loss threshold, or if the current iteration number is greater than the maximum iteration number, the second main clustering network and the first sub-clustering network continue to be iteratively optimized until the target main clustering network and the target sub-clustering network are determined.

[0026] According to a federated clustering method provided by the present invention, the method further includes:

[0027] Determine the first sample cluster category corresponding to each first sub-clustering network, and obtain the cluster splitting parameter corresponding to each first sample cluster category. The cluster splitting parameter is determined based on the cluster sample data corresponding to the first sample cluster category.

[0028] If the clustering splitting parameter corresponding to the first sample clustering category is greater than the preset classification threshold, node fusion processing is performed on the current main clustering network node and the current sub-clustering network node corresponding to the first sample clustering category respectively;

[0029] If the clustering splitting parameter corresponding to the first sample clustering category is not greater than the preset classification threshold, then the current main clustering network node and the current sub-clustering network node corresponding to the first sample clustering category are split into nodes respectively.

[0030] According to a federated clustering method provided by the present invention, the step of performing node fusion processing on the current main clustering network node and the current sub-clustering network node corresponding to the first sample clustering category includes:

[0031] Determine the adjacent sub-cluster network nodes corresponding to the optimized main cluster network node, and the adjacent main cluster network nodes corresponding to the optimized main cluster network node, and obtain the first network weight average value corresponding to the optimized main cluster network node and the adjacent sub-cluster network node;

[0032] The current sub-cluster network node and the adjacent sub-cluster network node are fused, and the average value of the first network weight is determined as the target network weight corresponding to the fused sub-cluster network node.

[0033] Obtain the first connection weight between the optimized main clustering network node and the previous layer main clustering network, and the second connection weight between the adjacent main clustering network node and the previous layer main clustering network;

[0034] The optimized main clustering network node and the adjacent main clustering network node are fused together, and the average of the first connection weight and the second connection weight is determined as the target connection weight corresponding to the fused main clustering network node.

[0035] The present invention also provides a federal clustering apparatus, comprising:

[0036] The model acquisition module is used to acquire a federated clustering model, which includes a target main clustering network and at least two target sub-clustering networks. The federated clustering model is obtained by training an initial clustering model through horizontal federated clustering based on clustering sample data from at least two participating devices.

[0037] The category determination module is used to send the target master network parameters corresponding to the target master clustering network to each of the participating devices, and to receive the target sample clustering category transmitted by each of the participating devices. The target sample clustering category is determined based on the target master network parameters and the clustering sample data of the participating devices.

[0038] The network determination module is used to determine, for each participating device, a first target sub-clustering network corresponding to the participating device from the at least two target sub-clustering networks based on the target sample clustering category corresponding to the participating device;

[0039] The clustering analysis module is used to send the target sub-network parameters corresponding to the first target sub-clustering network to the participating device, so that the participating device generates a target clustering model based on the target main network parameters and the target sub-network parameters, and performs clustering analysis on the data to be clustered based on the target clustering model.

[0040] The present invention also provides a central server, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the federated clustering method as described above.

[0041] The present invention also provides a federated clustering system, comprising: a central server as described in any of the above embodiments and at least two participating devices, wherein each of the participating devices is communicatively connected to the central server.

[0042] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the program, implements the federated clustering method as described above.

[0043] The present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the federated clustering method as described above.

[0044] The federated clustering method, apparatus, central server, system, and electronic device provided by this invention train an initial clustering model horizontally using clustering sample data from various participating devices, thereby obtaining a federated clustering model with relatively high recognition accuracy. By sending the target master clustering network parameters corresponding to the target master clustering network to each participating device, the target sample clustering category of each participating device's clustering sample data is obtained. This determines the first target sub-clustering network corresponding to the target sample clustering category of each participating device, and sends the target sub-network parameters corresponding to the first target sub-clustering network to the participating devices. This ensures that each participating device only receives the first target sub-clustering network corresponding to its own target sample clustering category, and not other target sub-clustering networks corresponding to sample clustering categories it does not possess. This avoids the defect in existing technologies where the clustering model parameters corresponding to categories that a participating device does not possess are exposed to that participating device, leading to a failure to guarantee the privacy of data among participating parties. This solves the technical problem in existing technologies that cannot guarantee the data privacy of participating parties during federated clustering analysis. Attached Figure Description

[0045] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced one by one below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0046] Figure 1 This is one of the flowcharts of the federated clustering method provided in the embodiments of the present invention;

[0047] Figure 2 This is the second flowchart of the federated clustering method provided in this embodiment of the invention;

[0048] Figure 3 This is a schematic diagram of the structure of the initial clustering model in an embodiment of the present invention;

[0049] Figure 4 This is the third flowchart of the federated clustering method provided in this embodiment of the invention;

[0050] Figure 5 This is the fourth flowchart of the federated clustering method provided in this embodiment of the invention;

[0051] Figure 6 This is the fifth flowchart illustrating the federated clustering method provided in this embodiment of the invention;

[0052] Figure 7 This is the sixth flowchart of the federated clustering method provided in this embodiment of the invention;

[0053] Figure 8 This is a schematic diagram of the structure of the federated clustering device provided in an embodiment of the present invention;

[0054] Figure 9 This is a schematic diagram of the structure of the central server provided in an embodiment of the present invention;

[0055] Figure 10 This is a schematic diagram of the structure of the federated clustering system provided in an embodiment of the present invention;

[0056] Figure 11 This is a schematic diagram of the structure of the electronic device provided in an embodiment of the present invention. Detailed Implementation

[0057] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.

[0058] The following is combined Figures 1-6 Describe the federated clustering method provided by this invention. For example... Figure 1 As shown, the present invention provides a federated clustering method, comprising:

[0059] Step 101: Obtain the federated clustering model. The federated clustering model includes a target master clustering network and at least two target sub-clustering networks. The federated clustering model is obtained by performing horizontal federated clustering training on the initial clustering model based on the clustering sample data of at least two participating devices.

[0060] In this system, the output layer dimension of the target main clustering network is the same as the number of target sub-clustering networks. Each output layer dimension of the target main clustering network corresponds to a target sub-clustering network, and both point to the same clustering category.

[0061] Step 102: Send the target master network parameters corresponding to the target master clustering network to each participating device, and receive the target sample clustering category transmitted by each participating device. The target sample clustering category is determined based on the target master network parameters and the clustering sample data of the participating devices.

[0062] Specifically, the target master clustering network parameters are sent to each participating device, enabling each participating device to generate a target master clustering network based on the received parameters, and input its corresponding clustering sample data into the target master clustering network to obtain the target sample clustering category of its corresponding clustering sample data. The clustering sample data contains clustering samples of at least one category.

[0063] Furthermore, the system receives the target sample cluster category transmitted by each participating device. The target sample cluster category represents the sample cluster category of the cluster sample in the corresponding cluster sample data sent by that participating device. The number of target sample cluster categories can be one or more.

[0064] Step 103: For each participating device, based on the target sample clustering category corresponding to the participating device, determine the first target sub-clustering network corresponding to the participating device from at least two target sub-clustering networks.

[0065] Specifically, from at least two target sub-clustering networks in the federated clustering model, a target sub-clustering network corresponding to each target sample cluster category of the participating device is determined, and this corresponding target sub-clustering network is determined as the first target sub-clustering network corresponding to the participating device. The number of first target sub-clustering networks is one or more, and the number of first target sub-clustering networks is the same as the number of target sample cluster categories.

[0066] Step 104: Send the target sub-network parameters corresponding to the first target sub-clustering network to the participating device, so that the participating device can generate a target clustering model based on the target main network parameters and the target sub-network parameters, and perform clustering analysis on the data to be clustered based on the target clustering model.

[0067] Specifically, for each participating device, the target sub-network parameters corresponding to the first target sub-clustering network are sent to that participating device. This enables the participating device to generate its own target clustering model based on the target main network parameters and the target sub-network parameters, and input its data to be clustered into the target clustering model to obtain the clustering analysis result of its corresponding data to be clustered. The clustering analysis result represents the target clustering category of the data to be clustered.

[0068] Furthermore, when the target sample clustering categories of the clustering sample data of the two participating devices are different, the target clustering models generated by the two participating devices are also different. That is, the target clustering model of each participating device corresponds to the target sample clustering category of its clustering sample data.

[0069] Steps 101 to 104 above involve training the initial clustering model using horizontal federated clustering by combining clustering sample data from all participating devices. This yields a federated clustering model with high recognition accuracy. The target master clustering network parameters are sent to each participating device to obtain the target sample clustering category of each device's clustering sample data. This determines the first target sub-clustering network corresponding to the target sample clustering category of each participating device. The target sub-clustering network parameters are then sent to the participating devices to ensure that each participating device only receives the first target sub-clustering network corresponding to its own target sample clustering category, and not other target sub-clustering networks corresponding to sample clustering categories it does not possess. This avoids the data privacy issues inherent in existing technologies where clustering model parameters corresponding to categories not possessed by a participant are exposed to that participant, thus resolving the technical problem of ensuring data privacy for all participants during federated clustering analysis.

[0070] In one embodiment, the initial clustering model includes an initial master clustering network and at least two initial sub-clustering networks. For example... Figure 2 As shown, the target master clustering network and target sub-clustering network in the federated clustering model are trained in the following way:

[0071] Step 201: Send the initial master network parameters corresponding to the initial master clustering network to each participating device, and receive the first loss corresponding to the initial master clustering network sent by each participating device. Determine the first master network clustering loss corresponding to the initial master clustering network after safe aggregation based on each first loss, and determine the optimized master clustering network based on the first master network clustering loss and the initial master clustering network.

[0072] In this system, the output layer dimension of the initial master clustering network is the same as the number of initial sub-clustering networks. Each output layer dimension of the initial master clustering network corresponds to an initial sub-clustering network, and both point to the same clustering category.

[0073] In one embodiment, step 201 is a first federated training phase that trains only the initial main clustering network, and steps 202 to 206 are a second federated training phase that trains both the tuned main clustering network and the initial sub-clustering network simultaneously. Specifically, step 201 includes the following steps:

[0074] S2011. Send the initial master network parameters corresponding to the initial master clustering network to each participating device, so that each participating device generates the initial master clustering network based on the received initial master network parameters, and calculates the first loss for forward propagation by inputting its clustering sample data into the initial master clustering network.

[0075] S2011. Receive the first loss corresponding to the initial main clustering network sent by each participating device, and add up the first losses corresponding to each participating device to obtain the first main network clustering loss corresponding to the initial main clustering network after secure aggregation.

[0076] S2013. Optimize the network parameters of the initial main clustering network along the direction of gradient descent of the first main network clustering loss, and determine the tuned main clustering network based on the optimized main clustering network.

[0077] Step 202: Send the tuning master network parameters corresponding to the tuning master clustering network to each participating device, and receive the first sample clustering category transmitted by each participating device. The first sample clustering category is determined based on the tuning master network parameters and the clustering sample data of the participating devices.

[0078] Specifically, the tuning master network parameters corresponding to the tuning master clustering network are sent to each participating device, so that each participating device generates a tuning master clustering network based on the received tuning master network parameters, and inputs its corresponding clustering sample data into the tuning master clustering network to obtain the first sample clustering category of its corresponding clustering sample data.

[0079] Furthermore, for participant device j, if in one iteration, the first sample cluster category obtained by participant device j inputting its clustering sample data into the tuning master clustering network can be represented by the following formula (1):

[0080]

[0081] Among them, mask j Let represent the set of the first cluster categories corresponding to the clustered sample data of participant device j, N represent the total number of samples in the clustered sample data of participant device j, and set is the set operation for retrieving or deduplicating data. This indicates the cluster category of the first cluster sample. This indicates the sample cluster category of the second cluster sample. This represents the cluster category of the Nth cluster sample.

[0082] Furthermore, each sample is clustered into categories z. i One cluster sample X corresponding to the number of cluster samples i The cluster sample X i The input is fed into the tuned master clustering network to obtain a K-dimensional probability distribution vector r. i,k For a K-dimensional probability distribution vector r i,k Perform hard distribution processing to obtain clustered samples X i The corresponding sample cluster category z i =argmaxk (r i,k ), and the cluster sample X i Classified to the corresponding z-th i Class. Specifically, the K-dimensional probability distribution vector r i,k The category corresponding to the maximum probability distribution value is determined as the cluster sample X. i The corresponding sample cluster category z i .

[0083] Step 203: For each participating device, determine the first initial sub-clustering network corresponding to the first sample clustering category of the participating device, and send the first sub-network parameters corresponding to the first initial sub-clustering network to the participating device.

[0084] Specifically, from at least two initial sub-clustering networks in the initial clustering model, an initial sub-clustering network corresponding to each first sample cluster category of the participating device is determined, and this corresponding initial sub-clustering network is determined as the first initial sub-clustering network corresponding to the participating device. The number of first initial sub-clustering networks is one or more, and the number of first initial sub-clustering networks is the same as the number of first sample cluster categories.

[0085] Step 204: Receive the second loss corresponding to the optimized main clustering network sent by each participating device, and determine the second main network clustering loss corresponding to the optimized main clustering network after safe aggregation based on each second loss.

[0086] In one embodiment, steps 203 and 204 above include the following steps:

[0087] S2011. Receive the first loss corresponding to the initial main clustering network sent by each participating device, and add up the first losses corresponding to each participating device to obtain the first main network clustering loss corresponding to the initial main clustering network after secure aggregation.

[0088] S2013. Optimize the network parameters of the initial main clustering network along the direction of gradient descent of the first main network clustering loss, and determine the tuned main clustering network based on the optimized main clustering network.

[0089] Step 205: Receive the third loss corresponding to the first initial sub-clustering network sent by each participating device, and determine the first sub-network clustering loss corresponding to the at least two initial sub-clustering networks after secure aggregation based on each third loss.

[0090] The third loss for each participating device is calculated as follows: sending the first sub-network parameters corresponding to the first initial sub-clustering network to each participating device, so that each participating device generates its corresponding first initial sub-clustering network based on the received first sub-network parameters, and calculates the third loss for inputting its clustering sample data into the first initial sub-clustering network for forward propagation.

[0091] Specifically, the third loss corresponding to the first initial sub-clustering network sent by each participating device is received, and the third losses corresponding to each first initial sub-clustering network are superimposed to obtain the total loss corresponding to each first initial sub-clustering network. The total losses corresponding to each first initial sub-clustering network are then superimposed to obtain the first sub-network clustering loss corresponding to the at least two initial sub-clustering networks after secure aggregation.

[0092] Step 206: Optimize the tuned main clustering network based on the second main network clustering loss to obtain the optimized target main clustering network, and optimize the at least two initial sub-clustering networks based on the first sub-network clustering loss to obtain the optimized target sub-clustering network.

[0093] Specifically, the network parameters of the tuned master clustering network are optimized along the direction of gradient descent of the second master network clustering loss, and the target master clustering network is determined based on the optimized tuned master clustering network. The network parameters of the at least two initial sub-clustering networks are optimized along the direction of gradient descent of the first sub-network clustering loss, and the target sub-clustering network is determined based on the optimized initial sub-clustering networks.

[0094] Steps 201 to 206 above improve the stability of the trained and tuned main clustering network by iteratively optimizing the network parameters of the initial main clustering network based on the clustering sample data of each participating device in the first federated training phase. This avoids the technical defect of slow convergence or failure to converge caused by the training results of directly using the initial main clustering network for federated training deviating too much from the actual values. This improves the convergence speed of iterative optimization of the main clustering network and sub-clustering networks in the second federated training phase. By determining the first initial sub-clustering network corresponding to the first sample clustering category of each participating device and sending the first sub-network parameters corresponding to the first initial sub-clustering network to the participating devices, it is ensured that each participating device can only obtain the first initial sub-clustering network corresponding to the first sample clustering category it possesses, and will not obtain other initial sub-clustering networks corresponding to sample clustering categories it does not possess. This avoids the defect in the prior art where the clustering model parameters corresponding to a category that a participating device does not possess are exposed to that participating device, which leads to the inability to guarantee the privacy of each participating device's data. This ensures the data privacy of each participating device during the federated clustering training process.

[0095] In one embodiment, the initial clustering model is trained based on the following method:

[0096] S101. Receive model building parameters transmitted by the first participating device from at least two participating devices. The model building parameters include model structure hyperparameters, which include, but are not limited to, the number of initial categories, the number of initial sub-clustering networks, the output layer dimension of the initial main clustering network and the initial sub-clustering networks, the hidden layer dimension, the number of hidden layers, and the normalization layer type.

[0097] Furthermore, the input layer dimensions of the initial main clustering network and the initial sub-clustering network are determined based on the feature dimensions of the clustering sample data from the participating devices, and the feature dimensions of the clustering sample data from each participating device are the same. The hidden layer dimension can also be called the intermediate layer dimension. The first participating device can also be called the initiating device.

[0098] Furthermore, the model construction parameters also include model training hyperparameters, which include the maximum number of iterations and the model optimization method, used to iteratively train the initial clustering model built based on the model structure parameters. The model optimization method includes gradient descent optimization.

[0099] S101. Construct an initial clustering model based on the model structure parameters. The initial clustering model includes an initial main clustering network and at least two initial sub-clustering networks, such as... Figure 3 As shown, the initial main clustering network includes a first input layer, a first hidden layer, a first output layer, and a softmax normalization layer; the initial sub-clustering network includes a second input layer, a second hidden layer, a second output layer, and a sigmoid normalization layer.

[0100] Furthermore, the output dimension of the first output layer is the same as the number of initial sub-clustering networks, both equal to the initial number of categories K. The output dimension of the second output layer is 1. The first and second hidden layers are neural networks, convolutional neural networks, or recurrent neural networks. Among them, neural networks are general-purpose neural networks; convolutional neural networks are generally used for image data analysis, and recurrent neural networks are generally used for natural language data analysis. The sum of the probability values ​​of the K clustered sample categories output by the softmax normalization layer is 1.

[0101] In one embodiment, such as Figure 4 As shown, step 201 above includes steps 301 to 303, wherein:

[0102] Step 301: In one iteration, the optimized first main clustering network is determined based on the first main clustering loss and the initial main clustering network. The first main network parameters corresponding to the first main clustering network are sent to each participating device. The fourth loss corresponding to the first main clustering network sent by each participating device is received, and the second main clustering loss corresponding to the first main clustering network after safe aggregation is determined based on each fourth loss.

[0103] In one embodiment, step 301 specifically includes the following steps:

[0104] S3011. Optimize the network parameters of the initial main clustering network along the direction of gradient descent of the first main network clustering loss to obtain the optimized first main clustering network.

[0105] S3012. Send the first master network parameters corresponding to the first master clustering network to each participating device, so that each participating device generates the first master clustering network based on the received first master network parameters, and calculates the fourth loss for inputting its clustering sample data into the initial master clustering network for forward propagation.

[0106] In one embodiment, the fourth loss corresponding to each participating device is determined based on the difference between the first clustering probability distribution obtained by the participating device in the previous iteration when it inputs its clustering sample data into the initial main clustering network and the second clustering probability distribution obtained by the participating device in the current iteration when it inputs its clustering sample data into the first main clustering network. Furthermore, the following formula (2) illustrates a method for calculating the fourth loss based on relative entropy:

[0107]

[0108] Among them, L cl This represents the fourth loss corresponding to the participating device. N represents the total number of clustered sample data for the participating device. Let r represent the first cluster probability distribution obtained from the previous training round. i This represents the second cluster probability distribution obtained in this round of training. and r i All are K-dimensional vectors. This represents the difference in probability distribution between the first and second cluster probability distributions, which is expressed as relative entropy or KL divergence.

[0109] S3012. Receive the fourth loss corresponding to the first main clustering network sent by each participating device, and add up the fourth losses corresponding to each participating device to obtain the second main network clustering loss corresponding to the first main clustering network after secure aggregation.

[0110] Step 302: If the clustering loss of the second main network is not less than the preset loss threshold and the current iteration number is not greater than the maximum iteration number, repeat the above steps to iteratively update the initial main clustering network and determine the iteratively updated initial main clustering network as the tuning main clustering network.

[0111] Step 303: If the clustering loss of the second main network is less than the preset loss threshold, or if the current iteration number is greater than the maximum iteration number, optimize the first main clustering network based on the clustering loss of the second main network, and determine the optimized first main clustering network as the tuning main clustering network.

[0112] Steps 301 to 303 above iteratively optimize the network parameters of the initial main clustering network based on the clustering sample data of each participating device in the first federated training phase. This reduces the probability distribution difference between the first clustering probability distribution obtained in the previous training round and the second clustering probability distribution obtained in the current training round, thereby improving the network stability of the trained and optimized main clustering network. This avoids the technical defect that the training results of directly using the initial main clustering network for federated training deviate too much from the actual values, resulting in slow convergence or failure to converge. In turn, it improves the convergence speed of iterative optimization of the main clustering network and sub-clustering network in the second federated training phase, thereby improving the training speed and training effect of federated clustering training.

[0113] In one embodiment, such as Figure 5 As shown, step 206 above includes steps 401 to 403, wherein:

[0114] Step 401: Optimize the tuned main clustering network based on the second main network clustering loss to obtain the optimized second main clustering network, and optimize the at least two initial sub-clustering networks based on the first sub-network clustering loss to obtain the optimized first sub-clustering network.

[0115] In one iteration, the system receives the second loss corresponding to the tuned main clustering network sent by each participating device, and determines the second main network clustering loss corresponding to the tuned main clustering network after secure aggregation based on each second loss; it also receives the third loss corresponding to the first initial sub-clustering network sent by each participating device, and determines the first sub-network clustering loss corresponding to the at least two initial sub-clustering networks after secure aggregation based on each third loss; it optimizes the tuned main clustering network based on the second main network clustering loss to obtain the optimized second main clustering network, and optimizes the at least two initial sub-clustering networks based on the first sub-network clustering loss to obtain the optimized first sub-clustering network, wherein the number of first sub-clustering networks is at least two.

[0116] Furthermore, the second loss corresponding to each participating device is determined based on the difference between the first clustering probability distribution obtained by the participating device in the previous iteration by inputting its clustering sample data into the tuning master clustering network and the second clustering probability distribution obtained by the participating device in the current iteration by inputting its clustering sample data into the tuning master clustering network. For the specific calculation formula, please refer to the above formula (2), which will not be repeated in this embodiment.

[0117] Furthermore, the third losses corresponding to each first initial sub-clustering network are summed to obtain the total loss corresponding to each first initial sub-clustering network. The total loss corresponding to each first initial sub-clustering network can be calculated by the following formula (3):

[0118]

[0119] Among them, L k,sub Let u represent the total loss corresponding to the k-th initial sub-clustering network, n represent the total number of clustered samples corresponding to the k-th initial sub-clustering network, and u represent the total loss corresponding to the k-th initial sub-clustering network. k x represents the mean or center of the cluster samples corresponding to the first initial sub-clustering network k. ki p represents the i-th cluster sample corresponding to the first initial sub-clustering network k. ki This represents the probability value obtained by inputting the i-th cluster sample into the first initial sub-clustering network k.

[0120] The total losses corresponding to each of the first initial sub-clustering networks are summed to obtain the first sub-network clustering loss corresponding to the at least two initial sub-clustering networks after safe aggregation. The first sub-network clustering loss can be calculated by the following formula (4):

[0121]

[0122] Among them, L sub L represents the clustering loss of the first sub-network, k=1 represents the first initial sub-clustering network or the first initial sub-clustering network. k,sub This represents the total loss corresponding to the k-th first initial sub-clustering network, where K represents the number of first initial sub-clustering networks or initial sub-clustering networks.

[0123] It should be noted that the initial sub-clustering network is the name in the central server, while the first initial sub-clustering network is the name when distributed to each participating device; both belong to the same sub-clustering network.

[0124] Step 402: If both the clustering loss of the second main network and the clustering loss of the first sub-network are less than the preset loss threshold, or if the current iteration number is greater than the maximum iteration number, then the second main clustering network is determined as the target main clustering network, and the first sub-clustering network is determined as the target sub-clustering network.

[0125] Step 403: If either the clustering loss of the second main network or the clustering loss of the first sub-network is greater than the preset loss threshold, or if the current iteration number is greater than the maximum iteration number, continue to iteratively optimize the second main clustering network and the first sub-clustering network until the target main clustering network and the target sub-clustering network are determined.

[0126] In existing technologies, the initiator usually does not know the actual number of cluster categories. Therefore, the number of cluster categories in the federated clustering model is usually initialized manually based on empirical values. Furthermore, during the actual model training process, the numerical value of the number of cluster categories is changed manually multiple times to achieve the purpose of model hyperparameter tuning.

[0127] However, the number of clusters set in this way is subject to subjective human factors, making it difficult to guarantee accuracy. Furthermore, excessive manual adjustments can lead to significant consumption of processor computing resources. Therefore, at least one embodiment is provided below to address the aforementioned technical problems.

[0128] In one embodiment, such as Figure 6 As shown, the federated clustering method provided by the present invention further includes steps 501 to 503, wherein:

[0129] Step 501: Determine the first sample cluster category corresponding to each first sub-clustering network, and obtain the cluster splitting parameter corresponding to each first sample cluster category. The cluster splitting parameter is determined based on the cluster sample data corresponding to the first sample cluster category.

[0130] Furthermore, the cluster splitting parameter H s It is calculated based on the cluster sample data corresponding to the first sample cluster category and the MH (Metropilis-Hastings) algorithm.

[0131] Step 502: If the cluster splitting parameter corresponding to the first sample cluster category is greater than the preset classification threshold, perform node fusion processing on the current main clustering network node and the current sub-clustering network node corresponding to the first sample cluster category.

[0132] In this system, each main clustering network node corresponds to one output layer dimension of the main clustering network, and each sub-clustering network node corresponds to one sub-clustering network. Since the output layer dimension of the main clustering network and the number of sub-clustering networks are both equal to the number of cluster categories, the node fusion or node splitting processing of the main and sub-clustering network nodes is equivalent to adjusting the number of cluster categories.

[0133] Furthermore, the preset classification threshold is set to 1. The clustering fusion parameter H... m Cluster splitting parameter H s The reciprocal of, that is

[0134] Step 503: If the cluster splitting parameter corresponding to the first sample cluster category is not greater than the preset classification threshold, perform node splitting processing on the current main clustering network node and the current sub-clustering network node corresponding to the first sample cluster category respectively.

[0135] In one embodiment, a new adjacent main clustering network node is added at the current main clustering network node's node position, and the connection weight between the current main clustering network node and the previous layer main clustering network is copied as the connection weight corresponding to the new adjacent main clustering network node. Similarly, a new adjacent sub-clustering network node is added at the current sub-clustering network node's node position, and the network weight corresponding to the current sub-clustering network node is copied as the network weight corresponding to the new adjacent sub-clustering network node.

[0136] Steps 501 to 503 above involve obtaining the clustering splitting parameters corresponding to each first sample cluster category. If the clustering splitting parameters are greater than a preset classification threshold, node fusion processing is performed on the current main clustering network node and the current sub-clustering network node corresponding to the first sample cluster category. If the clustering splitting parameters are not greater than the preset classification threshold, node splitting processing is performed on the current main clustering network node and the current sub-clustering network node corresponding to the first sample cluster category. By performing node fusion or node splitting processing on the current network nodes, the goal of automatically adjusting the number of initial clusters is achieved. The entire process is executed automatically by the computer without manual intervention. Furthermore, by analyzing the clustering sample data of each participating device, the correct adjustment direction for the number of initial clusters is determined, thereby achieving better adjustment effects and higher adjustment efficiency. This enables the rapid and accurate determination of the final number of cluster categories and avoids the final number of cluster categories falling into local optima, improving the accuracy of the number of cluster categories and saving processor computing resources.

[0137] In one embodiment, such as Figure 7As shown, step 502 above includes steps 601 to 604, wherein:

[0138] Step 601: Determine the adjacent sub-clustering network nodes corresponding to the optimized main clustering network node, and the adjacent main clustering network nodes corresponding to the optimized main clustering network node, and obtain the first network weight average value corresponding to the optimized main clustering network node and the adjacent sub-clustering network nodes.

[0139] Step 602: Perform fusion processing on the current sub-cluster network node and the adjacent sub-cluster network nodes, and determine the average value of the first network weight as the target network weight corresponding to the fused sub-cluster network node.

[0140] Step 603: Obtain the first connection weight between the main clustering network node and the previous layer main clustering network, and the second connection weight between the adjacent main clustering network node and the previous layer main clustering network.

[0141] Step 604: Perform fusion processing on the optimized main clustering network node and adjacent main clustering network nodes, and determine the average of the first connection weight and the second connection weight as the target connection weight corresponding to the fused main clustering network node.

[0142] The federated clustering apparatus provided by the present invention is described below. The federated clustering apparatus described below can be referred to in correspondence with the federated clustering method described above.

[0143] like Figure 8 As shown, the present invention provides a federated clustering device, the federated clustering device 100 comprising:

[0144] The model acquisition module 101 is used to acquire a federated clustering model. The federated clustering model includes a target main clustering network and at least two target sub-clustering networks. The federated clustering model is obtained by horizontal federated clustering training of the initial clustering model based on the clustering sample data of at least two participating devices.

[0145] The category determination module 102 is used to send the target master network parameters corresponding to the target master clustering network to each participating device, and to receive the target sample clustering category transmitted by each participating device. The target sample clustering category is determined based on the target master network parameters and the clustering sample data of the participating devices.

[0146] The network determination module 103 is used to determine the first target sub-clustering network corresponding to each participating device from at least two target sub-clustering networks based on the target sample clustering category corresponding to the participating device.

[0147] The clustering analysis module 104 is used to send the target sub-network parameters corresponding to the first target sub-clustering network to the participating device, so that the participating device can generate a target clustering model based on the target main network parameters and the target sub-network parameters, and perform clustering analysis on the data to be clustered based on the target clustering model.

[0148] In one embodiment, the federated clustering device 100 further includes a clustering training module for training the initial master clustering network and at least two initial sub-clustering networks in the initial clustering model to obtain a trained federated clustering model. The federated clustering model includes a target master clustering network and a target sub-clustering network. The clustering training module includes a network tuning unit, a category determination unit, a network allocation unit, a first computation unit, a second computation unit, and a network optimization unit, wherein:

[0149] The network optimization unit is used to send the initial main network parameters corresponding to the initial main clustering network to each participating device, and receive the first loss corresponding to the initial main clustering network sent by each participating device, determine the first main network clustering loss corresponding to the initial main clustering network after safe aggregation based on each first loss, and determine the optimized main clustering network based on the first main network clustering loss and the initial main clustering network.

[0150] The category determination unit is used to send the tuning master network parameters corresponding to the tuning master clustering network to each participating device, and to receive the first sample clustering category transmitted by each participating device. The first sample clustering category is determined based on the tuning master network parameters and the clustering sample data of the participating devices.

[0151] The network allocation unit is used to determine, for each participating device, a first initial sub-clustering network corresponding to the first sample clustering category of the participating device, and send the first sub-network parameters corresponding to the first initial sub-clustering network to the participating device.

[0152] The first calculation unit is used to receive the second loss corresponding to the optimized main clustering network sent by each participating device, and to determine the second main network clustering loss corresponding to the optimized main clustering network after safe aggregation based on each second loss.

[0153] The second calculation unit is used to receive the third loss corresponding to the first initial sub-clustering network sent by each participating device, and to determine the first sub-network clustering loss corresponding to the at least two initial sub-clustering networks after secure aggregation based on each third loss.

[0154] The network optimization unit is used to optimize the tuned main clustering network based on the second main network clustering loss to obtain the optimized target main clustering network, and to optimize the at least two initial sub-clustering networks based on the first sub-network clustering loss to obtain the optimized target sub-clustering network.

[0155] In one embodiment, the network optimization unit is further configured to, in one iteration, determine an optimized first main clustering network based on a first main network clustering loss and an initial main clustering network, send the first main network parameters corresponding to the first main clustering network to each participating device, receive the fourth loss corresponding to the first main clustering network sent by each participating device, and determine the second main network clustering loss corresponding to the first main clustering network after secure aggregation based on each fourth loss; if the second main network clustering loss is not less than a preset loss threshold and the current iteration number is not greater than the maximum iteration number, repeat the above steps to iteratively update the initial main clustering network and determine the iteratively updated initial main clustering network as the optimization main clustering network; if the second main network clustering loss is less than the preset loss threshold or the current iteration number is greater than the maximum iteration number, optimize the first main clustering network based on the second main network clustering loss and determine the optimized first main clustering network as the optimization main clustering network.

[0156] In one embodiment, the network optimization unit is further configured to optimize the tuned main clustering network based on the second main network clustering loss to obtain an optimized second main clustering network, and optimize the at least two initial sub-clustering networks based on the first sub-network clustering loss to obtain an optimized first sub-clustering network; if both the second main network clustering loss and the first sub-network clustering loss are less than a preset loss threshold, or if the current iteration number is greater than the maximum iteration number, the second main clustering network is determined as the target main clustering network, and the first sub-clustering network is determined as the target sub-clustering network; if either the second main network clustering loss or the first sub-network clustering loss is greater than the preset loss threshold, or if the current iteration number is greater than the maximum iteration number, the second main clustering network and the first sub-clustering network are iteratively optimized until the target main clustering network and the target sub-clustering network are determined.

[0157] In one embodiment, the network optimization unit is further configured to determine the first sample cluster category corresponding to each first sub-clustering network, and obtain the cluster splitting parameter corresponding to each first sample cluster category, wherein the cluster splitting parameter is determined based on the cluster sample data corresponding to the first sample cluster category; if the cluster splitting parameter corresponding to the first sample cluster category is greater than a preset classification threshold, node fusion processing is performed on the current main clustering network node and the current sub-clustering network node corresponding to the first sample cluster category respectively; if the cluster splitting parameter corresponding to the first sample cluster category is not greater than the preset classification threshold, node splitting processing is performed on the current main clustering network node and the current sub-clustering network node corresponding to the first sample cluster category respectively.

[0158] In one embodiment, the network optimization unit is further configured to: determine the neighboring sub-cluster network nodes corresponding to the optimized main cluster network node, and the neighboring main cluster network nodes corresponding to the optimized main cluster network node; obtain the average first network weight of the optimized main cluster network node and the neighboring sub-cluster network nodes; perform fusion processing on the current sub-cluster network node and the neighboring sub-cluster network nodes, and determine the average first network weight as the target network weight corresponding to the fused sub-cluster network node; obtain the first connection weight between the optimized main cluster network node and the previous layer main cluster network, and the second connection weight between the neighboring main cluster network node and the previous layer main cluster network; perform fusion processing on the optimized main cluster network node and the neighboring main cluster network nodes, and determine the average of the first connection weight and the second connection weight as the target connection weight corresponding to the fused main cluster network node.

[0159] Figure 9 An example of a schematic diagram of the physical structure of a central server is shown, such as... Figure 9 As shown, the electronic device may include: a processor 810, a communication interface 820, a memory 830, and a communication bus 840, wherein the processor 810, the communication interface 820, and the memory 830 communicate with each other through the communication bus 840. The processor 810 can call logical instructions in the memory 830 to execute the federated clustering method provided by the above methods. The method includes: acquiring a federated clustering model, which includes a target master clustering network and at least two target sub-clustering networks. The federated clustering model is obtained by training an initial clustering model horizontally with clustering sample data from at least two participating devices; sending the target master network parameters corresponding to the target master clustering network to each participating device and receiving the target sample clustering category transmitted by each participating device. The target sample clustering category is determined based on the target master network parameters and the clustering sample data of the participating devices; for each participating device, determining a first target sub-clustering network corresponding to the participating device from at least two target sub-clustering networks based on the target sample clustering category corresponding to the participating device; sending the target sub-network parameters corresponding to the first target sub-clustering network to the participating devices, so that the participating devices generate a target clustering model based on the target master network parameters and the target sub-network parameters, and perform clustering analysis on their data to be clustered based on the target clustering model.

[0160] Furthermore, the logical instructions in the aforementioned memory 830 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0161] like Figure 10 As shown, the present invention also provides a federated clustering system, comprising: a central server provided in the above embodiments and at least two participating devices, wherein: each participating device is communicatively connected to the central server and is used to receive target master network parameters and target sub-network parameters of the first target sub-clustering network corresponding to its own target sample clustering category transmitted by the central server, generate a target clustering model based on the target master network parameters and the target sub-network parameters, and perform clustering analysis on its data to be clustered based on the target clustering model to obtain the target clustering analysis result corresponding to the data to be clustered.

[0162] Figure 11 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 11As shown, the electronic device may include: a processor 910, a communication interface 920, a memory 930, and a communication bus 940, wherein the processor 910, the communication interface 920, and the memory 930 communicate with each other through the communication bus 940. The processor 910 can call logical instructions in the memory 930 to execute the federated clustering method provided by the above methods. The method includes: acquiring a federated clustering model, which includes a target master clustering network and at least two target sub-clustering networks. The federated clustering model is obtained by training an initial clustering model horizontally with clustering sample data from at least two participating devices; sending the target master network parameters corresponding to the target master clustering network to each participating device and receiving the target sample clustering category transmitted by each participating device. The target sample clustering category is determined based on the target master network parameters and the clustering sample data of the participating devices; for each participating device, determining a first target sub-clustering network corresponding to the participating device from at least two target sub-clustering networks based on the target sample clustering category corresponding to the participating device; sending the target sub-network parameters corresponding to the first target sub-clustering network to the participating devices, so that the participating devices generate a target clustering model based on the target master network parameters and the target sub-network parameters, and perform clustering analysis on their data to be clustered based on the target clustering model.

[0163] Furthermore, the logical instructions in the aforementioned memory 930 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, essentially, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0164] On the other hand, the present invention also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, is implemented to perform the federated clustering method provided by the methods described above. The method includes: acquiring a federated clustering model, the federated clustering model including a target master clustering network and at least two target sub-clustering networks, the federated clustering model being obtained by lateral federated clustering training of an initial clustering model based on clustering sample data from at least two participating devices; sending target master network parameters corresponding to the target master clustering network to each participating device, and receiving target sample clustering categories transmitted by each participating device, the target sample clustering categories being determined based on the target master network parameters and the clustering sample data of the participating devices; for each participating device, determining a first target sub-clustering network corresponding to the participating device from at least two target sub-clustering networks based on the target sample clustering categories corresponding to the participating device; sending target sub-network parameters corresponding to the first target sub-clustering network to the participating devices, so that the participating devices generate a target clustering model based on the target master network parameters and the target sub-network parameters, and perform clustering analysis on their data to be clustered based on the target clustering model.

[0165] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and 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 modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0166] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., including several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods of various embodiments or some parts of embodiments.

[0167] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; 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; and these 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 federated clustering method, characterized in that, include: A federated clustering model is obtained, which includes a target master clustering network and at least two target sub-clustering networks. The federated clustering model is obtained by training an initial clustering model through horizontal federated clustering based on clustering sample data from at least two participating devices. Send the target master network parameters corresponding to the target master clustering network to each of the participating devices, so that each of the participating devices generates the target master clustering network based on the received target master network parameters, and inputs its corresponding clustering sample data into the target master clustering network to obtain the target sample clustering category of its corresponding clustering sample data, and receives the target sample clustering category transmitted by each of the participating devices; For each participating device, based on the target sample clustering category corresponding to the participating device, a first target sub-clustering network corresponding to the participating device is determined from the at least two target sub-clustering networks; The target sub-network parameters corresponding to the first target sub-clustering network are sent to the participating device, so that the participating device generates a target clustering model based on the target main network parameters and the target sub-network parameters, and performs clustering analysis on the data to be clustered based on the target clustering model.

2. The federated clustering method according to claim 1, characterized in that, The initial clustering model includes an initial master clustering network and at least two initial sub-clustering networks. The target master clustering network and target sub-clustering networks in the federated clustering model are trained in the following manner: Send the initial master network parameters corresponding to the initial master clustering network to each of the participating devices, and receive the first loss corresponding to the initial master clustering network sent by each of the participating devices. Determine the first master network clustering loss corresponding to the initial master clustering network after safe aggregation based on each first loss, and determine the optimized master clustering network based on the first master network clustering loss and the initial master clustering network. The tuning master network parameters corresponding to the tuning master clustering network are sent to each of the participating devices, and the first sample clustering category transmitted by each of the participating devices is received. The first sample clustering category is determined based on the tuning master network parameters and the clustering sample data of the participating devices. For each participating device, a first initial sub-clustering network corresponding to the first sample clustering category of the participating device is determined, and the first sub-network parameters corresponding to the first initial sub-clustering network are sent to the participating device. Receive the second loss corresponding to the optimized main clustering network sent by each of the participating devices, and determine the second main network clustering loss corresponding to the optimized main clustering network after secure aggregation based on each of the second losses; Receive the third loss corresponding to the first initial sub-clustering network sent by each of the participating devices, and determine the first sub-network clustering loss corresponding to the at least two initial sub-clustering networks after secure aggregation based on each of the third losses; The optimized main clustering network is optimized based on the second main network clustering loss to obtain the optimized target main clustering network, and the at least two initial sub-clustering networks are optimized based on the first sub-network clustering loss to obtain the optimized target sub-clustering network.

3. The federated clustering method according to claim 2, characterized in that, The step of determining and optimizing the main clustering network based on the first main network clustering loss and the initial main clustering network includes: In one iteration, an optimized first main clustering network is determined based on the first main network clustering loss and the initial main clustering network. The first main network parameters corresponding to the first main clustering network are sent to each of the participating devices. The fourth loss corresponding to the first main clustering network sent by each of the participating devices is received. The second main network clustering loss corresponding to the first main clustering network after secure aggregation is determined based on each of the fourth losses. If the clustering loss of the second main network is not less than the preset loss threshold and the current iteration number is not greater than the maximum iteration number, repeat the above steps to iteratively update the initial main clustering network and determine the iteratively updated initial main clustering network as the optimized main clustering network. If the clustering loss of the second main network is less than a preset loss threshold, or if the current iteration number is greater than the maximum iteration number, the first main clustering network is optimized based on the clustering loss of the second main network, and the optimized first main clustering network is determined as the tuned main clustering network.

4. The federated clustering method according to claim 2, characterized in that, The process of optimizing the tuned main clustering network based on the second main network clustering loss to obtain an optimized target main clustering network, and optimizing the at least two initial sub-clustering networks based on the first sub-network clustering loss to obtain an optimized target sub-clustering network, includes: The optimized main clustering network is optimized based on the second main network clustering loss to obtain the optimized second main clustering network, and the at least two initial sub-clustering networks are optimized based on the first sub-network clustering loss to obtain the optimized first sub-clustering network. If both the clustering loss of the second main network and the clustering loss of the first sub-network are less than a preset loss threshold, or if the current iteration number is greater than the maximum iteration number, the second main clustering network is determined as the target main clustering network, and the first sub-clustering network is determined as the target sub-clustering network. If either the clustering loss of the second main network or the clustering loss of the first sub-network is greater than a preset loss threshold, or if the current iteration number is greater than the maximum iteration number, the second main clustering network and the first sub-clustering network continue to be iteratively optimized until the target main clustering network and the target sub-clustering network are determined.

5. The federated clustering method according to claim 4, characterized in that, The method further includes: Determine the first sample cluster category corresponding to each first sub-clustering network, and obtain the cluster splitting parameter corresponding to each first sample cluster category. The cluster splitting parameter is determined based on the cluster sample data corresponding to the first sample cluster category. If the clustering splitting parameter corresponding to the first sample clustering category is greater than the preset classification threshold, node fusion processing is performed on the current main clustering network node and the current sub-clustering network node corresponding to the first sample clustering category respectively; If the clustering splitting parameter corresponding to the first sample clustering category is not greater than the preset classification threshold, then the current main clustering network node and the current sub-clustering network node corresponding to the first sample clustering category are split into nodes respectively.

6. The federated clustering method according to claim 5, characterized in that, The step of performing node fusion processing on the current main clustering network node and the current sub-clustering network node corresponding to the first sample clustering category includes: Determine the adjacent sub-cluster network nodes corresponding to the optimized main cluster network node, and the adjacent main cluster network nodes corresponding to the optimized main cluster network node, and obtain the first network weight average value corresponding to the optimized main cluster network node and the adjacent sub-cluster network node; The current sub-cluster network node and the adjacent sub-cluster network node are fused, and the average value of the first network weight is determined as the target network weight corresponding to the fused sub-cluster network node. Obtain the first connection weight between the optimized main clustering network node and the previous layer main clustering network, and the second connection weight between the adjacent main clustering network node and the previous layer main clustering network; The optimized main clustering network node and the adjacent main clustering network node are fused together, and the average of the first connection weight and the second connection weight is determined as the target connection weight corresponding to the fused main clustering network node.

7. A federal clustering device, characterized in that, include: The model acquisition module is used to acquire a federated clustering model, which includes a target main clustering network and at least two target sub-clustering networks. The federated clustering model is obtained by training an initial clustering model through horizontal federated clustering based on clustering sample data from at least two participating devices. The category determination module is used to send the target master network parameters corresponding to the target master clustering network to each of the participating devices, so that each of the participating devices generates the target master clustering network based on the received target master network parameters, inputs its corresponding clustering sample data into the target master clustering network, obtains the target sample clustering category of its corresponding clustering sample data, and receives the target sample clustering category transmitted by each of the participating devices; The network determination module is used to determine, for each participating device, a first target sub-clustering network corresponding to the participating device from the at least two target sub-clustering networks based on the target sample clustering category corresponding to the participating device; The clustering analysis module is used to send the target sub-network parameters corresponding to the first target sub-clustering network to the participating device, so that the participating device generates a target clustering model based on the target main network parameters and the target sub-network parameters, and performs clustering analysis on the data to be clustered based on the target clustering model.

8. A central server, 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 program, it implements the federated clustering method as described in any one of claims 1 to 6.

9. A federated clustering system, characterized in that, include: The central server as described in claim 8 and at least two participating devices, wherein each of the participating devices is communicatively connected to the central server.

10. An electronic 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 program, it implements the federated clustering method as described in any one of claims 1 to 6.

11. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the federated clustering method as described in any one of claims 1 to 6.