CN113095512A - Federal learning modeling optimization method, apparatus, medium, and computer program product - Google Patents
Federal learning modeling optimization method, apparatus, medium, and computer program product Download PDFInfo
- Publication number
- CN113095512A CN113095512A CN202110443709.9A CN202110443709A CN113095512A CN 113095512 A CN113095512 A CN 113095512A CN 202110443709 A CN202110443709 A CN 202110443709A CN 113095512 A CN113095512 A CN 113095512A
- Authority
- CN
- China
- Prior art keywords
- model
- local
- cluster
- training
- feature
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N20/00—Machine learning
- G06N20/20—Ensemble learning
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/23—Clustering techniques
Landscapes
- Engineering & Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Theoretical Computer Science (AREA)
- Evolutionary Computation (AREA)
- General Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Computer Vision & Pattern Recognition (AREA)
- General Physics & Mathematics (AREA)
- Artificial Intelligence (AREA)
- Physics & Mathematics (AREA)
- Evolutionary Biology (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Life Sciences & Earth Sciences (AREA)
- Medical Informatics (AREA)
- Bioinformatics & Computational Biology (AREA)
- Computing Systems (AREA)
- Mathematical Physics (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
The application discloses a federated learning modeling optimization method, equipment, a medium and a computer program product, wherein the federated learning modeling optimization method is applied to coordinator equipment, and comprises the following steps: receiving local model parameters generated by each participant device iterative training local prediction model; clustering each feature characterization cluster generated by clustering the training feature characterization sent by each participant device, and performing clustering cluster aggregation on each local model parameter to obtain an aggregation model parameter corresponding to each feature characterization cluster; and feeding back the parameters of the aggregation model to corresponding participant equipment respectively so that the participant equipment optimizes the local prediction model according to the parameters of the aggregation model to obtain a federal prediction model. The method and the device solve the technical problem of low calculation efficiency in federal learning.
Description
Technical Field
The present application relates to the field of artificial intelligence in financial technology (Fintech), and in particular, to a method, apparatus, medium, and computer program product for optimizing federated learning modeling.
Background
With the continuous development of financial science and technology, especially internet science and technology, more and more technologies (such as distributed technology, artificial intelligence and the like) are applied to the financial field, but the financial industry also puts higher requirements on the technologies, for example, higher requirements on the distribution of backlog in the financial industry are also put forward.
With the continuous development of computer technology, artificial intelligence is more and more widely applied, currently, during federal learning, a coordinator usually directly aggregates local models of all participants to generate an aggregate model, but training data of all participants usually have large difference, so that the adaptation degree of the aggregate model and the training data of all participants is low, and after each aggregation, the aggregate model still needs to be continuously subjected to iterative training optimization based on the local training data, so that the convergence of the aggregate model in an iterative process is slow, and the calculation efficiency during federal learning is low.
Disclosure of Invention
The main purpose of the present application is to provide a method, an apparatus, a medium, and a computer program product for optimizing federated learning modeling, which aim to solve the technical problem of low computational efficiency in federated learning in the prior art.
In order to achieve the above object, the present application provides a federated learning modeling optimization method, where the federated learning modeling optimization method is applied to a coordinator device, and the federated learning modeling optimization method includes:
receiving local model parameters generated by each participant device iterative training local prediction model;
clustering each feature characterization cluster generated by clustering the training feature characterization sent by each participant device, and performing clustering cluster aggregation on each local model parameter to obtain an aggregation model parameter corresponding to each feature characterization cluster;
and feeding back the parameters of the aggregation model to corresponding participant equipment respectively so that the participant equipment optimizes the local prediction model according to the parameters of the aggregation model to obtain a federal prediction model.
The application also provides a federal learning optimization device that models, federal learning optimization device that models is virtual device, just federal learning optimization device that models is applied to the coordinator equipment, federal learning optimization device that models includes:
the receiving module is used for receiving local model parameters generated by the local prediction model iteratively trained by each participant device;
the clustering module is used for clustering each characteristic characterization clustering cluster generated by clustering the training characteristic characterization sent by each participant device, and clustering each local model parameter to obtain an aggregation model parameter corresponding to each characteristic characterization clustering cluster;
and the feedback module is used for respectively feeding back the parameters of the aggregation models to the corresponding participant equipment so that the participant equipment can optimize the local prediction model according to the parameters of the aggregation models to obtain a federal prediction model.
In order to achieve the above object, the present application provides a federated learning modeling optimization method, where the federated learning modeling optimization method is applied to a participant device, and the federated learning modeling optimization method includes:
obtaining a local prediction model, and iteratively training the local prediction model to a preset iteration number threshold value to obtain local model parameters of the local prediction model;
sending the local model parameters to coordinator equipment, so that the coordinator equipment can perform clustering cluster aggregation on the local model parameters sent by the participant equipment based on the characteristic representation clustering clusters to obtain aggregation model parameters;
and receiving an aggregation model parameter corresponding to the cluster to which the participant equipment belongs, and optimizing the local prediction model according to the aggregation model parameter to obtain a federal prediction model.
The application also provides a federal learning optimization device that models, federal learning optimization device that models is virtual device, just the participant's equipment is applied to federal learning optimization device that models, federal learning optimization device that models includes:
the iteration training module is used for obtaining a local prediction model, and iteratively training the local prediction model to a preset iteration number threshold value to obtain local model parameters of the local prediction model;
the sending module is used for sending the local model parameters to coordinator equipment so that the coordinator equipment can perform clustering cluster aggregation on the local model parameters sent by the participant equipment based on the characteristic representation clustering clusters to obtain aggregation model parameters;
and the model optimization module is used for receiving the aggregation model parameters corresponding to the clustering cluster of the participant equipment, optimizing the local prediction model according to the aggregation model parameters and obtaining a federal prediction model.
The application also provides a federal learning modeling optimization device, the federal learning modeling optimization device is an entity device, the federal learning modeling optimization device includes: a memory, a processor, and a program of the federated learning modeling optimization method stored on the memory and executable on the processor, the program of the federated learning modeling optimization method when executed by the processor may implement the steps of the federated learning modeling optimization method as described above.
The present application also provides a medium, which is a readable storage medium, on which a program for implementing the federal learning modeling optimization method is stored, and the program for implementing the federal learning modeling optimization method implements the steps of the federal learning modeling optimization method as described above when executed by a processor.
The present application also provides a computer program product comprising a computer program which, when executed by a processor, performs the steps of the method of federated learning modeling optimization as described above.
The application provides a method, equipment, a medium and a computer program product for optimizing modeling of federated learning, compared with the technical means of generating an aggregation model by directly aggregating local models of all participants by a coordinator in the prior art, the method comprises the steps of firstly receiving local model parameters generated by local prediction models iteratively trained by all the participant equipment, further clustering and generating feature characterization cluster clusters based on training feature characterizations sent by all the participant equipment, clustering and aggregating the local model parameters to obtain aggregation model parameters corresponding to all the feature characterization cluster clusters, namely, before aggregation, clustering and generating the feature characterization cluster by clustering the training feature characterizations sent by all the participant equipment, so as to realize the purpose of screening the participant equipment with training data with similar or identical data distribution in all the participant equipment, furthermore, by clustering and clustering the local model parameters, the local model parameters of the participant equipment with training data with similar or identical data distribution can be aggregated respectively, so that the aggregation model and the corresponding training data have higher adaptation degree, and the aggregation model parameters are fed back to the corresponding participant equipment respectively, so that the participant equipment optimizes the local prediction model according to the aggregation model parameters to obtain a federal prediction model, thereby achieving the purpose of updating the corresponding aggregation model based on the training data with higher adaptation degree and improving the convergence speed of the model, so that the problems that the training data of each participant usually has larger difference, the adaptation degree of the aggregation model and the training data of each participant is lower, and after each aggregation, the aggregation model still needs to be subjected to iterative training optimization based on local training data, so that the technical defect that the aggregation model is slow in convergence in the iterative process is caused, and the calculation efficiency in federal learning is improved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and together with the description, serve to explain the principles of the application.
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly described below, and it is obvious for those skilled in the art to obtain other drawings without inventive exercise.
FIG. 1 is a schematic flow chart diagram of a first embodiment of a federated learning modeling optimization method of the present application;
FIG. 2 is a schematic diagram of a hardware architecture involved in a clustering process in the Federal learning modeling optimization method of the present application;
FIG. 3 is a schematic flow chart diagram of a second embodiment of the federated learning modeling optimization method of the present application;
fig. 4 is a schematic device structure diagram of a hardware operating environment related to the federal learning modeling optimization method in the embodiment of the present application.
The objectives, features, and advantages of the present application will be further described with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
In a first embodiment of the federal learning modeling optimization method of the present application, referring to fig. 1, the federal learning modeling optimization method is applied to a coordinator device, and the federal learning modeling optimization method includes:
step S10, receiving local model parameters generated by each participant device iterative training local prediction model;
in this embodiment, it should be noted that the participant device is a participant in federal learning, and the coordinator device is a coordinator in federal learning, where the federal learning includes longitudinal federal learning and lateral federal learning.
Receiving local model parameters generated by each participant device iterative training local prediction model, specifically, the participant device iterative training the local prediction model to a preset iteration threshold based on training data, obtaining the local model parameters of the local prediction model after iterative training, sending the local model parameters to a coordinator device, and then the coordinator device receiving the local model parameters sent by each participant device, wherein the number of the participant devices is at least 2, and the local model parameters at least include one of a network weight parameter, a model loss and a model gradient.
Step S20, clustering local model parameters based on feature characterization clusters generated by clustering training feature characterizations sent by each participant device to obtain aggregation model parameters corresponding to each feature characterization cluster;
in this embodiment, it should be noted that the training feature characterization is a feature vector generated by the participant device performing feature extraction on local training data, and is used to characterize the data distribution condition of the training data, and the feature characterization cluster is a cluster type generated by the coordinator device clustering each training feature representation, where a distance between training feature characterizations belonging to the same feature characterization cluster is smaller than a preset inter-cluster distance threshold, and a cluster between training feature characterizations belonging to different feature characterization clusters is larger than a preset inter-cluster distance threshold.
Clustering each feature characterization cluster generated by clustering the training feature characterization sent by each participant device, clustering each local model parameter to obtain an aggregation model parameter corresponding to each feature characterization cluster, specifically, obtaining each feature characterization cluster generated by clustering the training feature characterization sent by each participant device, further aggregating the local model parameters sent by the participant devices corresponding to the training feature characterization belonging to the same feature characterization cluster, respectively, obtaining an aggregation model parameter corresponding to each feature characterization cluster, for example, assuming that the participant device A, B, the feature characterization cluster M corresponding to C, and the feature characterization cluster N corresponding to the participant devices C and D, then aggregating the local model parameters sent by the participant devices A, B and C, and obtaining a polymerization model parameter X, and polymerizing the local model parameters sent by the participator equipment C and the participator equipment D to obtain a polymerization model parameter Y.
The step of clustering, based on each feature characterization cluster generated by clustering the training feature characterizations sent by each participant device, each local model parameter to obtain an aggregation model parameter corresponding to each feature characterization cluster includes:
step S21, selecting each model parameter to be aggregated corresponding to each feature characterization cluster from each local model parameter;
in this embodiment, each model parameter to be aggregated corresponding to each feature characterization cluster is selected from each local model parameter, and specifically, each model parameter to be aggregated corresponding to each feature characterization cluster is selected from the local model parameters sent by each participating device based on a membership relationship between each feature characterization cluster and a training feature characterization sent by each participating device, where one training feature characterization uniquely corresponds to one feature characterization cluster and one feature characterization cluster corresponds to at least one training feature characterization.
And step S22, respectively aggregating the model parameters to be aggregated corresponding to each characteristic characterization cluster to obtain the aggregation model parameters.
In this embodiment, the model parameters to be aggregated corresponding to each of the feature characterization cluster are aggregated to obtain the aggregation model parameters, and specifically, the model parameters to be aggregated corresponding to each of the feature characterization cluster are aggregated based on a preset aggregation rule to obtain the aggregation model parameters, where the preset aggregation rule includes weighted averaging, summation, and the like.
And step S30, feeding back the parameters of the aggregation model to corresponding participant equipment respectively so that the participant equipment can optimize the local prediction model according to the parameters of the aggregation model to obtain a federal prediction model.
In this embodiment, each aggregation model parameter is fed back to the corresponding participant device, so that the participant equipment optimizes the local prediction model according to the aggregation model parameters to obtain a federal prediction model, specifically, each aggregation model parameter is respectively sent to the respective corresponding participant equipment, the participant device then receives the aggregation model parameters and, based on the aggregation model parameters, updating the model parameters of the local prediction model, judging whether the updated local prediction model meets the preset iterative training end condition, if so, taking the local prediction model as the federal prediction model, if not, returning to the step of iterating the local prediction model based on the training data to a preset iteration time threshold value, the preset iteration training end condition comprises a threshold value of maximum iteration times, loss function convergence and the like.
Before the step of clustering each feature characterization cluster generated by clustering the training feature characterizations sent by each participant device, clustering each local model parameter, and obtaining an aggregation model parameter corresponding to each feature characterization cluster, the federated learning modeling optimization method further includes:
step A10, receiving training feature representations sent by the participant devices, wherein the training feature representations are generated by the participant devices by performing feature extraction on training data corresponding to the local prediction model;
in this embodiment, training feature representations sent by the participant devices are received, where the training feature representations are generated by the participant devices by performing feature extraction on training data corresponding to the local prediction model, specifically, the participant devices acquire the training data corresponding to the local prediction model, perform feature extraction on the training data according to a feature extraction model constructed by federal learning, so as to map the training data to a vector space with preset dimensions, perform dimension reduction on the training data, obtain the training feature representations, further send the training feature representations to a coordinator device, and further the coordinator device receives the training feature representations sent by the participant devices, where a data dimension of the training feature representations is smaller than a data dimension of the training data.
Step A20, clustering each training feature characterization to obtain each feature characterization cluster.
In this embodiment, each training feature representation is clustered to obtain each feature representation cluster, and specifically, each training feature representation is clustered to divide each training feature representation into a preset number of cluster clusters, so that a distance between training feature representations belonging to the same cluster is smaller than a preset intra-cluster distance threshold, and a distance between training feature representations not belonging to the same cluster is larger than a preset inter-cluster distance threshold, so as to obtain each feature representation cluster, where a clustering manner includes K-Means clustering, Mean-Shift clustering, aggregation level clustering, and the like, as shown in fig. 2, the hardware architecture diagram related to the clustering process in the embodiment of the present application is obtained, where a single device above in fig. 2 is a coordinator device, and a plurality of devices below in fig. 2 are participant devices.
The embodiment of the application provides a federated learning modeling optimization method, compared with the technical means that a coordination party directly aggregates local models of all participants to generate an aggregation model in the prior art, the embodiment of the application firstly receives local model parameters generated by an iterative training local prediction model of all the participant devices, and then performs clustering on the basis of training characteristic characterizations sent by all the participant devices to generate characteristic characterization cluster clusters, performs clustering cluster aggregation on all the local model parameters to obtain aggregation model parameters corresponding to all the characteristic characterization cluster clusters, namely, before performing aggregation, the application realizes the purpose of screening the participant devices with training data with similar or identical data distribution in all the participant devices by clustering the training characteristic characterizations sent by all the participant devices to generate the characteristic characterization cluster, furthermore, by clustering and clustering the local model parameters, the local model parameters of the participant equipment with training data with similar or identical data distribution can be aggregated respectively, so that the aggregation model and the corresponding training data have higher adaptation degree, and the aggregation model parameters are fed back to the corresponding participant equipment respectively, so that the participant equipment optimizes the local prediction model according to the aggregation model parameters to obtain a federal prediction model, thereby achieving the purpose of updating the corresponding aggregation model based on the training data with higher adaptation degree and improving the convergence speed of the model, so that the problems that the training data of each participant usually has larger difference, the adaptation degree of the aggregation model and the training data of each participant is lower, and after each aggregation, the aggregation model still needs to be subjected to iterative training optimization based on local training data, so that the technical defect that the aggregation model is slow in convergence in the iterative process is caused, and the calculation efficiency in federal learning is improved.
Further, referring to fig. 3, in another embodiment of the present application, the federal learning modeling optimization method is applied to a participant device, and the federal learning modeling optimization method includes:
step B10, obtaining a local prediction model, and iteratively training the local prediction model to a preset iteration time threshold value to obtain local model parameters of the local prediction model;
in this embodiment, it should be noted that the local prediction model is a trained machine learning model, and the preset iteration threshold is a preset iteration, where each participant device interacts with a coordinator device and aggregates local model parameters once every time the participant device locally performs model iteration training with the preset iteration threshold.
The method comprises the steps of obtaining a local prediction model, training the local prediction model in an iterative manner to a preset iteration threshold, obtaining local model parameters of the local prediction model, specifically obtaining the local prediction model and training data, training the local prediction model in an iterative manner based on the training data, accumulating the iteration times of the iterative manner, and obtaining the local model parameters of the local prediction model after the iterative manner reaches the preset iteration threshold when the iteration times of the local prediction model reach the preset iteration threshold.
Step B20, sending the local model parameters to coordinator equipment, so that the coordinator equipment can perform clustering cluster aggregation on the local model parameters sent by each participant equipment based on each feature characterization clustering, and obtain each aggregation model parameter;
in this embodiment, the local model parameter is sent to the coordinator device, so that the coordinator device performs clustering cluster aggregation on the local model parameter sent by each participant device based on each feature characterization cluster to obtain each aggregation model parameter, specifically, the local model parameter is sent to the coordinator device, and then the coordinator device receives the local model parameter sent by each participant device and performs aggregation on each local model parameter corresponding to the same feature characterization cluster to obtain an aggregation model parameter corresponding to each feature characterization cluster, where the coordinator device performs clustering cluster aggregation on the local model parameter sent by each participant device based on each feature characterization cluster to obtain each aggregation model parameter, which may refer to specific contents in step S20 and its refinement step, and will not be described in detail herein.
Before the step of sending the local model parameters to coordinator equipment to allow the coordinator equipment to perform clustering cluster aggregation on the local model parameters sent by the participant equipment based on each feature characterization clustering, and obtain each aggregation model parameter, the federal learning modeling optimization method further includes:
step C10, acquiring training data corresponding to the local prediction model, and performing feature extraction on the training data based on a feature extraction model constructed by federal learning to obtain a training feature representation;
in this embodiment, it should be noted that the training data is data used for iteratively training the local prediction model.
Acquiring training data corresponding to the local prediction model, and based on a feature extraction model constructed by federal learning, performing feature extraction on the training data to obtain training feature characterization, specifically, obtaining training data for iteratively training the local prediction model, and inputting the training data into a feature extraction model constructed based on federated learning, performing feature extraction on the training data to extract the output of a target hidden layer in the feature extraction model as a training feature representation, wherein the target hidden layer is a hidden layer arranged at a preset position in a feature extraction model appointed by each participant device, assuming, for example, that there are 10 hidden layers in the feature extraction model, each participant device may agree to use the 2 nd hidden layer as the target hidden layer, wherein the data dimension of the training feature representation is smaller than the data dimension of the training data.
Additionally, it should be noted that the feature extraction model is constructed by each participant device based on local training data through federal learning, and includes an input layer, a plurality of hidden layers and an output layer, where an output of any hidden layer can be used as the training feature representation.
And step C20, sending the training feature characterization to the coordinator device, so that the coordinator device can cluster the training feature characterization sent by each participant device to obtain each feature characterization cluster.
In this embodiment, the training feature representations are sent to the coordinator device, so that the coordinator device clusters the training feature representations sent by each participant device to obtain each feature representation cluster, specifically, the training feature representations are sent to the coordinator device, and then the coordinator device receives the training feature representations sent by each participant device, and divides each training feature representation into each feature representation cluster by clustering each training feature representation, where the training feature representations sent by each participant device are clustered by the coordinator device, and the specific step of obtaining each feature representation cluster may refer to the specific contents in steps a10 to a20, which is not described herein again.
After the step of sending the training feature characterizations to the coordinator device for the coordinator device to cluster the training feature characterizations sent by the participant devices to obtain the feature characterization cluster, the federated learning modeling optimization method further includes:
step D10, if the preset cluster updating condition is met, acquiring second training data, and extracting the characteristics of the second training data based on the characteristic extraction model to acquire a second training characteristic representation;
in this embodiment, it should be noted that the preset cluster updating condition is a step of determining whether each feature representation needs to be updated, where the preset cluster updating condition includes that data distribution of training data in the participant device changes, the number of model iterations reaches a preset second iteration threshold, and the like.
And if the preset cluster updating condition is met, acquiring second training data, performing feature extraction on the second training data based on the feature extraction model, and acquiring a second training feature representation, specifically, if the preset cluster updating condition is met, acquiring current training data as second training data, inputting the second training data into the feature extraction model, and performing feature extraction on the second training data to extract the output of a target hidden layer in the feature extraction model as the second training feature representation.
And D20, sending the second training feature characterization to the coordinator device, so that the coordinator device can update each feature characterization cluster by clustering the second training feature characterization sent by each participant device.
In this embodiment, the second training feature token is sent to the coordinator device, so that the coordinator device updates each feature token cluster by clustering second training feature tokens sent by each participant device, specifically, the second training feature token is sent to the coordinator device, and then the coordinator device receives the second training feature tokens sent by each participant device, and clusters each second training feature token, divides each second training feature token into each second feature token cluster, and replaces and updates each feature token cluster to each second feature token cluster, where specific steps of clustering the second training feature tokens sent by each participant device by the coordinator device may refer to specific contents in steps a10 to a20, and will not be described in detail herein.
And step B30, receiving the aggregation model parameters corresponding to the cluster to which the participant equipment belongs, and optimizing the local prediction model according to the aggregation model parameters to obtain a federal prediction model.
In this embodiment, it should be noted that the cluster that belongs to is a feature characterization cluster corresponding to a training feature characterization generated by a participant device.
Receiving an aggregation model parameter corresponding to the cluster to which the participant device belongs, and optimizing the local prediction model according to the aggregation model parameter to obtain a federal prediction model, specifically, receiving an aggregation model parameter corresponding to the cluster to which the participant device belongs, and updating the model parameter of the local prediction model according to the aggregation model parameter until the local prediction model meets a preset iterative training end condition to obtain the federal prediction model.
The step of optimizing the local prediction model according to the aggregation model parameters to obtain a federal prediction model comprises the following steps:
step B31, updating the local prediction model based on the aggregation model parameters, and judging whether the updated local prediction model meets the preset iteration training end conditions;
in this embodiment, it should be noted that the aggregated model parameter is a model network weight parameter of the local prediction model.
Updating the local prediction model based on the aggregation model parameter, and judging whether the updated local prediction model meets a preset iterative training end condition, specifically, replacing and updating the model parameter of the local prediction model to the aggregation model parameter, and judging whether the replaced and updated local prediction model meets the preset iterative training end condition, wherein the judgment of whether the updated local prediction model meets the preset iterative training end condition is continuously performed in the whole iterative training process of the local prediction model until the iterative training is completed, and the preset iterative training end condition comprises reaching a maximum iteration threshold, converging a loss function and the like.
Step B32, if yes, taking the local prediction model as the federal prediction model;
and B33, if not, returning to the step of iteratively training the local prediction model to a preset iteration time threshold value, and acquiring the local model parameters of the local prediction model.
In this embodiment, specifically, if the local prediction model meets the requirement, it is proved that the local prediction model is finished with iterative training, and then the local prediction model is used as the federal prediction model, and if the local prediction model does not meet the requirement, the step of iteratively training the local prediction model to a preset iteration threshold value and obtaining the local model parameters of the local prediction model is returned until whether the updated local prediction model meets a preset iterative training end condition or not.
The embodiment of the application provides a federated learning modeling optimization method, and compared with the technical means of generating an aggregation model by directly aggregating local models of all participants by a coordinator in the prior art, the federated learning modeling optimization method firstly acquires a local prediction model, iteratively trains the local prediction model to a preset iteration time threshold value, acquires local model parameters of the local prediction model, further transmits the local model parameters to coordinator equipment so that the coordinator equipment represents cluster based on all characteristics, performs clustering cluster aggregation on the local model parameters transmitted by all the participant equipment to acquire all the aggregation model parameters,
because each characteristic representation cluster is generated by clustering based on the training characteristic representation sent by each participant device, the participant devices with similar or identical data distribution are screened from each participant device, and the aim of respectively aggregating the local model parameters of the participant devices with similar or identical data distribution is achieved, so that the aggregation model and the corresponding training data have higher adaptation degree, the aggregation model parameters corresponding to the cluster to which the participant device belongs are received, the local prediction model is optimized according to the aggregation model parameters, the federal prediction model is obtained, the aim of updating the corresponding aggregation model based on the training data with higher adaptation degree can be achieved, the convergence speed of the model is improved, and the problem that the training data of each participant usually have larger difference is overcome, and then the adaptation degree of the aggregation model and the training data of each participant is low, and after each aggregation, the aggregation model still needs to be subjected to iterative training optimization based on the local training data, so that the technical defect that the convergence of the aggregation model is slow in the iterative process is caused, and the calculation efficiency in federal learning is improved.
Referring to fig. 4, fig. 4 is a schematic device structure diagram of a hardware operating environment according to an embodiment of the present application.
As shown in fig. 4, the federal learning modeling optimization device may include: a processor 1001, such as a CPU, a memory 1005, and a communication bus 1002. The communication bus 1002 is used for realizing connection communication between the processor 1001 and the memory 1005. The memory 1005 may be a high-speed RAM memory or a non-volatile memory (e.g., a magnetic disk memory). The memory 1005 may alternatively be a memory device separate from the processor 1001 described above.
Optionally, the federal learning modeling optimization device may further include a rectangular user interface, a network interface, a camera, an RF (Radio Frequency) circuit, a sensor, an audio circuit, a WiFi module, and the like. The rectangular user interface may comprise a Display screen (Display), an input sub-module such as a Keyboard (Keyboard), and the optional rectangular user interface may also comprise a standard wired interface, a wireless interface. The network interface may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface).
Those skilled in the art will appreciate that the federated learning modeling optimization facility architecture illustrated in FIG. 4 does not constitute a limitation of the federated learning modeling optimization facility, and may include more or fewer components than those illustrated, or some components in combination, or a different arrangement of components.
As shown in fig. 4, the memory 1005, which is a type of computer storage medium, may include an operating system, a network communication module, and a federal learning modeling optimization program. The operating system is a program for managing and controlling hardware and software resources of the Federal learning modeling optimization equipment and supports the operation of the Federal learning modeling optimization program and other software and/or programs. The network communication module is used for realizing communication among components in the memory 1005 and communication with other hardware and software in the federal learning modeling optimization system.
In the federated learning modeling optimization apparatus shown in fig. 4, the processor 1001 is configured to execute a federated learning modeling optimization program stored in the memory 1005 to implement the steps of any of the federated learning modeling optimization methods described above.
The specific implementation of the federal learning modeling optimization device of the application is basically the same as that of each embodiment of the federal learning modeling optimization method, and details are not repeated herein.
The embodiment of the present application further provides a federal learning modeling optimization device, which is applied to a coordinator device, and includes:
the receiving module is used for receiving local model parameters generated by the local prediction model iteratively trained by each participant device;
the clustering module is used for clustering each characteristic characterization clustering cluster generated by clustering the training characteristic characterization sent by each participant device, and clustering each local model parameter to obtain an aggregation model parameter corresponding to each characteristic characterization clustering cluster;
and the feedback module is used for respectively feeding back the parameters of the aggregation models to the corresponding participant equipment so that the participant equipment can optimize the local prediction model according to the parameters of the aggregation models to obtain a federal prediction model.
Optionally, the clustering cluster aggregation module is further configured to:
selecting each model parameter to be aggregated corresponding to each characteristic characterization clustering cluster from each local model parameter;
and respectively aggregating the model parameters to be aggregated corresponding to the characteristic characterization clustering clusters to obtain the aggregation model parameters.
Optionally, the federal learning modeling optimization device is further configured to:
receiving training feature representations sent by the participant devices, wherein the training feature representations are generated by the participant devices through feature extraction on training data corresponding to the local prediction model;
and clustering each training feature characterization to obtain each feature characterization clustering cluster.
The specific implementation of the federal learning modeling optimization device of the application is basically the same as that of each embodiment of the federal learning modeling optimization method, and details are not repeated herein.
The embodiment of the present application further provides a federal learning modeling optimization device, the federal learning modeling optimization device is applied to the participant equipment, and the federal learning modeling optimization device includes:
the iteration training module is used for obtaining a local prediction model, and iteratively training the local prediction model to a preset iteration number threshold value to obtain local model parameters of the local prediction model;
the sending module is used for sending the local model parameters to coordinator equipment so that the coordinator equipment can perform clustering cluster aggregation on the local model parameters sent by the participant equipment based on the characteristic representation clustering clusters to obtain aggregation model parameters;
and the model optimization module is used for receiving the aggregation model parameters corresponding to the clustering cluster of the participant equipment, optimizing the local prediction model according to the aggregation model parameters and obtaining a federal prediction model.
Optionally, the federal learning modeling apparatus is further configured to:
acquiring training data corresponding to the local prediction model, and performing feature extraction on the training data based on a feature extraction model constructed by federal learning to obtain a training feature representation;
and sending the training feature characterization to the coordinator device, so that the coordinator device can cluster the training feature characterization sent by each participant device to obtain each feature characterization cluster.
Optionally, the federal learning modeling apparatus is further configured to:
if the preset cluster updating condition is met, acquiring second training data, and performing feature extraction on the second training data based on the feature extraction model to obtain a second training feature representation;
and sending the second training feature characterization to the coordinator device, so that the coordinator device can update each feature characterization cluster by clustering the second training feature characterization sent by each participant device.
Optionally, the model optimization module is further configured to:
updating the local prediction model based on the aggregation model parameters, and judging whether the updated local prediction model meets the preset iterative training end condition;
if so, taking the local prediction model as the federal prediction model;
and if not, returning the local prediction model for iterative training to a preset iteration time threshold value, and obtaining the local model parameters of the local prediction model.
The specific implementation of the federal learning modeling optimization device of the application is basically the same as that of each embodiment of the federal learning modeling optimization method, and details are not repeated herein.
The present application provides a medium, which is a readable storage medium, and the readable storage medium stores one or more programs, and the one or more programs are further executable by one or more processors for implementing the steps of any one of the above methods for federally learned modeling optimization.
The specific implementation of the readable storage medium of the application is substantially the same as that of each embodiment of the federated learning modeling optimization method, and is not described herein again.
The present application provides a computer program product, and the computer program product includes one or more computer programs, which can also be executed by one or more processors for implementing the steps of any of the above methods for federated learning modeling optimization.
The specific implementation of the computer program product of the present application is substantially the same as the embodiments of the federated learning modeling optimization method described above, and is not described herein again.
The above description is only a preferred embodiment of the present application, and not intended to limit the scope of the present application, and all modifications of equivalent structures and equivalent processes, which are made by the contents of the specification and the drawings, or which are directly or indirectly applied to other related technical fields, are included in the scope of the present application.
Claims (10)
1. The federated learning modeling optimization method is applied to coordinator equipment, and comprises the following steps:
receiving local model parameters generated by each participant device iterative training local prediction model;
clustering each feature characterization cluster generated by clustering the training feature characterization sent by each participant device, and performing clustering cluster aggregation on each local model parameter to obtain an aggregation model parameter corresponding to each feature characterization cluster;
and feeding back the parameters of the aggregation model to corresponding participant equipment respectively so that the participant equipment optimizes the local prediction model according to the parameters of the aggregation model to obtain a federal prediction model.
2. The federal learning modeling optimization method of claim 1, wherein the step of performing clustering on each local model parameter based on each feature characterization cluster generated by clustering training feature characterizations sent by each participant device to obtain aggregation model parameters corresponding to each feature characterization cluster comprises:
selecting each model parameter to be aggregated corresponding to each characteristic characterization clustering cluster from each local model parameter;
and respectively aggregating the model parameters to be aggregated corresponding to the characteristic characterization clustering clusters to obtain the aggregation model parameters.
3. The federal learning modeling optimization method of claim 1, wherein before the step of clustering each feature characterization cluster generated by clustering training feature characterizations sent by each of the participant devices, clustering each local model parameter to obtain aggregation model parameters corresponding to each of the feature characterization cluster, the federal learning modeling optimization method further comprises:
receiving training feature representations sent by the participant devices, wherein the training feature representations are generated by the participant devices through feature extraction on training data corresponding to the local prediction model;
and clustering each training feature characterization to obtain each feature characterization clustering cluster.
4. The federated learning modeling optimization method is applied to participant equipment, and comprises the following steps:
obtaining a local prediction model, and iteratively training the local prediction model to a preset iteration number threshold value to obtain local model parameters of the local prediction model;
sending the local model parameters to coordinator equipment, so that the coordinator equipment can perform clustering cluster aggregation on the local model parameters sent by the participant equipment based on the characteristic representation clustering clusters to obtain aggregation model parameters;
and receiving an aggregation model parameter corresponding to the cluster to which the participant equipment belongs, and optimizing the local prediction model according to the aggregation model parameter to obtain a federal prediction model.
5. The federal learning modeling optimization method of claim 4, wherein before the step of sending the local model parameters to a coordinator device, so that the coordinator device can characterize a cluster based on each feature, perform clustering cluster aggregation on the local model parameters sent by each of the participant devices, and obtain each aggregated model parameter, the federal learning modeling optimization method further comprises:
acquiring training data corresponding to the local prediction model, and performing feature extraction on the training data based on a feature extraction model constructed by federal learning to obtain a training feature representation;
and sending the training feature characterization to the coordinator device, so that the coordinator device can cluster the training feature characterization sent by each participant device to obtain each feature characterization cluster.
6. The federated learning modeling optimization method of claim 4, wherein after the step of sending the training feature tokens to the coordinator device for the coordinator device to cluster the training feature tokens sent by each of the participant devices to obtain each of the feature token cluster, the federated learning modeling optimization method further comprises:
if the preset cluster updating condition is met, acquiring second training data, and performing feature extraction on the second training data based on the feature extraction model to obtain a second training feature representation;
and sending the second training feature characterization to the coordinator device, so that the coordinator device can update each feature characterization cluster by clustering the second training feature characterization sent by each participant device.
7. The federal learning modeling optimization method of claim 4, wherein the step of optimizing the local predictive model based on the aggregate model parameters to obtain a federal predictive model comprises:
updating the local prediction model based on the aggregation model parameters, and judging whether the updated local prediction model meets the preset iterative training end condition;
if so, taking the local prediction model as the federal prediction model;
and if not, returning the local prediction model for iterative training to a preset iteration time threshold value, and obtaining the local model parameters of the local prediction model.
8. The Federal learning modeling optimization apparatus is characterized by comprising: a memory, a processor, and a program stored on the memory for implementing the federated learning modeling optimization method,
the memory is used for storing a program for realizing the Federal learning modeling optimization method;
the processor is configured to execute a program implementing the federated learning modeling optimization method to implement the steps of the federated learning modeling optimization method as recited in any one of claims 1 to 3 or 4 to 7.
9. A medium being a readable storage medium, characterized in that the readable storage medium has stored thereon a program for implementing a federal learning modeling optimization method, the program being executed by a processor to implement the steps of the federal learning modeling optimization method as claimed in any one of claims 1 to 3 or 4 to 7.
10. A computer program product comprising a computer program, wherein the computer program when executed by a processor implements the steps of the federal learning modeling optimization method as claimed in any of claims 1 to 3 or 4 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110443709.9A CN113095512A (en) | 2021-04-23 | 2021-04-23 | Federal learning modeling optimization method, apparatus, medium, and computer program product |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110443709.9A CN113095512A (en) | 2021-04-23 | 2021-04-23 | Federal learning modeling optimization method, apparatus, medium, and computer program product |
Publications (1)
Publication Number | Publication Date |
---|---|
CN113095512A true CN113095512A (en) | 2021-07-09 |
Family
ID=76679638
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110443709.9A Pending CN113095512A (en) | 2021-04-23 | 2021-04-23 | Federal learning modeling optimization method, apparatus, medium, and computer program product |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113095512A (en) |
Cited By (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113487043A (en) * | 2021-07-22 | 2021-10-08 | 深圳前海微众银行股份有限公司 | Federal learning modeling optimization method, apparatus, medium, and computer program product |
CN113516255A (en) * | 2021-07-28 | 2021-10-19 | 深圳前海微众银行股份有限公司 | Federal learning modeling optimization method, apparatus, readable storage medium, and program product |
CN113627086A (en) * | 2021-08-21 | 2021-11-09 | 深圳前海微众银行股份有限公司 | Method, apparatus, medium, and program product for optimizing horizontal federated learning modeling |
CN113657525A (en) * | 2021-08-23 | 2021-11-16 | 同盾科技有限公司 | KMeans-based cross-feature federated clustering method and related equipment |
CN113723509A (en) * | 2021-08-30 | 2021-11-30 | 平安科技(深圳)有限公司 | Follow-up monitoring method and device based on federal reinforcement learning and related equipment |
CN113887747A (en) * | 2021-10-21 | 2022-01-04 | 新智我来网络科技有限公司 | Data fusion method and device based on joint learning |
CN113935409A (en) * | 2021-09-30 | 2022-01-14 | 光大科技有限公司 | Method and device for processing federated learning |
CN114202397A (en) * | 2022-02-17 | 2022-03-18 | 浙江君同智能科技有限责任公司 | Longitudinal federal learning backdoor defense method based on neuron activation value clustering |
WO2023024378A1 (en) * | 2021-08-25 | 2023-03-02 | 深圳前海微众银行股份有限公司 | Multi-agent model training method, apparatus, electronic device, storage medium and program product |
WO2023092792A1 (en) * | 2021-11-29 | 2023-06-01 | 深圳前海微众银行股份有限公司 | Optimization method for modeling based on federated learning, and electronic device, storage medium and program product |
CN117131951A (en) * | 2023-02-16 | 2023-11-28 | 荣耀终端有限公司 | Federal learning method and electronic equipment |
CN117521151A (en) * | 2024-01-05 | 2024-02-06 | 齐鲁工业大学(山东省科学院) | Block chain-based decentralization federation learning data sharing method |
-
2021
- 2021-04-23 CN CN202110443709.9A patent/CN113095512A/en active Pending
Cited By (16)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113487043A (en) * | 2021-07-22 | 2021-10-08 | 深圳前海微众银行股份有限公司 | Federal learning modeling optimization method, apparatus, medium, and computer program product |
CN113516255A (en) * | 2021-07-28 | 2021-10-19 | 深圳前海微众银行股份有限公司 | Federal learning modeling optimization method, apparatus, readable storage medium, and program product |
CN113627086A (en) * | 2021-08-21 | 2021-11-09 | 深圳前海微众银行股份有限公司 | Method, apparatus, medium, and program product for optimizing horizontal federated learning modeling |
CN113627086B (en) * | 2021-08-21 | 2024-03-26 | 深圳前海微众银行股份有限公司 | Method, device, medium and program product for optimizing horizontal federal learning modeling |
CN113657525A (en) * | 2021-08-23 | 2021-11-16 | 同盾科技有限公司 | KMeans-based cross-feature federated clustering method and related equipment |
CN113657525B (en) * | 2021-08-23 | 2024-04-26 | 同盾科技有限公司 | KMeans-based cross-feature federal clustering method and related equipment |
WO2023024378A1 (en) * | 2021-08-25 | 2023-03-02 | 深圳前海微众银行股份有限公司 | Multi-agent model training method, apparatus, electronic device, storage medium and program product |
CN113723509A (en) * | 2021-08-30 | 2021-11-30 | 平安科技(深圳)有限公司 | Follow-up monitoring method and device based on federal reinforcement learning and related equipment |
CN113723509B (en) * | 2021-08-30 | 2024-01-16 | 平安科技(深圳)有限公司 | Follow-up monitoring method and device based on federal reinforcement learning and related equipment |
CN113935409A (en) * | 2021-09-30 | 2022-01-14 | 光大科技有限公司 | Method and device for processing federated learning |
CN113887747A (en) * | 2021-10-21 | 2022-01-04 | 新智我来网络科技有限公司 | Data fusion method and device based on joint learning |
WO2023092792A1 (en) * | 2021-11-29 | 2023-06-01 | 深圳前海微众银行股份有限公司 | Optimization method for modeling based on federated learning, and electronic device, storage medium and program product |
CN114202397A (en) * | 2022-02-17 | 2022-03-18 | 浙江君同智能科技有限责任公司 | Longitudinal federal learning backdoor defense method based on neuron activation value clustering |
CN117131951A (en) * | 2023-02-16 | 2023-11-28 | 荣耀终端有限公司 | Federal learning method and electronic equipment |
CN117521151A (en) * | 2024-01-05 | 2024-02-06 | 齐鲁工业大学(山东省科学院) | Block chain-based decentralization federation learning data sharing method |
CN117521151B (en) * | 2024-01-05 | 2024-04-09 | 齐鲁工业大学(山东省科学院) | Block chain-based decentralization federation learning data sharing method |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN113095512A (en) | Federal learning modeling optimization method, apparatus, medium, and computer program product | |
CN110782042B (en) | Method, device, equipment and medium for combining horizontal federation and vertical federation | |
WO2020168761A1 (en) | Model training method and apparatus | |
CN112181666A (en) | Method, system, equipment and readable storage medium for equipment evaluation and federal learning importance aggregation based on edge intelligence | |
CN111340614B (en) | Sample sampling method and device based on federal learning and readable storage medium | |
CN113516255A (en) | Federal learning modeling optimization method, apparatus, readable storage medium, and program product | |
US20230153622A1 (en) | Method, Apparatus, and Computing Device for Updating AI Model, and Storage Medium | |
KR20180081101A (en) | Method and apparatus for optimizing user credit score | |
US20240135191A1 (en) | Method, apparatus, and system for generating neural network model, device, medium, and program product | |
CN113037877B (en) | Optimization method for time-space data and resource scheduling under cloud edge architecture | |
CN115552429A (en) | Method and system for horizontal federal learning using non-IID data | |
CN113469325A (en) | Layered federated learning method, computer equipment and storage medium for edge aggregation interval adaptive control | |
CN110968426A (en) | Edge cloud collaborative k-means clustering model optimization method based on online learning | |
CN113268341A (en) | Distribution method, device, equipment and storage medium of power grid edge calculation task | |
US20230281513A1 (en) | Data model training method and apparatus | |
CN111241745A (en) | Stepwise model selection method, apparatus and readable storage medium | |
EP3767549A1 (en) | Delivery of compressed neural networks | |
CN111898768A (en) | Data processing method, device, equipment and medium | |
CN114065863A (en) | Method, device and system for federal learning, electronic equipment and storage medium | |
CN113962161A (en) | Optimal QoS service selection method and device based on black and wife optimization algorithm | |
CN113869533A (en) | Federal learning modeling optimization method, apparatus, readable storage medium, and program product | |
WO2022252694A1 (en) | Neural network optimization method and apparatus | |
CN111210022A (en) | Backward model selection method, device and readable storage medium | |
CN112817563A (en) | Target attribute configuration information determination method, computer device, and storage medium | |
CN113792892A (en) | Federal learning modeling optimization method, apparatus, readable storage medium, and program product |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |